Commit 8cc9de3e authored by David Woodhouse's avatar David Woodhouse

mtd: Remove redundant mutex from mtd_blkdevs.c

In commit 2a48fc0a ('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
480792b7 ('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: default avatarDavid Woodhouse <David.Woodhouse@intel.com>
parent 67577927
...@@ -37,7 +37,6 @@ ...@@ -37,7 +37,6 @@
#include "mtdcore.h" #include "mtdcore.h"
static DEFINE_MUTEX(mtd_blkdevs_mutex);
static LIST_HEAD(blktrans_majors); static LIST_HEAD(blktrans_majors);
static DEFINE_MUTEX(blktrans_ref_mutex); static DEFINE_MUTEX(blktrans_ref_mutex);
...@@ -185,7 +184,6 @@ static int blktrans_open(struct block_device *bdev, fmode_t mode) ...@@ -185,7 +184,6 @@ static int blktrans_open(struct block_device *bdev, fmode_t mode)
if (!dev) if (!dev)
return -ERESTARTSYS; /* FIXME: busy loop! -arnd*/ return -ERESTARTSYS; /* FIXME: busy loop! -arnd*/
mutex_lock(&mtd_blkdevs_mutex);
mutex_lock(&dev->lock); mutex_lock(&dev->lock);
if (dev->open++) if (dev->open++)
...@@ -202,7 +200,6 @@ static int blktrans_open(struct block_device *bdev, fmode_t mode) ...@@ -202,7 +200,6 @@ static int blktrans_open(struct block_device *bdev, fmode_t mode)
unlock: unlock:
mutex_unlock(&dev->lock); mutex_unlock(&dev->lock);
blktrans_dev_put(dev); blktrans_dev_put(dev);
mutex_unlock(&mtd_blkdevs_mutex);
return ret; return ret;
} }
...@@ -214,7 +211,6 @@ static int blktrans_release(struct gendisk *disk, fmode_t mode) ...@@ -214,7 +211,6 @@ static int blktrans_release(struct gendisk *disk, fmode_t mode)
if (!dev) if (!dev)
return ret; return ret;
mutex_lock(&mtd_blkdevs_mutex);
mutex_lock(&dev->lock); mutex_lock(&dev->lock);
if (--dev->open) if (--dev->open)
...@@ -230,7 +226,6 @@ static int blktrans_release(struct gendisk *disk, fmode_t mode) ...@@ -230,7 +226,6 @@ static int blktrans_release(struct gendisk *disk, fmode_t mode)
unlock: unlock:
mutex_unlock(&dev->lock); mutex_unlock(&dev->lock);
blktrans_dev_put(dev); blktrans_dev_put(dev);
mutex_unlock(&mtd_blkdevs_mutex);
return ret; return ret;
} }
...@@ -263,7 +258,6 @@ static int blktrans_ioctl(struct block_device *bdev, fmode_t mode, ...@@ -263,7 +258,6 @@ static int blktrans_ioctl(struct block_device *bdev, fmode_t mode,
if (!dev) if (!dev)
return ret; return ret;
mutex_lock(&mtd_blkdevs_mutex);
mutex_lock(&dev->lock); mutex_lock(&dev->lock);
if (!dev->mtd) if (!dev->mtd)
...@@ -278,7 +272,6 @@ static int blktrans_ioctl(struct block_device *bdev, fmode_t mode, ...@@ -278,7 +272,6 @@ static int blktrans_ioctl(struct block_device *bdev, fmode_t mode,
} }
unlock: unlock:
mutex_unlock(&dev->lock); mutex_unlock(&dev->lock);
mutex_unlock(&mtd_blkdevs_mutex);
blktrans_dev_put(dev); blktrans_dev_put(dev);
return ret; return ret;
} }
......
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