diff options
author | NeilBrown <neilb@suse.de> | 2009-10-16 15:56:01 +1100 |
---|---|---|
committer | NeilBrown <neilb@suse.de> | 2009-10-16 15:56:01 +1100 |
commit | ae8fa2831bbc5092ee9d1b90e623af881cf27140 (patch) | |
tree | 1a9e1aa4192ce9a5c57ea93d777c4fec2322b9e9 /drivers | |
parent | ed9bfdf1a40952fd0f8094ec77f876b84ead69af (diff) | |
download | kernel-crypto-ae8fa2831bbc5092ee9d1b90e623af881cf27140.tar.gz kernel-crypto-ae8fa2831bbc5092ee9d1b90e623af881cf27140.tar.xz kernel-crypto-ae8fa2831bbc5092ee9d1b90e623af881cf27140.zip |
md: remove clumsy usage of do_sync_mapping_range from bitmap code
and replace with vfs_fsync which is much neater (but wasn't exported,
or even in existence at the time the code was written).
Cc: Christoph Hellwig <hch@lst.de>
Signed-off-by: NeilBrown <neilb@suse.de>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/md/bitmap.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/drivers/md/bitmap.c b/drivers/md/bitmap.c index 6986b0059d2..60e2b322db1 100644 --- a/drivers/md/bitmap.c +++ b/drivers/md/bitmap.c @@ -1624,10 +1624,11 @@ int bitmap_create(mddev_t *mddev) bitmap->offset = mddev->bitmap_offset; if (file) { get_file(file); - do_sync_mapping_range(file->f_mapping, 0, LLONG_MAX, - SYNC_FILE_RANGE_WAIT_BEFORE | - SYNC_FILE_RANGE_WRITE | - SYNC_FILE_RANGE_WAIT_AFTER); + /* As future accesses to this file will use bmap, + * and bypass the page cache, we must sync the file + * first. + */ + vfs_fsync(file, file->f_dentry, 1); } /* read superblock from bitmap file (this sets bitmap->chunksize) */ err = bitmap_read_sb(bitmap); |