diff options
-rw-r--r-- | drivers/md/bitmap.c | 8 | ||||
-rw-r--r-- | fs/sync.c | 2 | ||||
-rw-r--r-- | include/linux/fs.h | 5 | ||||
-rw-r--r-- | mm/filemap.c | 8 |
4 files changed, 9 insertions, 14 deletions
diff --git a/drivers/md/bitmap.c b/drivers/md/bitmap.c index e61e0efe9ec7..5a4a74c1097c 100644 --- a/drivers/md/bitmap.c +++ b/drivers/md/bitmap.c | |||
@@ -1456,10 +1456,10 @@ int bitmap_create(mddev_t *mddev) | |||
1456 | bitmap->offset = mddev->bitmap_offset; | 1456 | bitmap->offset = mddev->bitmap_offset; |
1457 | if (file) { | 1457 | if (file) { |
1458 | get_file(file); | 1458 | get_file(file); |
1459 | do_sync_file_range(file, 0, LLONG_MAX, | 1459 | do_sync_mapping_range(file->f_mapping, 0, LLONG_MAX, |
1460 | SYNC_FILE_RANGE_WAIT_BEFORE | | 1460 | SYNC_FILE_RANGE_WAIT_BEFORE | |
1461 | SYNC_FILE_RANGE_WRITE | | 1461 | SYNC_FILE_RANGE_WRITE | |
1462 | SYNC_FILE_RANGE_WAIT_AFTER); | 1462 | SYNC_FILE_RANGE_WAIT_AFTER); |
1463 | } | 1463 | } |
1464 | /* read superblock from bitmap file (this sets bitmap->chunksize) */ | 1464 | /* read superblock from bitmap file (this sets bitmap->chunksize) */ |
1465 | err = bitmap_read_sb(bitmap); | 1465 | err = bitmap_read_sb(bitmap); |
@@ -229,7 +229,7 @@ asmlinkage long sys_sync_file_range(int fd, loff_t offset, loff_t nbytes, | |||
229 | !S_ISLNK(i_mode)) | 229 | !S_ISLNK(i_mode)) |
230 | goto out_put; | 230 | goto out_put; |
231 | 231 | ||
232 | ret = do_sync_file_range(file, offset, endbyte, flags); | 232 | ret = do_sync_mapping_range(file->f_mapping, offset, endbyte, flags); |
233 | out_put: | 233 | out_put: |
234 | fput_light(file, fput_needed); | 234 | fput_light(file, fput_needed); |
235 | out: | 235 | out: |
diff --git a/include/linux/fs.h b/include/linux/fs.h index 527a09a82297..7cf0c54a46a7 100644 --- a/include/linux/fs.h +++ b/include/linux/fs.h | |||
@@ -849,11 +849,6 @@ extern int fcntl_getlease(struct file *filp); | |||
849 | /* fs/sync.c */ | 849 | /* fs/sync.c */ |
850 | extern int do_sync_mapping_range(struct address_space *mapping, loff_t offset, | 850 | extern int do_sync_mapping_range(struct address_space *mapping, loff_t offset, |
851 | loff_t endbyte, unsigned int flags); | 851 | loff_t endbyte, unsigned int flags); |
852 | static inline int do_sync_file_range(struct file *file, loff_t offset, | ||
853 | loff_t endbyte, unsigned int flags) | ||
854 | { | ||
855 | return do_sync_mapping_range(file->f_mapping, offset, endbyte, flags); | ||
856 | } | ||
857 | 852 | ||
858 | /* fs/locks.c */ | 853 | /* fs/locks.c */ |
859 | extern void locks_init_lock(struct file_lock *); | 854 | extern void locks_init_lock(struct file_lock *); |
diff --git a/mm/filemap.c b/mm/filemap.c index 3e49fe13d6ac..9cbf4fea4a59 100644 --- a/mm/filemap.c +++ b/mm/filemap.c | |||
@@ -2309,10 +2309,10 @@ __generic_file_aio_write_nolock(struct kiocb *iocb, const struct iovec *iov, | |||
2309 | * semantics. | 2309 | * semantics. |
2310 | */ | 2310 | */ |
2311 | endbyte = pos + written_buffered - written - 1; | 2311 | endbyte = pos + written_buffered - written - 1; |
2312 | err = do_sync_file_range(file, pos, endbyte, | 2312 | err = do_sync_mapping_range(file->f_mapping, pos, endbyte, |
2313 | SYNC_FILE_RANGE_WAIT_BEFORE| | 2313 | SYNC_FILE_RANGE_WAIT_BEFORE| |
2314 | SYNC_FILE_RANGE_WRITE| | 2314 | SYNC_FILE_RANGE_WRITE| |
2315 | SYNC_FILE_RANGE_WAIT_AFTER); | 2315 | SYNC_FILE_RANGE_WAIT_AFTER); |
2316 | if (err == 0) { | 2316 | if (err == 0) { |
2317 | written = written_buffered; | 2317 | written = written_buffered; |
2318 | invalidate_mapping_pages(mapping, | 2318 | invalidate_mapping_pages(mapping, |