Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit b89b12b4 authored by Al Viro's avatar Al Viro
Browse files

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: default avatarIan Kent <raven@themaw.net>
Signed-off-by: default avatarAl Viro <viro@zeniv.linux.org.uk>
parent 26e6c910
Loading
Loading
Loading
Loading
+0 −1
Original line number Original line Diff line number Diff line
@@ -338,5 +338,4 @@ static inline void autofs4_del_expiring(struct dentry *dentry)
	return;
	return;
}
}


void autofs4_dentry_release(struct dentry *);
extern void autofs4_kill_sb(struct super_block *);
extern void autofs4_kill_sb(struct super_block *);
+0 −4
Original line number Original line Diff line number Diff line
@@ -43,10 +43,6 @@ void autofs4_clean_ino(struct autofs_info *ino)


void autofs4_free_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);
	kfree(ino);
}
}


+16 −14
Original line number Original line Diff line number Diff line
@@ -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 dentry *autofs4_lookup(struct inode *,struct dentry *, struct nameidata *);
static struct vfsmount *autofs4_d_automount(struct path *);
static struct vfsmount *autofs4_d_automount(struct path *);
static int autofs4_d_manage(struct dentry *, bool, bool);
static int autofs4_d_manage(struct dentry *, bool, bool);
static void autofs4_dentry_release(struct dentry *);


const struct file_operations autofs4_root_operations = {
const struct file_operations autofs4_root_operations = {
	.open		= dcache_dir_open,
	.open		= dcache_dir_open,
@@ -138,25 +139,26 @@ out:
	return dcache_dir_open(inode, file);
	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);
	DPRINTK("releasing %p", de);


	inf = autofs4_dentry_ino(de);
	if (!ino)
	if (inf) {
		return;
		struct autofs_sb_info *sbi = autofs4_sbi(de->d_sb);

	if (sbi) {
	if (sbi) {
		spin_lock(&sbi->lookup_lock);
		spin_lock(&sbi->lookup_lock);
			if (!list_empty(&inf->active))
		if (!list_empty(&ino->active))
				list_del(&inf->active);
			list_del(&ino->active);
			if (!list_empty(&inf->expiring))
		if (!list_empty(&ino->expiring))
				list_del(&inf->expiring);
			list_del(&ino->expiring);
		spin_unlock(&sbi->lookup_lock);
		spin_unlock(&sbi->lookup_lock);
	}
	}
		autofs4_free_ino(inf);

	}
	autofs4_free_ino(ino);
}
}


static struct dentry *autofs4_lookup_active(struct dentry *dentry)
static struct dentry *autofs4_lookup_active(struct dentry *dentry)