linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Chris Mason <chris.mason@oracle.com>
To: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Al Viro <viro@zeniv.linux.org.uk>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	linux-fsdevel <linux-fsdevel@vger.kernel.org>
Subject: Re: .. anybody know of any filesystems that depend on the exact VFS 'namehash' implementation?
Date: Thu, 1 Mar 2012 13:34:03 -0500	[thread overview]
Message-ID: <20120301183403.GF5054@shiny> (raw)
In-Reply-To: <CA+55aFzxWifxyFSpQfuztmOiyBQpYfiM560DWXoooZ8j8p3fYw@mail.gmail.com>

On Thu, Mar 01, 2012 at 09:14:13AM -0800, Linus Torvalds wrote:
> On Thu, Mar 1, 2012 at 8:57 AM, Al Viro <viro@zeniv.linux.org.uk> wrote:
> >
> > As long as full_name_hash() is still around, any such filesystem is welcome
> > to use it for ->d_hash() and STFU.
> 
> Well, I'd make full_name_hash() match the new hash model, so no, they
> couldn't use that. They'd have to actually implement the old hash, and
> make it "their hash".
> 
> Also note that the hash model would have to become dependent on config
> options: doing things a word at a time really only works well on
> architectures that have fast unaligned accesses, and even on those
> archtiectures it really doesn't work if you enable
> CONFIG_DEBUG_PAGE_ALLOC.
> 
> > Note that there are places like this one (in btrfs_real_readdir())
> >                        q.name = name_ptr;
> >                        q.len = name_len;
> >                        q.hash = full_name_hash(q.name, q.len);
> >                        tmp = d_lookup(filp->f_dentry, &q);
> > and they _will_ need to be updated if we switch the default.
> 
> I don't agree that it will need to be updated - I was planning on just
> updating full_name_hash() to always match. That part is easy and
> obvious.

Just to clarify, btrfs isn't putting the dcache hashes on disk.  The
code above is part of our optimization to preload some information we
find during readdir to reduce IO when the file is later opened.

On disk we're crc32c only.

-chris

  reply	other threads:[~2012-03-01 18:34 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-02-29 23:36 .. anybody know of any filesystems that depend on the exact VFS 'namehash' implementation? Linus Torvalds
2012-03-01 10:13 ` Steven Whitehouse
2012-03-01 15:59   ` Linus Torvalds
2012-03-01 16:57 ` Al Viro
2012-03-01 17:14   ` Linus Torvalds
2012-03-01 18:34     ` Chris Mason [this message]
2012-03-01 22:42       ` Linus Torvalds
2012-03-17 12:29         ` Faulty has_zero()? (was: .. anybody know of any filesystems that depend on the exact VFS 'namehash' implementation?) Sven Anderson
2012-03-17 16:53           ` Linus Torvalds
2012-03-17 18:00             ` Sven Anderson
2012-03-02  0:46 ` .. anybody know of any filesystems that depend on the exact VFS 'namehash' implementation? Andi Kleen
2012-03-02  1:01   ` Linus Torvalds
2012-03-02  1:11     ` Andi Kleen
2012-03-02  1:38       ` Linus Torvalds

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=20120301183403.GF5054@shiny \
    --to=chris.mason@oracle.com \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=torvalds@linux-foundation.org \
    --cc=viro@zeniv.linux.org.uk \
    /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;
as well as URLs for NNTP newsgroup(s).