diff options
Diffstat (limited to 'fs/btrfs/file.c')
-rw-r--r-- | fs/btrfs/file.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/fs/btrfs/file.c b/fs/btrfs/file.c index 5b9386452218..9fbda6552069 100644 --- a/fs/btrfs/file.c +++ b/fs/btrfs/file.c | |||
@@ -908,11 +908,17 @@ out_nolock: | |||
908 | if (err < 0) | 908 | if (err < 0) |
909 | num_written = err; | 909 | num_written = err; |
910 | } else if (num_written > 0 && (file->f_flags & O_DIRECT)) { | 910 | } else if (num_written > 0 && (file->f_flags & O_DIRECT)) { |
911 | #if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,23) | ||
912 | do_sync_file_range(file, start_pos, | ||
913 | start_pos + num_written - 1, | ||
914 | SYNC_FILE_RANGE_WRITE | | ||
915 | SYNC_FILE_RANGE_WAIT_AFTER); | ||
916 | #else | ||
911 | do_sync_mapping_range(inode->i_mapping, start_pos, | 917 | do_sync_mapping_range(inode->i_mapping, start_pos, |
912 | start_pos + num_written - 1, | 918 | start_pos + num_written - 1, |
913 | SYNC_FILE_RANGE_WRITE | | 919 | SYNC_FILE_RANGE_WRITE | |
914 | SYNC_FILE_RANGE_WAIT_AFTER); | 920 | SYNC_FILE_RANGE_WAIT_AFTER); |
915 | 921 | #endif | |
916 | invalidate_mapping_pages(inode->i_mapping, | 922 | invalidate_mapping_pages(inode->i_mapping, |
917 | start_pos >> PAGE_CACHE_SHIFT, | 923 | start_pos >> PAGE_CACHE_SHIFT, |
918 | (start_pos + num_written - 1) >> PAGE_CACHE_SHIFT); | 924 | (start_pos + num_written - 1) >> PAGE_CACHE_SHIFT); |