Whamcloud - gitweb
b=15134
authorpravins <pravins>
Sun, 8 Feb 2009 17:02:20 +0000 (17:02 +0000)
committerpravins <pravins>
Sun, 8 Feb 2009 17:02:20 +0000 (17:02 +0000)
i=nikita.danilov
i=h.huang
use unsigned long index for  radix tree lookup

lustre/include/lustre_lite.h
lustre/liblustre/dir.c
lustre/llite/dir.c

index 9fab984..f0c6495 100644 (file)
@@ -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
index 7b0832e..c8e3300 100644 (file)
@@ -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;
index f94d458..a31cc3e 100644 (file)
@@ -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);