diff options
author | Jes Sorensen <jes@sgi.com> | 2006-01-09 18:59:24 -0500 |
---|---|---|
committer | Ingo Molnar <mingo@hera.kernel.org> | 2006-01-09 18:59:24 -0500 |
commit | 1b1dcc1b57a49136f118a0f16367256ff9994a69 (patch) | |
tree | b0b36d4f41d28c9d6514fb309d33c1a084d6309b /security | |
parent | 794ee1baee1c26be40410233e6c20bceb2b03c08 (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 'security')
-rw-r--r-- | security/inode.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/security/inode.c b/security/inode.c index a5964502ae30..0f77b0223662 100644 --- a/security/inode.c +++ b/security/inode.c | |||
@@ -172,7 +172,7 @@ static int create_by_name(const char *name, mode_t mode, | |||
172 | return -EFAULT; | 172 | return -EFAULT; |
173 | } | 173 | } |
174 | 174 | ||
175 | down(&parent->d_inode->i_sem); | 175 | mutex_lock(&parent->d_inode->i_mutex); |
176 | *dentry = lookup_one_len(name, parent, strlen(name)); | 176 | *dentry = lookup_one_len(name, parent, strlen(name)); |
177 | if (!IS_ERR(dentry)) { | 177 | if (!IS_ERR(dentry)) { |
178 | if ((mode & S_IFMT) == S_IFDIR) | 178 | if ((mode & S_IFMT) == S_IFDIR) |
@@ -181,7 +181,7 @@ static int create_by_name(const char *name, mode_t mode, | |||
181 | error = create(parent->d_inode, *dentry, mode); | 181 | error = create(parent->d_inode, *dentry, mode); |
182 | } else | 182 | } else |
183 | error = PTR_ERR(dentry); | 183 | error = PTR_ERR(dentry); |
184 | up(&parent->d_inode->i_sem); | 184 | mutex_unlock(&parent->d_inode->i_mutex); |
185 | 185 | ||
186 | return error; | 186 | return error; |
187 | } | 187 | } |
@@ -302,7 +302,7 @@ void securityfs_remove(struct dentry *dentry) | |||
302 | if (!parent || !parent->d_inode) | 302 | if (!parent || !parent->d_inode) |
303 | return; | 303 | return; |
304 | 304 | ||
305 | down(&parent->d_inode->i_sem); | 305 | mutex_lock(&parent->d_inode->i_mutex); |
306 | if (positive(dentry)) { | 306 | if (positive(dentry)) { |
307 | if (dentry->d_inode) { | 307 | if (dentry->d_inode) { |
308 | if (S_ISDIR(dentry->d_inode->i_mode)) | 308 | if (S_ISDIR(dentry->d_inode->i_mode)) |
@@ -312,7 +312,7 @@ void securityfs_remove(struct dentry *dentry) | |||
312 | dput(dentry); | 312 | dput(dentry); |
313 | } | 313 | } |
314 | } | 314 | } |
315 | up(&parent->d_inode->i_sem); | 315 | mutex_unlock(&parent->d_inode->i_mutex); |
316 | simple_release_fs(&mount, &mount_count); | 316 | simple_release_fs(&mount, &mount_count); |
317 | } | 317 | } |
318 | EXPORT_SYMBOL_GPL(securityfs_remove); | 318 | EXPORT_SYMBOL_GPL(securityfs_remove); |