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 /drivers/oprofile | |
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 'drivers/oprofile')
-rw-r--r-- | drivers/oprofile/oprofilefs.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/drivers/oprofile/oprofilefs.c b/drivers/oprofile/oprofilefs.c index dd92c5edf219..b48ac6300c79 100644 --- a/drivers/oprofile/oprofilefs.c +++ b/drivers/oprofile/oprofilefs.c | |||
@@ -138,22 +138,22 @@ static int __oprofilefs_create_file(struct dentry *root, char const *name, | |||
138 | struct dentry *dentry; | 138 | struct dentry *dentry; |
139 | struct inode *inode; | 139 | struct inode *inode; |
140 | 140 | ||
141 | mutex_lock(&d_inode(root)->i_mutex); | 141 | inode_lock(d_inode(root)); |
142 | dentry = d_alloc_name(root, name); | 142 | dentry = d_alloc_name(root, name); |
143 | if (!dentry) { | 143 | if (!dentry) { |
144 | mutex_unlock(&d_inode(root)->i_mutex); | 144 | inode_unlock(d_inode(root)); |
145 | return -ENOMEM; | 145 | return -ENOMEM; |
146 | } | 146 | } |
147 | inode = oprofilefs_get_inode(root->d_sb, S_IFREG | perm); | 147 | inode = oprofilefs_get_inode(root->d_sb, S_IFREG | perm); |
148 | if (!inode) { | 148 | if (!inode) { |
149 | dput(dentry); | 149 | dput(dentry); |
150 | mutex_unlock(&d_inode(root)->i_mutex); | 150 | inode_unlock(d_inode(root)); |
151 | return -ENOMEM; | 151 | return -ENOMEM; |
152 | } | 152 | } |
153 | inode->i_fop = fops; | 153 | inode->i_fop = fops; |
154 | inode->i_private = priv; | 154 | inode->i_private = priv; |
155 | d_add(dentry, inode); | 155 | d_add(dentry, inode); |
156 | mutex_unlock(&d_inode(root)->i_mutex); | 156 | inode_unlock(d_inode(root)); |
157 | return 0; | 157 | return 0; |
158 | } | 158 | } |
159 | 159 | ||
@@ -215,22 +215,22 @@ struct dentry *oprofilefs_mkdir(struct dentry *parent, char const *name) | |||
215 | struct dentry *dentry; | 215 | struct dentry *dentry; |
216 | struct inode *inode; | 216 | struct inode *inode; |
217 | 217 | ||
218 | mutex_lock(&d_inode(parent)->i_mutex); | 218 | inode_lock(d_inode(parent)); |
219 | dentry = d_alloc_name(parent, name); | 219 | dentry = d_alloc_name(parent, name); |
220 | if (!dentry) { | 220 | if (!dentry) { |
221 | mutex_unlock(&d_inode(parent)->i_mutex); | 221 | inode_unlock(d_inode(parent)); |
222 | return NULL; | 222 | return NULL; |
223 | } | 223 | } |
224 | inode = oprofilefs_get_inode(parent->d_sb, S_IFDIR | 0755); | 224 | inode = oprofilefs_get_inode(parent->d_sb, S_IFDIR | 0755); |
225 | if (!inode) { | 225 | if (!inode) { |
226 | dput(dentry); | 226 | dput(dentry); |
227 | mutex_unlock(&d_inode(parent)->i_mutex); | 227 | inode_unlock(d_inode(parent)); |
228 | return NULL; | 228 | return NULL; |
229 | } | 229 | } |
230 | inode->i_op = &simple_dir_inode_operations; | 230 | inode->i_op = &simple_dir_inode_operations; |
231 | inode->i_fop = &simple_dir_operations; | 231 | inode->i_fop = &simple_dir_operations; |
232 | d_add(dentry, inode); | 232 | d_add(dentry, inode); |
233 | mutex_unlock(&d_inode(parent)->i_mutex); | 233 | inode_unlock(d_inode(parent)); |
234 | return dentry; | 234 | return dentry; |
235 | } | 235 | } |
236 | 236 | ||