From: ebiederm@xmission.com (Eric W. Biederman)
To: Al Viro <viro@ZenIV.linux.org.uk>
Cc: "Eric W. Biederman" <ebiederm@aristanetworks.com>,
linux-fsdevel@vger.kernel.org
Subject: Re: [sysfs] why ->delete_inode() instead of ->clear_inode()?
Date: Sat, 29 May 2010 00:06:34 -0700 [thread overview]
Message-ID: <m1wruni3ut.fsf@fess.ebiederm.org> (raw)
In-Reply-To: <20100529054321.GN31073@ZenIV.linux.org.uk> (Al Viro's message of "Sat\, 29 May 2010 06\:43\:21 +0100")
Al Viro <viro@ZenIV.linux.org.uk> writes:
> Is there any problem with simply doing
>
> void sysfs_clear_inode(struct inode *inode)
> {
> struct sysfs_dirent *sd = inode->i_private;
> sysfs_put(sd);
> }
I can't see any problems with a quick review.
Given that drop_inode calls generic_delete_inode I don't see that
changing that will make any difference in the case of sysfs.
I can't remember why I did it that way but I can say nothing terribly subtle
is going on. We need a reference to the sysfs_dirent from the inode and when
the inode goes away we need to clear the reference.
>From the look of things proc_delete_inode can also be changed to a clear_inode
method if that is preferred.
Eric
next prev parent reply other threads:[~2010-05-29 7:06 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-05-29 5:43 [sysfs] why ->delete_inode() instead of ->clear_inode()? Al Viro
2010-05-29 7:06 ` Eric W. Biederman [this message]
2010-05-29 11:36 ` Al Viro
2010-05-30 0:45 ` Eric W. Biederman
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=m1wruni3ut.fsf@fess.ebiederm.org \
--to=ebiederm@xmission.com \
--cc=ebiederm@aristanetworks.com \
--cc=linux-fsdevel@vger.kernel.org \
--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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.