Commit 2ef41634 authored by Christoph Hellwig's avatar Christoph Hellwig Committed by Linus Torvalds

[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: default avatarChristoph Hellwig <hch@lst.de>
Cc: <viro@parcelfarce.linux.theplanet.co.uk>
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent 91bb5241
...@@ -3345,7 +3345,7 @@ static inline int set_geometry(unsigned int cmd, struct floppy_struct *g, ...@@ -3345,7 +3345,7 @@ static inline int set_geometry(unsigned int cmd, struct floppy_struct *g,
struct block_device *bdev = opened_bdev[cnt]; struct block_device *bdev = opened_bdev[cnt];
if (!bdev || ITYPE(drive_state[cnt].fd_device) != type) if (!bdev || ITYPE(drive_state[cnt].fd_device) != type)
continue; continue;
__invalidate_device(bdev, 0); __invalidate_device(bdev);
} }
up(&open_lock); up(&open_lock);
} else { } else {
......
...@@ -14,6 +14,7 @@ ...@@ -14,6 +14,7 @@
#include <linux/slab.h> #include <linux/slab.h>
#include <linux/kmod.h> #include <linux/kmod.h>
#include <linux/kobj_map.h> #include <linux/kobj_map.h>
#include <linux/buffer_head.h>
#define MAX_PROBE_HASH 255 /* random */ #define MAX_PROBE_HASH 255 /* random */
...@@ -676,7 +677,8 @@ int invalidate_partition(struct gendisk *disk, int index) ...@@ -676,7 +677,8 @@ int invalidate_partition(struct gendisk *disk, int index)
int res = 0; int res = 0;
struct block_device *bdev = bdget_disk(disk, index); struct block_device *bdev = bdget_disk(disk, index);
if (bdev) { if (bdev) {
res = __invalidate_device(bdev, 1); fsync_bdev(bdev);
res = __invalidate_device(bdev);
bdput(bdev); bdput(bdev);
} }
return res; return res;
......
...@@ -530,7 +530,7 @@ int check_disk_change(struct block_device *bdev) ...@@ -530,7 +530,7 @@ int check_disk_change(struct block_device *bdev)
if (!bdops->media_changed(bdev->bd_disk)) if (!bdops->media_changed(bdev->bd_disk))
return 0; return 0;
if (__invalidate_device(bdev, 0)) if (__invalidate_device(bdev))
printk("VFS: busy inodes on changed media.\n"); printk("VFS: busy inodes on changed media.\n");
if (bdops->revalidate_disk) if (bdops->revalidate_disk)
......
...@@ -26,7 +26,6 @@ ...@@ -26,7 +26,6 @@
* This is needed for the following functions: * This is needed for the following functions:
* - inode_has_buffers * - inode_has_buffers
* - invalidate_inode_buffers * - invalidate_inode_buffers
* - fsync_bdev
* - invalidate_bdev * - invalidate_bdev
* *
* FIXME: remove all knowledge of the buffer layer from this file * 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,14 +331,6 @@ static int invalidate_list(struct list_head *head, struct list_head *dispose)
return busy; 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 * invalidate_inodes - discard the inodes on a device
* @sb: superblock * @sb: superblock
...@@ -366,16 +357,11 @@ int invalidate_inodes(struct super_block * sb) ...@@ -366,16 +357,11 @@ int invalidate_inodes(struct super_block * sb)
EXPORT_SYMBOL(invalidate_inodes); 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; struct super_block *sb = get_super(bdev);
int res; int res = 0;
if (do_sync)
fsync_bdev(bdev);
res = 0;
sb = get_super(bdev);
if (sb) { if (sb) {
/* /*
* no need to lock the super, get_super holds the * 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,7 +376,6 @@ int __invalidate_device(struct block_device *bdev, int do_sync)
invalidate_bdev(bdev, 0); invalidate_bdev(bdev, 0);
return res; return res;
} }
EXPORT_SYMBOL(__invalidate_device); EXPORT_SYMBOL(__invalidate_device);
static int can_unuse(struct inode *inode) static int can_unuse(struct inode *inode)
......
...@@ -1341,7 +1341,7 @@ extern int fs_may_remount_ro(struct super_block *); ...@@ -1341,7 +1341,7 @@ extern int fs_may_remount_ro(struct super_block *);
extern int check_disk_change(struct block_device *); extern int check_disk_change(struct block_device *);
extern int invalidate_inodes(struct super_block *); 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); extern int invalidate_partition(struct gendisk *, int);
unsigned long invalidate_mapping_pages(struct address_space *mapping, unsigned long invalidate_mapping_pages(struct address_space *mapping,
pgoff_t start, pgoff_t end); pgoff_t start, pgoff_t end);
......
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