summaryrefslogtreecommitdiffstats
path: root/fs
diff options
context:
space:
mode:
authorGeorge Spelvin <linux@sciencehorizons.net>2016-05-27 04:11:51 +0200
committerGeorge Spelvin <linux@sciencehorizons.net>2016-05-28 21:48:31 +0200
commit468a9428521e7d00fb21250af363eb94dc1d6861 (patch)
tree75a5e7b73594e643a1f8ca870bcc4fe679bfb610 /fs
parentfs/namei.c: Improve dcache hash function (diff)
downloadlinux-468a9428521e7d00fb21250af363eb94dc1d6861.tar.xz
linux-468a9428521e7d00fb21250af363eb94dc1d6861.zip
<linux/hash.h>: Add support for architecture-specific functions
This is just the infrastructure; there are no users yet. This is modelled on CONFIG_ARCH_RANDOM; a CONFIG_ symbol declares the existence of <asm/hash.h>. That file may define its own versions of various functions, and define HAVE_* symbols (no CONFIG_ prefix!) to suppress the generic ones. Included is a self-test (in lib/test_hash.c) that verifies the basics. It is NOT in general required that the arch-specific functions compute the same thing as the generic, but if a HAVE_* symbol is defined with the value 1, then equality is tested. Signed-off-by: George Spelvin <linux@sciencehorizons.net> Cc: Geert Uytterhoeven <geert@linux-m68k.org> Cc: Greg Ungerer <gerg@linux-m68k.org> Cc: Andreas Schwab <schwab@linux-m68k.org> Cc: Philippe De Muyter <phdm@macq.eu> Cc: linux-m68k@lists.linux-m68k.org Cc: Alistair Francis <alistai@xilinx.com> Cc: Michal Simek <michal.simek@xilinx.com> Cc: Yoshinori Sato <ysato@users.sourceforge.jp> Cc: uclinux-h8-devel@lists.sourceforge.jp
Diffstat (limited to 'fs')
-rw-r--r--fs/namei.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/fs/namei.c b/fs/namei.c
index a49cbd7efcaa..968dae025230 100644
--- a/fs/namei.c
+++ b/fs/namei.c
@@ -1788,7 +1788,11 @@ static int walk_component(struct nameidata *nd, int flags)
#include <asm/word-at-a-time.h>
-#ifdef CONFIG_64BIT
+#ifdef HASH_MIX
+
+/* Architecture provides HASH_MIX and fold_hash() in <asm/hash.h> */
+
+#elif defined(CONFIG_64BIT)
/*
* Register pressure in the mixing function is an issue, particularly
* on 32-bit x86, but almost any function requires one state value and