dm-devel.redhat.com archive mirror
 help / color / mirror / Atom feed
From: Milan Broz <mbroz@redhat.com>
To: dm-devel@redhat.com
Cc: Milan Broz <mbroz@redhat.com>
Subject: [PATCH] dm: remove dm_mutex (after bkl conversion)
Date: Mon, 29 Nov 2010 23:53:05 +0100	[thread overview]
Message-ID: <1291071187-6231-1-git-send-email-mbroz@redhat.com> (raw)

During the BKL conversion, commit
2a48fc0ab24241755dc93bfd4f01d68efab47f5a
pushed down lock_kernel() into dm_blk_open/close calls
and commit 2a48fc0ab24241755dc93bfd4f01d68efab47f5a
converted it to local mutex.

Patch removes this mutex, DM does not need it, there is
_minor_lock in open call covering create/remove DM device
operation.

In close call there is just atomic reference decrementation
which does not need to be covered by lock.

Signed-off-by: Milan Broz <mbroz@redhat.com>
---
 drivers/md/dm.c |    5 -----
 1 files changed, 0 insertions(+), 5 deletions(-)

diff --git a/drivers/md/dm.c b/drivers/md/dm.c
index 7cb1352..5ca9fc2 100644
--- a/drivers/md/dm.c
+++ b/drivers/md/dm.c
@@ -32,7 +32,6 @@
 #define DM_COOKIE_ENV_VAR_NAME "DM_COOKIE"
 #define DM_COOKIE_LENGTH 24
 
-static DEFINE_MUTEX(dm_mutex);
 static const char *_name = DM_NAME;
 
 static unsigned int major = 0;
@@ -328,7 +327,6 @@ static int dm_blk_open(struct block_device *bdev, fmode_t mode)
 {
 	struct mapped_device *md;
 
-	mutex_lock(&dm_mutex);
 	spin_lock(&_minor_lock);
 
 	md = bdev->bd_disk->private_data;
@@ -346,7 +344,6 @@ static int dm_blk_open(struct block_device *bdev, fmode_t mode)
 
 out:
 	spin_unlock(&_minor_lock);
-	mutex_unlock(&dm_mutex);
 
 	return md ? 0 : -ENXIO;
 }
@@ -355,10 +352,8 @@ static int dm_blk_close(struct gendisk *disk, fmode_t mode)
 {
 	struct mapped_device *md = disk->private_data;
 
-	mutex_lock(&dm_mutex);
 	atomic_dec(&md->open_count);
 	dm_put(md);
-	mutex_unlock(&dm_mutex);
 
 	return 0;
 }
-- 
1.7.2.3

             reply	other threads:[~2010-11-29 22:53 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-11-29 22:53 Milan Broz [this message]
2010-11-29 22:53 ` [PATCH] dm crypt: scale to multiple CPUs Milan Broz
2010-11-29 22:53 ` [PATCH] dm crypt: use IO thread for reads only if mempool is exhausted Milan Broz

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1291071187-6231-1-git-send-email-mbroz@redhat.com \
    --to=mbroz@redhat.com \
    --cc=dm-devel@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).