From 777cefdfd2bb28d5eda3723077a03ef2aeadedff Mon Sep 17 00:00:00 2001 From: pravins Date: Sun, 8 Feb 2009 17:02:20 +0000 Subject: [PATCH] b=15134 i=nikita.danilov i=h.huang use unsigned long index for radix tree lookup --- lustre/include/lustre_lite.h | 4 ++-- lustre/liblustre/dir.c | 4 ++-- lustre/llite/dir.c | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/lustre/include/lustre_lite.h b/lustre/include/lustre_lite.h index 9fab984..f0c6495 100644 --- a/lustre/include/lustre_lite.h +++ b/lustre/include/lustre_lite.h @@ -145,8 +145,8 @@ static inline void ll_dir_chain_fini(struct ll_dir_chain *chain) { } -static inline __u32 hash_x_index(__u32 value) +static inline unsigned long hash_x_index(unsigned long value) { - return ((__u32)~0) - value; + return ~0UL - value; } #endif diff --git a/lustre/liblustre/dir.c b/lustre/liblustre/dir.c index 7b0832e..c8e3300 100644 --- a/lustre/liblustre/dir.c +++ b/lustre/liblustre/dir.c @@ -132,8 +132,8 @@ static int llu_dir_do_readpage(struct inode *inode, struct page *page) return rc; } -static cfs_page_t *llu_dir_read_page(struct inode *ino, __u32 hash, - int exact, struct ll_dir_chain *chain) +static cfs_page_t *llu_dir_read_page(struct inode *ino, __u64 hash, + int exact, struct ll_dir_chain *chain) { cfs_page_t *page; int rc; diff --git a/lustre/llite/dir.c b/lustre/llite/dir.c index f94d458..a31cc3e 100644 --- a/lustre/llite/dir.c +++ b/lustre/llite/dir.c @@ -221,7 +221,7 @@ static struct page *ll_dir_page_locate(struct inode *dir, __u64 hash, * radix_tree_gang_lookup() can be used to find a page with starting * hash _smaller_ than one we are looking for. */ - unsigned long offset = hash_x_index((__u32)hash); + unsigned long offset = hash_x_index((unsigned long)hash); struct page *page; int found; @@ -345,7 +345,7 @@ struct page *ll_get_dir_page(struct inode *dir, __u64 hash, int exact, } } - page = read_cache_page(mapping, hash_x_index((__u32)hash), + page = read_cache_page(mapping, hash_x_index((unsigned long)hash), (filler_t*)mapping->a_ops->readpage, NULL); if (IS_ERR(page)) GOTO(out_unlock, page); -- 1.8.3.1