From mboxrd@z Thu Jan 1 00:00:00 1970 From: Al Viro Subject: [sysfs] why ->delete_inode() instead of ->clear_inode()? Date: Sat, 29 May 2010 06:43:21 +0100 Message-ID: <20100529054321.GN31073@ZenIV.linux.org.uk> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: linux-fsdevel@vger.kernel.org To: "Eric W. Biederman" Return-path: Received: from zeniv.linux.org.uk ([195.92.253.2]:48412 "EHLO ZenIV.linux.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750960Ab0E2FnW (ORCPT ); Sat, 29 May 2010 01:43:22 -0400 Content-Disposition: inline Sender: linux-fsdevel-owner@vger.kernel.org List-ID: Is there any problem with simply doing void sysfs_clear_inode(struct inode *inode) { struct sysfs_dirent *sd = inode->i_private; sysfs_put(sd); } instead of (mis)using ->delete_inode()? Note that clear_inode() is not going to be called on any inodes with positive i_count, that you are forcibly evicting them from icache on the final iput() anyway and that clear_inode() is never called twice on the same struct inode()... Al, very unenthusiastic about ->delete_inode() instances in general - that sucker gets abused in the strangest ways by a lot of filesystems ;-/