# HG changeset patch # User Daniel Stodden # Date 1272506749 25200 # Node ID fc49ba48fc5dde4869704cc05cc3737682ca650a # Parent a781d46d987f8f8a9308412ba50bad4654a3d97c blkfront: Remove obsolete info->users. This is just bd_openers, protected by the bd_mutex. Signed-off-by: Daniel Stodden diff -r a781d46d987f -r fc49ba48fc5d drivers/block/xen-blkfront.c --- a/drivers/block/xen-blkfront.c Wed Apr 28 19:05:49 2010 -0700 +++ b/drivers/block/xen-blkfront.c Wed Apr 28 19:05:49 2010 -0700 @@ -93,12 +93,6 @@ unsigned long shadow_free; int feature_barrier; int is_ready; - - /** - * The number of people holding this device open. We won't allow a - * hot-unplug unless this is 0. - */ - int users; }; static DEFINE_SPINLOCK(blkif_io_lock); @@ -976,7 +970,7 @@ mutex_lock(&bdev->bd_mutex); - if (info->users) { + if (bdev->bd_openers) { xenbus_dev_error(xbdev, -EBUSY, "Device in use; refusing to close"); xenbus_switch_state(xbdev, XenbusStateClosing); @@ -1103,7 +1097,7 @@ mutex_lock(&bdev->bd_mutex); - if (!info->users) { + if (!bdev->bd_openers) { xlvbd_release_gendisk(info); kfree(info); } @@ -1136,9 +1130,6 @@ mutex_unlock(&info->mutex); - if (!err) - ++info->users; - return err; } @@ -1148,12 +1139,12 @@ struct block_device *bdev; struct xenbus_device *xbdev; - if (--info->users) - return 0; - bdev = bdget_disk(disk, 0); bdput(bdev); + if (bdev->bd_openers) + return 0; + /* * Check if we have been instructed to close. We will have * deferred this request, because the bdev was still open.