All of lore.kernel.org
 help / color / mirror / Atom feed
From: Christoph Hellwig <hch@infradead.org>
To: cluster-devel.redhat.com
Subject: [Cluster-devel] GFS2: Make . and .. qstrs constant
Date: Wed, 8 Sep 2010 21:57:54 -0400	[thread overview]
Message-ID: <20100909015754.GA5230@infradead.org> (raw)
In-Reply-To: <1283960120.2443.5.camel@localhost>

On Wed, Sep 08, 2010 at 04:35:20PM +0100, Steven Whitehouse wrote:
> >From bc9fb728211162a24afd341c9ffb85e7b459fb8d Mon Sep 17 00:00:00 2001
> From: Steven Whitehouse <swhiteho@redhat.com>
> Date: Wed, 8 Sep 2010 16:02:13 +0100
> Subject: GFS2: Make . and .. qstrs constant
> 
> Rather than calculating the qstrs for . and .. each time
> we need them, its better to keep a constant version of
> these and just refer to them when required.
> 
> Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>
> 
> +const struct qstr gfs2_qdot = { .name = ".", .len = 1, .hash = 0xed4e242};
> +const struct qstr gfs2_qdotdot = { .name = "..", .len = 2, .hash = 0x9608161c};

I don't think hardcoding the values for the current dcache hash is a
good idea.  We have already changed that hash in not too recent history
and chances are we'll do again at some point.

Just calculate it once at startup time using the normal hash function.
Extra points for doing it in core code and finding places in other
filesystems that have the same issue.



  reply	other threads:[~2010-09-09  1:57 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-09-08 15:35 [Cluster-devel] GFS2: Make . and .. qstrs constant Steven Whitehouse
2010-09-09  1:57 ` Christoph Hellwig [this message]
2010-09-09  8:32   ` Steven Whitehouse
  -- strict thread matches above, loose matches on Subject: below --
2010-09-17 12:18 Steven Whitehouse

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=20100909015754.GA5230@infradead.org \
    --to=hch@infradead.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.