Commit 971175cc authored by James Simmons's avatar James Simmons Committed by Greg Kroah-Hartman

staging: lustre: lnet: remove generic lnet_handle_any_t

With the creation of unique handlers we can remove the
barely used generic handlers.
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 17588810
......@@ -76,7 +76,6 @@ int LNetNIFini(void);
*/
int LNetGetId(unsigned int index, lnet_process_id_t *id);
int LNetDist(lnet_nid_t nid, lnet_nid_t *srcnid, __u32 *order);
void LNetSnprintHandle(char *str, int str_len, lnet_handle_any_t handle);
/** @} lnet_addr */
......
......@@ -272,48 +272,13 @@ typedef struct lnet_counters {
/**
* Objects maintained by the LNet are accessed through handles. Handle types
* have names of the form lnet_handle_xx_t, where xx is one of the two letter
* have names of the form lnet_handle_xx, where xx is one of the two letter
* object type codes ('eq' for event queue, 'md' for memory descriptor, and
* 'me' for match entry).
* Each type of object is given a unique handle type to enhance type checking.
* The type lnet_handle_any_t can be used when a generic handle is needed.
* Every handle value can be converted into a value of type lnet_handle_any_t
* without loss of information.
* 'me' for match entry). Each type of object is given a unique handle type
* to enhance type checking.
*/
typedef struct {
__u64 cookie;
} lnet_handle_any_t;
#define LNET_WIRE_HANDLE_COOKIE_NONE (-1)
/**
* Invalidate handle \a h.
*/
static inline void LNetInvalidateHandle(lnet_handle_any_t *h)
{
h->cookie = LNET_WIRE_HANDLE_COOKIE_NONE;
}
/**
* Compare handles \a h1 and \a h2.
*
* \return 1 if handles are equal, 0 if otherwise.
*/
static inline int LNetHandleIsEqual(lnet_handle_any_t h1, lnet_handle_any_t h2)
{
return h1.cookie == h2.cookie;
}
/**
* Check whether handle \a h is invalid.
*
* \return 1 if handle is invalid, 0 if valid.
*/
static inline int LNetHandleIsInvalid(lnet_handle_any_t h)
{
return h.cookie == LNET_WIRE_HANDLE_COOKIE_NONE;
}
struct lnet_handle_eq {
u64 cookie;
};
......
......@@ -2127,17 +2127,6 @@ LNetGetId(unsigned int index, lnet_process_id_t *id)
}
EXPORT_SYMBOL(LNetGetId);
/**
* Print a string representation of handle \a h into buffer \a str of
* \a len bytes.
*/
void
LNetSnprintHandle(char *str, int len, lnet_handle_any_t h)
{
snprintf(str, len, "%#llx", h.cookie);
}
EXPORT_SYMBOL(LNetSnprintHandle);
static int lnet_ping(lnet_process_id_t id, int timeout_ms,
lnet_process_id_t __user *ids, int n_ids)
{
......
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