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>
struct block_device *bdev = opened_bdev[cnt];
if (!bdev || ITYPE(drive_state[cnt].fd_device) != type)
continue;
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 {
}
up(&open_lock);
} else {
#include <linux/slab.h>
#include <linux/kmod.h>
#include <linux/kobj_map.h>
#include <linux/slab.h>
#include <linux/kmod.h>
#include <linux/kobj_map.h>
+#include <linux/buffer_head.h>
#define MAX_PROBE_HASH 255 /* random */
#define MAX_PROBE_HASH 255 /* random */
int res = 0;
struct block_device *bdev = bdget_disk(disk, index);
if (bdev) {
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;
bdput(bdev);
}
return res;
if (!bdops->media_changed(bdev->bd_disk))
return 0;
if (!bdops->media_changed(bdev->bd_disk))
return 0;
- if (__invalidate_device(bdev, 0))
+ if (__invalidate_device(bdev))
printk("VFS: busy inodes on changed media.\n");
if (bdops->revalidate_disk)
printk("VFS: busy inodes on changed media.\n");
if (bdops->revalidate_disk)
* This is needed for the following functions:
* - inode_has_buffers
* - invalidate_inode_buffers
* This is needed for the following functions:
* - inode_has_buffers
* - invalidate_inode_buffers
* - invalidate_bdev
*
* FIXME: remove all knowledge of the buffer layer from this file
* - invalidate_bdev
*
* FIXME: remove all knowledge of the buffer layer from this file
-/*
- * 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
/**
* invalidate_inodes - discard the inodes on a device
* @sb: superblock
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;
- 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
if (sb) {
/*
* no need to lock the super, get_super holds the
invalidate_bdev(bdev, 0);
return res;
}
invalidate_bdev(bdev, 0);
return res;
}
EXPORT_SYMBOL(__invalidate_device);
static int can_unuse(struct inode *inode)
EXPORT_SYMBOL(__invalidate_device);
static int can_unuse(struct inode *inode)
extern int check_disk_change(struct block_device *);
extern int invalidate_inodes(struct super_block *);
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);
extern int invalidate_partition(struct gendisk *, int);
unsigned long invalidate_mapping_pages(struct address_space *mapping,
pgoff_t start, pgoff_t end);