diff options
author | David Howells <dhowells@redhat.com> | 2015-03-17 18:25:59 -0400 |
---|---|---|
committer | Al Viro <viro@zeniv.linux.org.uk> | 2015-04-15 15:06:57 -0400 |
commit | 2b0143b5c986be1ce8408b3aadc4709e0a94429d (patch) | |
tree | 98b1dee70f3d5d9ac9309f4638e41864ddcd0952 /fs/autofs4 | |
parent | ce0b16ddf18df35026164fda4a642ef10c01f442 (diff) |
VFS: normal filesystems (and lustre): d_inode() annotations
that's the bulk of filesystem drivers dealing with inodes of their own
Signed-off-by: David Howells <dhowells@redhat.com>
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'fs/autofs4')
-rw-r--r-- | fs/autofs4/autofs_i.h | 4 | ||||
-rw-r--r-- | fs/autofs4/expire.c | 2 | ||||
-rw-r--r-- | fs/autofs4/inode.c | 6 | ||||
-rw-r--r-- | fs/autofs4/root.c | 18 | ||||
-rw-r--r-- | fs/autofs4/symlink.c | 2 | ||||
-rw-r--r-- | fs/autofs4/waitq.c | 4 |
6 files changed, 18 insertions, 18 deletions
diff --git a/fs/autofs4/autofs_i.h b/fs/autofs4/autofs_i.h index d10e619632ab..5b700ef1e59d 100644 --- a/fs/autofs4/autofs_i.h +++ b/fs/autofs4/autofs_i.h | |||
@@ -235,12 +235,12 @@ static inline u32 autofs4_get_dev(struct autofs_sb_info *sbi) | |||
235 | 235 | ||
236 | static inline u64 autofs4_get_ino(struct autofs_sb_info *sbi) | 236 | static inline u64 autofs4_get_ino(struct autofs_sb_info *sbi) |
237 | { | 237 | { |
238 | return sbi->sb->s_root->d_inode->i_ino; | 238 | return d_inode(sbi->sb->s_root)->i_ino; |
239 | } | 239 | } |
240 | 240 | ||
241 | static inline int simple_positive(struct dentry *dentry) | 241 | static inline int simple_positive(struct dentry *dentry) |
242 | { | 242 | { |
243 | return dentry->d_inode && !d_unhashed(dentry); | 243 | return d_really_is_positive(dentry) && !d_unhashed(dentry); |
244 | } | 244 | } |
245 | 245 | ||
246 | static inline void __autofs4_add_expiring(struct dentry *dentry) | 246 | static inline void __autofs4_add_expiring(struct dentry *dentry) |
diff --git a/fs/autofs4/expire.c b/fs/autofs4/expire.c index 11dd118f75e2..1cebc3c52fa5 100644 --- a/fs/autofs4/expire.c +++ b/fs/autofs4/expire.c | |||
@@ -374,7 +374,7 @@ static struct dentry *should_expire(struct dentry *dentry, | |||
374 | return NULL; | 374 | return NULL; |
375 | } | 375 | } |
376 | 376 | ||
377 | if (dentry->d_inode && d_is_symlink(dentry)) { | 377 | if (d_really_is_positive(dentry) && d_is_symlink(dentry)) { |
378 | DPRINTK("checking symlink %p %pd", dentry, dentry); | 378 | DPRINTK("checking symlink %p %pd", dentry, dentry); |
379 | /* | 379 | /* |
380 | * A symlink can't be "busy" in the usual sense so | 380 | * A symlink can't be "busy" in the usual sense so |
diff --git a/fs/autofs4/inode.c b/fs/autofs4/inode.c index 1c55388ae633..a3ae0b2aeb5a 100644 --- a/fs/autofs4/inode.c +++ b/fs/autofs4/inode.c | |||
@@ -71,7 +71,7 @@ void autofs4_kill_sb(struct super_block *sb) | |||
71 | static int autofs4_show_options(struct seq_file *m, struct dentry *root) | 71 | static int autofs4_show_options(struct seq_file *m, struct dentry *root) |
72 | { | 72 | { |
73 | struct autofs_sb_info *sbi = autofs4_sbi(root->d_sb); | 73 | struct autofs_sb_info *sbi = autofs4_sbi(root->d_sb); |
74 | struct inode *root_inode = root->d_sb->s_root->d_inode; | 74 | struct inode *root_inode = d_inode(root->d_sb->s_root); |
75 | 75 | ||
76 | if (!sbi) | 76 | if (!sbi) |
77 | return 0; | 77 | return 0; |
@@ -352,8 +352,8 @@ struct inode *autofs4_get_inode(struct super_block *sb, umode_t mode) | |||
352 | 352 | ||
353 | inode->i_mode = mode; | 353 | inode->i_mode = mode; |
354 | if (sb->s_root) { | 354 | if (sb->s_root) { |
355 | inode->i_uid = sb->s_root->d_inode->i_uid; | 355 | inode->i_uid = d_inode(sb->s_root)->i_uid; |
356 | inode->i_gid = sb->s_root->d_inode->i_gid; | 356 | inode->i_gid = d_inode(sb->s_root)->i_gid; |
357 | } | 357 | } |
358 | inode->i_atime = inode->i_mtime = inode->i_ctime = CURRENT_TIME; | 358 | inode->i_atime = inode->i_mtime = inode->i_ctime = CURRENT_TIME; |
359 | inode->i_ino = get_next_ino(); | 359 | inode->i_ino = get_next_ino(); |
diff --git a/fs/autofs4/root.c b/fs/autofs4/root.c index 7e44fdd03e2d..c6d7d3dbd52a 100644 --- a/fs/autofs4/root.c +++ b/fs/autofs4/root.c | |||
@@ -240,7 +240,7 @@ static struct dentry *autofs4_lookup_expiring(struct dentry *dentry, | |||
240 | spin_lock(&expiring->d_lock); | 240 | spin_lock(&expiring->d_lock); |
241 | 241 | ||
242 | /* We've already been dentry_iput or unlinked */ | 242 | /* We've already been dentry_iput or unlinked */ |
243 | if (!expiring->d_inode) | 243 | if (d_really_is_negative(expiring)) |
244 | goto next; | 244 | goto next; |
245 | 245 | ||
246 | qstr = &expiring->d_name; | 246 | qstr = &expiring->d_name; |
@@ -371,7 +371,7 @@ static struct vfsmount *autofs4_d_automount(struct path *path) | |||
371 | * having d_mountpoint() true, so there's no need to call back | 371 | * having d_mountpoint() true, so there's no need to call back |
372 | * to the daemon. | 372 | * to the daemon. |
373 | */ | 373 | */ |
374 | if (dentry->d_inode && d_is_symlink(dentry)) { | 374 | if (d_really_is_positive(dentry) && d_is_symlink(dentry)) { |
375 | spin_unlock(&sbi->fs_lock); | 375 | spin_unlock(&sbi->fs_lock); |
376 | goto done; | 376 | goto done; |
377 | } | 377 | } |
@@ -459,7 +459,7 @@ static int autofs4_d_manage(struct dentry *dentry, bool rcu_walk) | |||
459 | return 0; | 459 | return 0; |
460 | if (d_mountpoint(dentry)) | 460 | if (d_mountpoint(dentry)) |
461 | return 0; | 461 | return 0; |
462 | inode = ACCESS_ONCE(dentry->d_inode); | 462 | inode = d_inode_rcu(dentry); |
463 | if (inode && S_ISLNK(inode->i_mode)) | 463 | if (inode && S_ISLNK(inode->i_mode)) |
464 | return -EISDIR; | 464 | return -EISDIR; |
465 | if (list_empty(&dentry->d_subdirs)) | 465 | if (list_empty(&dentry->d_subdirs)) |
@@ -485,7 +485,7 @@ static int autofs4_d_manage(struct dentry *dentry, bool rcu_walk) | |||
485 | * an incorrect ELOOP error return. | 485 | * an incorrect ELOOP error return. |
486 | */ | 486 | */ |
487 | if ((!d_mountpoint(dentry) && !simple_empty(dentry)) || | 487 | if ((!d_mountpoint(dentry) && !simple_empty(dentry)) || |
488 | (dentry->d_inode && d_is_symlink(dentry))) | 488 | (d_really_is_positive(dentry) && d_is_symlink(dentry))) |
489 | status = -EISDIR; | 489 | status = -EISDIR; |
490 | } | 490 | } |
491 | spin_unlock(&sbi->fs_lock); | 491 | spin_unlock(&sbi->fs_lock); |
@@ -625,8 +625,8 @@ static int autofs4_dir_unlink(struct inode *dir, struct dentry *dentry) | |||
625 | } | 625 | } |
626 | dput(ino->dentry); | 626 | dput(ino->dentry); |
627 | 627 | ||
628 | dentry->d_inode->i_size = 0; | 628 | d_inode(dentry)->i_size = 0; |
629 | clear_nlink(dentry->d_inode); | 629 | clear_nlink(d_inode(dentry)); |
630 | 630 | ||
631 | dir->i_mtime = CURRENT_TIME; | 631 | dir->i_mtime = CURRENT_TIME; |
632 | 632 | ||
@@ -719,8 +719,8 @@ static int autofs4_dir_rmdir(struct inode *dir, struct dentry *dentry) | |||
719 | atomic_dec(&p_ino->count); | 719 | atomic_dec(&p_ino->count); |
720 | } | 720 | } |
721 | dput(ino->dentry); | 721 | dput(ino->dentry); |
722 | dentry->d_inode->i_size = 0; | 722 | d_inode(dentry)->i_size = 0; |
723 | clear_nlink(dentry->d_inode); | 723 | clear_nlink(d_inode(dentry)); |
724 | 724 | ||
725 | if (dir->i_nlink) | 725 | if (dir->i_nlink) |
726 | drop_nlink(dir); | 726 | drop_nlink(dir); |
@@ -839,7 +839,7 @@ static inline int autofs4_ask_umount(struct vfsmount *mnt, int __user *p) | |||
839 | */ | 839 | */ |
840 | int is_autofs4_dentry(struct dentry *dentry) | 840 | int is_autofs4_dentry(struct dentry *dentry) |
841 | { | 841 | { |
842 | return dentry && dentry->d_inode && | 842 | return dentry && d_really_is_positive(dentry) && |
843 | dentry->d_op == &autofs4_dentry_operations && | 843 | dentry->d_op == &autofs4_dentry_operations && |
844 | dentry->d_fsdata != NULL; | 844 | dentry->d_fsdata != NULL; |
845 | } | 845 | } |
diff --git a/fs/autofs4/symlink.c b/fs/autofs4/symlink.c index 1e8ea192be2b..de58cc7b8076 100644 --- a/fs/autofs4/symlink.c +++ b/fs/autofs4/symlink.c | |||
@@ -18,7 +18,7 @@ static void *autofs4_follow_link(struct dentry *dentry, struct nameidata *nd) | |||
18 | struct autofs_info *ino = autofs4_dentry_ino(dentry); | 18 | struct autofs_info *ino = autofs4_dentry_ino(dentry); |
19 | if (ino && !autofs4_oz_mode(sbi)) | 19 | if (ino && !autofs4_oz_mode(sbi)) |
20 | ino->last_used = jiffies; | 20 | ino->last_used = jiffies; |
21 | nd_set_link(nd, dentry->d_inode->i_private); | 21 | nd_set_link(nd, d_inode(dentry)->i_private); |
22 | return NULL; | 22 | return NULL; |
23 | } | 23 | } |
24 | 24 | ||
diff --git a/fs/autofs4/waitq.c b/fs/autofs4/waitq.c index 2ad05ab93db8..35b755e79c2d 100644 --- a/fs/autofs4/waitq.c +++ b/fs/autofs4/waitq.c | |||
@@ -322,7 +322,7 @@ static int validate_request(struct autofs_wait_queue **wait, | |||
322 | * continue on and create a new request. | 322 | * continue on and create a new request. |
323 | */ | 323 | */ |
324 | if (!IS_ROOT(dentry)) { | 324 | if (!IS_ROOT(dentry)) { |
325 | if (dentry->d_inode && d_unhashed(dentry)) { | 325 | if (d_really_is_positive(dentry) && d_unhashed(dentry)) { |
326 | struct dentry *parent = dentry->d_parent; | 326 | struct dentry *parent = dentry->d_parent; |
327 | new = d_lookup(parent, &dentry->d_name); | 327 | new = d_lookup(parent, &dentry->d_name); |
328 | if (new) | 328 | if (new) |
@@ -364,7 +364,7 @@ int autofs4_wait(struct autofs_sb_info *sbi, struct dentry *dentry, | |||
364 | if (pid == 0 || tgid == 0) | 364 | if (pid == 0 || tgid == 0) |
365 | return -ENOENT; | 365 | return -ENOENT; |
366 | 366 | ||
367 | if (!dentry->d_inode) { | 367 | if (d_really_is_negative(dentry)) { |
368 | /* | 368 | /* |
369 | * A wait for a negative dentry is invalid for certain | 369 | * A wait for a negative dentry is invalid for certain |
370 | * cases. A direct or offset mount "always" has its mount | 370 | * cases. A direct or offset mount "always" has its mount |