Commit 16b9ab7f authored by James Simmons's avatar James Simmons Committed by Greg Kroah-Hartman

staging: lustre: lnet: change lnet_event_t to proper structure

Change lnet_event_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 ef391eac
...@@ -148,7 +148,7 @@ int LNetMDUnlink(struct lnet_handle_md md_in); ...@@ -148,7 +148,7 @@ int LNetMDUnlink(struct lnet_handle_md md_in);
* *
* In addition to the lnet_handle_eq, the LNet API defines two types * In addition to the lnet_handle_eq, the LNet API defines two types
* associated with events: The ::lnet_event_kind_t defines the kinds of events * associated with events: The ::lnet_event_kind_t defines the kinds of events
* that can be stored in an EQ. The lnet_event_t defines a structure that * that can be stored in an EQ. The lnet_event defines a structure that
* holds the information about with an event. * holds the information about with an event.
* *
* There are five functions for dealing with EQs: LNetEQAlloc() is used to * There are five functions for dealing with EQs: LNetEQAlloc() is used to
...@@ -168,7 +168,7 @@ int LNetEQFree(struct lnet_handle_eq eventq_in); ...@@ -168,7 +168,7 @@ int LNetEQFree(struct lnet_handle_eq eventq_in);
int LNetEQPoll(struct lnet_handle_eq *eventqs_in, int LNetEQPoll(struct lnet_handle_eq *eventqs_in,
int neq_in, int neq_in,
int timeout_ms, int timeout_ms,
lnet_event_t *event_out, struct lnet_event *event_out,
int *which_eq_out); int *which_eq_out);
/** @} lnet_eq */ /** @} lnet_eq */
......
...@@ -485,12 +485,12 @@ int lnet_islocalnet(__u32 net); ...@@ -485,12 +485,12 @@ int lnet_islocalnet(__u32 net);
void lnet_msg_attach_md(struct lnet_msg *msg, struct lnet_libmd *md, void lnet_msg_attach_md(struct lnet_msg *msg, struct lnet_libmd *md,
unsigned int offset, unsigned int mlen); unsigned int offset, unsigned int mlen);
void lnet_msg_detach_md(struct lnet_msg *msg, int status); void lnet_msg_detach_md(struct lnet_msg *msg, int status);
void lnet_build_unlink_event(struct lnet_libmd *md, lnet_event_t *ev); void lnet_build_unlink_event(struct lnet_libmd *md, struct lnet_event *ev);
void lnet_build_msg_event(struct lnet_msg *msg, lnet_event_kind_t ev_type); 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(struct lnet_eq *eq, lnet_event_t *ev); void lnet_eq_enqueue_event(struct lnet_eq *eq, struct lnet_event *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);
......
...@@ -104,7 +104,7 @@ struct lnet_msg { ...@@ -104,7 +104,7 @@ struct lnet_msg {
struct kvec *msg_iov; struct kvec *msg_iov;
lnet_kiov_t *msg_kiov; lnet_kiov_t *msg_kiov;
lnet_event_t msg_ev; struct lnet_event msg_ev;
struct lnet_hdr msg_hdr; struct lnet_hdr msg_hdr;
}; };
...@@ -123,7 +123,7 @@ struct lnet_eq { ...@@ -123,7 +123,7 @@ struct lnet_eq {
lnet_seq_t eq_deq_seq; lnet_seq_t eq_deq_seq;
unsigned int eq_size; unsigned int eq_size;
lnet_eq_handler_t eq_callback; lnet_eq_handler_t eq_callback;
lnet_event_t *eq_events; struct lnet_event *eq_events;
int **eq_refs; /* percpt refcount for EQ */ int **eq_refs; /* percpt refcount for EQ */
}; };
......
...@@ -568,7 +568,7 @@ typedef unsigned LNET_SEQ_BASETYPE lnet_seq_t; ...@@ -568,7 +568,7 @@ typedef unsigned LNET_SEQ_BASETYPE lnet_seq_t;
/** /**
* Information about an event on a MD. * Information about an event on a MD.
*/ */
typedef struct { struct lnet_event {
/** The identifier (nid, pid) of the target. */ /** The identifier (nid, pid) of the target. */
lnet_process_id_t target; lnet_process_id_t target;
/** The identifier (nid, pid) of the initiator. */ /** The identifier (nid, pid) of the initiator. */
...@@ -635,7 +635,7 @@ typedef struct { ...@@ -635,7 +635,7 @@ typedef struct {
* to each event. * to each event.
*/ */
volatile lnet_seq_t sequence; volatile lnet_seq_t sequence;
} lnet_event_t; };
/** /**
* Event queue handler function type. * Event queue handler function type.
...@@ -647,7 +647,7 @@ typedef struct { ...@@ -647,7 +647,7 @@ typedef struct {
* The handler must not block, must be reentrant, and must not call any LNet * The handler must not block, must be reentrant, and must not call any LNet
* API functions. It should return as quickly as possible. * API functions. It should return as quickly as possible.
*/ */
typedef void (*lnet_eq_handler_t)(lnet_event_t *event); typedef void (*lnet_eq_handler_t)(struct lnet_event *event);
#define LNET_EQ_HANDLER_NONE NULL #define LNET_EQ_HANDLER_NONE NULL
/** @} lnet_eq */ /** @} lnet_eq */
......
...@@ -888,7 +888,7 @@ lnet_ping_info_destroy(void) ...@@ -888,7 +888,7 @@ lnet_ping_info_destroy(void)
} }
static void static void
lnet_ping_event_handler(lnet_event_t *event) lnet_ping_event_handler(struct lnet_event *event)
{ {
struct lnet_ping_info *pinfo = event->md.user_ptr; struct lnet_ping_info *pinfo = event->md.user_ptr;
...@@ -2133,7 +2133,7 @@ static int lnet_ping(lnet_process_id_t id, int timeout_ms, ...@@ -2133,7 +2133,7 @@ static int lnet_ping(lnet_process_id_t id, int timeout_ms,
{ {
struct lnet_handle_eq eqh; struct lnet_handle_eq eqh;
struct lnet_handle_md mdh; struct lnet_handle_md mdh;
lnet_event_t event; struct lnet_event event;
struct lnet_md md = { NULL }; struct lnet_md md = { NULL };
int which; int which;
int unlinked = 0; int unlinked = 0;
......
...@@ -93,7 +93,7 @@ LNetEQAlloc(unsigned int count, lnet_eq_handler_t callback, ...@@ -93,7 +93,7 @@ LNetEQAlloc(unsigned int count, lnet_eq_handler_t callback,
return -ENOMEM; return -ENOMEM;
if (count) { if (count) {
LIBCFS_ALLOC(eq->eq_events, count * sizeof(lnet_event_t)); LIBCFS_ALLOC(eq->eq_events, count * sizeof(struct lnet_event));
if (!eq->eq_events) if (!eq->eq_events)
goto failed; goto failed;
/* /*
...@@ -131,7 +131,7 @@ LNetEQAlloc(unsigned int count, lnet_eq_handler_t callback, ...@@ -131,7 +131,7 @@ LNetEQAlloc(unsigned int count, lnet_eq_handler_t callback,
failed: failed:
if (eq->eq_events) if (eq->eq_events)
LIBCFS_FREE(eq->eq_events, count * sizeof(lnet_event_t)); LIBCFS_FREE(eq->eq_events, count * sizeof(struct lnet_event));
if (eq->eq_refs) if (eq->eq_refs)
cfs_percpt_free(eq->eq_refs); cfs_percpt_free(eq->eq_refs);
...@@ -155,7 +155,7 @@ int ...@@ -155,7 +155,7 @@ int
LNetEQFree(struct lnet_handle_eq eqh) LNetEQFree(struct lnet_handle_eq eqh)
{ {
struct lnet_eq *eq; struct lnet_eq *eq;
lnet_event_t *events = NULL; struct lnet_event *events = NULL;
int **refs = NULL; int **refs = NULL;
int *ref; int *ref;
int rc = 0; int rc = 0;
...@@ -201,7 +201,7 @@ LNetEQFree(struct lnet_handle_eq eqh) ...@@ -201,7 +201,7 @@ LNetEQFree(struct lnet_handle_eq eqh)
lnet_res_unlock(LNET_LOCK_EX); lnet_res_unlock(LNET_LOCK_EX);
if (events) if (events)
LIBCFS_FREE(events, size * sizeof(lnet_event_t)); LIBCFS_FREE(events, size * sizeof(struct lnet_event));
if (refs) if (refs)
cfs_percpt_free(refs); cfs_percpt_free(refs);
...@@ -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(struct lnet_eq *eq, lnet_event_t *ev) lnet_eq_enqueue_event(struct lnet_eq *eq, struct lnet_event *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,10 +239,10 @@ lnet_eq_enqueue_event(struct lnet_eq *eq, lnet_event_t *ev) ...@@ -239,10 +239,10 @@ lnet_eq_enqueue_event(struct lnet_eq *eq, lnet_event_t *ev)
} }
static int static int
lnet_eq_dequeue_event(struct lnet_eq *eq, lnet_event_t *ev) lnet_eq_dequeue_event(struct lnet_eq *eq, struct lnet_event *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]; struct lnet_event *new_event = &eq->eq_events[new_index];
int rc; int rc;
/* must called with lnet_eq_wait_lock hold */ /* must called with lnet_eq_wait_lock hold */
...@@ -371,7 +371,7 @@ __must_hold(&the_lnet.ln_eq_wait_lock) ...@@ -371,7 +371,7 @@ __must_hold(&the_lnet.ln_eq_wait_lock)
*/ */
int int
LNetEQPoll(struct lnet_handle_eq *eventqs, int neq, int timeout_ms, LNetEQPoll(struct lnet_handle_eq *eventqs, int neq, int timeout_ms,
lnet_event_t *event, int *which) struct lnet_event *event, int *which)
{ {
int wait = 1; int wait = 1;
int rc; int rc;
......
...@@ -428,7 +428,7 @@ EXPORT_SYMBOL(LNetMDBind); ...@@ -428,7 +428,7 @@ EXPORT_SYMBOL(LNetMDBind);
int int
LNetMDUnlink(struct lnet_handle_md mdh) LNetMDUnlink(struct lnet_handle_md mdh)
{ {
lnet_event_t ev; struct lnet_event ev;
struct lnet_libmd *md; struct lnet_libmd *md;
int cpt; int cpt;
......
...@@ -224,7 +224,7 @@ LNetMEUnlink(struct lnet_handle_me meh) ...@@ -224,7 +224,7 @@ LNetMEUnlink(struct lnet_handle_me meh)
{ {
struct lnet_me *me; struct lnet_me *me;
struct lnet_libmd *md; struct lnet_libmd *md;
lnet_event_t ev; struct lnet_event ev;
int cpt; int cpt;
LASSERT(the_lnet.ln_refcount > 0); LASSERT(the_lnet.ln_refcount > 0);
......
...@@ -1987,7 +1987,7 @@ lnet_recv_delayed_msg_list(struct list_head *head) ...@@ -1987,7 +1987,7 @@ lnet_recv_delayed_msg_list(struct list_head *head)
* \retval -ENOMEM Memory allocation failure. * \retval -ENOMEM Memory allocation failure.
* \retval -ENOENT Invalid MD object. * \retval -ENOENT Invalid MD object.
* *
* \see lnet_event_t::hdr_data and lnet_event_kind_t. * \see lnet_event::hdr_data and lnet_event_kind_t.
*/ */
int int
LNetPut(lnet_nid_t self, struct lnet_handle_md mdh, lnet_ack_req_t ack, LNetPut(lnet_nid_t self, struct lnet_handle_md mdh, lnet_ack_req_t ack,
......
...@@ -39,7 +39,7 @@ ...@@ -39,7 +39,7 @@
#include "../../include/linux/lnet/lib-lnet.h" #include "../../include/linux/lnet/lib-lnet.h"
void void
lnet_build_unlink_event(struct lnet_libmd *md, lnet_event_t *ev) lnet_build_unlink_event(struct lnet_libmd *md, struct lnet_event *ev)
{ {
memset(ev, 0, sizeof(*ev)); memset(ev, 0, sizeof(*ev));
...@@ -57,7 +57,7 @@ void ...@@ -57,7 +57,7 @@ void
lnet_build_msg_event(struct lnet_msg *msg, lnet_event_kind_t ev_type) lnet_build_msg_event(struct lnet_msg *msg, lnet_event_kind_t ev_type)
{ {
struct lnet_hdr *hdr = &msg->msg_hdr; struct lnet_hdr *hdr = &msg->msg_hdr;
lnet_event_t *ev = &msg->msg_ev; struct lnet_event *ev = &msg->msg_ev;
LASSERT(!msg->msg_routing); LASSERT(!msg->msg_routing);
...@@ -165,7 +165,7 @@ static void ...@@ -165,7 +165,7 @@ static void
lnet_msg_decommit_tx(struct lnet_msg *msg, int status) lnet_msg_decommit_tx(struct lnet_msg *msg, int status)
{ {
struct lnet_counters *counters; struct lnet_counters *counters;
lnet_event_t *ev = &msg->msg_ev; struct lnet_event *ev = &msg->msg_ev;
LASSERT(msg->msg_tx_committed); LASSERT(msg->msg_tx_committed);
if (status) if (status)
...@@ -217,7 +217,7 @@ static void ...@@ -217,7 +217,7 @@ static void
lnet_msg_decommit_rx(struct lnet_msg *msg, int status) lnet_msg_decommit_rx(struct lnet_msg *msg, int status)
{ {
struct lnet_counters *counters; struct lnet_counters *counters;
lnet_event_t *ev = &msg->msg_ev; struct lnet_event *ev = &msg->msg_ev;
LASSERT(!msg->msg_tx_committed); /* decommitted or never committed */ LASSERT(!msg->msg_tx_committed); /* decommitted or never committed */
LASSERT(msg->msg_rx_committed); LASSERT(msg->msg_rx_committed);
......
...@@ -733,7 +733,7 @@ lnet_parse_rc_info(struct lnet_rc_data *rcd) ...@@ -733,7 +733,7 @@ lnet_parse_rc_info(struct lnet_rc_data *rcd)
} }
static void static void
lnet_router_checker_event(lnet_event_t *event) lnet_router_checker_event(struct lnet_event *event)
{ {
struct lnet_rc_data *rcd = event->md.user_ptr; struct lnet_rc_data *rcd = event->md.user_ptr;
struct lnet_peer *lp; struct lnet_peer *lp;
......
...@@ -1408,7 +1408,7 @@ srpc_send_reply(struct srpc_server_rpc *rpc) ...@@ -1408,7 +1408,7 @@ srpc_send_reply(struct srpc_server_rpc *rpc)
/* when in kernel always called with LNET_LOCK() held, and in thread context */ /* when in kernel always called with LNET_LOCK() held, and in thread context */
static void static void
srpc_lnet_ev_handler(lnet_event_t *ev) srpc_lnet_ev_handler(struct lnet_event *ev)
{ {
struct srpc_service_cd *scd; struct srpc_service_cd *scd;
struct srpc_event *rpcev = ev->md.user_ptr; struct srpc_event *rpcev = ev->md.user_ptr;
......
...@@ -400,7 +400,7 @@ struct ptlrpc_service; ...@@ -400,7 +400,7 @@ struct ptlrpc_service;
* ptlrpc callback & work item stuff * ptlrpc callback & work item stuff
*/ */
struct ptlrpc_cb_id { struct ptlrpc_cb_id {
void (*cbid_fn)(lnet_event_t *ev); /* specific callback fn */ void (*cbid_fn)(struct lnet_event *ev); /* specific callback fn */
void *cbid_arg; /* additional arg */ void *cbid_arg; /* additional arg */
}; };
...@@ -1757,11 +1757,11 @@ int ptlrpc_uuid_to_peer(struct obd_uuid *uuid, ...@@ -1757,11 +1757,11 @@ int ptlrpc_uuid_to_peer(struct obd_uuid *uuid,
* underlying buffer * underlying buffer
* @{ * @{
*/ */
void request_out_callback(lnet_event_t *ev); void request_out_callback(struct lnet_event *ev);
void reply_in_callback(lnet_event_t *ev); void reply_in_callback(struct lnet_event *ev);
void client_bulk_callback(lnet_event_t *ev); void client_bulk_callback(struct lnet_event *ev);
void request_in_callback(lnet_event_t *ev); void request_in_callback(struct lnet_event *ev);
void reply_out_callback(lnet_event_t *ev); void reply_out_callback(struct lnet_event *ev);
/** @} */ /** @} */
/* ptlrpc/connection.c */ /* ptlrpc/connection.c */
......
...@@ -47,7 +47,7 @@ struct lnet_handle_eq ptlrpc_eq_h; ...@@ -47,7 +47,7 @@ struct lnet_handle_eq ptlrpc_eq_h;
/* /*
* Client's outgoing request callback * Client's outgoing request callback
*/ */
void request_out_callback(lnet_event_t *ev) void request_out_callback(struct lnet_event *ev)
{ {
struct ptlrpc_cb_id *cbid = ev->md.user_ptr; struct ptlrpc_cb_id *cbid = ev->md.user_ptr;
struct ptlrpc_request *req = cbid->cbid_arg; struct ptlrpc_request *req = cbid->cbid_arg;
...@@ -86,7 +86,7 @@ void request_out_callback(lnet_event_t *ev) ...@@ -86,7 +86,7 @@ void request_out_callback(lnet_event_t *ev)
/* /*
* Client's incoming reply callback * Client's incoming reply callback
*/ */
void reply_in_callback(lnet_event_t *ev) void reply_in_callback(struct lnet_event *ev)
{ {
struct ptlrpc_cb_id *cbid = ev->md.user_ptr; struct ptlrpc_cb_id *cbid = ev->md.user_ptr;
struct ptlrpc_request *req = cbid->cbid_arg; struct ptlrpc_request *req = cbid->cbid_arg;
...@@ -176,7 +176,7 @@ void reply_in_callback(lnet_event_t *ev) ...@@ -176,7 +176,7 @@ void reply_in_callback(lnet_event_t *ev)
/* /*
* Client's bulk has been written/read * Client's bulk has been written/read
*/ */
void client_bulk_callback(lnet_event_t *ev) void client_bulk_callback(struct lnet_event *ev)
{ {
struct ptlrpc_cb_id *cbid = ev->md.user_ptr; struct ptlrpc_cb_id *cbid = ev->md.user_ptr;
struct ptlrpc_bulk_desc *desc = cbid->cbid_arg; struct ptlrpc_bulk_desc *desc = cbid->cbid_arg;
...@@ -289,7 +289,7 @@ static void ptlrpc_req_add_history(struct ptlrpc_service_part *svcpt, ...@@ -289,7 +289,7 @@ static void ptlrpc_req_add_history(struct ptlrpc_service_part *svcpt,
/* /*
* Server's incoming request callback * Server's incoming request callback
*/ */
void request_in_callback(lnet_event_t *ev) void request_in_callback(struct lnet_event *ev)
{ {
struct ptlrpc_cb_id *cbid = ev->md.user_ptr; struct ptlrpc_cb_id *cbid = ev->md.user_ptr;
struct ptlrpc_request_buffer_desc *rqbd = cbid->cbid_arg; struct ptlrpc_request_buffer_desc *rqbd = cbid->cbid_arg;
...@@ -389,7 +389,7 @@ void request_in_callback(lnet_event_t *ev) ...@@ -389,7 +389,7 @@ void request_in_callback(lnet_event_t *ev)
/* /*
* Server's outgoing reply callback * Server's outgoing reply callback
*/ */
void reply_out_callback(lnet_event_t *ev) void reply_out_callback(struct lnet_event *ev)
{ {
struct ptlrpc_cb_id *cbid = ev->md.user_ptr; struct ptlrpc_cb_id *cbid = ev->md.user_ptr;
struct ptlrpc_reply_state *rs = cbid->cbid_arg; struct ptlrpc_reply_state *rs = cbid->cbid_arg;
...@@ -429,10 +429,10 @@ void reply_out_callback(lnet_event_t *ev) ...@@ -429,10 +429,10 @@ void reply_out_callback(lnet_event_t *ev)
} }
} }
static void ptlrpc_master_callback(lnet_event_t *ev) static void ptlrpc_master_callback(struct lnet_event *ev)
{ {
struct ptlrpc_cb_id *cbid = ev->md.user_ptr; struct ptlrpc_cb_id *cbid = ev->md.user_ptr;
void (*callback)(lnet_event_t *ev) = cbid->cbid_fn; void (*callback)(struct lnet_event *ev) = cbid->cbid_fn;
/* Honestly, it's best to find out early. */ /* Honestly, it's best to find out early. */
LASSERT(cbid->cbid_arg != LP_POISON); LASSERT(cbid->cbid_arg != LP_POISON);
......
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