diff options
author | Christoph Hellwig <hch@lst.de> | 2005-05-05 19:15:59 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@ppc970.osdl.org> | 2005-05-05 19:36:44 -0400 |
commit | 2ef41634def0fcb0def3e3c90220c651ca478cb3 (patch) | |
tree | 86fb9c439ad5043d38d69588975e84bd8b565619 | |
parent | 91bb52416854dfd581efe6e2a0aca8dc655f043e (diff) |
[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>
-rw-r--r-- | drivers/block/floppy.c | 2 | ||||
-rw-r--r-- | drivers/block/genhd.c | 4 | ||||
-rw-r--r-- | fs/block_dev.c | 2 | ||||
-rw-r--r-- | fs/inode.c | 21 | ||||
-rw-r--r-- | include/linux/fs.h | 2 |
5 files changed, 9 insertions, 22 deletions
diff --git a/drivers/block/floppy.c b/drivers/block/floppy.c index 42dfa281a880..f0c1084b840f 100644 --- a/drivers/block/floppy.c +++ b/drivers/block/floppy.c | |||
@@ -3345,7 +3345,7 @@ static inline int set_geometry(unsigned int cmd, struct floppy_struct *g, | |||
3345 | struct block_device *bdev = opened_bdev[cnt]; | 3345 | struct block_device *bdev = opened_bdev[cnt]; |
3346 | if (!bdev || ITYPE(drive_state[cnt].fd_device) != type) | 3346 | if (!bdev || ITYPE(drive_state[cnt].fd_device) != type) |
3347 | continue; | 3347 | continue; |
3348 | __invalidate_device(bdev, 0); | 3348 | __invalidate_device(bdev); |
3349 | } | 3349 | } |
3350 | up(&open_lock); | 3350 | up(&open_lock); |
3351 | } else { | 3351 | } else { |
diff --git a/drivers/block/genhd.c b/drivers/block/genhd.c index ab4db71375e0..8bbe01d4b487 100644 --- a/drivers/block/genhd.c +++ b/drivers/block/genhd.c | |||
@@ -14,6 +14,7 @@ | |||
14 | #include <linux/slab.h> | 14 | #include <linux/slab.h> |
15 | #include <linux/kmod.h> | 15 | #include <linux/kmod.h> |
16 | #include <linux/kobj_map.h> | 16 | #include <linux/kobj_map.h> |
17 | #include <linux/buffer_head.h> | ||
17 | 18 | ||
18 | #define MAX_PROBE_HASH 255 /* random */ | 19 | #define MAX_PROBE_HASH 255 /* random */ |
19 | 20 | ||
@@ -676,7 +677,8 @@ int invalidate_partition(struct gendisk *disk, int index) | |||
676 | int res = 0; | 677 | int res = 0; |
677 | struct block_device *bdev = bdget_disk(disk, index); | 678 | struct block_device *bdev = bdget_disk(disk, index); |
678 | if (bdev) { | 679 | if (bdev) { |
679 | res = __invalidate_device(bdev, 1); | 680 | fsync_bdev(bdev); |
681 | res = __invalidate_device(bdev); | ||
680 | bdput(bdev); | 682 | bdput(bdev); |
681 | } | 683 | } |
682 | return res; | 684 | return res; |
diff --git a/fs/block_dev.c b/fs/block_dev.c index d19d07c49ad3..c0cbd1bc1a02 100644 --- a/fs/block_dev.c +++ b/fs/block_dev.c | |||
@@ -530,7 +530,7 @@ int check_disk_change(struct block_device *bdev) | |||
530 | if (!bdops->media_changed(bdev->bd_disk)) | 530 | if (!bdops->media_changed(bdev->bd_disk)) |
531 | return 0; | 531 | return 0; |
532 | 532 | ||
533 | if (__invalidate_device(bdev, 0)) | 533 | if (__invalidate_device(bdev)) |
534 | printk("VFS: busy inodes on changed media.\n"); | 534 | printk("VFS: busy inodes on changed media.\n"); |
535 | 535 | ||
536 | if (bdops->revalidate_disk) | 536 | if (bdops->revalidate_disk) |
diff --git a/fs/inode.c b/fs/inode.c index 90a110feb713..801fe7f36280 100644 --- a/fs/inode.c +++ b/fs/inode.c | |||
@@ -26,7 +26,6 @@ | |||
26 | * This is needed for the following functions: | 26 | * This is needed for the following functions: |
27 | * - inode_has_buffers | 27 | * - inode_has_buffers |
28 | * - invalidate_inode_buffers | 28 | * - invalidate_inode_buffers |
29 | * - fsync_bdev | ||
30 | * - invalidate_bdev | 29 | * - invalidate_bdev |
31 | * | 30 | * |
32 | * FIXME: remove all knowledge of the buffer layer from this file | 31 | * FIXME: remove all knowledge of the buffer layer from this file |
@@ -332,14 +331,6 @@ static int invalidate_list(struct list_head *head, struct list_head *dispose) | |||
332 | return busy; | 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 | * invalidate_inodes - discard the inodes on a device | 335 | * invalidate_inodes - discard the inodes on a device |
345 | * @sb: superblock | 336 | * @sb: superblock |
@@ -366,16 +357,11 @@ int invalidate_inodes(struct super_block * sb) | |||
366 | 357 | ||
367 | EXPORT_SYMBOL(invalidate_inodes); | 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; | 362 | struct super_block *sb = get_super(bdev); |
372 | int res; | 363 | int res = 0; |
373 | 364 | ||
374 | if (do_sync) | ||
375 | fsync_bdev(bdev); | ||
376 | |||
377 | res = 0; | ||
378 | sb = get_super(bdev); | ||
379 | if (sb) { | 365 | if (sb) { |
380 | /* | 366 | /* |
381 | * no need to lock the super, get_super holds the | 367 | * no need to lock the super, get_super holds the |
@@ -390,7 +376,6 @@ int __invalidate_device(struct block_device *bdev, int do_sync) | |||
390 | invalidate_bdev(bdev, 0); | 376 | invalidate_bdev(bdev, 0); |
391 | return res; | 377 | return res; |
392 | } | 378 | } |
393 | |||
394 | EXPORT_SYMBOL(__invalidate_device); | 379 | EXPORT_SYMBOL(__invalidate_device); |
395 | 380 | ||
396 | static int can_unuse(struct inode *inode) | 381 | static int can_unuse(struct inode *inode) |
diff --git a/include/linux/fs.h b/include/linux/fs.h index 4edba067a717..0180102dace1 100644 --- a/include/linux/fs.h +++ b/include/linux/fs.h | |||
@@ -1341,7 +1341,7 @@ extern int fs_may_remount_ro(struct super_block *); | |||
1341 | 1341 | ||
1342 | extern int check_disk_change(struct block_device *); | 1342 | extern int check_disk_change(struct block_device *); |
1343 | extern int invalidate_inodes(struct super_block *); | 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 | extern int invalidate_partition(struct gendisk *, int); | 1345 | extern int invalidate_partition(struct gendisk *, int); |
1346 | unsigned long invalidate_mapping_pages(struct address_space *mapping, | 1346 | unsigned long invalidate_mapping_pages(struct address_space *mapping, |
1347 | pgoff_t start, pgoff_t end); | 1347 | pgoff_t start, pgoff_t end); |