diff options
author | Al Viro <viro@zeniv.linux.org.uk> | 2011-01-16 21:42:32 -0500 |
---|---|---|
committer | Al Viro <viro@zeniv.linux.org.uk> | 2011-01-18 01:21:29 -0500 |
commit | b89b12b46211d971d75e5ca8249817bc9e11c453 (patch) | |
tree | 3b846ec3daa6ce9e301668121b8c335b0d879470 /fs | |
parent | 26e6c910670171410577c7df2aebe94cef76e150 (diff) |
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>
Diffstat (limited to 'fs')
-rw-r--r-- | fs/autofs4/autofs_i.h | 1 | ||||
-rw-r--r-- | fs/autofs4/inode.c | 4 | ||||
-rw-r--r-- | fs/autofs4/root.c | 30 |
3 files changed, 16 insertions, 19 deletions
diff --git a/fs/autofs4/autofs_i.h b/fs/autofs4/autofs_i.h index bfa0c6e542f2..54f923792728 100644 --- a/fs/autofs4/autofs_i.h +++ b/fs/autofs4/autofs_i.h | |||
@@ -338,5 +338,4 @@ static inline void autofs4_del_expiring(struct dentry *dentry) | |||
338 | return; | 338 | return; |
339 | } | 339 | } |
340 | 340 | ||
341 | void autofs4_dentry_release(struct dentry *); | ||
342 | extern void autofs4_kill_sb(struct super_block *); | 341 | extern void autofs4_kill_sb(struct super_block *); |
diff --git a/fs/autofs4/inode.c b/fs/autofs4/inode.c index 0df0c7c46fa2..180fa2425e49 100644 --- a/fs/autofs4/inode.c +++ b/fs/autofs4/inode.c | |||
@@ -43,10 +43,6 @@ void autofs4_clean_ino(struct autofs_info *ino) | |||
43 | 43 | ||
44 | void autofs4_free_ino(struct autofs_info *ino) | 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 | kfree(ino); | 46 | kfree(ino); |
51 | } | 47 | } |
52 | 48 | ||
diff --git a/fs/autofs4/root.c b/fs/autofs4/root.c index f7c97c084c1f..014e7aba3b08 100644 --- a/fs/autofs4/root.c +++ b/fs/autofs4/root.c | |||
@@ -37,6 +37,7 @@ static int autofs4_dir_open(struct inode *inode, struct file *file); | |||
37 | static struct dentry *autofs4_lookup(struct inode *,struct dentry *, struct nameidata *); | 37 | static struct dentry *autofs4_lookup(struct inode *,struct dentry *, struct nameidata *); |
38 | static struct vfsmount *autofs4_d_automount(struct path *); | 38 | static struct vfsmount *autofs4_d_automount(struct path *); |
39 | static int autofs4_d_manage(struct dentry *, bool, bool); | 39 | static int autofs4_d_manage(struct dentry *, bool, bool); |
40 | static void autofs4_dentry_release(struct dentry *); | ||
40 | 41 | ||
41 | const struct file_operations autofs4_root_operations = { | 42 | const struct file_operations autofs4_root_operations = { |
42 | .open = dcache_dir_open, | 43 | .open = dcache_dir_open, |
@@ -138,25 +139,26 @@ out: | |||
138 | return dcache_dir_open(inode, file); | 139 | return dcache_dir_open(inode, file); |
139 | } | 140 | } |
140 | 141 | ||
141 | void autofs4_dentry_release(struct dentry *de) | 142 | static void autofs4_dentry_release(struct dentry *de) |
142 | { | 143 | { |
143 | struct autofs_info *inf; | 144 | struct autofs_info *ino = autofs4_dentry_ino(de); |
145 | struct autofs_sb_info *sbi = autofs4_sbi(de->d_sb); | ||
144 | 146 | ||
145 | DPRINTK("releasing %p", de); | 147 | DPRINTK("releasing %p", de); |
146 | 148 | ||
147 | inf = autofs4_dentry_ino(de); | 149 | if (!ino) |
148 | if (inf) { | 150 | return; |
149 | struct autofs_sb_info *sbi = autofs4_sbi(de->d_sb); | 151 | |
150 | if (sbi) { | 152 | if (sbi) { |
151 | spin_lock(&sbi->lookup_lock); | 153 | spin_lock(&sbi->lookup_lock); |
152 | if (!list_empty(&inf->active)) | 154 | if (!list_empty(&ino->active)) |
153 | list_del(&inf->active); | 155 | list_del(&ino->active); |
154 | if (!list_empty(&inf->expiring)) | 156 | if (!list_empty(&ino->expiring)) |
155 | list_del(&inf->expiring); | 157 | list_del(&ino->expiring); |
156 | spin_unlock(&sbi->lookup_lock); | 158 | spin_unlock(&sbi->lookup_lock); |
157 | } | ||
158 | autofs4_free_ino(inf); | ||
159 | } | 159 | } |
160 | |||
161 | autofs4_free_ino(ino); | ||
160 | } | 162 | } |
161 | 163 | ||
162 | static struct dentry *autofs4_lookup_active(struct dentry *dentry) | 164 | static struct dentry *autofs4_lookup_active(struct dentry *dentry) |