Commit 2ef41634def0fcb0def3e3c90220c651ca478cb3
Committed by
Linus Torvalds
1 parent
91bb524168
Exists in
master
and in
7 other branches
[PATCH] 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 <hch@lst.de> Cc: <viro@parcelfarce.linux.theplanet.co.uk> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Showing 5 changed files with 9 additions and 22 deletions Side-by-side Diff
drivers/block/floppy.c
drivers/block/genhd.c
... | ... | @@ -14,6 +14,7 @@ |
14 | 14 | #include <linux/slab.h> |
15 | 15 | #include <linux/kmod.h> |
16 | 16 | #include <linux/kobj_map.h> |
17 | +#include <linux/buffer_head.h> | |
17 | 18 | |
18 | 19 | #define MAX_PROBE_HASH 255 /* random */ |
19 | 20 | |
... | ... | @@ -676,7 +677,8 @@ |
676 | 677 | int res = 0; |
677 | 678 | struct block_device *bdev = bdget_disk(disk, index); |
678 | 679 | if (bdev) { |
679 | - res = __invalidate_device(bdev, 1); | |
680 | + fsync_bdev(bdev); | |
681 | + res = __invalidate_device(bdev); | |
680 | 682 | bdput(bdev); |
681 | 683 | } |
682 | 684 | return res; |
fs/block_dev.c
fs/inode.c
... | ... | @@ -26,7 +26,6 @@ |
26 | 26 | * This is needed for the following functions: |
27 | 27 | * - inode_has_buffers |
28 | 28 | * - invalidate_inode_buffers |
29 | - * - fsync_bdev | |
30 | 29 | * - invalidate_bdev |
31 | 30 | * |
32 | 31 | * FIXME: remove all knowledge of the buffer layer from this file |
... | ... | @@ -332,14 +331,6 @@ |
332 | 331 | return busy; |
333 | 332 | } |
334 | 333 | |
335 | -/* | |
336 | - * This is a two-stage process. First we collect all | |
337 | - * offending inodes onto the throw-away list, and in | |
338 | - * the second stage we actually dispose of them. This | |
339 | - * is because we don't want to sleep while messing | |
340 | - * with the global lists.. | |
341 | - */ | |
342 | - | |
343 | 334 | /** |
344 | 335 | * invalidate_inodes - discard the inodes on a device |
345 | 336 | * @sb: superblock |
346 | 337 | |
347 | 338 | |
... | ... | @@ -366,16 +357,11 @@ |
366 | 357 | |
367 | 358 | EXPORT_SYMBOL(invalidate_inodes); |
368 | 359 | |
369 | -int __invalidate_device(struct block_device *bdev, int do_sync) | |
360 | +int __invalidate_device(struct block_device *bdev) | |
370 | 361 | { |
371 | - struct super_block *sb; | |
372 | - int res; | |
362 | + struct super_block *sb = get_super(bdev); | |
363 | + int res = 0; | |
373 | 364 | |
374 | - if (do_sync) | |
375 | - fsync_bdev(bdev); | |
376 | - | |
377 | - res = 0; | |
378 | - sb = get_super(bdev); | |
379 | 365 | if (sb) { |
380 | 366 | /* |
381 | 367 | * no need to lock the super, get_super holds the |
... | ... | @@ -390,7 +376,6 @@ |
390 | 376 | invalidate_bdev(bdev, 0); |
391 | 377 | return res; |
392 | 378 | } |
393 | - | |
394 | 379 | EXPORT_SYMBOL(__invalidate_device); |
395 | 380 | |
396 | 381 | static int can_unuse(struct inode *inode) |
include/linux/fs.h
... | ... | @@ -1341,7 +1341,7 @@ |
1341 | 1341 | |
1342 | 1342 | extern int check_disk_change(struct block_device *); |
1343 | 1343 | extern int invalidate_inodes(struct super_block *); |
1344 | -extern int __invalidate_device(struct block_device *, int); | |
1344 | +extern int __invalidate_device(struct block_device *); | |
1345 | 1345 | extern int invalidate_partition(struct gendisk *, int); |
1346 | 1346 | unsigned long invalidate_mapping_pages(struct address_space *mapping, |
1347 | 1347 | pgoff_t start, pgoff_t end); |