Whamcloud - gitweb
LU-10288 lfsck: layout LFSCK for mirrored file
[fs/lustre-release.git] / lustre / utils / portals.c
index 4ebf306..e544588 100644 (file)
 #include <time.h>
 #include <linux/types.h>
 
-#include <libcfs/util/string.h>
 #include <libcfs/util/ioctl.h>
 #include <linux/lnet/libcfs_debug.h>
 #include <linux/lnet/lnet-dlc.h>
 #include <linux/lnet/lnetctl.h>
 #include <linux/lnet/nidstr.h>
 #include <linux/lnet/socklnd.h>
+#include <lustre/lustreapi.h>
 
 unsigned int libcfs_debug;
 unsigned int libcfs_printk = D_CANTMASK;
@@ -177,7 +177,7 @@ ptl_ipaddr_2_str(__u32 ipaddr, char *str, size_t strsize, int lookup)
                 net_ip = htonl (ipaddr);
                 he = gethostbyaddr (&net_ip, sizeof (net_ip), AF_INET);
                 if (he != NULL) {
-                       strlcpy(str, he->h_name, strsize);
+                       snprintf(str, strsize, "%s", he->h_name);
                         return (str);
                 }
         }
@@ -299,8 +299,6 @@ int jt_ptl_network(int argc, char **argv)
        __u32 net = LNET_NIDNET(LNET_NID_ANY);
        int rc;
 
-       fprintf(stderr, "This command has been deprecated. Plesae use 'lnetctl net add'\n");
-
        if (argc != 2) {
                fprintf(stderr, "usage: %s <net>|up|down\n", argv[0]);
                return -1;
@@ -359,8 +357,6 @@ jt_ptl_list_nids(int argc, char **argv)
         int                      count;
         int                      rc;
 
-       fprintf(stderr, "This command has been deprecated. Plesae use 'lnetctl net show'\n");
-
         all = (argc == 2) && (strcmp(argv[1], "all") == 0);
         /* Hack to pass back value */
         return_nid = (argc == 2) && (argv[1][0] == 1);
@@ -922,8 +918,6 @@ int jt_ptl_ping(int argc, char **argv)
         char                    *sep;
         int                      i;
 
-       fprintf(stderr, "This command has been deprecated. Plesae use 'lnetctl ping'\n");
-
         if (argc < 2) {
                 fprintf(stderr, "usage: %s id [timeout (secs)]\n", argv[0]);
                 return 0;
@@ -1229,8 +1223,6 @@ jt_ptl_print_routes (int argc, char **argv)
        int                       alive;
        unsigned int              pri;
 
-       fprintf(stderr, "This command has been deprecated. Plesae use 'lnetctl route show'\n");
-
        for (index = 0; ; index++) {
                LIBCFS_IOC_INIT_V2(data, cfg_hdr);
                data.cfg_count = index;