autofs4: clean ->d_release() and autofs4_free_ino() up

The latter is called only when both ino and dentry are about to
be freed, so cleaning ->d_fsdata and ->dentry is pointless.

Acked-by: Ian Kent <raven@themaw.net>
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>

Al Viro b89b12b4 26e6c910

+16 -19
-1
fs/autofs4/autofs_i.h
··· 338 338 return; 339 339 } 340 340 341 - void autofs4_dentry_release(struct dentry *); 342 341 extern void autofs4_kill_sb(struct super_block *);
-4
fs/autofs4/inode.c
··· 43 43 44 44 void autofs4_free_ino(struct autofs_info *ino) 45 45 { 46 - if (ino->dentry) { 47 - ino->dentry->d_fsdata = NULL; 48 - ino->dentry = NULL; 49 - } 50 46 kfree(ino); 51 47 } 52 48
+16 -14
fs/autofs4/root.c
··· 37 37 static struct dentry *autofs4_lookup(struct inode *,struct dentry *, struct nameidata *); 38 38 static struct vfsmount *autofs4_d_automount(struct path *); 39 39 static int autofs4_d_manage(struct dentry *, bool, bool); 40 + static void autofs4_dentry_release(struct dentry *); 40 41 41 42 const struct file_operations autofs4_root_operations = { 42 43 .open = dcache_dir_open, ··· 139 138 return dcache_dir_open(inode, file); 140 139 } 141 140 142 - void autofs4_dentry_release(struct dentry *de) 141 + static void autofs4_dentry_release(struct dentry *de) 143 142 { 144 - struct autofs_info *inf; 143 + struct autofs_info *ino = autofs4_dentry_ino(de); 144 + struct autofs_sb_info *sbi = autofs4_sbi(de->d_sb); 145 145 146 146 DPRINTK("releasing %p", de); 147 147 148 - inf = autofs4_dentry_ino(de); 149 - if (inf) { 150 - struct autofs_sb_info *sbi = autofs4_sbi(de->d_sb); 151 - if (sbi) { 152 - spin_lock(&sbi->lookup_lock); 153 - if (!list_empty(&inf->active)) 154 - list_del(&inf->active); 155 - if (!list_empty(&inf->expiring)) 156 - list_del(&inf->expiring); 157 - spin_unlock(&sbi->lookup_lock); 158 - } 159 - autofs4_free_ino(inf); 148 + if (!ino) 149 + return; 150 + 151 + if (sbi) { 152 + spin_lock(&sbi->lookup_lock); 153 + if (!list_empty(&ino->active)) 154 + list_del(&ino->active); 155 + if (!list_empty(&ino->expiring)) 156 + list_del(&ino->expiring); 157 + spin_unlock(&sbi->lookup_lock); 160 158 } 159 + 160 + autofs4_free_ino(ino); 161 161 } 162 162 163 163 static struct dentry *autofs4_lookup_active(struct dentry *dentry)