aboutsummaryrefslogtreecommitdiffstats
path: root/fs/namespace.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/namespace.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/namespace.c')
-rw-r--r--fs/namespace.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/fs/namespace.c b/fs/namespace.c
index 3e8fb61ad597..f0e353f5bc30 100644
--- a/fs/namespace.c
+++ b/fs/namespace.c
@@ -814,7 +814,7 @@ static int graft_tree(struct vfsmount *mnt, struct nameidata *nd)
814 return -ENOTDIR; 814 return -ENOTDIR;
815 815
816 err = -ENOENT; 816 err = -ENOENT;
817 down(&nd->dentry->d_inode->i_sem); 817 mutex_lock(&nd->dentry->d_inode->i_mutex);
818 if (IS_DEADDIR(nd->dentry->d_inode)) 818 if (IS_DEADDIR(nd->dentry->d_inode))
819 goto out_unlock; 819 goto out_unlock;
820 820
@@ -826,7 +826,7 @@ static int graft_tree(struct vfsmount *mnt, struct nameidata *nd)
826 if (IS_ROOT(nd->dentry) || !d_unhashed(nd->dentry)) 826 if (IS_ROOT(nd->dentry) || !d_unhashed(nd->dentry))
827 err = attach_recursive_mnt(mnt, nd, NULL); 827 err = attach_recursive_mnt(mnt, nd, NULL);
828out_unlock: 828out_unlock:
829 up(&nd->dentry->d_inode->i_sem); 829 mutex_unlock(&nd->dentry->d_inode->i_mutex);
830 if (!err) 830 if (!err)
831 security_sb_post_addmount(mnt, nd); 831 security_sb_post_addmount(mnt, nd);
832 return err; 832 return err;
@@ -962,7 +962,7 @@ static int do_move_mount(struct nameidata *nd, char *old_name)
962 goto out; 962 goto out;
963 963
964 err = -ENOENT; 964 err = -ENOENT;
965 down(&nd->dentry->d_inode->i_sem); 965 mutex_lock(&nd->dentry->d_inode->i_mutex);
966 if (IS_DEADDIR(nd->dentry->d_inode)) 966 if (IS_DEADDIR(nd->dentry->d_inode))
967 goto out1; 967 goto out1;
968 968
@@ -1004,7 +1004,7 @@ static int do_move_mount(struct nameidata *nd, char *old_name)
1004 list_del_init(&old_nd.mnt->mnt_expire); 1004 list_del_init(&old_nd.mnt->mnt_expire);
1005 spin_unlock(&vfsmount_lock); 1005 spin_unlock(&vfsmount_lock);
1006out1: 1006out1:
1007 up(&nd->dentry->d_inode->i_sem); 1007 mutex_unlock(&nd->dentry->d_inode->i_mutex);
1008out: 1008out:
1009 up_write(&namespace_sem); 1009 up_write(&namespace_sem);
1010 if (!err) 1010 if (!err)
@@ -1573,7 +1573,7 @@ asmlinkage long sys_pivot_root(const char __user * new_root,
1573 user_nd.dentry = dget(current->fs->root); 1573 user_nd.dentry = dget(current->fs->root);
1574 read_unlock(&current->fs->lock); 1574 read_unlock(&current->fs->lock);
1575 down_write(&namespace_sem); 1575 down_write(&namespace_sem);
1576 down(&old_nd.dentry->d_inode->i_sem); 1576 mutex_lock(&old_nd.dentry->d_inode->i_mutex);
1577 error = -EINVAL; 1577 error = -EINVAL;
1578 if (IS_MNT_SHARED(old_nd.mnt) || 1578 if (IS_MNT_SHARED(old_nd.mnt) ||
1579 IS_MNT_SHARED(new_nd.mnt->mnt_parent) || 1579 IS_MNT_SHARED(new_nd.mnt->mnt_parent) ||
@@ -1626,7 +1626,7 @@ asmlinkage long sys_pivot_root(const char __user * new_root,
1626 path_release(&root_parent); 1626 path_release(&root_parent);
1627 path_release(&parent_nd); 1627 path_release(&parent_nd);
1628out2: 1628out2:
1629 up(&old_nd.dentry->d_inode->i_sem); 1629 mutex_unlock(&old_nd.dentry->d_inode->i_mutex);
1630 up_write(&namespace_sem); 1630 up_write(&namespace_sem);
1631 path_release(&user_nd); 1631 path_release(&user_nd);
1632 path_release(&old_nd); 1632 path_release(&old_nd);