public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Ingo Molnar <mingo@elte.hu>
To: lkml <linux-kernel@vger.kernel.org>
Cc: Linus Torvalds <torvalds@osdl.org>, Andrew Morton <akpm@osdl.org>,
	Arjan van de Ven <arjan@infradead.org>,
	Nicolas Pitre <nico@cam.org>,
	Jes Sorensen <jes@trained-monkey.org>,
	Al Viro <viro@ftp.linux.org.uk>, Oleg Nesterov <oleg@tv-sign.ru>,
	David Howells <dhowells@redhat.com>,
	Alan Cox <alan@lxorguk.ukuu.org.uk>,
	Christoph Hellwig <hch@infradead.org>, Andi Kleen <ak@suse.de>,
	Russell King <rmk+lkml@arm.linux.org.uk>
Subject: [patch 13/13] mutex subsystem, more i_sem -> i_mutex conversions
Date: Thu, 29 Dec 2005 22:05:36 +0100	[thread overview]
Message-ID: <20051229210536.GN665@elte.hu> (raw)

more i_sem -> i_mutex conversions that were needed for my .config.

Signed-off-by: Ingo Molnar <mingo@elte.hu>
--

 fs/nfs/dir.c                |    6 +++---
 fs/nfs/file.c               |   12 ++++++------
 sound/core/oss/pcm_oss.c    |    4 ++--
 sound/core/seq/seq_memory.c |    4 ----
 4 files changed, 11 insertions(+), 15 deletions(-)

Index: linux/fs/nfs/dir.c
===================================================================
--- linux.orig/fs/nfs/dir.c
+++ linux/fs/nfs/dir.c
@@ -194,7 +194,7 @@ int nfs_readdir_filler(nfs_readdir_descr
 	spin_unlock(&inode->i_lock);
 	/* Ensure consistent page alignment of the data.
 	 * Note: assumes we have exclusive access to this mapping either
-	 *	 through inode->i_sem or some other mechanism.
+	 *	 through inode->i_mutex or some other mechanism.
 	 */
 	if (page->index == 0)
 		invalidate_inode_pages2_range(inode->i_mapping, PAGE_CACHE_SIZE, -1);
@@ -1001,7 +1001,7 @@ static int nfs_open_revalidate(struct de
 	openflags &= ~(O_CREAT|O_TRUNC);
 
 	/*
-	 * Note: we're not holding inode->i_sem and so may be racing with
+	 * Note: we're not holding inode->i_mutex and so may be racing with
 	 * operations that change the directory. We therefore save the
 	 * change attribute *before* we do the RPC call.
 	 */
@@ -1051,7 +1051,7 @@ static struct dentry *nfs_readdir_lookup
 		return dentry;
 	if (!desc->plus || !(entry->fattr->valid & NFS_ATTR_FATTR))
 		return NULL;
-	/* Note: caller is already holding the dir->i_sem! */
+	/* Note: caller is already holding the dir->i_mutex! */
 	dentry = d_alloc(parent, &name);
 	if (dentry == NULL)
 		return NULL;
Index: linux/fs/nfs/file.c
===================================================================
--- linux.orig/fs/nfs/file.c
+++ linux/fs/nfs/file.c
@@ -434,9 +434,9 @@ static int do_unlk(struct file *filp, in
 	 * with locks..
 	 */
 	filemap_fdatawrite(filp->f_mapping);
-	down(&inode->i_sem);
+	mutex_lock(&inode->i_mutex);
 	nfs_wb_all(inode);
-	up(&inode->i_sem);
+	mutex_unlock(&inode->i_mutex);
 	filemap_fdatawait(filp->f_mapping);
 
 	/* NOTE: special case
@@ -467,9 +467,9 @@ static int do_setlk(struct file *filp, i
 	 */
 	status = filemap_fdatawrite(filp->f_mapping);
 	if (status == 0) {
-		down(&inode->i_sem);
+		mutex_lock(&inode->i_mutex);
 		status = nfs_wb_all(inode);
-		up(&inode->i_sem);
+		mutex_unlock(&inode->i_mutex);
 		if (status == 0)
 			status = filemap_fdatawait(filp->f_mapping);
 	}
@@ -498,9 +498,9 @@ static int do_setlk(struct file *filp, i
 	 * This makes locking act as a cache coherency point.
 	 */
 	filemap_fdatawrite(filp->f_mapping);
-	down(&inode->i_sem);
+	mutex_lock(&inode->i_mutex);
 	nfs_wb_all(inode);	/* we may have slept */
-	up(&inode->i_sem);
+	mutex_unlock(&inode->i_mutex);
 	filemap_fdatawait(filp->f_mapping);
 	nfs_zap_caches(inode);
 out:
Index: linux/sound/core/oss/pcm_oss.c
===================================================================
--- linux.orig/sound/core/oss/pcm_oss.c
+++ linux/sound/core/oss/pcm_oss.c
@@ -2141,9 +2141,9 @@ static ssize_t snd_pcm_oss_write(struct 
 	substream = pcm_oss_file->streams[SNDRV_PCM_STREAM_PLAYBACK];
 	if (substream == NULL)
 		return -ENXIO;
-	up(&file->f_dentry->d_inode->i_sem);
+	mutex_unlock(&file->f_dentry->d_inode->i_mutex);
 	result = snd_pcm_oss_write1(substream, buf, count);
-	down(&file->f_dentry->d_inode->i_sem);
+	mutex_lock(&file->f_dentry->d_inode->i_mutex);
 #ifdef OSS_DEBUG
 	printk("pcm_oss: write %li bytes (wrote %li bytes)\n", (long)count, (long)result);
 #endif
Index: linux/sound/core/seq/seq_memory.c
===================================================================
--- linux.orig/sound/core/seq/seq_memory.c
+++ linux/sound/core/seq/seq_memory.c
@@ -32,10 +32,6 @@
 #include "seq_info.h"
 #include "seq_lock.h"
 
-/* semaphore in struct file record */
-#define semaphore_of(fp)	((fp)->f_dentry->d_inode->i_sem)
-
-
 static inline int snd_seq_pool_available(pool_t *pool)
 {
 	return pool->total_elements - atomic_read(&pool->counter);

                 reply	other threads:[~2005-12-29 21:06 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=20051229210536.GN665@elte.hu \
    --to=mingo@elte.hu \
    --cc=ak@suse.de \
    --cc=akpm@osdl.org \
    --cc=alan@lxorguk.ukuu.org.uk \
    --cc=arjan@infradead.org \
    --cc=dhowells@redhat.com \
    --cc=hch@infradead.org \
    --cc=jes@trained-monkey.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=nico@cam.org \
    --cc=oleg@tv-sign.ru \
    --cc=rmk+lkml@arm.linux.org.uk \
    --cc=torvalds@osdl.org \
    --cc=viro@ftp.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