aboutsummaryrefslogtreecommitdiffstats
path: root/kernel
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 /kernel
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 'kernel')
-rw-r--r--kernel/cpuset.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/kernel/cpuset.c b/kernel/cpuset.c
index eab64e23bcae..2a75e44e1a41 100644
--- a/kernel/cpuset.c
+++ b/kernel/cpuset.c
@@ -1513,7 +1513,7 @@ static int cpuset_add_file(struct dentry *dir, const struct cftype *cft)
1513 struct dentry *dentry; 1513 struct dentry *dentry;
1514 int error; 1514 int error;
1515 1515
1516 down(&dir->d_inode->i_sem); 1516 mutex_lock(&dir->d_inode->i_mutex);
1517 dentry = cpuset_get_dentry(dir, cft->name); 1517 dentry = cpuset_get_dentry(dir, cft->name);
1518 if (!IS_ERR(dentry)) { 1518 if (!IS_ERR(dentry)) {
1519 error = cpuset_create_file(dentry, 0644 | S_IFREG); 1519 error = cpuset_create_file(dentry, 0644 | S_IFREG);
@@ -1522,7 +1522,7 @@ static int cpuset_add_file(struct dentry *dir, const struct cftype *cft)
1522 dput(dentry); 1522 dput(dentry);
1523 } else 1523 } else
1524 error = PTR_ERR(dentry); 1524 error = PTR_ERR(dentry);
1525 up(&dir->d_inode->i_sem); 1525 mutex_unlock(&dir->d_inode->i_mutex);
1526 return error; 1526 return error;
1527} 1527}
1528 1528
@@ -1793,7 +1793,7 @@ static long cpuset_create(struct cpuset *parent, const char *name, int mode)
1793 1793
1794 /* 1794 /*
1795 * Release manage_sem before cpuset_populate_dir() because it 1795 * Release manage_sem before cpuset_populate_dir() because it
1796 * will down() this new directory's i_sem and if we race with 1796 * will down() this new directory's i_mutex and if we race with
1797 * another mkdir, we might deadlock. 1797 * another mkdir, we might deadlock.
1798 */ 1798 */
1799 up(&manage_sem); 1799 up(&manage_sem);
@@ -1812,7 +1812,7 @@ static int cpuset_mkdir(struct inode *dir, struct dentry *dentry, int mode)
1812{ 1812{
1813 struct cpuset *c_parent = dentry->d_parent->d_fsdata; 1813 struct cpuset *c_parent = dentry->d_parent->d_fsdata;
1814 1814
1815 /* the vfs holds inode->i_sem already */ 1815 /* the vfs holds inode->i_mutex already */
1816 return cpuset_create(c_parent, dentry->d_name.name, mode | S_IFDIR); 1816 return cpuset_create(c_parent, dentry->d_name.name, mode | S_IFDIR);
1817} 1817}
1818 1818
@@ -1823,7 +1823,7 @@ static int cpuset_rmdir(struct inode *unused_dir, struct dentry *dentry)
1823 struct cpuset *parent; 1823 struct cpuset *parent;
1824 char *pathbuf = NULL; 1824 char *pathbuf = NULL;
1825 1825
1826 /* the vfs holds both inode->i_sem already */ 1826 /* the vfs holds both inode->i_mutex already */
1827 1827
1828 down(&manage_sem); 1828 down(&manage_sem);
1829 cpuset_update_task_memory_state(); 1829 cpuset_update_task_memory_state();