]> git.baikalelectronics.ru Git - kernel.git/commit
fs: Enable bmap() function to properly return errors
authorCarlos Maiolino <cmaiolino@redhat.com>
Thu, 9 Jan 2020 13:30:41 +0000 (14:30 +0100)
committerAl Viro <viro@zeniv.linux.org.uk>
Mon, 3 Feb 2020 13:05:37 +0000 (08:05 -0500)
commit141fc94a767dc351fefca050c54a4f20ca9408e7
tree5397a83545672205eda15c343eaa20b1427920d4
parentd4f46b330cc523efd6fb99dfb35e4def34bd935c
fs: Enable bmap() function to properly return errors

By now, bmap() will either return the physical block number related to
the requested file offset or 0 in case of error or the requested offset
maps into a hole.
This patch makes the needed changes to enable bmap() to proper return
errors, using the return value as an error return, and now, a pointer
must be passed to bmap() to be filled with the mapped physical block.

It will change the behavior of bmap() on return:

- negative value in case of error
- zero on success or map fell into a hole

In case of a hole, the *block will be zero too

Since this is a prep patch, by now, the only error return is -EINVAL if
->bmap doesn't exist.

Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Carlos Maiolino <cmaiolino@redhat.com>
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
drivers/md/md-bitmap.c
fs/f2fs/data.c
fs/inode.c
fs/jbd2/journal.c
include/linux/fs.h
mm/page_io.c