X-Git-Url: https://git.whamcloud.com/?a=blobdiff_plain;f=lustre%2Finclude%2Flustre_lite.h;h=ac71d69e849238d1bfcc422870b8e18002a21bef;hb=80ac0f4ee600d5a0b8d818843562d9328fef2ef0;hp=c9c112947fc225c146e0f5b7588937edee179b93;hpb=6e3ec5812ebd1b5ecf7cae584f429b013ffe7431;p=fs%2Flustre-release.git diff --git a/lustre/include/lustre_lite.h b/lustre/include/lustre_lite.h index c9c1129..ac71d69 100644 --- a/lustre/include/lustre_lite.h +++ b/lustre/include/lustre_lite.h @@ -26,7 +26,7 @@ * GPL HEADER END */ /* - * Copyright 2008 Sun Microsystems, Inc. All rights reserved + * Copyright (c) 2007, 2010, Oracle and/or its affiliates. All rights reserved. * Use is subject to license terms. */ /* @@ -37,6 +37,11 @@ #ifndef _LL_H #define _LL_H +/** \defgroup lite lite + * + * @{ + */ + #if defined(__linux__) #include #elif defined(__APPLE__) @@ -145,8 +150,16 @@ static inline void ll_dir_chain_fini(struct ll_dir_chain *chain) { } -static inline unsigned long hash_x_index(unsigned long value) +static inline unsigned long hash_x_index(__u64 hash) { - return ~0UL - value; +#ifdef __KERNEL__ +# if BITS_PER_LONG == 32 + hash >>= 32; +# endif +#endif + return ~0UL - hash; } + +/** @} lite */ + #endif