diff options
Diffstat (limited to 'drivers/staging/lustre/include/linux/lnet')
4 files changed, 32 insertions, 11 deletions
diff --git a/drivers/staging/lustre/include/linux/lnet/api.h b/drivers/staging/lustre/include/linux/lnet/api.h index cb0d6b481455..1db4e0003462 100644 --- a/drivers/staging/lustre/include/linux/lnet/api.h +++ b/drivers/staging/lustre/include/linux/lnet/api.h @@ -147,7 +147,7 @@ int LNetMDUnlink(lnet_handle_md_t md_in); * associated with it. If an event handler exists, it will be run for each * event that is deposited into the EQ. * - * In addition to the lnet_handle_eq_t, 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 * that can be stored in an EQ. The lnet_event_t defines a structure that * holds the information about with an event. @@ -162,11 +162,11 @@ int LNetMDUnlink(lnet_handle_md_t md_in); */ int LNetEQAlloc(unsigned int count_in, lnet_eq_handler_t handler, - lnet_handle_eq_t *handle_out); + struct lnet_handle_eq *handle_out); -int LNetEQFree(lnet_handle_eq_t eventq_in); +int LNetEQFree(struct lnet_handle_eq eventq_in); -int LNetEQPoll(lnet_handle_eq_t *eventqs_in, +int LNetEQPoll(struct lnet_handle_eq *eventqs_in, int neq_in, int timeout_ms, lnet_event_t *event_out, diff --git a/drivers/staging/lustre/include/linux/lnet/lib-lnet.h b/drivers/staging/lustre/include/linux/lnet/lib-lnet.h index 3d19402ba728..808d886e9815 100644 --- a/drivers/staging/lustre/include/linux/lnet/lib-lnet.h +++ b/drivers/staging/lustre/include/linux/lnet/lib-lnet.h @@ -278,10 +278,10 @@ lnet_res_lh_invalidate(lnet_libhandle_t *lh) } static inline void -lnet_eq2handle(lnet_handle_eq_t *handle, lnet_eq_t *eq) +lnet_eq2handle(struct lnet_handle_eq *handle, lnet_eq_t *eq) { if (!eq) { - LNetInvalidateHandle(handle); + LNetInvalidateEQHandle(handle); return; } @@ -289,7 +289,7 @@ lnet_eq2handle(lnet_handle_eq_t *handle, lnet_eq_t *eq) } static inline lnet_eq_t * -lnet_handle2eq(lnet_handle_eq_t *handle) +lnet_handle2eq(struct lnet_handle_eq *handle) { lnet_libhandle_t *lh; diff --git a/drivers/staging/lustre/include/linux/lnet/lib-types.h b/drivers/staging/lustre/include/linux/lnet/lib-types.h index 9850398bf29a..199e194669f8 100644 --- a/drivers/staging/lustre/include/linux/lnet/lib-types.h +++ b/drivers/staging/lustre/include/linux/lnet/lib-types.h @@ -598,13 +598,13 @@ typedef struct { lnet_rtrbufpool_t **ln_rtrpools; lnet_handle_md_t ln_ping_target_md; - lnet_handle_eq_t ln_ping_target_eq; + struct lnet_handle_eq ln_ping_target_eq; struct lnet_ping_info *ln_ping_info; /* router checker startup/shutdown state */ int ln_rc_state; /* router checker's event queue */ - lnet_handle_eq_t ln_rc_eqh; + struct lnet_handle_eq ln_rc_eqh; /* rcd still pending on net */ struct list_head ln_rcd_deathrow; /* rcd ready for free */ diff --git a/drivers/staging/lustre/include/linux/lnet/types.h b/drivers/staging/lustre/include/linux/lnet/types.h index 1c8de72e6d6b..ebf87cd65ef4 100644 --- a/drivers/staging/lustre/include/linux/lnet/types.h +++ b/drivers/staging/lustre/include/linux/lnet/types.h @@ -284,7 +284,6 @@ typedef struct { __u64 cookie; } lnet_handle_any_t; -typedef lnet_handle_any_t lnet_handle_eq_t; typedef lnet_handle_any_t lnet_handle_md_t; typedef lnet_handle_any_t lnet_handle_me_t; @@ -318,6 +317,28 @@ static inline int LNetHandleIsInvalid(lnet_handle_any_t h) return h.cookie == LNET_WIRE_HANDLE_COOKIE_NONE; } +struct lnet_handle_eq { + u64 cookie; +}; + +/** + * Invalidate eq handle @h. + */ +static inline void LNetInvalidateEQHandle(struct lnet_handle_eq *h) +{ + h->cookie = LNET_WIRE_HANDLE_COOKIE_NONE; +} + +/** + * Check whether eq handle @h is invalid. + * + * @return 1 if handle is invalid, 0 if valid. + */ +static inline int LNetEQHandleIsInvalid(struct lnet_handle_eq h) +{ + return (LNET_WIRE_HANDLE_COOKIE_NONE == h.cookie); +} + /** * Global process ID. */ @@ -461,7 +482,7 @@ typedef struct { * by LNetInvalidateHandle()), operations performed on this memory * descriptor are not logged. */ - lnet_handle_eq_t eq_handle; + struct lnet_handle_eq eq_handle; } lnet_md_t; /* |