Whamcloud - gitweb
LU-6245 libcfs: remove cfs_fs_time handling
[fs/lustre-release.git] / lnet / lnet / config.c
index 4f338cc..b00267d 100644 (file)
@@ -27,7 +27,7 @@
  * Copyright (c) 2007, 2010, Oracle and/or its affiliates. All rights reserved.
  * Use is subject to license terms.
  *
- * Copyright (c) 2012, 2014, Intel Corporation.
+ * Copyright (c) 2012, 2015, Intel Corporation.
  */
 /*
  * This file is part of Lustre, http://www.lustre.org/
@@ -479,7 +479,7 @@ lnet_str2tbs_sep(struct list_head *tbs, char *str)
                        ltb = lnet_new_text_buf(nob);
                        if (ltb == NULL) {
                                lnet_free_text_bufs(&pending);
-                               return -1;
+                               return -ENOMEM;
                        }
 
                         for (i = 0; i < nob; i++)
@@ -612,7 +612,7 @@ lnet_str2tbs_expand(struct list_head *tbs, char *str)
 
  failed:
        lnet_free_text_bufs(&pending);
-       return -1;
+       return -EINVAL;
 }
 
 static int
@@ -646,7 +646,7 @@ lnet_parse_priority(char *str, unsigned int *priority, char **token)
                /* Update the caller's token pointer so it treats the found
                   priority as the token to report in the error message. */
                *token += sep - str + 1;
-               return -1;
+               return -EINVAL;
        }
 
        CDEBUG(D_NET, "gateway %s, priority %d, nob %d\n", str, *priority, nob);
@@ -676,7 +676,7 @@ lnet_parse_route (char *str, int *im_a_router)
        char             *token = str;
        int               ntokens = 0;
        int               myrc = -1;
-       unsigned int      hops;
+       __u32             hops;
        int               got_hops = 0;
        unsigned int      priority = 0;
 
@@ -759,8 +759,10 @@ lnet_parse_route (char *str, int *im_a_router)
                }
        }
 
+       /* if there are no hops set then we want to flag this value as
+        * unset since hops is an optional parameter */
        if (!got_hops)
-               hops = 1;
+               hops = LNET_UNDEFINED_HOPS;
 
        LASSERT(!list_empty(&nets));
        LASSERT(!list_empty(&gateways));