diff options
Diffstat (limited to 'drivers/staging/lustre/lustre/obdclass/lu_object.c')
-rw-r--r-- | drivers/staging/lustre/lustre/obdclass/lu_object.c | 53 |
1 files changed, 27 insertions, 26 deletions
diff --git a/drivers/staging/lustre/lustre/obdclass/lu_object.c b/drivers/staging/lustre/lustre/obdclass/lu_object.c index 3a3d5bc5a628..212823ab937b 100644 --- a/drivers/staging/lustre/lustre/obdclass/lu_object.c +++ b/drivers/staging/lustre/lustre/obdclass/lu_object.c @@ -71,7 +71,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; @@ -175,8 +175,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); list_del_init(&top->loh_lru); @@ -306,8 +306,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; int start; @@ -526,7 +526,7 @@ int lu_object_invariant(const struct lu_object *o) EXPORT_SYMBOL(lu_object_invariant); 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) @@ -589,8 +589,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; struct lu_site_bkt_data *bkt; o = lu_object_alloc(env, dev, f, conf); @@ -618,8 +618,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; /* @@ -788,7 +788,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; @@ -874,7 +874,7 @@ static int lu_htable_order(void) 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; @@ -914,14 +914,14 @@ 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; h = hlist_entry(hnode, struct lu_object_header, loh_hash); if (atomic_add_return(1, &h->loh_ref) == 1) { struct lu_site_bkt_data *bkt; - cfs_hash_bd_t bd; + struct cfs_hash_bd bd; cfs_hash_bd_get(hs, &h->loh_fid, &bd); bkt = cfs_hash_bd_extra_get(hs, &bd); @@ -929,7 +929,7 @@ static void lu_obj_hop_get(cfs_hash_t *hs, struct hlist_node *hnode) } } -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 */ } @@ -975,12 +975,12 @@ 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]; int bits; int i; - memset(s, 0, sizeof *s); + memset(s, 0, sizeof(*s)); bits = lu_htable_order(); snprintf(name, 16, "lu_site_%s", top->ld_type->ldt_name); for (bits = min(max(LU_SITE_BITS_MIN, bits), LU_SITE_BITS_MAX); @@ -1110,7 +1110,7 @@ int lu_device_init(struct lu_device *d, struct lu_device_type *t) { if (t->ldt_device_nr++ == 0 && t->ldt_ops->ldto_start != NULL) t->ldt_ops->ldto_start(t); - memset(d, 0, sizeof *d); + memset(d, 0, sizeof(*d)); atomic_set(&d->ld_ref, 0); d->ld_type = t; lu_ref_init(&d->ld_reference); @@ -1206,7 +1206,7 @@ EXPORT_SYMBOL(lu_object_add); */ int lu_object_header_init(struct lu_object_header *h) { - memset(h, 0, sizeof *h); + memset(h, 0, sizeof(*h)); atomic_set(&h->loh_ref, 1); INIT_HLIST_NODE(&h->loh_hash); INIT_LIST_HEAD(&h->loh_lru); @@ -1525,7 +1525,7 @@ static void keys_fini(struct lu_context *ctx) for (i = 0; i < ARRAY_SIZE(lu_keys); ++i) key_fini(ctx, i); - OBD_FREE(ctx->lc_value, ARRAY_SIZE(lu_keys) * sizeof ctx->lc_value[0]); + OBD_FREE(ctx->lc_value, ARRAY_SIZE(lu_keys) * sizeof(ctx->lc_value[0])); ctx->lc_value = NULL; } @@ -1574,7 +1574,8 @@ static int keys_fill(struct lu_context *ctx) static int keys_init(struct lu_context *ctx) { - OBD_ALLOC(ctx->lc_value, ARRAY_SIZE(lu_keys) * sizeof ctx->lc_value[0]); + OBD_ALLOC(ctx->lc_value, + ARRAY_SIZE(lu_keys) * sizeof(ctx->lc_value[0])); if (likely(ctx->lc_value != NULL)) return keys_fill(ctx); @@ -1588,7 +1589,7 @@ int lu_context_init(struct lu_context *ctx, __u32 tags) { int rc; - memset(ctx, 0, sizeof *ctx); + memset(ctx, 0, sizeof(*ctx)); ctx->lc_state = LCS_INITIALIZED; ctx->lc_tags = tags; if (tags & LCT_REMEMBER) { @@ -1787,10 +1788,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; int i; cfs_hash_for_each_bucket(hs, &bd, i) { @@ -2071,8 +2072,8 @@ void lu_object_assign_fid(const struct lu_env *env, struct lu_object *o, struct lu_site_bkt_data *bkt; 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)); |