From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752255AbbBVMkA (ORCPT ); Sun, 22 Feb 2015 07:40:00 -0500 Received: from mx1.redhat.com ([209.132.183.28]:49209 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751906AbbBVMj7 (ORCPT ); Sun, 22 Feb 2015 07:39:59 -0500 Organization: Red Hat UK Ltd. Registered Address: Red Hat UK Ltd, Amberley Place, 107-111 Peascod Street, Windsor, Berkshire, SI4 1TE, United Kingdom. Registered in England and Wales under Company Registration No. 3798903 From: David Howells In-Reply-To: References: <20150221033452.GU29656@ZenIV.linux.org.uk> <20150222005125.GX29656@ZenIV.linux.org.uk> To: Linus Torvalds Cc: dhowells@redhat.com, Al Viro , Linux Kernel Mailing List , linux-fsdevel Subject: Re: [git pull] more vfs bits MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <27512.1424608792.1@warthog.procyon.org.uk> Date: Sun, 22 Feb 2015 12:39:52 +0000 Message-ID: <27513.1424608792@warthog.procyon.org.uk> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Linus Torvalds wrote: > - dentry_inode*() is supposed to be "the inode that would be used if > the dentry was opened" > > What part of "dentry_inode()" implies "if the dentry was opened" to > you? Nothing. The name is fundamentally bad. That because I wasn't thinking of it that way because it's used in a lot more places than just opening code. Audit, for example. > And what *possible* situation could make that "_once()" version ever be > valid? None. It's bogus. It's crap. It's insane. There is no way that it is > *ever* a valid question to even ask. If the dentry is so unstable that you > can't safely look at the inode, you had damn well better never ask "ok, what > would the inode be if I opened this random pointer"? There were originally some uses of dentry_inode_once(), but I think they dropped out when I removed most of fs/*.c from consideration by the scripts. > - fs_inode*() is supposed to be "this is the inode that the native > filesystem uses". Yes. > So of the four new helpers, I really don't see any of them as "good". > I think "dentry_inode()" could remain, but even there I think the name > should specify *what* it is ("d_opened_inode()"? I don't like that name > either, That's also a poor choice. The inode isn't even opened necessarily. If it is opened and you have the struct file *, you should almost certainly be using file_inode(). David