summaryrefslogtreecommitdiff
path: root/fs
diff options
context:
space:
mode:
authorAlexander Viro <viro@math.psu.edu>2002-02-27 20:23:33 -0800
committerLinus Torvalds <torvalds@penguin.transmeta.com>2002-02-27 20:23:33 -0800
commit7155112cbcab15e2e34809c97c89907b8fa8013e (patch)
treeb5d82a5e69f94544f9f7adcee522347a3fb9e977 /fs
parent8a0acc94ebedbcc6459763c1b391a3f83a5e8df0 (diff)
[PATCH] (1/7) kdev_t removals
* new function - fsync_bdev() (analog of fsync_dev(), but takes struct block_device * instead of kdev_t. Callers of fsync_dev() that have struct block_device in question are using fsync_bdev() now. * old code for fsync_dev(NODEV) had been moved to sys_sync(). Other callers of fsync_dev(NODEV) are calling sys_sync() now. * fsync_dev() became a wrapper fro fsync_bdev(). * sync_dev() (not used anywhere in the tree) is gone. * i2oblock.c had fsync_dev() called in ->release(). Removed. * s390/block/xparm.c was doing fsync_dev() on its devices in cleanup_module(). Removed.
Diffstat (limited to 'fs')
-rw-r--r--fs/buffer.c47
1 files changed, 24 insertions, 23 deletions
diff --git a/fs/buffer.c b/fs/buffer.c
index 3077d85c2e4a..e330e7ed6213 100644
--- a/fs/buffer.c
+++ b/fs/buffer.c
@@ -343,36 +343,37 @@ int fsync_no_super(struct block_device *bdev)
int fsync_dev(kdev_t dev)
{
- sync_buffers(dev, 0);
-
- lock_kernel();
- sync_inodes(dev);
- if (!kdev_none(dev)) {
- struct super_block *sb = get_super(dev);
- if (sb) {
- DQUOT_SYNC(sb);
- drop_super(sb);
- }
- } else
- DQUOT_SYNC(NULL);
- sync_supers(dev);
- unlock_kernel();
-
- return sync_buffers(dev, 1);
+ struct block_device *bdev = bdget(kdev_t_to_nr(dev));
+ if (bdev) {
+ int res = fsync_bdev(bdev);
+ bdput(bdev);
+ return res;
+ }
+ return 0;
}
-/*
- * There's no real reason to pretend we should
- * ever do anything differently
- */
-void sync_dev(kdev_t dev)
+int fsync_bdev(struct block_device *bdev)
{
- fsync_dev(dev);
+ struct super_block *sb = get_super(to_kdev_t(bdev->bd_dev));
+ if (sb) {
+ int res = fsync_super(sb);
+ drop_super(sb);
+ return res;
+ }
+ return fsync_no_super(bdev);
}
asmlinkage long sys_sync(void)
{
- fsync_dev(NODEV);
+ sync_buffers(NODEV, 0);
+
+ lock_kernel();
+ sync_inodes(NODEV);
+ DQUOT_SYNC(NULL);
+ sync_supers(NODEV);
+ unlock_kernel();
+
+ sync_buffers(NODEV, 1);
return 0;
}