remove do_sync parameter from __invalidate_device
Subsystems (3)
PATCH 1/1 remove do_sync parameter from __invalidate_device
the only caller that ever sets it can call fsync_bdev itself easily. Also update some comments.
Signed-off-by Christoph Hellwig <[email protected]>
drivers/block/floppy.c (mode:100644) renamed from drivers/block/floppy.c (mode:100644 sha1:42dfa281a880f684ba6b187cbb57712f752e6afe) +1 -1
@@ -3345,7 +3345,7 @@ struct block_device *bdev = opened_bdev[cnt]; if (!bdev || ITYPE(drive_state[cnt].fd_device) != type) continue; - __invalidate_device(bdev, 0); + __invalidate_device(bdev); } up(&open_lock); } else {
drivers/block/genhd.c (mode:100644) renamed from drivers/block/genhd.c (mode:100644 sha1:ab4db71375e08e41c13e4049efe1cd3cef5cbc8a) +3 -1
@@ -14,6 +14,7 @@ #include <linux/slab.h> #include <linux/kmod.h> #include <linux/kobj_map.h> +#include <linux/buffer_head.h> #define MAX_PROBE_HASH 255 /* random */
@@ -676,7 +677,8 @@ int res = 0; struct block_device *bdev = bdget_disk(disk, index); if (bdev) { - res = __invalidate_device(bdev, 1); + fsync_bdev(bdev); + res = __invalidate_device(bdev); bdput(bdev); } return res;
fs/inode.c (mode:100644) renamed from fs/inode.c (mode:100644 sha1:af8fd78d2099a0852d7867a4b2691924c1ed3982) +3 -18
@@ -26,7 +26,6 @@ * This is needed for the following functions: * - inode_has_buffers * - invalidate_inode_buffers - * - fsync_bdev * - invalidate_bdev * * FIXME: remove all knowledge of the buffer layer from this file
@@ -332,14 +331,6 @@ return busy; } -/* - * This is a two-stage process. First we collect all - * offending inodes onto the throw-away list, and in - * the second stage we actually dispose of them. This - * is because we don't want to sleep while messing - * with the global lists.. - */ - /** * invalidate_inodes - discard the inodes on a device * @sb: superblock
@@ -366,16 +357,11 @@ EXPORT_SYMBOL(invalidate_inodes); -int __invalidate_device(struct block_device *bdev, int do_sync) +int __invalidate_device(struct block_device *bdev) { - struct super_block *sb; - int res; + struct super_block *sb = get_super(bdev); + int res = 0; - if (do_sync) - fsync_bdev(bdev); - - res = 0; - sb = get_super(bdev); if (sb) { /* * no need to lock the super, get_super holds the
@@ -390,7 +376,6 @@ invalidate_bdev(bdev, 0); return res; } - EXPORT_SYMBOL(__invalidate_device); static int can_unuse(struct inode *inode)
include/linux/fs.h (mode:100644) renamed from include/linux/fs.h (mode:100644 sha1:4edba067a7178103f78544717a91ef98dae7994d) +1 -1
@@ -1341,7 +1341,7 @@ extern int check_disk_change(struct block_device *); extern int invalidate_inodes(struct super_block *); -extern int __invalidate_device(struct block_device *, int); +extern int __invalidate_device(struct block_device *); extern int invalidate_partition(struct gendisk *, int); unsigned long invalidate_mapping_pages(struct address_space *mapping, pgoff_t start, pgoff_t end);