From: David Howells <dhowells@redhat.com>
To: npiggin@kernel.dk, viro@zeniv.linux.org.uk, raven@themaw.net
Cc: dhowells@redhat.com, autofs@linux.kernel.org,
linux-fsdevel@vger.kernel.org
Subject: [PATCH 14/18] autofs4: Clean up autofs4_free_ino()
Date: Tue, 11 Jan 2011 17:49:24 +0000 [thread overview]
Message-ID: <20110111174924.2291.44496.stgit@warthog.procyon.org.uk> (raw)
In-Reply-To: <20110111174809.2291.52242.stgit@warthog.procyon.org.uk>
From: Ian Kent <raven@themaw.net>
When this function is called the local reference count does't need to
be updated since the dentry is going away and dput definitely must
not be called here.
Also the autofs info struct field inode isn't used so remove it.
Signed-off-by: Ian Kent <raven@themaw.net>
Signed-off-by: David Howells <dhowells@redhat.com>
---
fs/autofs4/inode.c | 13 -------------
fs/autofs4/root.c | 9 ---------
2 files changed, 0 insertions(+), 22 deletions(-)
diff --git a/fs/autofs4/inode.c b/fs/autofs4/inode.c
index 427c357..3ecd2e2 100644
--- a/fs/autofs4/inode.c
+++ b/fs/autofs4/inode.c
@@ -45,7 +45,6 @@ struct autofs_info *autofs4_init_ino(struct autofs_info *ino,
if (!reinit) {
ino->flags = 0;
- ino->inode = NULL;
ino->dentry = NULL;
ino->size = 0;
INIT_LIST_HEAD(&ino->active);
@@ -76,19 +75,8 @@ struct autofs_info *autofs4_init_ino(struct autofs_info *ino,
void autofs4_free_ino(struct autofs_info *ino)
{
- struct autofs_info *p_ino;
-
if (ino->dentry) {
ino->dentry->d_fsdata = NULL;
- if (ino->dentry->d_inode) {
- struct dentry *parent = ino->dentry->d_parent;
- if (atomic_dec_and_test(&ino->count)) {
- p_ino = autofs4_dentry_ino(parent);
- if (p_ino && parent != ino->dentry)
- atomic_dec(&p_ino->count);
- }
- dput(ino->dentry);
- }
ino->dentry = NULL;
}
if (ino->free)
@@ -390,7 +378,6 @@ struct inode *autofs4_get_inode(struct super_block *sb,
if (inode == NULL)
return NULL;
- inf->inode = inode;
inode->i_mode = inf->mode;
if (sb->s_root) {
inode->i_uid = sb->s_root->d_inode->i_uid;
diff --git a/fs/autofs4/root.c b/fs/autofs4/root.c
index b3ab9e9..51a4c2a 100644
--- a/fs/autofs4/root.c
+++ b/fs/autofs4/root.c
@@ -151,11 +151,8 @@ void autofs4_dentry_release(struct dentry *de)
DPRINTK("releasing %p", de);
inf = autofs4_dentry_ino(de);
- de->d_fsdata = NULL;
-
if (inf) {
struct autofs_sb_info *sbi = autofs4_sbi(de->d_sb);
-
if (sbi) {
spin_lock(&sbi->lookup_lock);
if (!list_empty(&inf->active))
@@ -164,10 +161,6 @@ void autofs4_dentry_release(struct dentry *de)
list_del(&inf->expiring);
spin_unlock(&sbi->lookup_lock);
}
-
- inf->dentry = NULL;
- inf->inode = NULL;
-
autofs4_free_ino(inf);
}
}
@@ -588,7 +581,6 @@ static int autofs4_dir_symlink(struct inode *dir,
p_ino = autofs4_dentry_ino(dentry->d_parent);
if (p_ino && dentry->d_parent != dentry)
atomic_inc(&p_ino->count);
- ino->inode = inode;
ino->u.symlink = cp;
dir->i_mtime = CURRENT_TIME;
@@ -718,7 +710,6 @@ static int autofs4_dir_mkdir(struct inode *dir, struct dentry *dentry, int mode)
p_ino = autofs4_dentry_ino(dentry->d_parent);
if (p_ino && dentry->d_parent != dentry)
atomic_inc(&p_ino->count);
- ino->inode = inode;
inc_nlink(dir);
dir->i_mtime = CURRENT_TIME;
next prev parent reply other threads:[~2011-01-11 17:49 UTC|newest]
Thread overview: 30+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-01-11 17:48 [PATCH 00/18] Introduce automount support in the VFS David Howells
2011-01-11 17:48 ` [PATCH 01/18] Add a dentry op to handle automounting rather than abusing follow_link() David Howells
2011-01-13 3:53 ` Nick Piggin
2011-01-13 5:10 ` Nick Piggin
2011-01-13 15:12 ` David Howells
2011-01-14 1:19 ` Nick Piggin
2011-01-14 16:24 ` Al Viro
2011-01-14 22:14 ` Nick Piggin
2011-01-13 12:20 ` David Howells
2011-01-14 1:04 ` Nick Piggin
2011-01-14 9:24 ` David Howells
2011-01-11 17:48 ` [PATCH 02/18] AFS: Use d_automount() " David Howells
2011-01-11 17:48 ` [PATCH 03/18] NFS: " David Howells
2011-01-11 17:48 ` [PATCH 04/18] CIFS: " David Howells
2011-01-11 17:48 ` [PATCH 05/18] Remove the automount through follow_link() kludge code from pathwalk David Howells
2011-01-11 17:48 ` [PATCH 06/18] Add an AT_NO_AUTOMOUNT flag to suppress terminal automount David Howells
2011-01-11 17:48 ` [PATCH 07/18] Add more dentry flags for special function directories David Howells
2011-01-12 13:52 ` [PATCH 07/18] Add more dentry flags for special function directories [UPDATE] David Howells
2011-01-11 17:48 ` [PATCH 08/18] Make follow_down() handle d_manage() David Howells
2011-01-11 17:48 ` [PATCH 09/18] autofs4: Add d_automount() dentry operation David Howells
2011-01-11 17:49 ` [PATCH 10/18] autofs4: Add d_manage() " David Howells
2011-01-11 17:49 ` [PATCH 11/18] autofs4: Remove unused code David Howells
2011-01-11 17:49 ` [PATCH 12/18] autofs4: Clean up inode operations David Howells
2011-01-11 17:49 ` [PATCH 13/18] autofs4: Clean up dentry operations David Howells
2011-01-11 17:49 ` David Howells [this message]
2011-01-11 17:49 ` [PATCH 15/18] autofs4: Fix wait validation David Howells
2011-01-11 17:49 ` [PATCH 16/18] autofs4: Add v4 pseudo direct mount support David Howells
2011-01-11 17:49 ` [PATCH 17/18] autofs4: Bump version David Howells
2011-01-11 17:49 ` [PATCH 18/18] Remove a further kludge from __do_follow_link() David Howells
2011-01-12 19:16 ` [PATCH 00/18] Introduce automount support in the VFS David Howells
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20110111174924.2291.44496.stgit@warthog.procyon.org.uk \
--to=dhowells@redhat.com \
--cc=autofs@linux.kernel.org \
--cc=linux-fsdevel@vger.kernel.org \
--cc=npiggin@kernel.dk \
--cc=raven@themaw.net \
--cc=viro@zeniv.linux.org.uk \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).