fs: convert sync_file_range to use errseq_t based error-tracking
authorJeff Layton <jlayton@redhat.com>
Mon, 24 Jul 2017 10:22:14 +0000 (06:22 -0400)
committerJeff Layton <jlayton@redhat.com>
Tue, 1 Aug 2017 12:39:29 +0000 (08:39 -0400)
sync_file_range doesn't call down into the filesystem directly at all.
It only kicks off writeback of pagecache pages and optionally waits
on the result.

Convert sync_file_range to use errseq_t based error tracking, under the
assumption that most users will prefer this behavior when errors occur.

Reviewed-by: Jan Kara <jack@suse.cz>
Signed-off-by: Jeff Layton <jlayton@redhat.com>
fs/sync.c

index 2a54c1f2203595823df1bd97680b9a1fb163e400..27d6b8bbcb6a51d3f5987079b32b9c89754c7489 100644 (file)
--- a/fs/sync.c
+++ b/fs/sync.c
@@ -342,7 +342,7 @@ SYSCALL_DEFINE4(sync_file_range, int, fd, loff_t, offset, loff_t, nbytes,
 
        ret = 0;
        if (flags & SYNC_FILE_RANGE_WAIT_BEFORE) {
-               ret = filemap_fdatawait_range(mapping, offset, endbyte);
+               ret = file_fdatawait_range(f.file, offset, endbyte);
                if (ret < 0)
                        goto out_put;
        }
@@ -355,7 +355,7 @@ SYSCALL_DEFINE4(sync_file_range, int, fd, loff_t, offset, loff_t, nbytes,
        }
 
        if (flags & SYNC_FILE_RANGE_WAIT_AFTER)
-               ret = filemap_fdatawait_range(mapping, offset, endbyte);
+               ret = file_fdatawait_range(f.file, offset, endbyte);
 
 out_put:
        fdput(f);