mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-30 03:27:44 -04:00
direct-io: always call ->end_io if non-NULL
This way we can pass back errors to the file system, and allow for cleanup required for all direct I/O invocations. Also allow the ->end_io handlers to return errors on their own, so that I/O completion errors can be passed on to the callers. Signed-off-by: Christoph Hellwig <[email protected]> Reviewed-by: Dave Chinner <[email protected]> Signed-off-by: Dave Chinner <[email protected]>
This commit is contained in:
parent
36f90b0a2d
commit
187372a3b9
6 changed files with 35 additions and 14 deletions
|
|
@ -253,8 +253,13 @@ static ssize_t dio_complete(struct dio *dio, loff_t offset, ssize_t ret,
|
|||
if (ret == 0)
|
||||
ret = transferred;
|
||||
|
||||
if (dio->end_io && dio->result)
|
||||
dio->end_io(dio->iocb, offset, transferred, dio->private);
|
||||
if (dio->end_io) {
|
||||
int err;
|
||||
|
||||
err = dio->end_io(dio->iocb, offset, ret, dio->private);
|
||||
if (err)
|
||||
ret = err;
|
||||
}
|
||||
|
||||
if (!(dio->flags & DIO_SKIP_DIO_COUNT))
|
||||
inode_dio_end(dio->inode);
|
||||
|
|
|
|||
Loading…
Reference in a new issue