mtd: Remove redundant mutex from mtd_blkdevs.c

Linux-MTD Mailing List linux-mtd at lists.infradead.org
Sat Oct 30 07:59:02 EDT 2010


Gitweb:     http://git.infradead.org/?p=mtd-2.6.git;a=commit;h=8cc9de3ebdf654601db51a516267dff89c49acc3
Commit:     8cc9de3ebdf654601db51a516267dff89c49acc3
Parent:     67577927e8d7a1f4b09b4992df640eadc6aacb36
Author:     David Woodhouse <David.Woodhouse at intel.com>
AuthorDate: Sat Oct 30 12:39:21 2010 +0100
Committer:  David Woodhouse <David.Woodhouse at intel.com>
CommitDate: Sat Oct 30 12:39:21 2010 +0100

    mtd: Remove redundant mutex from mtd_blkdevs.c
    
    In commit 2a48fc0ab24241755dc93bfd4f01d68efab47f5a ('block: autoconvert
    trivial BKL users to private mutex'), Arnd replaced the BKL usage with a
    mutex. However, Maxim has already provided a better fix in commit
    480792b7bf188c29b8d4b10fee65c3a06ec5dbf7 ('mtd: blktrans: kill BKL'),
    which was simply to remove the BKL without replacing it — since he'd
    already made it do all necessary locking for itself.
    
    Signed-off-by: David Woodhouse <David.Woodhouse at intel.com>
---
 drivers/mtd/mtd_blkdevs.c |    7 -------
 1 files changed, 0 insertions(+), 7 deletions(-)

diff --git a/drivers/mtd/mtd_blkdevs.c b/drivers/mtd/mtd_blkdevs.c
index f932979..cb20c67 100644
--- a/drivers/mtd/mtd_blkdevs.c
+++ b/drivers/mtd/mtd_blkdevs.c
@@ -37,7 +37,6 @@
 
 #include "mtdcore.h"
 
-static DEFINE_MUTEX(mtd_blkdevs_mutex);
 static LIST_HEAD(blktrans_majors);
 static DEFINE_MUTEX(blktrans_ref_mutex);
 
@@ -185,7 +184,6 @@ static int blktrans_open(struct block_device *bdev, fmode_t mode)
 	if (!dev)
 		return -ERESTARTSYS; /* FIXME: busy loop! -arnd*/
 
-	mutex_lock(&mtd_blkdevs_mutex);
 	mutex_lock(&dev->lock);
 
 	if (dev->open++)
@@ -202,7 +200,6 @@ static int blktrans_open(struct block_device *bdev, fmode_t mode)
 unlock:
 	mutex_unlock(&dev->lock);
 	blktrans_dev_put(dev);
-	mutex_unlock(&mtd_blkdevs_mutex);
 	return ret;
 }
 
@@ -214,7 +211,6 @@ static int blktrans_release(struct gendisk *disk, fmode_t mode)
 	if (!dev)
 		return ret;
 
-	mutex_lock(&mtd_blkdevs_mutex);
 	mutex_lock(&dev->lock);
 
 	if (--dev->open)
@@ -230,7 +226,6 @@ static int blktrans_release(struct gendisk *disk, fmode_t mode)
 unlock:
 	mutex_unlock(&dev->lock);
 	blktrans_dev_put(dev);
-	mutex_unlock(&mtd_blkdevs_mutex);
 	return ret;
 }
 
@@ -263,7 +258,6 @@ static int blktrans_ioctl(struct block_device *bdev, fmode_t mode,
 	if (!dev)
 		return ret;
 
-	mutex_lock(&mtd_blkdevs_mutex);
 	mutex_lock(&dev->lock);
 
 	if (!dev->mtd)
@@ -278,7 +272,6 @@ static int blktrans_ioctl(struct block_device *bdev, fmode_t mode,
 	}
 unlock:
 	mutex_unlock(&dev->lock);
-	mutex_unlock(&mtd_blkdevs_mutex);
 	blktrans_dev_put(dev);
 	return ret;
 }



More information about the linux-mtd-cvs mailing list