From: John L. Hammond Date: Wed, 17 Sep 2014 12:56:47 +0000 (-0500) Subject: LU-2675 libcfs: remove LUSTRE_{,SRV_}LNET_PID X-Git-Tag: 2.6.90~75 X-Git-Url: https://git.whamcloud.com/?p=fs%2Flustre-release.git;a=commitdiff_plain;h=bf5db236dd09f4e671f64123a7b54c115b626853 LU-2675 libcfs: remove LUSTRE_{,SRV_}LNET_PID Remove LUSTRE_LNET_PID (12354) and LUSTRE_SRV_LNET_PID (12345) from the libcfs headers and replace their uses with a new macro LNET_PID_LUSTRE (also 12345) in lnet/types.h. Signed-off-by: John L. Hammond Change-Id: Ib92e1eaa8237c998d04ee0110907dac2dbffdc5e Reviewed-on: http://review.whamcloud.com/11985 Tested-by: Jenkins Tested-by: Maloo Reviewed-by: James Simmons Reviewed-by: Bob Glossman Reviewed-by: Dmitry Eremin Reviewed-by: Andreas Dilger --- diff --git a/libcfs/include/libcfs/libcfs.h b/libcfs/include/libcfs/libcfs.h index 3843ac7..5121cb1 100644 --- a/libcfs/include/libcfs/libcfs.h +++ b/libcfs/include/libcfs/libcfs.h @@ -107,8 +107,6 @@ static inline int __is_po2(unsigned long long val) #define NULL ((void *)0) -#define LUSTRE_SRV_LNET_PID LUSTRE_LNET_PID - #ifdef __KERNEL__ #include diff --git a/libcfs/include/libcfs/linux/libcfs.h b/libcfs/include/libcfs/linux/libcfs.h index cda2b1f..5c0eb7f 100644 --- a/libcfs/include/libcfs/linux/libcfs.h +++ b/libcfs/include/libcfs/linux/libcfs.h @@ -96,9 +96,6 @@ do { \ #define CDEBUG_STACK() (0L) #endif /* __x86_64__ */ -/* initial pid */ -#define LUSTRE_LNET_PID 12345 - /** * Platform specific declarations for cfs_curproc API (libcfs/curproc.h) * diff --git a/libcfs/include/libcfs/posix/libcfs.h b/libcfs/include/libcfs/posix/libcfs.h index 6a2d831..37834d3 100644 --- a/libcfs/include/libcfs/posix/libcfs.h +++ b/libcfs/include/libcfs/posix/libcfs.h @@ -164,9 +164,6 @@ typedef unsigned long long cfs_cycles_t; #define CFS_CHECK_STACK(msgdata, mask, cdls) do {} while(0) #define CDEBUG_STACK() (0L) -/* initial pid */ -#define LUSTRE_LNET_PID 12345 - /** * Platform specific declarations for cfs_curproc API (libcfs/curproc.h) * diff --git a/lnet/include/lnet/types.h b/lnet/include/lnet/types.h index 997fbc1..e1dd34b 100644 --- a/lnet/include/lnet/types.h +++ b/lnet/include/lnet/types.h @@ -74,6 +74,7 @@ typedef __u32 lnet_pid_t; #define LNET_PID_RESERVED 0xf0000000 /* reserved bits in PID */ #define LNET_PID_USERFLAG 0x80000000 /* set in userspace peers */ +#define LNET_PID_LUSTRE 12345 #define LNET_TIME_FOREVER (-1) diff --git a/lnet/klnds/gnilnd/gnilnd.c b/lnet/klnds/gnilnd/gnilnd.c index 84829e5..cb9bf24 100644 --- a/lnet/klnds/gnilnd/gnilnd.c +++ b/lnet/klnds/gnilnd/gnilnd.c @@ -1874,7 +1874,10 @@ kgnilnd_query(lnet_ni_t *ni, lnet_nid_t nid, cfs_time_t *when) kgn_tx_t *tx; kgn_peer_t *peer = NULL; kgn_conn_t *conn = NULL; - lnet_process_id_t id = {.nid = nid, .pid = LUSTRE_SRV_LNET_PID}; + lnet_process_id_t id = { + .nid = nid, + .pid = LNET_PID_LUSTRE, + }; ENTRY; /* I expect to find him, so only take a read lock */ diff --git a/lnet/klnds/socklnd/socklnd.c b/lnet/klnds/socklnd/socklnd.c index 36d4322..c4adaaa 100644 --- a/lnet/klnds/socklnd/socklnd.c +++ b/lnet/klnds/socklnd/socklnd.c @@ -1806,7 +1806,10 @@ ksocknal_query (lnet_ni_t *ni, lnet_nid_t nid, cfs_time_t *when) cfs_time_t now = cfs_time_current(); ksock_peer_t *peer = NULL; rwlock_t *glock = &ksocknal_data.ksnd_global_lock; - lnet_process_id_t id = {.nid = nid, .pid = LUSTRE_SRV_LNET_PID}; + lnet_process_id_t id = { + .nid = nid, + .pid = LNET_PID_LUSTRE, + }; read_lock(glock); @@ -2156,7 +2159,7 @@ ksocknal_ctl(lnet_ni_t *ni, unsigned int cmd, void *arg) case IOC_LIBCFS_ADD_PEER: id.nid = data->ioc_nid; - id.pid = LUSTRE_SRV_LNET_PID; + id.pid = LNET_PID_LUSTRE; return ksocknal_add_peer (ni, id, data->ioc_u32[0], /* IP */ data->ioc_u32[1]); /* port */ diff --git a/lnet/lnet/api-ni.c b/lnet/lnet/api-ni.c index 8e7bca3..7fc2158 100644 --- a/lnet/lnet/api-ni.c +++ b/lnet/lnet/api-ni.c @@ -2349,7 +2349,7 @@ lnet_ping(lnet_process_id_t id, int timeout_ms, lnet_process_id_t __user *ids, return -EINVAL; if (id.pid == LNET_PID_ANY) - id.pid = LUSTRE_SRV_LNET_PID; + id.pid = LNET_PID_LUSTRE; LIBCFS_ALLOC(info, infosz); if (info == NULL) diff --git a/lnet/lnet/lib-move.c b/lnet/lnet/lib-move.c index 7657ea8..f576b42 100644 --- a/lnet/lnet/lib-move.c +++ b/lnet/lnet/lib-move.c @@ -1449,7 +1449,7 @@ lnet_send(lnet_nid_t src_nid, lnet_msg_t *msg, lnet_nid_t rtr_nid) msg->msg_target_is_router = 1; msg->msg_target.nid = lp->lp_nid; - msg->msg_target.pid = LUSTRE_SRV_LNET_PID; + msg->msg_target.pid = LNET_PID_LUSTRE; } /* 'lp' is our best choice of peer */ @@ -2640,7 +2640,7 @@ LNetSetAsync(lnet_process_id_t id, int nasync) /* set async on all the routers */ while (nnids-- > 0) { - id.pid = LUSTRE_SRV_LNET_PID; + id.pid = LNET_PID_LUSTRE; id.nid = nids[nnids]; ni = lnet_net2ni(LNET_NIDNET(id.nid)); diff --git a/lnet/lnet/module.c b/lnet/lnet/module.c index 3547a3b..f1fd951 100644 --- a/lnet/lnet/module.c +++ b/lnet/lnet/module.c @@ -53,7 +53,7 @@ lnet_configure(void *arg) LNET_MUTEX_LOCK(&lnet_config_mutex); if (!the_lnet.ln_niinit_self) { - rc = LNetNIInit(LUSTRE_SRV_LNET_PID); + rc = LNetNIInit(LNET_PID_LUSTRE); if (rc >= 0) { the_lnet.ln_niinit_self = 1; rc = 0; @@ -93,7 +93,7 @@ lnet_dyn_configure(struct libcfs_ioctl_hdr *hdr) LNET_MUTEX_LOCK(&lnet_config_mutex); if (the_lnet.ln_niinit_self) - rc = lnet_dyn_add_ni(LUSTRE_SRV_LNET_PID, + rc = lnet_dyn_add_ni(LNET_PID_LUSTRE, conf->cfg_config_u.cfg_net.net_intf, conf->cfg_config_u.cfg_net. net_peer_timeout, diff --git a/lnet/lnet/router.c b/lnet/lnet/router.c index 290fe2d..1c0c3af 100644 --- a/lnet/lnet/router.c +++ b/lnet/lnet/router.c @@ -1011,7 +1011,7 @@ lnet_ping_router_locked (lnet_peer_t *rtr) lnet_handle_md_t mdh; id.nid = rtr->lp_nid; - id.pid = LUSTRE_SRV_LNET_PID; + id.pid = LNET_PID_LUSTRE; CDEBUG(D_NET, "Check: %s\n", libcfs_id2str(id)); rtr->lp_ping_notsent = 1; @@ -1069,7 +1069,7 @@ lnet_router_checker_start(void) /* one async ping reply per router */ id.nid = rtr->lp_nid; - id.pid = LUSTRE_SRV_LNET_PID; + id.pid = LNET_PID_LUSTRE; lnet_net_unlock(0); diff --git a/lnet/selftest/rpc.c b/lnet/selftest/rpc.c index f86155e..91c7009 100644 --- a/lnet/selftest/rpc.c +++ b/lnet/selftest/rpc.c @@ -1667,10 +1667,10 @@ srpc_startup (void) srpc_data.rpc_state = SRPC_STATE_NONE; #ifdef __KERNEL__ - rc = LNetNIInit(LUSTRE_SRV_LNET_PID); + rc = LNetNIInit(LNET_PID_LUSTRE); #else if (the_lnet.ln_server_mode_flag) - rc = LNetNIInit(LUSTRE_SRV_LNET_PID); + rc = LNetNIInit(LNET_PID_LUSTRE); else rc = LNetNIInit(getpid() | LNET_PID_USERFLAG); #endif diff --git a/lnet/utils/lst.c b/lnet/utils/lst.c index 1aacbda..abe2acf 100644 --- a/lnet/utils/lst.c +++ b/lnet/utils/lst.c @@ -283,7 +283,7 @@ out: rc = -1; } - (*idspp)[i].pid = LUSTRE_LNET_PID; + (*idspp)[i].pid = LNET_PID_LUSTRE; i++; } diff --git a/lustre/ptlrpc/events.c b/lustre/ptlrpc/events.c index cd3fecb..1147ff3 100644 --- a/lustre/ptlrpc/events.c +++ b/lustre/ptlrpc/events.c @@ -509,7 +509,7 @@ int ptlrpc_uuid_to_peer (struct obd_uuid *uuid, portals_compatibility = LNetCtl(IOC_LIBCFS_PORTALS_COMPATIBILITY, NULL); - peer->pid = LUSTRE_SRV_LNET_PID; + peer->pid = LNET_PID_LUSTRE; /* Choose the matching UUID that's closest */ while (lustre_uuid_to_peer(uuid->uuid, &dst_nid, count++) == 0) { @@ -585,10 +585,7 @@ void ptlrpc_ni_fini(void) lnet_pid_t ptl_get_pid(void) { - lnet_pid_t pid; - - pid = LUSTRE_SRV_LNET_PID; - return pid; + return LNET_PID_LUSTRE; } int ptlrpc_ni_init(void)