Commit 04d16611 authored by Andrew Morton's avatar Andrew Morton Committed by Dave Jones

[PATCH] sync blockdevs on the final close only

From: davej@codemonkey.org.uk

We currently run sync_blockdev() on every close of a blockdev.  This patch
arranges for the sync to happen only on the final close.
parent 860b3cb2
......@@ -653,15 +653,16 @@ int blkdev_put(struct block_device *bdev, int kind)
struct gendisk *disk = bdev->bd_disk;
down(&bdev->bd_sem);
lock_kernel();
if (!--bdev->bd_openers) {
switch (kind) {
case BDEV_FILE:
case BDEV_FS:
sync_blockdev(bd_inode->i_bdev);
break;
}
lock_kernel();
if (!--bdev->bd_openers)
kill_bdev(bdev);
}
if (bdev->bd_contains == bdev) {
if (disk->fops->release)
ret = disk->fops->release(bd_inode, NULL);
......
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