Whamcloud - gitweb
LU-2675 libcfs: remove LUSTRE_{,SRV_}LNET_PID 85/11985/2
authorJohn L. Hammond <john.hammond@intel.com>
Wed, 17 Sep 2014 12:56:47 +0000 (07:56 -0500)
committerAndreas Dilger <andreas.dilger@intel.com>
Fri, 24 Oct 2014 18:36:08 +0000 (18:36 +0000)
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 <john.hammond@intel.com>
Change-Id: Ib92e1eaa8237c998d04ee0110907dac2dbffdc5e
Reviewed-on: http://review.whamcloud.com/11985
Tested-by: Jenkins
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: James Simmons <uja.ornl@gmail.com>
Reviewed-by: Bob Glossman <bob.glossman@intel.com>
Reviewed-by: Dmitry Eremin <dmitry.eremin@intel.com>
Reviewed-by: Andreas Dilger <andreas.dilger@intel.com>
13 files changed:
libcfs/include/libcfs/libcfs.h
libcfs/include/libcfs/linux/libcfs.h
libcfs/include/libcfs/posix/libcfs.h
lnet/include/lnet/types.h
lnet/klnds/gnilnd/gnilnd.c
lnet/klnds/socklnd/socklnd.c
lnet/lnet/api-ni.c
lnet/lnet/lib-move.c
lnet/lnet/module.c
lnet/lnet/router.c
lnet/selftest/rpc.c
lnet/utils/lst.c
lustre/ptlrpc/events.c

index 3843ac7..5121cb1 100644 (file)
@@ -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 <libcfs/list.h>
index cda2b1f..5c0eb7f 100644 (file)
@@ -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)
  *
index 6a2d831..37834d3 100644 (file)
@@ -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)
  *
index 997fbc1..e1dd34b 100644 (file)
@@ -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)
 
index 84829e5..cb9bf24 100644 (file)
@@ -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 */
index 36d4322..c4adaaa 100644 (file)
@@ -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 */
index 8e7bca3..7fc2158 100644 (file)
@@ -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)
index 7657ea8..f576b42 100644 (file)
@@ -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));
index 3547a3b..f1fd951 100644 (file)
@@ -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,
index 290fe2d..1c0c3af 100644 (file)
@@ -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);
 
index f86155e..91c7009 100644 (file)
@@ -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
index 1aacbda..abe2acf 100644 (file)
@@ -283,7 +283,7 @@ out:
                                 rc = -1;
                         }
 
-                        (*idspp)[i].pid = LUSTRE_LNET_PID;
+                       (*idspp)[i].pid = LNET_PID_LUSTRE;
                         i++;
                 }
 
index cd3fecb..1147ff3 100644 (file)
@@ -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)