Skip to content

Commit

Permalink
dcache.c: get rid of pointless macros
Browse files Browse the repository at this point in the history
D_HASH{MASK,BITS} are used once each, both in the same function (d_hash()).
At this point they are actively misguiding - they imply that values are
compiler constants, which is no longer true.

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
  • Loading branch information
Al Viro committed Nov 16, 2013
1 parent 2bc74fe commit 482db90
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions fs/dcache.c
Original file line number Diff line number Diff line change
Expand Up @@ -96,8 +96,6 @@ static struct kmem_cache *dentry_cache __read_mostly;
* This hash-function tries to avoid losing too many bits of hash
* information, yet avoid using a prime hash-size or similar.
*/
#define D_HASHBITS d_hash_shift
#define D_HASHMASK d_hash_mask

static unsigned int d_hash_mask __read_mostly;
static unsigned int d_hash_shift __read_mostly;
Expand All @@ -108,8 +106,8 @@ static inline struct hlist_bl_head *d_hash(const struct dentry *parent,
unsigned int hash)
{
hash += (unsigned long) parent / L1_CACHE_BYTES;
hash = hash + (hash >> D_HASHBITS);
return dentry_hashtable + (hash & D_HASHMASK);
hash = hash + (hash >> d_hash_shift);
return dentry_hashtable + (hash & d_hash_mask);
}

/* Statistics gathering. */
Expand Down

0 comments on commit 482db90

Please sign in to comment.