summaryrefslogtreecommitdiff
path: root/fs/autofs4
diff options
context:
space:
mode:
authorAl Viro <viro@zeniv.linux.org.uk>2011-01-16 21:42:32 -0500
committerAl Viro <viro@zeniv.linux.org.uk>2011-01-18 01:21:29 -0500
commitb89b12b46211d971d75e5ca8249817bc9e11c453 (patch)
tree3b846ec3daa6ce9e301668121b8c335b0d879470 /fs/autofs4
parent26e6c910670171410577c7df2aebe94cef76e150 (diff)
downloadlinux-3.10-b89b12b46211d971d75e5ca8249817bc9e11c453.tar.gz
linux-3.10-b89b12b46211d971d75e5ca8249817bc9e11c453.tar.bz2
linux-3.10-b89b12b46211d971d75e5ca8249817bc9e11c453.zip
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/autofs4')
-rw-r--r--fs/autofs4/autofs_i.h1
-rw-r--r--fs/autofs4/inode.c4
-rw-r--r--fs/autofs4/root.c30
3 files changed, 16 insertions, 19 deletions
diff --git a/fs/autofs4/autofs_i.h b/fs/autofs4/autofs_i.h
index bfa0c6e542f..54f92379272 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)
return;
}
-void autofs4_dentry_release(struct dentry *);
extern void autofs4_kill_sb(struct super_block *);
diff --git a/fs/autofs4/inode.c b/fs/autofs4/inode.c
index 0df0c7c46fa..180fa2425e4 100644
--- a/fs/autofs4/inode.c
+++ b/fs/autofs4/inode.c
@@ -43,10 +43,6 @@ void autofs4_clean_ino(struct autofs_info *ino)
void autofs4_free_ino(struct autofs_info *ino)
{
- if (ino->dentry) {
- ino->dentry->d_fsdata = NULL;
- ino->dentry = NULL;
- }
kfree(ino);
}
diff --git a/fs/autofs4/root.c b/fs/autofs4/root.c
index f7c97c084c1..014e7aba3b0 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);
static struct dentry *autofs4_lookup(struct inode *,struct dentry *, struct nameidata *);
static struct vfsmount *autofs4_d_automount(struct path *);
static int autofs4_d_manage(struct dentry *, bool, bool);
+static void autofs4_dentry_release(struct dentry *);
const struct file_operations autofs4_root_operations = {
.open = dcache_dir_open,
@@ -138,25 +139,26 @@ out:
return dcache_dir_open(inode, file);
}
-void autofs4_dentry_release(struct dentry *de)
+static void autofs4_dentry_release(struct dentry *de)
{
- struct autofs_info *inf;
+ struct autofs_info *ino = autofs4_dentry_ino(de);
+ struct autofs_sb_info *sbi = autofs4_sbi(de->d_sb);
DPRINTK("releasing %p", de);
- inf = autofs4_dentry_ino(de);
- if (inf) {
- struct autofs_sb_info *sbi = autofs4_sbi(de->d_sb);
- if (sbi) {
- spin_lock(&sbi->lookup_lock);
- if (!list_empty(&inf->active))
- list_del(&inf->active);
- if (!list_empty(&inf->expiring))
- list_del(&inf->expiring);
- spin_unlock(&sbi->lookup_lock);
- }
- autofs4_free_ino(inf);
+ if (!ino)
+ return;
+
+ if (sbi) {
+ spin_lock(&sbi->lookup_lock);
+ if (!list_empty(&ino->active))
+ list_del(&ino->active);
+ if (!list_empty(&ino->expiring))
+ list_del(&ino->expiring);
+ spin_unlock(&sbi->lookup_lock);
}
+
+ autofs4_free_ino(ino);
}
static struct dentry *autofs4_lookup_active(struct dentry *dentry)