Whamcloud - gitweb
LU-6245 libcfs: cleanup up libcfs hash code for upstream
[fs/lustre-release.git] / lustre / obdclass / lu_object.c
index c111b05..a51dc41 100644 (file)
@@ -98,7 +98,7 @@ void lu_object_put(const struct lu_env *env, struct lu_object *o)
         struct lu_object_header *top;
         struct lu_site          *site;
         struct lu_object        *orig;
-        cfs_hash_bd_t            bd;
+       struct cfs_hash_bd            bd;
        const struct lu_fid     *fid;
 
         top  = o->lo_header;
@@ -202,8 +202,8 @@ void lu_object_unhash(const struct lu_env *env, struct lu_object *o)
        top = o->lo_header;
        set_bit(LU_OBJECT_HEARD_BANSHEE, &top->loh_flags);
        if (!test_and_set_bit(LU_OBJECT_UNHASHED, &top->loh_flags)) {
-               cfs_hash_t *obj_hash = o->lo_dev->ld_site->ls_obj_hash;
-               cfs_hash_bd_t bd;
+               struct cfs_hash *obj_hash = o->lo_dev->ld_site->ls_obj_hash;
+               struct cfs_hash_bd bd;
 
                cfs_hash_bd_get_and_lock(obj_hash, &top->loh_fid, &bd, 1);
                if (!list_empty(&top->loh_lru)) {
@@ -346,8 +346,8 @@ int lu_site_purge(const struct lu_env *env, struct lu_site *s, int nr)
         struct lu_object_header *h;
         struct lu_object_header *temp;
         struct lu_site_bkt_data *bkt;
-        cfs_hash_bd_t            bd;
-        cfs_hash_bd_t            bd2;
+       struct cfs_hash_bd            bd;
+       struct cfs_hash_bd            bd2;
        struct list_head         dispose;
        int                      did_sth;
        unsigned int             start;
@@ -574,7 +574,7 @@ int lu_object_invariant(const struct lu_object *o)
 }
 
 static struct lu_object *htable_lookup(struct lu_site *s,
-                                      cfs_hash_bd_t *bd,
+                                      struct cfs_hash_bd *bd,
                                       const struct lu_fid *f,
                                       wait_queue_t *waiter,
                                       __u64 *version)
@@ -667,8 +667,8 @@ static struct lu_object *lu_object_new(const struct lu_env *env,
                                        const struct lu_object_conf *conf)
 {
         struct lu_object        *o;
-        cfs_hash_t              *hs;
-        cfs_hash_bd_t            bd;
+       struct cfs_hash              *hs;
+       struct cfs_hash_bd            bd;
 
         o = lu_object_alloc(env, dev, f, conf);
         if (unlikely(IS_ERR(o)))
@@ -696,8 +696,8 @@ static struct lu_object *lu_object_find_try(const struct lu_env *env,
        struct lu_object      *o;
        struct lu_object      *shadow;
        struct lu_site        *s;
-       cfs_hash_t            *hs;
-       cfs_hash_bd_t          bd;
+       struct cfs_hash            *hs;
+       struct cfs_hash_bd          bd;
        __u64                  version = 0;
 
         /*
@@ -868,7 +868,7 @@ struct lu_site_print_arg {
 };
 
 static int
-lu_site_obj_print(cfs_hash_t *hs, cfs_hash_bd_t *bd,
+lu_site_obj_print(struct cfs_hash *hs, struct cfs_hash_bd *bd,
                  struct hlist_node *hnode, void *data)
 {
        struct lu_site_print_arg *arg = (struct lu_site_print_arg *)data;
@@ -957,7 +957,7 @@ static unsigned long lu_htable_order(struct lu_device *top)
         return bits;
 }
 
-static unsigned lu_obj_hop_hash(cfs_hash_t *hs,
+static unsigned lu_obj_hop_hash(struct cfs_hash *hs,
                                const void *key, unsigned mask)
 {
        struct lu_fid  *fid = (struct lu_fid *)key;
@@ -997,7 +997,7 @@ static int lu_obj_hop_keycmp(const void *key, struct hlist_node *hnode)
        return lu_fid_eq(&h->loh_fid, (struct lu_fid *)key);
 }
 
-static void lu_obj_hop_get(cfs_hash_t *hs, struct hlist_node *hnode)
+static void lu_obj_hop_get(struct cfs_hash *hs, struct hlist_node *hnode)
 {
        struct lu_object_header *h;
 
@@ -1005,12 +1005,12 @@ static void lu_obj_hop_get(cfs_hash_t *hs, struct hlist_node *hnode)
        atomic_inc(&h->loh_ref);
 }
 
-static void lu_obj_hop_put_locked(cfs_hash_t *hs, struct hlist_node *hnode)
+static void lu_obj_hop_put_locked(struct cfs_hash *hs, struct hlist_node *hnode)
 {
         LBUG(); /* we should never called it */
 }
 
-static cfs_hash_ops_t lu_site_hash_ops = {
+static struct cfs_hash_ops lu_site_hash_ops = {
         .hs_hash        = lu_obj_hop_hash,
         .hs_key         = lu_obj_hop_key,
         .hs_keycmp      = lu_obj_hop_keycmp,
@@ -1042,7 +1042,7 @@ EXPORT_SYMBOL(lu_dev_del_linkage);
 int lu_site_init(struct lu_site *s, struct lu_device *top)
 {
        struct lu_site_bkt_data *bkt;
-       cfs_hash_bd_t bd;
+       struct cfs_hash_bd bd;
        char name[16];
        unsigned long bits;
        unsigned int i;
@@ -1914,10 +1914,10 @@ typedef struct lu_site_stats{
         unsigned        lss_busy;
 } lu_site_stats_t;
 
-static void lu_site_stats_get(cfs_hash_t *hs,
+static void lu_site_stats_get(struct cfs_hash *hs,
                               lu_site_stats_t *stats, int populated)
 {
-       cfs_hash_bd_t bd;
+       struct cfs_hash_bd bd;
        unsigned int  i;
 
         cfs_hash_for_each_bucket(hs, &bd, i) {
@@ -2275,8 +2275,8 @@ void lu_object_assign_fid(const struct lu_env *env, struct lu_object *o,
        struct lu_fid           *old = &o->lo_header->loh_fid;
        struct lu_object        *shadow;
        wait_queue_t             waiter;
-       cfs_hash_t              *hs;
-       cfs_hash_bd_t            bd;
+       struct cfs_hash         *hs;
+       struct cfs_hash_bd       bd;
        __u64                    version = 0;
 
        LASSERT(fid_is_zero(old));