From mboxrd@z Thu Jan 1 00:00:00 1970 From: ebiederm@xmission.com (Eric W. Biederman) Subject: Re: [sysfs] why ->delete_inode() instead of ->clear_inode()? Date: Sat, 29 May 2010 00:06:34 -0700 Message-ID: References: <20100529054321.GN31073@ZenIV.linux.org.uk> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: "Eric W. Biederman" , linux-fsdevel@vger.kernel.org To: Al Viro Return-path: Received: from out02.mta.xmission.com ([166.70.13.232]:45989 "EHLO out02.mta.xmission.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752207Ab0E2HGm (ORCPT ); Sat, 29 May 2010 03:06:42 -0400 In-Reply-To: <20100529054321.GN31073@ZenIV.linux.org.uk> (Al Viro's message of "Sat\, 29 May 2010 06\:43\:21 +0100") Sender: linux-fsdevel-owner@vger.kernel.org List-ID: Al Viro 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