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>
This commit is contained in:
@@ -235,12 +235,12 @@ static inline u32 autofs4_get_dev(struct autofs_sb_info *sbi)
|
||||
|
||||
static inline u64 autofs4_get_ino(struct autofs_sb_info *sbi)
|
||||
{
|
||||
return sbi->sb->s_root->d_inode->i_ino;
|
||||
return d_inode(sbi->sb->s_root)->i_ino;
|
||||
}
|
||||
|
||||
static inline int simple_positive(struct dentry *dentry)
|
||||
{
|
||||
return dentry->d_inode && !d_unhashed(dentry);
|
||||
return d_really_is_positive(dentry) && !d_unhashed(dentry);
|
||||
}
|
||||
|
||||
static inline void __autofs4_add_expiring(struct dentry *dentry)
|
||||
|
@@ -374,7 +374,7 @@ static struct dentry *should_expire(struct dentry *dentry,
|
||||
return NULL;
|
||||
}
|
||||
|
||||
if (dentry->d_inode && d_is_symlink(dentry)) {
|
||||
if (d_really_is_positive(dentry) && d_is_symlink(dentry)) {
|
||||
DPRINTK("checking symlink %p %pd", dentry, dentry);
|
||||
/*
|
||||
* A symlink can't be "busy" in the usual sense so
|
||||
|
@@ -71,7 +71,7 @@ void autofs4_kill_sb(struct super_block *sb)
|
||||
static int autofs4_show_options(struct seq_file *m, struct dentry *root)
|
||||
{
|
||||
struct autofs_sb_info *sbi = autofs4_sbi(root->d_sb);
|
||||
struct inode *root_inode = root->d_sb->s_root->d_inode;
|
||||
struct inode *root_inode = d_inode(root->d_sb->s_root);
|
||||
|
||||
if (!sbi)
|
||||
return 0;
|
||||
@@ -352,8 +352,8 @@ struct inode *autofs4_get_inode(struct super_block *sb, umode_t mode)
|
||||
|
||||
inode->i_mode = mode;
|
||||
if (sb->s_root) {
|
||||
inode->i_uid = sb->s_root->d_inode->i_uid;
|
||||
inode->i_gid = sb->s_root->d_inode->i_gid;
|
||||
inode->i_uid = d_inode(sb->s_root)->i_uid;
|
||||
inode->i_gid = d_inode(sb->s_root)->i_gid;
|
||||
}
|
||||
inode->i_atime = inode->i_mtime = inode->i_ctime = CURRENT_TIME;
|
||||
inode->i_ino = get_next_ino();
|
||||
|
@@ -240,7 +240,7 @@ static struct dentry *autofs4_lookup_expiring(struct dentry *dentry,
|
||||
spin_lock(&expiring->d_lock);
|
||||
|
||||
/* We've already been dentry_iput or unlinked */
|
||||
if (!expiring->d_inode)
|
||||
if (d_really_is_negative(expiring))
|
||||
goto next;
|
||||
|
||||
qstr = &expiring->d_name;
|
||||
@@ -371,7 +371,7 @@ static struct vfsmount *autofs4_d_automount(struct path *path)
|
||||
* having d_mountpoint() true, so there's no need to call back
|
||||
* to the daemon.
|
||||
*/
|
||||
if (dentry->d_inode && d_is_symlink(dentry)) {
|
||||
if (d_really_is_positive(dentry) && d_is_symlink(dentry)) {
|
||||
spin_unlock(&sbi->fs_lock);
|
||||
goto done;
|
||||
}
|
||||
@@ -459,7 +459,7 @@ static int autofs4_d_manage(struct dentry *dentry, bool rcu_walk)
|
||||
return 0;
|
||||
if (d_mountpoint(dentry))
|
||||
return 0;
|
||||
inode = ACCESS_ONCE(dentry->d_inode);
|
||||
inode = d_inode_rcu(dentry);
|
||||
if (inode && S_ISLNK(inode->i_mode))
|
||||
return -EISDIR;
|
||||
if (list_empty(&dentry->d_subdirs))
|
||||
@@ -485,7 +485,7 @@ static int autofs4_d_manage(struct dentry *dentry, bool rcu_walk)
|
||||
* an incorrect ELOOP error return.
|
||||
*/
|
||||
if ((!d_mountpoint(dentry) && !simple_empty(dentry)) ||
|
||||
(dentry->d_inode && d_is_symlink(dentry)))
|
||||
(d_really_is_positive(dentry) && d_is_symlink(dentry)))
|
||||
status = -EISDIR;
|
||||
}
|
||||
spin_unlock(&sbi->fs_lock);
|
||||
@@ -625,8 +625,8 @@ static int autofs4_dir_unlink(struct inode *dir, struct dentry *dentry)
|
||||
}
|
||||
dput(ino->dentry);
|
||||
|
||||
dentry->d_inode->i_size = 0;
|
||||
clear_nlink(dentry->d_inode);
|
||||
d_inode(dentry)->i_size = 0;
|
||||
clear_nlink(d_inode(dentry));
|
||||
|
||||
dir->i_mtime = CURRENT_TIME;
|
||||
|
||||
@@ -719,8 +719,8 @@ static int autofs4_dir_rmdir(struct inode *dir, struct dentry *dentry)
|
||||
atomic_dec(&p_ino->count);
|
||||
}
|
||||
dput(ino->dentry);
|
||||
dentry->d_inode->i_size = 0;
|
||||
clear_nlink(dentry->d_inode);
|
||||
d_inode(dentry)->i_size = 0;
|
||||
clear_nlink(d_inode(dentry));
|
||||
|
||||
if (dir->i_nlink)
|
||||
drop_nlink(dir);
|
||||
@@ -839,7 +839,7 @@ static inline int autofs4_ask_umount(struct vfsmount *mnt, int __user *p)
|
||||
*/
|
||||
int is_autofs4_dentry(struct dentry *dentry)
|
||||
{
|
||||
return dentry && dentry->d_inode &&
|
||||
return dentry && d_really_is_positive(dentry) &&
|
||||
dentry->d_op == &autofs4_dentry_operations &&
|
||||
dentry->d_fsdata != NULL;
|
||||
}
|
||||
|
@@ -18,7 +18,7 @@ static void *autofs4_follow_link(struct dentry *dentry, struct nameidata *nd)
|
||||
struct autofs_info *ino = autofs4_dentry_ino(dentry);
|
||||
if (ino && !autofs4_oz_mode(sbi))
|
||||
ino->last_used = jiffies;
|
||||
nd_set_link(nd, dentry->d_inode->i_private);
|
||||
nd_set_link(nd, d_inode(dentry)->i_private);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
@@ -322,7 +322,7 @@ static int validate_request(struct autofs_wait_queue **wait,
|
||||
* continue on and create a new request.
|
||||
*/
|
||||
if (!IS_ROOT(dentry)) {
|
||||
if (dentry->d_inode && d_unhashed(dentry)) {
|
||||
if (d_really_is_positive(dentry) && d_unhashed(dentry)) {
|
||||
struct dentry *parent = dentry->d_parent;
|
||||
new = d_lookup(parent, &dentry->d_name);
|
||||
if (new)
|
||||
@@ -364,7 +364,7 @@ int autofs4_wait(struct autofs_sb_info *sbi, struct dentry *dentry,
|
||||
if (pid == 0 || tgid == 0)
|
||||
return -ENOENT;
|
||||
|
||||
if (!dentry->d_inode) {
|
||||
if (d_really_is_negative(dentry)) {
|
||||
/*
|
||||
* A wait for a negative dentry is invalid for certain
|
||||
* cases. A direct or offset mount "always" has its mount
|
||||
|
Reference in New Issue
Block a user