diff options
author | Al Viro <viro@zeniv.linux.org.uk> | 2016-01-22 15:40:57 -0500 |
---|---|---|
committer | Al Viro <viro@zeniv.linux.org.uk> | 2016-01-22 18:04:28 -0500 |
commit | 5955102c9984fa081b2d570cfac75c97eecf8f3b (patch) | |
tree | a4744386eac4b916e847eb4eedfada158f6527b4 /security/inode.c | |
parent | 57b8f112cfe6622ddddb8c2641206bb5fa8a112d (diff) |
wrappers for ->i_mutex access
parallel to mutex_{lock,unlock,trylock,is_locked,lock_nested},
inode_foo(inode) being mutex_foo(&inode->i_mutex).
Please, use those for access to ->i_mutex; over the coming cycle
->i_mutex will become rwsem, with ->lookup() done with it held
only shared.
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'security/inode.c')
-rw-r--r-- | security/inode.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/security/inode.c b/security/inode.c index 16622aef9bde..28414b0207ce 100644 --- a/security/inode.c +++ b/security/inode.c | |||
@@ -99,7 +99,7 @@ struct dentry *securityfs_create_file(const char *name, umode_t mode, | |||
99 | 99 | ||
100 | dir = d_inode(parent); | 100 | dir = d_inode(parent); |
101 | 101 | ||
102 | mutex_lock(&dir->i_mutex); | 102 | inode_lock(dir); |
103 | dentry = lookup_one_len(name, parent, strlen(name)); | 103 | dentry = lookup_one_len(name, parent, strlen(name)); |
104 | if (IS_ERR(dentry)) | 104 | if (IS_ERR(dentry)) |
105 | goto out; | 105 | goto out; |
@@ -129,14 +129,14 @@ struct dentry *securityfs_create_file(const char *name, umode_t mode, | |||
129 | } | 129 | } |
130 | d_instantiate(dentry, inode); | 130 | d_instantiate(dentry, inode); |
131 | dget(dentry); | 131 | dget(dentry); |
132 | mutex_unlock(&dir->i_mutex); | 132 | inode_unlock(dir); |
133 | return dentry; | 133 | return dentry; |
134 | 134 | ||
135 | out1: | 135 | out1: |
136 | dput(dentry); | 136 | dput(dentry); |
137 | dentry = ERR_PTR(error); | 137 | dentry = ERR_PTR(error); |
138 | out: | 138 | out: |
139 | mutex_unlock(&dir->i_mutex); | 139 | inode_unlock(dir); |
140 | simple_release_fs(&mount, &mount_count); | 140 | simple_release_fs(&mount, &mount_count); |
141 | return dentry; | 141 | return dentry; |
142 | } | 142 | } |
@@ -195,7 +195,7 @@ void securityfs_remove(struct dentry *dentry) | |||
195 | if (!parent || d_really_is_negative(parent)) | 195 | if (!parent || d_really_is_negative(parent)) |
196 | return; | 196 | return; |
197 | 197 | ||
198 | mutex_lock(&d_inode(parent)->i_mutex); | 198 | inode_lock(d_inode(parent)); |
199 | if (simple_positive(dentry)) { | 199 | if (simple_positive(dentry)) { |
200 | if (d_is_dir(dentry)) | 200 | if (d_is_dir(dentry)) |
201 | simple_rmdir(d_inode(parent), dentry); | 201 | simple_rmdir(d_inode(parent), dentry); |
@@ -203,7 +203,7 @@ void securityfs_remove(struct dentry *dentry) | |||
203 | simple_unlink(d_inode(parent), dentry); | 203 | simple_unlink(d_inode(parent), dentry); |
204 | dput(dentry); | 204 | dput(dentry); |
205 | } | 205 | } |
206 | mutex_unlock(&d_inode(parent)->i_mutex); | 206 | inode_unlock(d_inode(parent)); |
207 | simple_release_fs(&mount, &mount_count); | 207 | simple_release_fs(&mount, &mount_count); |
208 | } | 208 | } |
209 | EXPORT_SYMBOL_GPL(securityfs_remove); | 209 | EXPORT_SYMBOL_GPL(securityfs_remove); |