From 03d6dae5a4003bcaf86eb887f63444c0565ad32c Mon Sep 17 00:00:00 2001 From: Shehjar Tikoo Date: Mon, 20 Jul 2009 01:25:12 +0000 Subject: libglusterfsclient: Fake a fsid for every VMP This is needed to work around the replicate behaviour of possibly returning device number for the same file from different subvolumes. Signed-off-by: Anand V. Avati BUG: 148 (replicate: Returns st_dev from different subvols resulting in ESTALE thru unfs3booster) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=148 --- libglusterfs/src/hashfn.c | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'libglusterfs/src/hashfn.c') diff --git a/libglusterfs/src/hashfn.c b/libglusterfs/src/hashfn.c index 9ef8955a8..d53ecb56a 100644 --- a/libglusterfs/src/hashfn.c +++ b/libglusterfs/src/hashfn.c @@ -33,6 +33,17 @@ #define DM_FULLROUNDS 10 /* 32 is overkill, 16 is strong crypto */ #define DM_PARTROUNDS 6 /* 6 gets complete mixing */ + +uint32_t +ReallySimpleHash (char *path, int len) +{ + uint32_t hash = 0; + for (;len > 0; len--) + hash ^= (char)path[len]; + + return hash; +} + /* This is apparently the "fastest hash function for strings". Written by Paul Hsieh -- cgit