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 return; 339 } 340 341 - void autofs4_dentry_release(struct dentry *); 342 extern void autofs4_kill_sb(struct super_block *);
··· 338 return; 339 } 340 341 extern void autofs4_kill_sb(struct super_block *);
-4
fs/autofs4/inode.c
··· 43 44 void autofs4_free_ino(struct autofs_info *ino) 45 { 46 - if (ino->dentry) { 47 - ino->dentry->d_fsdata = NULL; 48 - ino->dentry = NULL; 49 - } 50 kfree(ino); 51 } 52
··· 43 44 void autofs4_free_ino(struct autofs_info *ino) 45 { 46 kfree(ino); 47 } 48
+16 -14
fs/autofs4/root.c
··· 37 static struct dentry *autofs4_lookup(struct inode *,struct dentry *, struct nameidata *); 38 static struct vfsmount *autofs4_d_automount(struct path *); 39 static int autofs4_d_manage(struct dentry *, bool, bool); 40 41 const struct file_operations autofs4_root_operations = { 42 .open = dcache_dir_open, ··· 139 return dcache_dir_open(inode, file); 140 } 141 142 - void autofs4_dentry_release(struct dentry *de) 143 { 144 - struct autofs_info *inf; 145 146 DPRINTK("releasing %p", de); 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); 160 } 161 } 162 163 static struct dentry *autofs4_lookup_active(struct dentry *dentry)
··· 37 static struct dentry *autofs4_lookup(struct inode *,struct dentry *, struct nameidata *); 38 static struct vfsmount *autofs4_d_automount(struct path *); 39 static int autofs4_d_manage(struct dentry *, bool, bool); 40 + static void autofs4_dentry_release(struct dentry *); 41 42 const struct file_operations autofs4_root_operations = { 43 .open = dcache_dir_open, ··· 138 return dcache_dir_open(inode, file); 139 } 140 141 + static void autofs4_dentry_release(struct dentry *de) 142 { 143 + struct autofs_info *ino = autofs4_dentry_ino(de); 144 + struct autofs_sb_info *sbi = autofs4_sbi(de->d_sb); 145 146 DPRINTK("releasing %p", de); 147 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); 158 } 159 + 160 + autofs4_free_ino(ino); 161 } 162 163 static struct dentry *autofs4_lookup_active(struct dentry *dentry)