aboutsummaryrefslogtreecommitdiffstats
path: root/fs/nfs/dir.c
diff options
context:
space:
mode:
authorJes Sorensen <jes@sgi.com>2006-01-09 18:59:24 -0500
committerIngo Molnar <mingo@hera.kernel.org>2006-01-09 18:59:24 -0500
commit1b1dcc1b57a49136f118a0f16367256ff9994a69 (patch)
treeb0b36d4f41d28c9d6514fb309d33c1a084d6309b /fs/nfs/dir.c
parent794ee1baee1c26be40410233e6c20bceb2b03c08 (diff)
[PATCH] mutex subsystem, semaphore to mutex: VFS, ->i_sem
This patch converts the inode semaphore to a mutex. I have tested it on XFS and compiled as much as one can consider on an ia64. Anyway your luck with it might be different. Modified-by: Ingo Molnar <mingo@elte.hu> (finished the conversion) Signed-off-by: Jes Sorensen <jes@sgi.com> Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'fs/nfs/dir.c')
-rw-r--r--fs/nfs/dir.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/fs/nfs/dir.c b/fs/nfs/dir.c
index e9255198f767..a1554bead692 100644
--- a/fs/nfs/dir.c
+++ b/fs/nfs/dir.c
@@ -194,7 +194,7 @@ int nfs_readdir_filler(nfs_readdir_descriptor_t *desc, struct page *page)
194 spin_unlock(&inode->i_lock); 194 spin_unlock(&inode->i_lock);
195 /* Ensure consistent page alignment of the data. 195 /* Ensure consistent page alignment of the data.
196 * Note: assumes we have exclusive access to this mapping either 196 * Note: assumes we have exclusive access to this mapping either
197 * through inode->i_sem or some other mechanism. 197 * through inode->i_mutex or some other mechanism.
198 */ 198 */
199 if (page->index == 0) 199 if (page->index == 0)
200 invalidate_inode_pages2_range(inode->i_mapping, PAGE_CACHE_SIZE, -1); 200 invalidate_inode_pages2_range(inode->i_mapping, PAGE_CACHE_SIZE, -1);
@@ -573,7 +573,7 @@ static int nfs_readdir(struct file *filp, void *dirent, filldir_t filldir)
573 573
574loff_t nfs_llseek_dir(struct file *filp, loff_t offset, int origin) 574loff_t nfs_llseek_dir(struct file *filp, loff_t offset, int origin)
575{ 575{
576 down(&filp->f_dentry->d_inode->i_sem); 576 mutex_lock(&filp->f_dentry->d_inode->i_mutex);
577 switch (origin) { 577 switch (origin) {
578 case 1: 578 case 1:
579 offset += filp->f_pos; 579 offset += filp->f_pos;
@@ -589,7 +589,7 @@ loff_t nfs_llseek_dir(struct file *filp, loff_t offset, int origin)
589 ((struct nfs_open_context *)filp->private_data)->dir_cookie = 0; 589 ((struct nfs_open_context *)filp->private_data)->dir_cookie = 0;
590 } 590 }
591out: 591out:
592 up(&filp->f_dentry->d_inode->i_sem); 592 mutex_unlock(&filp->f_dentry->d_inode->i_mutex);
593 return offset; 593 return offset;
594} 594}
595 595
@@ -1001,7 +1001,7 @@ static int nfs_open_revalidate(struct dentry *dentry, struct nameidata *nd)
1001 openflags &= ~(O_CREAT|O_TRUNC); 1001 openflags &= ~(O_CREAT|O_TRUNC);
1002 1002
1003 /* 1003 /*
1004 * Note: we're not holding inode->i_sem and so may be racing with 1004 * Note: we're not holding inode->i_mutex and so may be racing with
1005 * operations that change the directory. We therefore save the 1005 * operations that change the directory. We therefore save the
1006 * change attribute *before* we do the RPC call. 1006 * change attribute *before* we do the RPC call.
1007 */ 1007 */
@@ -1051,7 +1051,7 @@ static struct dentry *nfs_readdir_lookup(nfs_readdir_descriptor_t *desc)
1051 return dentry; 1051 return dentry;
1052 if (!desc->plus || !(entry->fattr->valid & NFS_ATTR_FATTR)) 1052 if (!desc->plus || !(entry->fattr->valid & NFS_ATTR_FATTR))
1053 return NULL; 1053 return NULL;
1054 /* Note: caller is already holding the dir->i_sem! */ 1054 /* Note: caller is already holding the dir->i_mutex! */
1055 dentry = d_alloc(parent, &name); 1055 dentry = d_alloc(parent, &name);
1056 if (dentry == NULL) 1056 if (dentry == NULL)
1057 return NULL; 1057 return NULL;