From: Daniel Walker <dwalker@mvista.com>
To: akpm@linux-foundation.org
Cc: linux-kernel@vger.kernel.org, mingo@elte.hu, linux@bohmer.net,
jonathan@jonmasters.org, matthias.kaehlcke@gmail.com,
kjwinchester@gmail.com
Subject: [PATCH 4/4] md: dm driver: suspend_lock semaphore to mutex
Date: Fri, 07 Dec 2007 00:00:04 -0800 [thread overview]
Message-ID: <20071208025623.282441997@mvista.com> (raw)
In-Reply-To: 20071208025608.631609481@mvista.com
[-- Attachment #1: md-suspend_lock-semaphore-to-mutex.patch --]
[-- Type: text/plain, Size: 2063 bytes --]
Signed-off-by: Daniel Walker <dwalker@mvista.com>
---
drivers/md/dm.c | 16 ++++++++--------
1 file changed, 8 insertions(+), 8 deletions(-)
Index: linux-2.6.23/drivers/md/dm.c
===================================================================
--- linux-2.6.23.orig/drivers/md/dm.c
+++ linux-2.6.23/drivers/md/dm.c
@@ -73,7 +73,7 @@ union map_info *dm_get_mapinfo(struct bi
struct mapped_device {
struct rw_semaphore io_lock;
- struct semaphore suspend_lock;
+ struct mutex suspend_lock;
spinlock_t pushback_lock;
rwlock_t map_lock;
atomic_t holders;
@@ -982,7 +982,7 @@ static struct mapped_device *alloc_dev(i
memset(md, 0, sizeof(*md));
init_rwsem(&md->io_lock);
- init_MUTEX(&md->suspend_lock);
+ mutex_init(&md->suspend_lock);
spin_lock_init(&md->pushback_lock);
rwlock_init(&md->map_lock);
atomic_set(&md->holders, 1);
@@ -1270,7 +1270,7 @@ int dm_swap_table(struct mapped_device *
{
int r = -EINVAL;
- down(&md->suspend_lock);
+ mutex_lock(&md->suspend_lock);
/* device must be suspended */
if (!dm_suspended(md))
@@ -1285,7 +1285,7 @@ int dm_swap_table(struct mapped_device *
r = __bind(md, table);
out:
- up(&md->suspend_lock);
+ mutex_unlock(&md->suspend_lock);
return r;
}
@@ -1341,7 +1341,7 @@ int dm_suspend(struct mapped_device *md,
int do_lockfs = suspend_flags & DM_SUSPEND_LOCKFS_FLAG ? 1 : 0;
int noflush = suspend_flags & DM_SUSPEND_NOFLUSH_FLAG ? 1 : 0;
- down(&md->suspend_lock);
+ mutex_lock(&md->suspend_lock);
if (dm_suspended(md))
goto out_unlock;
@@ -1462,7 +1462,7 @@ out:
dm_table_put(map);
out_unlock:
- up(&md->suspend_lock);
+ mutex_unlock(&md->suspend_lock);
return r;
}
@@ -1472,7 +1472,7 @@ int dm_resume(struct mapped_device *md)
struct bio *def;
struct dm_table *map = NULL;
- down(&md->suspend_lock);
+ mutex_lock(&md->suspend_lock);
if (!dm_suspended(md))
goto out;
@@ -1508,7 +1508,7 @@ int dm_resume(struct mapped_device *md)
out:
dm_table_put(map);
- up(&md->suspend_lock);
+ mutex_unlock(&md->suspend_lock);
return r;
}
--
prev parent reply other threads:[~2007-12-08 3:08 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20071208025608.631609481@mvista.com>
2007-12-07 8:00 ` [PATCH 1/4] media: video: usbvision: remove ctrlUrbLock Daniel Walker
2007-12-07 8:00 ` [PATCH 2/4] docs: kernel-locking: Convert semaphore references Daniel Walker
2007-12-07 8:00 ` [PATCH 3/4] mcheck mce_64: mce_read_sem to mutex Daniel Walker
2007-12-07 8:00 ` Daniel Walker [this message]
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=20071208025623.282441997@mvista.com \
--to=dwalker@mvista.com \
--cc=akpm@linux-foundation.org \
--cc=jonathan@jonmasters.org \
--cc=kjwinchester@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux@bohmer.net \
--cc=matthias.kaehlcke@gmail.com \
--cc=mingo@elte.hu \
/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