summaryrefslogtreecommitdiffstats
path: root/fs/configfs/inode.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/configfs/inode.c')
-rw-r--r--fs/configfs/inode.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/fs/configfs/inode.c b/fs/configfs/inode.c
index 5423a6a6ecc8..8d89f5fd0331 100644
--- a/fs/configfs/inode.c
+++ b/fs/configfs/inode.c
@@ -56,7 +56,7 @@ static const struct inode_operations configfs_inode_operations ={
56 56
57int configfs_setattr(struct dentry * dentry, struct iattr * iattr) 57int configfs_setattr(struct dentry * dentry, struct iattr * iattr)
58{ 58{
59 struct inode * inode = dentry->d_inode; 59 struct inode * inode = d_inode(dentry);
60 struct configfs_dirent * sd = dentry->d_fsdata; 60 struct configfs_dirent * sd = dentry->d_fsdata;
61 struct iattr * sd_iattr; 61 struct iattr * sd_iattr;
62 unsigned int ia_valid = iattr->ia_valid; 62 unsigned int ia_valid = iattr->ia_valid;
@@ -186,7 +186,7 @@ int configfs_create(struct dentry * dentry, umode_t mode, void (*init)(struct in
186 if (!dentry) 186 if (!dentry)
187 return -ENOENT; 187 return -ENOENT;
188 188
189 if (dentry->d_inode) 189 if (d_really_is_positive(dentry))
190 return -EEXIST; 190 return -EEXIST;
191 191
192 sd = dentry->d_fsdata; 192 sd = dentry->d_fsdata;
@@ -194,7 +194,7 @@ int configfs_create(struct dentry * dentry, umode_t mode, void (*init)(struct in
194 if (!inode) 194 if (!inode)
195 return -ENOMEM; 195 return -ENOMEM;
196 196
197 p_inode = dentry->d_parent->d_inode; 197 p_inode = d_inode(dentry->d_parent);
198 p_inode->i_mtime = p_inode->i_ctime = CURRENT_TIME; 198 p_inode->i_mtime = p_inode->i_ctime = CURRENT_TIME;
199 configfs_set_inode_lock_class(sd, inode); 199 configfs_set_inode_lock_class(sd, inode);
200 200
@@ -236,11 +236,11 @@ void configfs_drop_dentry(struct configfs_dirent * sd, struct dentry * parent)
236 236
237 if (dentry) { 237 if (dentry) {
238 spin_lock(&dentry->d_lock); 238 spin_lock(&dentry->d_lock);
239 if (!d_unhashed(dentry) && dentry->d_inode) { 239 if (!d_unhashed(dentry) && d_really_is_positive(dentry)) {
240 dget_dlock(dentry); 240 dget_dlock(dentry);
241 __d_drop(dentry); 241 __d_drop(dentry);
242 spin_unlock(&dentry->d_lock); 242 spin_unlock(&dentry->d_lock);
243 simple_unlink(parent->d_inode, dentry); 243 simple_unlink(d_inode(parent), dentry);
244 } else 244 } else
245 spin_unlock(&dentry->d_lock); 245 spin_unlock(&dentry->d_lock);
246 } 246 }
@@ -251,11 +251,11 @@ void configfs_hash_and_remove(struct dentry * dir, const char * name)
251 struct configfs_dirent * sd; 251 struct configfs_dirent * sd;
252 struct configfs_dirent * parent_sd = dir->d_fsdata; 252 struct configfs_dirent * parent_sd = dir->d_fsdata;
253 253
254 if (dir->d_inode == NULL) 254 if (d_really_is_negative(dir))
255 /* no inode means this hasn't been made visible yet */ 255 /* no inode means this hasn't been made visible yet */
256 return; 256 return;
257 257
258 mutex_lock(&dir->d_inode->i_mutex); 258 mutex_lock(&d_inode(dir)->i_mutex);
259 list_for_each_entry(sd, &parent_sd->s_children, s_sibling) { 259 list_for_each_entry(sd, &parent_sd->s_children, s_sibling) {
260 if (!sd->s_element) 260 if (!sd->s_element)
261 continue; 261 continue;
@@ -268,5 +268,5 @@ void configfs_hash_and_remove(struct dentry * dir, const char * name)
268 break; 268 break;
269 } 269 }
270 } 270 }
271 mutex_unlock(&dir->d_inode->i_mutex); 271 mutex_unlock(&d_inode(dir)->i_mutex);
272} 272}