Commit 49a0b0ad authored by James Simmons's avatar James Simmons Committed by Greg Kroah-Hartman

staging: lustre: convert last typedef data types in hash.c

Change the last typedef data types cfs_hash_lookup_intent_t
to enum and cfs_hash_cond_arg_t to a structure.
Signed-off-by: default avatarJames Simmons <jsimmons@infradead.org>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 6cd3d850
...@@ -606,7 +606,7 @@ enum { ...@@ -606,7 +606,7 @@ enum {
CFS_HS_LOOKUP_MASK_DEL = BIT(3), CFS_HS_LOOKUP_MASK_DEL = BIT(3),
}; };
typedef enum cfs_hash_lookup_intent { enum cfs_hash_lookup_intent {
/** return item w/o refcount */ /** return item w/o refcount */
CFS_HS_LOOKUP_IT_PEEK = CFS_HS_LOOKUP_MASK_FIND, CFS_HS_LOOKUP_IT_PEEK = CFS_HS_LOOKUP_MASK_FIND,
/** return item with refcount */ /** return item with refcount */
...@@ -621,12 +621,12 @@ typedef enum cfs_hash_lookup_intent { ...@@ -621,12 +621,12 @@ typedef enum cfs_hash_lookup_intent {
/** delete if existed */ /** delete if existed */
CFS_HS_LOOKUP_IT_FINDDEL = (CFS_HS_LOOKUP_MASK_FIND | CFS_HS_LOOKUP_IT_FINDDEL = (CFS_HS_LOOKUP_MASK_FIND |
CFS_HS_LOOKUP_MASK_DEL) CFS_HS_LOOKUP_MASK_DEL)
} cfs_hash_lookup_intent_t; };
static struct hlist_node * static struct hlist_node *
cfs_hash_bd_lookup_intent(struct cfs_hash *hs, struct cfs_hash_bd *bd, cfs_hash_bd_lookup_intent(struct cfs_hash *hs, struct cfs_hash_bd *bd,
const void *key, struct hlist_node *hnode, const void *key, struct hlist_node *hnode,
cfs_hash_lookup_intent_t intent) enum cfs_hash_lookup_intent intent)
{ {
struct hlist_head *hhead = cfs_hash_bd_hhead(hs, bd); struct hlist_head *hhead = cfs_hash_bd_hhead(hs, bd);
...@@ -1489,16 +1489,16 @@ cfs_hash_for_each_tight(struct cfs_hash *hs, cfs_hash_for_each_cb_t func, ...@@ -1489,16 +1489,16 @@ cfs_hash_for_each_tight(struct cfs_hash *hs, cfs_hash_for_each_cb_t func,
return count; return count;
} }
typedef struct { struct cfs_hash_cond_arg {
cfs_hash_cond_opt_cb_t func; cfs_hash_cond_opt_cb_t func;
void *arg; void *arg;
} cfs_hash_cond_arg_t; };
static int static int
cfs_hash_cond_del_locked(struct cfs_hash *hs, struct cfs_hash_bd *bd, cfs_hash_cond_del_locked(struct cfs_hash *hs, struct cfs_hash_bd *bd,
struct hlist_node *hnode, void *data) struct hlist_node *hnode, void *data)
{ {
cfs_hash_cond_arg_t *cond = data; struct cfs_hash_cond_arg *cond = data;
if (cond->func(cfs_hash_object(hs, hnode), cond->arg)) if (cond->func(cfs_hash_object(hs, hnode), cond->arg))
cfs_hash_bd_del_locked(hs, bd, hnode); cfs_hash_bd_del_locked(hs, bd, hnode);
...@@ -1513,7 +1513,7 @@ cfs_hash_cond_del_locked(struct cfs_hash *hs, struct cfs_hash_bd *bd, ...@@ -1513,7 +1513,7 @@ cfs_hash_cond_del_locked(struct cfs_hash *hs, struct cfs_hash_bd *bd,
void void
cfs_hash_cond_del(struct cfs_hash *hs, cfs_hash_cond_opt_cb_t func, void *data) cfs_hash_cond_del(struct cfs_hash *hs, cfs_hash_cond_opt_cb_t func, void *data)
{ {
cfs_hash_cond_arg_t arg = { struct cfs_hash_cond_arg arg = {
.func = func, .func = func,
.arg = data, .arg = data,
}; };
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment