aboutsummaryrefslogtreecommitdiffstats
path: root/security/inode.c
diff options
context:
space:
mode:
Diffstat (limited to 'security/inode.c')
-rw-r--r--security/inode.c8
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}
318EXPORT_SYMBOL_GPL(securityfs_remove); 318EXPORT_SYMBOL_GPL(securityfs_remove);