@@ -109,12 +109,12 @@ static int tracefs_syscall_rmdir(struct inode *inode, struct dentry *dentry)
109
109
* also the directory that is being deleted.
110
110
*/
111
111
inode_unlock (inode );
112
- inode_unlock (dentry -> d_inode );
112
+ inode_unlock (d_inode ( dentry ) );
113
113
114
114
ret = tracefs_ops .rmdir (name );
115
115
116
116
inode_lock_nested (inode , I_MUTEX_PARENT );
117
- inode_lock (dentry -> d_inode );
117
+ inode_lock (d_inode ( dentry ) );
118
118
119
119
kfree (name );
120
120
@@ -212,7 +212,7 @@ static int tracefs_parse_options(char *data, struct tracefs_mount_opts *opts)
212
212
static int tracefs_apply_options (struct super_block * sb )
213
213
{
214
214
struct tracefs_fs_info * fsi = sb -> s_fs_info ;
215
- struct inode * inode = sb -> s_root -> d_inode ;
215
+ struct inode * inode = d_inode ( sb -> s_root ) ;
216
216
struct tracefs_mount_opts * opts = & fsi -> mount_opts ;
217
217
218
218
inode -> i_mode &= ~S_IALLUGO ;
@@ -331,18 +331,18 @@ static struct dentry *start_creating(const char *name, struct dentry *parent)
331
331
if (!parent )
332
332
parent = tracefs_mount -> mnt_root ;
333
333
334
- inode_lock (parent -> d_inode );
335
- if (unlikely (IS_DEADDIR (parent -> d_inode )))
334
+ inode_lock (d_inode ( parent ) );
335
+ if (unlikely (IS_DEADDIR (d_inode ( parent ) )))
336
336
dentry = ERR_PTR (- ENOENT );
337
337
else
338
338
dentry = lookup_one_len (name , parent , strlen (name ));
339
- if (!IS_ERR (dentry ) && dentry -> d_inode ) {
339
+ if (!IS_ERR (dentry ) && d_inode ( dentry ) ) {
340
340
dput (dentry );
341
341
dentry = ERR_PTR (- EEXIST );
342
342
}
343
343
344
344
if (IS_ERR (dentry )) {
345
- inode_unlock (parent -> d_inode );
345
+ inode_unlock (d_inode ( parent ) );
346
346
simple_release_fs (& tracefs_mount , & tracefs_mount_count );
347
347
}
348
348
@@ -351,15 +351,15 @@ static struct dentry *start_creating(const char *name, struct dentry *parent)
351
351
352
352
static struct dentry * failed_creating (struct dentry * dentry )
353
353
{
354
- inode_unlock (dentry -> d_parent -> d_inode );
354
+ inode_unlock (d_inode ( dentry -> d_parent ) );
355
355
dput (dentry );
356
356
simple_release_fs (& tracefs_mount , & tracefs_mount_count );
357
357
return NULL ;
358
358
}
359
359
360
360
static struct dentry * end_creating (struct dentry * dentry )
361
361
{
362
- inode_unlock (dentry -> d_parent -> d_inode );
362
+ inode_unlock (d_inode ( dentry -> d_parent ) );
363
363
return dentry ;
364
364
}
365
365
@@ -415,7 +415,7 @@ struct dentry *tracefs_create_file(const char *name, umode_t mode,
415
415
inode -> i_fop = fops ? fops : & tracefs_file_operations ;
416
416
inode -> i_private = data ;
417
417
d_instantiate (dentry , inode );
418
- fsnotify_create (dentry -> d_parent -> d_inode , dentry );
418
+ fsnotify_create (d_inode ( dentry -> d_parent ) , dentry );
419
419
return end_creating (dentry );
420
420
}
421
421
@@ -440,8 +440,8 @@ static struct dentry *__create_dir(const char *name, struct dentry *parent,
440
440
/* directory inodes start off with i_nlink == 2 (for "." entry) */
441
441
inc_nlink (inode );
442
442
d_instantiate (dentry , inode );
443
- inc_nlink (dentry -> d_parent -> d_inode );
444
- fsnotify_mkdir (dentry -> d_parent -> d_inode , dentry );
443
+ inc_nlink (d_inode ( dentry -> d_parent ) );
444
+ fsnotify_mkdir (d_inode ( dentry -> d_parent ) , dentry );
445
445
return end_creating (dentry );
446
446
}
447
447
0 commit comments