Commit ae8fa283 authored by NeilBrown's avatar NeilBrown

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: default avatarNeilBrown <neilb@suse.de>
parent ed9bfdf1
...@@ -1624,10 +1624,11 @@ int bitmap_create(mddev_t *mddev) ...@@ -1624,10 +1624,11 @@ int bitmap_create(mddev_t *mddev)
bitmap->offset = mddev->bitmap_offset; bitmap->offset = mddev->bitmap_offset;
if (file) { if (file) {
get_file(file); get_file(file);
do_sync_mapping_range(file->f_mapping, 0, LLONG_MAX, /* As future accesses to this file will use bmap,
SYNC_FILE_RANGE_WAIT_BEFORE | * and bypass the page cache, we must sync the file
SYNC_FILE_RANGE_WRITE | * first.
SYNC_FILE_RANGE_WAIT_AFTER); */
vfs_fsync(file, file->f_dentry, 1);
} }
/* read superblock from bitmap file (this sets bitmap->chunksize) */ /* read superblock from bitmap file (this sets bitmap->chunksize) */
err = bitmap_read_sb(bitmap); err = bitmap_read_sb(bitmap);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment