diff options
author | Milan Broz <mbroz@redhat.com> | 2011-01-13 14:59:48 -0500 |
---|---|---|
committer | Alasdair G Kergon <agk@redhat.com> | 2011-01-13 14:59:48 -0500 |
commit | 4a1aeb98297e17f4e0a8cdda919e63bf528b2e5d (patch) | |
tree | 4709346914cbdab86200c59241262d0ea2cbd204 /drivers/md | |
parent | 5fc2ffeabb9ee0fc0e71ff16b49f34f0ed3d05b4 (diff) |
dm: remove dm_mutex after bkl conversion
This patch replaces dm_mutex with _minor_lock in dm_blk_close()
and then removes it.
During the BKL conversion, commit 6e9624b8caec290d28b4c6d9ec75749df6372b87
(block: push down BKL into .open and .release) pushed lock_kernel()
down into dm_blk_open/close calls.
Commit 2a48fc0ab24241755dc93bfd4f01d68efab47f5a
(block: autoconvert trivial BKL users to private mutex) converted it to a
local mutex, but _minor_lock is sufficient.
Signed-off-by: Milan Broz <mbroz@redhat.com>
Signed-off-by: Alasdair G Kergon <agk@redhat.com>
Diffstat (limited to 'drivers/md')
-rw-r--r-- | drivers/md/dm.c | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/drivers/md/dm.c b/drivers/md/dm.c index 4ef066a3090f..0de692176ad4 100644 --- a/drivers/md/dm.c +++ b/drivers/md/dm.c | |||
@@ -32,7 +32,6 @@ | |||
32 | #define DM_COOKIE_ENV_VAR_NAME "DM_COOKIE" | 32 | #define DM_COOKIE_ENV_VAR_NAME "DM_COOKIE" |
33 | #define DM_COOKIE_LENGTH 24 | 33 | #define DM_COOKIE_LENGTH 24 |
34 | 34 | ||
35 | static DEFINE_MUTEX(dm_mutex); | ||
36 | static const char *_name = DM_NAME; | 35 | static const char *_name = DM_NAME; |
37 | 36 | ||
38 | static unsigned int major = 0; | 37 | static unsigned int major = 0; |
@@ -328,7 +327,6 @@ static int dm_blk_open(struct block_device *bdev, fmode_t mode) | |||
328 | { | 327 | { |
329 | struct mapped_device *md; | 328 | struct mapped_device *md; |
330 | 329 | ||
331 | mutex_lock(&dm_mutex); | ||
332 | spin_lock(&_minor_lock); | 330 | spin_lock(&_minor_lock); |
333 | 331 | ||
334 | md = bdev->bd_disk->private_data; | 332 | md = bdev->bd_disk->private_data; |
@@ -346,7 +344,6 @@ static int dm_blk_open(struct block_device *bdev, fmode_t mode) | |||
346 | 344 | ||
347 | out: | 345 | out: |
348 | spin_unlock(&_minor_lock); | 346 | spin_unlock(&_minor_lock); |
349 | mutex_unlock(&dm_mutex); | ||
350 | 347 | ||
351 | return md ? 0 : -ENXIO; | 348 | return md ? 0 : -ENXIO; |
352 | } | 349 | } |
@@ -355,10 +352,12 @@ static int dm_blk_close(struct gendisk *disk, fmode_t mode) | |||
355 | { | 352 | { |
356 | struct mapped_device *md = disk->private_data; | 353 | struct mapped_device *md = disk->private_data; |
357 | 354 | ||
358 | mutex_lock(&dm_mutex); | 355 | spin_lock(&_minor_lock); |
356 | |||
359 | atomic_dec(&md->open_count); | 357 | atomic_dec(&md->open_count); |
360 | dm_put(md); | 358 | dm_put(md); |
361 | mutex_unlock(&dm_mutex); | 359 | |
360 | spin_unlock(&_minor_lock); | ||
362 | 361 | ||
363 | return 0; | 362 | return 0; |
364 | } | 363 | } |