From: David Howells <dhowells@redhat.com>
To: "J. Bruce Fields" <bfields@fieldses.org>
Cc: dhowells@redhat.com, Miklos Szeredi <miklos@szeredi.hu>,
viro@zeniv.linux.org.uk, torvalds@linux-foundation.org,
linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org,
hch@infradead.org, akpm@linux-foundation.org, zab@redhat.com,
jack@suse.cz, luto@amacapital.net, mszeredi@suse.cz
Subject: Re: [PATCH 01/13] vfs: add d_is_dir()
Date: Fri, 07 Feb 2014 19:30:57 +0000 [thread overview]
Message-ID: <26966.1391801457@warthog.procyon.org.uk> (raw)
In-Reply-To: <20140207173636.GA8801@fieldses.org>
J. Bruce Fields <bfields@fieldses.org> wrote:
> On Fri, Feb 07, 2014 at 05:48:59PM +0100, Miklos Szeredi wrote:
> > From: Miklos Szeredi <mszeredi@suse.cz>
> >
> > Add d_is_dir(dentry) helper which is analogous to S_ISDIR().
>
> While trying to get up to speed I notice that these flags were
> introduced by b18825a7c8e37a7cf6abb97a12a6ad71af160de7 "VFS: Put a small
> type field into struct dentry::d_flags" whose changelog tells me "what"
> but not "why". So out of curiosity: was that some kind of optimization,
> or was there some other reason for it?
The idea is to put into the dentry information about objects that pathwalk
specifically needs to know about, ie. negative dentries, dirs, automount
points and symlinks so that you don't have to look this up in the inode.
We can use this to distinguish lookupable dirs from nonlookupable dirs
(ie. automounts), thereby subsuming the can_lookup query.
However, the real power comes in support for fs unioning. There are two
additional uses for this field:
(1) Whiteout dentry type. An additional type is added for this field which
causes d_is_negative() to return true, but can be distinguished when
trying to decide whether to look in a lower layer or not.
(2) Fallthroughs. Whilst the dentry may appear negative by virtue of having
a NULL d_inode pointer, it does in fact correspond to a real object on a
lower layer. The type of the lower object is set in this field so that
pathwalk can immediately know how to deal with it.
David
next prev parent reply other threads:[~2014-02-07 19:58 UTC|newest]
Thread overview: 47+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-02-07 16:48 [PATCH 00/13] cross rename v4 Miklos Szeredi
2014-02-07 16:48 ` [PATCH 01/13] vfs: add d_is_dir() Miklos Szeredi
2014-02-07 17:36 ` J. Bruce Fields
2014-02-07 19:30 ` David Howells [this message]
2014-02-07 16:49 ` [PATCH 02/13] vfs: rename: move d_move() up Miklos Szeredi
2014-02-07 16:49 ` [PATCH 03/13] vfs: rename: use common code for dir and non-dir Miklos Szeredi
2014-02-07 16:49 ` [PATCH 04/13] vfs: add renameat2 syscall Miklos Szeredi
2014-02-07 16:49 ` [PATCH 05/13] vfs: add RENAME_NOREPLACE flag Miklos Szeredi
2014-02-07 16:49 ` [PATCH 06/13] security: add flags to rename hooks Miklos Szeredi
2014-02-07 16:49 ` [PATCH 07/13] vfs: lock_two_nondirectories: allow directory args Miklos Szeredi
2014-02-07 21:16 ` J. Bruce Fields
2014-02-11 15:32 ` Miklos Szeredi
2014-02-07 16:49 ` [PATCH 08/13] vfs: add cross-rename Miklos Szeredi
2014-02-07 22:40 ` J. Bruce Fields
2014-02-11 15:55 ` Miklos Szeredi
2014-02-07 16:49 ` [PATCH 09/13] ext4: rename: create ext4_renament structure for local vars Miklos Szeredi
2014-02-07 16:49 ` [PATCH 10/13] ext4: rename: move EMLINK check up Miklos Szeredi
2014-02-07 16:49 ` [PATCH 11/13] ext4: rename: split out helper functions Miklos Szeredi
2014-02-07 16:49 ` [PATCH 12/13] ext4: add cross rename support Miklos Szeredi
2014-02-11 21:23 ` Jan Kara
2014-02-07 16:49 ` [PATCH 13/13] vfs: merge rename2 into rename Miklos Szeredi
2014-02-07 22:46 ` [PATCH 00/13] cross rename v4 J. Bruce Fields
2014-02-11 15:57 ` Miklos Szeredi
2014-02-13 19:32 ` J. Bruce Fields
2014-02-10 10:51 ` Dave Chinner
2014-02-11 16:01 ` Miklos Szeredi
2014-02-12 17:18 ` Miklos Szeredi
2014-02-17 8:19 ` Dave Chinner
2014-02-17 18:04 ` Theodore Ts'o
2014-03-19 13:57 ` xfstest for renameat2 system call (was: [PATCH 00/13] cross rename v4) Miklos Szeredi
2014-04-08 1:23 ` Dave Chinner
2014-02-13 15:54 ` [PATCH 00/13] cross rename v4 David Howells
2014-02-13 16:25 ` Miklos Szeredi
2014-02-13 16:42 ` David Howells
2014-02-13 17:28 ` Miklos Szeredi
2014-02-13 18:21 ` Andy Lutomirski
2014-02-13 18:29 ` Linus Torvalds
2014-02-13 18:56 ` Miklos Szeredi
2014-02-13 19:20 ` Linus Torvalds
2014-02-13 19:02 ` David Howells
2014-02-13 19:32 ` Linus Torvalds
2014-02-13 20:17 ` Eric W. Biederman
2014-02-13 20:28 ` Miklos Szeredi
2014-02-24 17:12 ` Miklos Szeredi
2014-02-24 17:49 ` Linus Torvalds
2014-02-25 4:07 ` J. R. Okajima
2014-02-26 15:15 ` Jan Kara
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=26966.1391801457@warthog.procyon.org.uk \
--to=dhowells@redhat.com \
--cc=akpm@linux-foundation.org \
--cc=bfields@fieldses.org \
--cc=hch@infradead.org \
--cc=jack@suse.cz \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=luto@amacapital.net \
--cc=miklos@szeredi.hu \
--cc=mszeredi@suse.cz \
--cc=torvalds@linux-foundation.org \
--cc=viro@zeniv.linux.org.uk \
--cc=zab@redhat.com \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Powered by JetHome