Re: [git pull] more vfs bits

From: David Howells
Date: Sun Feb 22 2015 - 07:40:15 EST

Linus Torvalds <torvalds@xxxxxxxxxxxxxxxxxxxx> 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".


> 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

To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at
Please read the FAQ at