Commit 96e78422 authored by James Simmons's avatar James Simmons Committed by Greg Kroah-Hartman

staging: lustre: lnet: change lnet_eq_t to proper structure

Change lnet_eq_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 3589a055
...@@ -178,17 +178,17 @@ lnet_net_lock_current(void) ...@@ -178,17 +178,17 @@ lnet_net_lock_current(void)
#define MAX_PORTALS 64 #define MAX_PORTALS 64
static inline lnet_eq_t * static inline struct lnet_eq *
lnet_eq_alloc(void) lnet_eq_alloc(void)
{ {
lnet_eq_t *eq; struct lnet_eq *eq;
LIBCFS_ALLOC(eq, sizeof(*eq)); LIBCFS_ALLOC(eq, sizeof(*eq));
return eq; return eq;
} }
static inline void static inline void
lnet_eq_free(lnet_eq_t *eq) lnet_eq_free(struct lnet_eq *eq)
{ {
LIBCFS_FREE(eq, sizeof(*eq)); LIBCFS_FREE(eq, sizeof(*eq));
} }
...@@ -278,7 +278,7 @@ lnet_res_lh_invalidate(struct lnet_libhandle *lh) ...@@ -278,7 +278,7 @@ lnet_res_lh_invalidate(struct lnet_libhandle *lh)
} }
static inline void static inline void
lnet_eq2handle(struct lnet_handle_eq *handle, lnet_eq_t *eq) lnet_eq2handle(struct lnet_handle_eq *handle, struct lnet_eq *eq)
{ {
if (!eq) { if (!eq) {
LNetInvalidateEQHandle(handle); LNetInvalidateEQHandle(handle);
...@@ -288,7 +288,7 @@ lnet_eq2handle(struct lnet_handle_eq *handle, lnet_eq_t *eq) ...@@ -288,7 +288,7 @@ lnet_eq2handle(struct lnet_handle_eq *handle, lnet_eq_t *eq)
handle->cookie = eq->eq_lh.lh_cookie; handle->cookie = eq->eq_lh.lh_cookie;
} }
static inline lnet_eq_t * static inline struct lnet_eq *
lnet_handle2eq(struct lnet_handle_eq *handle) lnet_handle2eq(struct lnet_handle_eq *handle)
{ {
struct lnet_libhandle *lh; struct lnet_libhandle *lh;
...@@ -297,7 +297,7 @@ lnet_handle2eq(struct lnet_handle_eq *handle) ...@@ -297,7 +297,7 @@ lnet_handle2eq(struct lnet_handle_eq *handle)
if (!lh) if (!lh)
return NULL; return NULL;
return lh_entry(lh, lnet_eq_t, eq_lh); return lh_entry(lh, struct lnet_eq, eq_lh);
} }
static inline void static inline void
...@@ -490,7 +490,7 @@ void lnet_build_msg_event(struct lnet_msg *msg, lnet_event_kind_t ev_type); ...@@ -490,7 +490,7 @@ void lnet_build_msg_event(struct lnet_msg *msg, lnet_event_kind_t ev_type);
void lnet_msg_commit(struct lnet_msg *msg, int cpt); void lnet_msg_commit(struct lnet_msg *msg, int cpt);
void lnet_msg_decommit(struct lnet_msg *msg, int cpt, int status); void lnet_msg_decommit(struct lnet_msg *msg, int cpt, int status);
void lnet_eq_enqueue_event(lnet_eq_t *eq, lnet_event_t *ev); void lnet_eq_enqueue_event(struct lnet_eq *eq, lnet_event_t *ev);
void lnet_prep_send(struct lnet_msg *msg, int type, lnet_process_id_t target, void lnet_prep_send(struct lnet_msg *msg, int type, lnet_process_id_t target,
unsigned int offset, unsigned int len); unsigned int offset, unsigned int len);
int lnet_send(lnet_nid_t nid, struct lnet_msg *msg, lnet_nid_t rtr_nid); int lnet_send(lnet_nid_t nid, struct lnet_msg *msg, lnet_nid_t rtr_nid);
......
...@@ -116,7 +116,7 @@ struct lnet_libhandle { ...@@ -116,7 +116,7 @@ struct lnet_libhandle {
#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 { struct lnet_eq {
struct list_head eq_list; struct list_head eq_list;
struct lnet_libhandle eq_lh; struct lnet_libhandle eq_lh;
lnet_seq_t eq_enq_seq; lnet_seq_t eq_enq_seq;
...@@ -125,7 +125,7 @@ typedef struct lnet_eq { ...@@ -125,7 +125,7 @@ typedef struct lnet_eq {
lnet_eq_handler_t eq_callback; lnet_eq_handler_t eq_callback;
lnet_event_t *eq_events; lnet_event_t *eq_events;
int **eq_refs; /* percpt refcount for EQ */ int **eq_refs; /* percpt refcount for EQ */
} lnet_eq_t; };
typedef struct lnet_me { typedef struct lnet_me {
struct list_head me_list; struct list_head me_list;
...@@ -152,7 +152,7 @@ typedef struct lnet_libmd { ...@@ -152,7 +152,7 @@ typedef struct lnet_libmd {
unsigned int md_options; unsigned int md_options;
unsigned int md_flags; unsigned int md_flags;
void *md_user_ptr; void *md_user_ptr;
lnet_eq_t *md_eq; struct lnet_eq *md_eq;
unsigned int md_niov; /* # frags */ unsigned int md_niov; /* # frags */
union { union {
struct kvec iov[LNET_MAX_IOV]; struct kvec iov[LNET_MAX_IOV];
......
...@@ -383,7 +383,7 @@ lnet_res_container_cleanup(struct lnet_res_container *rec) ...@@ -383,7 +383,7 @@ lnet_res_container_cleanup(struct lnet_res_container *rec)
list_del_init(e); list_del_init(e);
if (rec->rec_type == LNET_COOKIE_TYPE_EQ) { if (rec->rec_type == LNET_COOKIE_TYPE_EQ) {
lnet_eq_free(list_entry(e, lnet_eq_t, eq_list)); lnet_eq_free(list_entry(e, struct lnet_eq, eq_list));
} else if (rec->rec_type == LNET_COOKIE_TYPE_MD) { } else if (rec->rec_type == LNET_COOKIE_TYPE_MD) {
lnet_md_free(list_entry(e, lnet_libmd_t, md_list)); lnet_md_free(list_entry(e, lnet_libmd_t, md_list));
......
...@@ -66,7 +66,7 @@ int ...@@ -66,7 +66,7 @@ int
LNetEQAlloc(unsigned int count, lnet_eq_handler_t callback, LNetEQAlloc(unsigned int count, lnet_eq_handler_t callback,
struct lnet_handle_eq *handle) struct lnet_handle_eq *handle)
{ {
lnet_eq_t *eq; struct lnet_eq *eq;
LASSERT(the_lnet.ln_refcount > 0); LASSERT(the_lnet.ln_refcount > 0);
...@@ -210,7 +210,7 @@ LNetEQFree(struct lnet_handle_eq eqh) ...@@ -210,7 +210,7 @@ LNetEQFree(struct lnet_handle_eq eqh)
EXPORT_SYMBOL(LNetEQFree); EXPORT_SYMBOL(LNetEQFree);
void void
lnet_eq_enqueue_event(lnet_eq_t *eq, lnet_event_t *ev) lnet_eq_enqueue_event(struct lnet_eq *eq, lnet_event_t *ev)
{ {
/* MUST called with resource lock hold but w/o lnet_eq_wait_lock */ /* MUST called with resource lock hold but w/o lnet_eq_wait_lock */
int index; int index;
...@@ -239,7 +239,7 @@ lnet_eq_enqueue_event(lnet_eq_t *eq, lnet_event_t *ev) ...@@ -239,7 +239,7 @@ lnet_eq_enqueue_event(lnet_eq_t *eq, lnet_event_t *ev)
} }
static int static int
lnet_eq_dequeue_event(lnet_eq_t *eq, lnet_event_t *ev) lnet_eq_dequeue_event(struct lnet_eq *eq, lnet_event_t *ev)
{ {
int new_index = eq->eq_deq_seq & (eq->eq_size - 1); int new_index = eq->eq_deq_seq & (eq->eq_size - 1);
lnet_event_t *new_event = &eq->eq_events[new_index]; lnet_event_t *new_event = &eq->eq_events[new_index];
...@@ -386,7 +386,7 @@ LNetEQPoll(struct lnet_handle_eq *eventqs, int neq, int timeout_ms, ...@@ -386,7 +386,7 @@ LNetEQPoll(struct lnet_handle_eq *eventqs, int neq, int timeout_ms,
for (;;) { for (;;) {
for (i = 0; i < neq; i++) { for (i = 0; i < neq; i++) {
lnet_eq_t *eq = lnet_handle2eq(&eventqs[i]); struct lnet_eq *eq = lnet_handle2eq(&eventqs[i]);
if (!eq) { if (!eq) {
lnet_eq_wait_unlock(); lnet_eq_wait_unlock();
......
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