From: Thomas Gleixner <tglx@linutronix.de>
To: LKML <linux-kernel@vger.kernel.org>
Cc: Christoph Hellwig <hch@infradead.org>,
Peter Zijlstra <peterz@infradead.org>,
Ingo Molnar <mingo@elte.hu>, Al Viro <viro@zeniv.linux.org.uk>
Subject: [patch 02/10] hpfs: Convert sbi->hpfs_creation_de to mutex
Date: Fri, 29 Jan 2010 20:38:38 -0000 [thread overview]
Message-ID: <20100129203613.443786537@linutronix.de> (raw)
In-Reply-To: 20100129203549.526478432@linutronix.de
[-- Attachment #1: hpfs-convert-sema.patch --]
[-- Type: text/plain, Size: 2066 bytes --]
The sbi->hpfs_creation_de semaphore is used as mutex. Convert it to a
real mutex.
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Cc: Al Viro <viro@zeniv.linux.org.uk>
---
fs/hpfs/buffer.c | 4 ++--
fs/hpfs/hpfs_fn.h | 2 +-
fs/hpfs/super.c | 2 +-
3 files changed, 4 insertions(+), 4 deletions(-)
Index: linux-2.6-tip/fs/hpfs/buffer.c
===================================================================
--- linux-2.6-tip.orig/fs/hpfs/buffer.c
+++ linux-2.6-tip/fs/hpfs/buffer.c
@@ -13,7 +13,7 @@ void hpfs_lock_creation(struct super_blo
#ifdef DEBUG_LOCKS
printk("lock creation\n");
#endif
- down(&hpfs_sb(s)->hpfs_creation_de);
+ mutex_lock(&hpfs_sb(s)->hpfs_creation_de);
}
void hpfs_unlock_creation(struct super_block *s)
@@ -21,7 +21,7 @@ void hpfs_unlock_creation(struct super_b
#ifdef DEBUG_LOCKS
printk("unlock creation\n");
#endif
- up(&hpfs_sb(s)->hpfs_creation_de);
+ mutex_unlock(&hpfs_sb(s)->hpfs_creation_de);
}
/* Map a sector into a buffer and return pointers to it and to the buffer. */
Index: linux-2.6-tip/fs/hpfs/hpfs_fn.h
===================================================================
--- linux-2.6-tip.orig/fs/hpfs/hpfs_fn.h
+++ linux-2.6-tip/fs/hpfs/hpfs_fn.h
@@ -87,7 +87,7 @@ struct hpfs_sb_info {
unsigned *sb_bmp_dir; /* main bitmap directory */
unsigned sb_c_bitmap; /* current bitmap */
unsigned sb_max_fwd_alloc; /* max forwad allocation */
- struct semaphore hpfs_creation_de; /* when creating dirents, nobody else
+ struct mutex hpfs_creation_de; /* when creating dirents, nobody else
can alloc blocks */
/*unsigned sb_mounting : 1;*/
int sb_timeshift;
Index: linux-2.6-tip/fs/hpfs/super.c
===================================================================
--- linux-2.6-tip.orig/fs/hpfs/super.c
+++ linux-2.6-tip/fs/hpfs/super.c
@@ -486,7 +486,7 @@ static int hpfs_fill_super(struct super_
sbi->sb_bmp_dir = NULL;
sbi->sb_cp_table = NULL;
- init_MUTEX(&sbi->hpfs_creation_de);
+ mutex_init(&sbi->hpfs_creation_de);
uid = current_uid();
gid = current_gid();
next prev parent reply other threads:[~2010-01-29 20:39 UTC|newest]
Thread overview: 28+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-01-29 20:38 [patch 00/10] semaphore to mutex conversions Thomas Gleixner
2010-01-29 20:38 ` [patch 01/10] smbfs: Convert server->sem to mutex Thomas Gleixner
2010-01-29 22:14 ` Christoph Hellwig
2010-01-29 20:38 ` Thomas Gleixner [this message]
2010-01-29 22:20 ` [patch 02/10] hpfs: Convert sbi->hpfs_creation_de " Christoph Hellwig
2010-01-29 20:38 ` [patch 03/10] hpfsplus: Convert tree_lock " Thomas Gleixner
2010-01-29 22:23 ` Christoph Hellwig
2010-01-29 20:38 ` [patch 04/10] hfs: " Thomas Gleixner
2010-01-29 22:26 ` Christoph Hellwig
2010-01-29 20:38 ` [patch 05/10] cifs: convert semaphore " Thomas Gleixner
2010-01-29 22:29 ` Christoph Hellwig
2010-01-29 20:38 ` [patch 06/10] affs: Convert semaphores to mutexes Thomas Gleixner
2010-01-29 22:25 ` Al Viro
2010-01-29 22:36 ` Christoph Hellwig
2010-01-29 23:03 ` Thomas Gleixner
2010-01-29 23:41 ` Al Viro
2010-01-29 20:38 ` [patch 07/10] usb: gadgetfs: Convert semaphore to mutex Thomas Gleixner
2010-01-29 21:14 ` Greg KH
2010-01-29 21:48 ` Thomas Gleixner
2010-01-29 22:07 ` Greg KH
2010-01-29 23:04 ` Thomas Gleixner
2010-01-30 5:27 ` Greg KH
2010-01-29 20:39 ` [patch 08/10] drivers/base: Convert dev->sem " Thomas Gleixner
2010-01-29 21:13 ` Greg KH
2010-01-29 21:48 ` Thomas Gleixner
2010-01-30 5:26 ` Greg KH
2010-01-29 20:39 ` [patch 09/10] block: drbd: Convert semaphore " Thomas Gleixner
2010-01-29 20:39 ` [patch 10/10] hwmon: s3c-hwmon: " Thomas Gleixner
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=20100129203613.443786537@linutronix.de \
--to=tglx@linutronix.de \
--cc=hch@infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@elte.hu \
--cc=peterz@infradead.org \
--cc=viro@zeniv.linux.org.uk \
/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