Commit 0fffc261 authored by James Simmons's avatar James Simmons Committed by Greg Kroah-Hartman

staging: lustre: lnet: change lnd_t to proper structure

Change lnd_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 f1e0bfb0
...@@ -439,7 +439,7 @@ lnet_net2rnethash(__u32 net) ...@@ -439,7 +439,7 @@ lnet_net2rnethash(__u32 net)
((1U << the_lnet.ln_remote_nets_hbits) - 1)]; ((1U << the_lnet.ln_remote_nets_hbits) - 1)];
} }
extern lnd_t the_lolnd; extern struct lnet_lnd the_lolnd;
extern int avoid_asym_router_failure; extern int avoid_asym_router_failure;
int lnet_cpt_of_nid_locked(lnet_nid_t nid); int lnet_cpt_of_nid_locked(lnet_nid_t nid);
...@@ -628,8 +628,8 @@ void lnet_me_unlink(struct lnet_me *me); ...@@ -628,8 +628,8 @@ void lnet_me_unlink(struct lnet_me *me);
void lnet_md_unlink(struct lnet_libmd *md); void lnet_md_unlink(struct lnet_libmd *md);
void lnet_md_deconstruct(struct lnet_libmd *lmd, lnet_md_t *umd); void lnet_md_deconstruct(struct lnet_libmd *lmd, lnet_md_t *umd);
void lnet_register_lnd(lnd_t *lnd); void lnet_register_lnd(struct lnet_lnd *lnd);
void lnet_unregister_lnd(lnd_t *lnd); void lnet_unregister_lnd(struct lnet_lnd *lnd);
int lnet_connect(struct socket **sockp, lnet_nid_t peer_nid, int lnet_connect(struct socket **sockp, lnet_nid_t peer_nid,
__u32 local_ip, __u32 peer_ip, int peer_port); __u32 local_ip, __u32 peer_ip, int peer_port);
......
...@@ -179,7 +179,7 @@ struct lnet_test_peer { ...@@ -179,7 +179,7 @@ struct lnet_test_peer {
struct lnet_ni; /* forward ref */ struct lnet_ni; /* forward ref */
typedef struct lnet_lnd { struct lnet_lnd {
/* fields managed by portals */ /* fields managed by portals */
struct list_head lnd_list; /* stash in the LND table */ struct list_head lnd_list; /* stash in the LND table */
int lnd_refcount; /* # active instances */ int lnd_refcount; /* # active instances */
...@@ -243,7 +243,7 @@ typedef struct lnet_lnd { ...@@ -243,7 +243,7 @@ typedef struct lnet_lnd {
/* accept a new connection */ /* accept a new connection */
int (*lnd_accept)(struct lnet_ni *ni, struct socket *sock); int (*lnd_accept)(struct lnet_ni *ni, struct socket *sock);
} lnd_t; };
struct lnet_tx_queue { struct lnet_tx_queue {
int tq_credits; /* # tx credits free */ int tq_credits; /* # tx credits free */
...@@ -267,7 +267,7 @@ typedef struct lnet_ni { ...@@ -267,7 +267,7 @@ typedef struct lnet_ni {
__u32 *ni_cpts; /* bond NI on some CPTs */ __u32 *ni_cpts; /* bond NI on some CPTs */
lnet_nid_t ni_nid; /* interface's NID */ lnet_nid_t ni_nid; /* interface's NID */
void *ni_data; /* instance-specific data */ void *ni_data; /* instance-specific data */
lnd_t *ni_lnd; /* procedural interface */ struct lnet_lnd *ni_lnd; /* procedural interface */
struct lnet_tx_queue **ni_tx_queues; /* percpt TX queues */ struct lnet_tx_queue **ni_tx_queues; /* percpt TX queues */
int **ni_refs; /* percpt reference count */ int **ni_refs; /* percpt reference count */
time64_t ni_last_alive;/* when I was last alive */ time64_t ni_last_alive;/* when I was last alive */
......
...@@ -38,7 +38,7 @@ ...@@ -38,7 +38,7 @@
#include <asm/page.h> #include <asm/page.h>
#include "o2iblnd.h" #include "o2iblnd.h"
static lnd_t the_o2iblnd; static struct lnet_lnd the_o2iblnd;
struct kib_data kiblnd_data; struct kib_data kiblnd_data;
...@@ -2938,7 +2938,7 @@ static int kiblnd_startup(lnet_ni_t *ni) ...@@ -2938,7 +2938,7 @@ static int kiblnd_startup(lnet_ni_t *ni)
return -ENETDOWN; return -ENETDOWN;
} }
static lnd_t the_o2iblnd = { static struct lnet_lnd the_o2iblnd = {
.lnd_type = O2IBLND, .lnd_type = O2IBLND,
.lnd_startup = kiblnd_startup, .lnd_startup = kiblnd_startup,
.lnd_shutdown = kiblnd_shutdown, .lnd_shutdown = kiblnd_shutdown,
......
...@@ -39,7 +39,7 @@ ...@@ -39,7 +39,7 @@
#include "socklnd.h" #include "socklnd.h"
static lnd_t the_ksocklnd; static struct lnet_lnd the_ksocklnd;
struct ksock_nal_data ksocknal_data; struct ksock_nal_data ksocknal_data;
static struct ksock_interface * static struct ksock_interface *
......
...@@ -265,15 +265,15 @@ static void lnet_assert_wire_constants(void) ...@@ -265,15 +265,15 @@ static void lnet_assert_wire_constants(void)
BUILD_BUG_ON((int)sizeof(((struct lnet_hdr *)0)->msg.hello.type) != 4); BUILD_BUG_ON((int)sizeof(((struct lnet_hdr *)0)->msg.hello.type) != 4);
} }
static lnd_t * static struct lnet_lnd *
lnet_find_lnd_by_type(__u32 type) lnet_find_lnd_by_type(__u32 type)
{ {
lnd_t *lnd; struct lnet_lnd *lnd;
struct list_head *tmp; struct list_head *tmp;
/* holding lnd mutex */ /* holding lnd mutex */
list_for_each(tmp, &the_lnet.ln_lnds) { list_for_each(tmp, &the_lnet.ln_lnds) {
lnd = list_entry(tmp, lnd_t, lnd_list); lnd = list_entry(tmp, struct lnet_lnd, lnd_list);
if (lnd->lnd_type == type) if (lnd->lnd_type == type)
return lnd; return lnd;
...@@ -283,7 +283,7 @@ lnet_find_lnd_by_type(__u32 type) ...@@ -283,7 +283,7 @@ lnet_find_lnd_by_type(__u32 type)
} }
void void
lnet_register_lnd(lnd_t *lnd) lnet_register_lnd(struct lnet_lnd *lnd)
{ {
mutex_lock(&the_lnet.ln_lnd_mutex); mutex_lock(&the_lnet.ln_lnd_mutex);
...@@ -300,7 +300,7 @@ lnet_register_lnd(lnd_t *lnd) ...@@ -300,7 +300,7 @@ lnet_register_lnd(lnd_t *lnd)
EXPORT_SYMBOL(lnet_register_lnd); EXPORT_SYMBOL(lnet_register_lnd);
void void
lnet_unregister_lnd(lnd_t *lnd) lnet_unregister_lnd(struct lnet_lnd *lnd)
{ {
mutex_lock(&the_lnet.ln_lnd_mutex); mutex_lock(&the_lnet.ln_lnd_mutex);
...@@ -1220,7 +1220,7 @@ lnet_startup_lndni(struct lnet_ni *ni, struct lnet_ioctl_config_data *conf) ...@@ -1220,7 +1220,7 @@ lnet_startup_lndni(struct lnet_ni *ni, struct lnet_ioctl_config_data *conf)
struct lnet_ioctl_config_lnd_tunables *lnd_tunables = NULL; struct lnet_ioctl_config_lnd_tunables *lnd_tunables = NULL;
int rc = -EINVAL; int rc = -EINVAL;
int lnd_type; int lnd_type;
lnd_t *lnd; struct lnet_lnd *lnd;
struct lnet_tx_queue *tq; struct lnet_tx_queue *tq;
int i; int i;
...@@ -1475,7 +1475,7 @@ void lnet_lib_exit(void) ...@@ -1475,7 +1475,7 @@ void lnet_lib_exit(void)
while (!list_empty(&the_lnet.ln_lnds)) while (!list_empty(&the_lnet.ln_lnds))
lnet_unregister_lnd(list_entry(the_lnet.ln_lnds.next, lnet_unregister_lnd(list_entry(the_lnet.ln_lnds.next,
lnd_t, lnd_list)); struct lnet_lnd, lnd_list));
lnet_destroy_locks(); lnet_destroy_locks();
} }
......
...@@ -88,7 +88,7 @@ lolnd_startup(lnet_ni_t *ni) ...@@ -88,7 +88,7 @@ lolnd_startup(lnet_ni_t *ni)
return 0; return 0;
} }
lnd_t the_lolnd = { struct lnet_lnd the_lolnd = {
/* .lnd_list = */ {&the_lolnd.lnd_list, &the_lolnd.lnd_list}, /* .lnd_list = */ {&the_lolnd.lnd_list, &the_lolnd.lnd_list},
/* .lnd_refcount = */ 0, /* .lnd_refcount = */ 0,
/* .lnd_type = */ LOLND, /* .lnd_type = */ LOLND,
......
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