Commit 3589a055 authored by James Simmons's avatar James Simmons Committed by Greg Kroah-Hartman

staging: lustre: lnet: change lnet_libhandle_t to proper structure

Change lnet_libhandle_t from typedef to proper structure.
Signed-off-by: default avatarJames Simmons <uja.ornl@yahoo.com>
Reviewed-on: https://review.whamcloud.com/20831Reviewed-by: default avatarOlaf Weber <olaf@sgi.com>
Reviewed-by: default avatarDoug Oucharek <doug.s.oucharek@intel.com>
Reviewed-by: default avatarDmitry Eremin <dmitry.eremin@intel.com>
Reviewed-by: default avatarOleg Drokin <oleg.drokin@intel.com>
Signed-off-by: default avatarJames Simmons <jsimmons@infradead.org>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent a9a5ac68
...@@ -266,12 +266,12 @@ lnet_msg_free(struct lnet_msg *msg) ...@@ -266,12 +266,12 @@ lnet_msg_free(struct lnet_msg *msg)
LIBCFS_FREE(msg, sizeof(*msg)); LIBCFS_FREE(msg, sizeof(*msg));
} }
lnet_libhandle_t *lnet_res_lh_lookup(struct lnet_res_container *rec, struct lnet_libhandle *lnet_res_lh_lookup(struct lnet_res_container *rec,
__u64 cookie); __u64 cookie);
void lnet_res_lh_initialize(struct lnet_res_container *rec, void lnet_res_lh_initialize(struct lnet_res_container *rec,
lnet_libhandle_t *lh); struct lnet_libhandle *lh);
static inline void static inline void
lnet_res_lh_invalidate(lnet_libhandle_t *lh) lnet_res_lh_invalidate(struct lnet_libhandle *lh)
{ {
/* NB: cookie is still useful, don't reset it */ /* NB: cookie is still useful, don't reset it */
list_del(&lh->lh_hash_chain); list_del(&lh->lh_hash_chain);
...@@ -291,7 +291,7 @@ lnet_eq2handle(struct lnet_handle_eq *handle, lnet_eq_t *eq) ...@@ -291,7 +291,7 @@ lnet_eq2handle(struct lnet_handle_eq *handle, lnet_eq_t *eq)
static inline lnet_eq_t * static inline lnet_eq_t *
lnet_handle2eq(struct lnet_handle_eq *handle) lnet_handle2eq(struct lnet_handle_eq *handle)
{ {
lnet_libhandle_t *lh; struct lnet_libhandle *lh;
lh = lnet_res_lh_lookup(&the_lnet.ln_eq_container, handle->cookie); lh = lnet_res_lh_lookup(&the_lnet.ln_eq_container, handle->cookie);
if (!lh) if (!lh)
...@@ -310,7 +310,7 @@ static inline lnet_libmd_t * ...@@ -310,7 +310,7 @@ static inline lnet_libmd_t *
lnet_handle2md(struct lnet_handle_md *handle) lnet_handle2md(struct lnet_handle_md *handle)
{ {
/* ALWAYS called with resource lock held */ /* ALWAYS called with resource lock held */
lnet_libhandle_t *lh; struct lnet_libhandle *lh;
int cpt; int cpt;
cpt = lnet_cpt_of_cookie(handle->cookie); cpt = lnet_cpt_of_cookie(handle->cookie);
...@@ -326,7 +326,7 @@ static inline lnet_libmd_t * ...@@ -326,7 +326,7 @@ static inline lnet_libmd_t *
lnet_wire_handle2md(struct lnet_handle_wire *wh) lnet_wire_handle2md(struct lnet_handle_wire *wh)
{ {
/* ALWAYS called with resource lock held */ /* ALWAYS called with resource lock held */
lnet_libhandle_t *lh; struct lnet_libhandle *lh;
int cpt; int cpt;
if (wh->wh_interface_cookie != the_lnet.ln_interface_cookie) if (wh->wh_interface_cookie != the_lnet.ln_interface_cookie)
...@@ -351,7 +351,7 @@ static inline lnet_me_t * ...@@ -351,7 +351,7 @@ static inline lnet_me_t *
lnet_handle2me(struct lnet_handle_me *handle) lnet_handle2me(struct lnet_handle_me *handle)
{ {
/* ALWAYS called with resource lock held */ /* ALWAYS called with resource lock held */
lnet_libhandle_t *lh; struct lnet_libhandle *lh;
int cpt; int cpt;
cpt = lnet_cpt_of_cookie(handle->cookie); cpt = lnet_cpt_of_cookie(handle->cookie);
......
...@@ -108,17 +108,17 @@ struct lnet_msg { ...@@ -108,17 +108,17 @@ struct lnet_msg {
struct lnet_hdr msg_hdr; struct lnet_hdr msg_hdr;
}; };
typedef struct lnet_libhandle { struct lnet_libhandle {
struct list_head lh_hash_chain; struct list_head lh_hash_chain;
__u64 lh_cookie; __u64 lh_cookie;
} lnet_libhandle_t; };
#define lh_entry(ptr, type, member) \ #define lh_entry(ptr, type, member) \
((type *)((char *)(ptr) - (char *)(&((type *)0)->member))) ((type *)((char *)(ptr) - (char *)(&((type *)0)->member)))
typedef struct lnet_eq { typedef struct lnet_eq {
struct list_head eq_list; struct list_head eq_list;
lnet_libhandle_t eq_lh; struct lnet_libhandle eq_lh;
lnet_seq_t eq_enq_seq; lnet_seq_t eq_enq_seq;
lnet_seq_t eq_deq_seq; lnet_seq_t eq_deq_seq;
unsigned int eq_size; unsigned int eq_size;
...@@ -129,7 +129,7 @@ typedef struct lnet_eq { ...@@ -129,7 +129,7 @@ typedef struct lnet_eq {
typedef struct lnet_me { typedef struct lnet_me {
struct list_head me_list; struct list_head me_list;
lnet_libhandle_t me_lh; struct lnet_libhandle me_lh;
lnet_process_id_t me_match_id; lnet_process_id_t me_match_id;
unsigned int me_portal; unsigned int me_portal;
unsigned int me_pos; /* hash offset in mt_hash */ unsigned int me_pos; /* hash offset in mt_hash */
...@@ -141,7 +141,7 @@ typedef struct lnet_me { ...@@ -141,7 +141,7 @@ typedef struct lnet_me {
typedef struct lnet_libmd { typedef struct lnet_libmd {
struct list_head md_list; struct list_head md_list;
lnet_libhandle_t md_lh; struct lnet_libhandle md_lh;
lnet_me_t *md_me; lnet_me_t *md_me;
char *md_start; char *md_start;
unsigned int md_offset; unsigned int md_offset;
......
...@@ -483,12 +483,12 @@ lnet_res_containers_create(int type) ...@@ -483,12 +483,12 @@ lnet_res_containers_create(int type)
return recs; return recs;
} }
lnet_libhandle_t * struct lnet_libhandle *
lnet_res_lh_lookup(struct lnet_res_container *rec, __u64 cookie) lnet_res_lh_lookup(struct lnet_res_container *rec, __u64 cookie)
{ {
/* ALWAYS called with lnet_res_lock held */ /* ALWAYS called with lnet_res_lock held */
struct list_head *head; struct list_head *head;
lnet_libhandle_t *lh; struct lnet_libhandle *lh;
unsigned int hash; unsigned int hash;
if ((cookie & LNET_COOKIE_MASK) != rec->rec_type) if ((cookie & LNET_COOKIE_MASK) != rec->rec_type)
...@@ -506,7 +506,8 @@ lnet_res_lh_lookup(struct lnet_res_container *rec, __u64 cookie) ...@@ -506,7 +506,8 @@ lnet_res_lh_lookup(struct lnet_res_container *rec, __u64 cookie)
} }
void void
lnet_res_lh_initialize(struct lnet_res_container *rec, lnet_libhandle_t *lh) lnet_res_lh_initialize(struct lnet_res_container *rec,
struct lnet_libhandle *lh)
{ {
/* ALWAYS called with lnet_res_lock held */ /* ALWAYS called with lnet_res_lock held */
unsigned int ibits = LNET_COOKIE_TYPE_BITS + LNET_CPT_BITS; unsigned int ibits = LNET_COOKIE_TYPE_BITS + LNET_CPT_BITS;
......
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