]> git.baikalelectronics.ru Git - kernel.git/commit
iomap: split size and error for iomap_dio_rw ->end_io
authorMatthew Bobrowski <mbobrowski@mbobrowski.org>
Thu, 19 Sep 2019 22:32:44 +0000 (15:32 -0700)
committerDarrick J. Wong <darrick.wong@oracle.com>
Thu, 19 Sep 2019 22:32:44 +0000 (15:32 -0700)
commit9deaa426150c1e8cba68788d899188e09fed3c55
tree08ae8dd10545ba16c4d38a19da5f9d45204fbde8
parentbfe2de5a355e71917b08e947fe3e805ec2f51c71
iomap: split size and error for iomap_dio_rw ->end_io

Modify the calling convention for the iomap_dio_rw ->end_io() callback.
Rather than passing either dio->error or dio->size as the 'size' argument,
instead pass both the dio->error and the dio->size value separately.

In the instance that an error occurred during a write, we currently cannot
determine whether any blocks have been allocated beyond the current EOF and
data has subsequently been written to these blocks within the ->end_io()
callback. As a result, we cannot judge whether we should take the truncate
failed write path. Having both dio->error and dio->size will allow us to
perform such checks within this callback.

Signed-off-by: Matthew Bobrowski <mbobrowski@mbobrowski.org>
[hch: minor cleanups]
Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Darrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Reviewed-by: Matthew Wilcox (Oracle) <willy@infradead.org>
fs/iomap/direct-io.c
fs/xfs/xfs_file.c
include/linux/iomap.h