change from * to ^ in hashing of device/inode. Using * meant that if
authorAndrew Tridgell <tridge@samba.org>
Fri, 31 Oct 1997 05:56:07 +0000 (05:56 +0000)
committerAndrew Tridgell <tridge@samba.org>
Fri, 31 Oct 1997 05:56:07 +0000 (05:56 +0000)
the device number happened to divide the number of hash buckets we
would only use a small fraction of the hash buckets, which would slow
things down.

source/locking/locking_shm.c

index c1e32538e1ede1c0734dfdc8ec8c24332fb9258f..dfabbac2901e9f9f3b1b3de35788f9cec4df04da 100644 (file)
@@ -64,7 +64,7 @@ static int read_only;
 
 
 /* Conversion to hash entry index from device and inode numbers. */
-#define HASH_ENTRY(dev,ino) ((((uint32)(dev)) * ((uint32)(ino))) % shmops->hash_size())
+#define HASH_ENTRY(dev,ino) ((((uint32)(dev)) ^ ((uint32)(ino))) % shmops->hash_size())
 
 
 /*******************************************************************