From mboxrd@z Thu Jan 1 00:00:00 1970 From: Christoph Hellwig Date: Wed, 8 Sep 2010 21:57:54 -0400 Subject: [Cluster-devel] GFS2: Make . and .. qstrs constant In-Reply-To: <1283960120.2443.5.camel@localhost> References: <1283960120.2443.5.camel@localhost> Message-ID: <20100909015754.GA5230@infradead.org> List-Id: To: cluster-devel.redhat.com MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit 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 > 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 > > +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.