X-Git-Url: https://git.whamcloud.com/?a=blobdiff_plain;f=lustre%2Futils%2Fliblustreapi_param.c;h=56c19791826c34c8be8514714fd80a172633945f;hb=1d40214d96dd6e36bd39a35f8419f753bae8d305;hp=65cad298f5fb7c320c3ad8d5c7e272fb7735e31f;hpb=8813fdf2a4f2055e4867df653644f12ac4c78b15;p=fs%2Flustre-release.git diff --git a/lustre/utils/liblustreapi_param.c b/lustre/utils/liblustreapi_param.c index 65cad29..56c1979 100644 --- a/lustre/utils/liblustreapi_param.c +++ b/lustre/utils/liblustreapi_param.c @@ -21,6 +21,8 @@ * * This code handles user interaction with the configuration interface * to the Lustre file system to fine tune it. + * + * Copyright (c) 2016 Intel Corporation. */ #include #include @@ -67,7 +69,7 @@ get_lustre_param_path(const char *obd_type, const char *filter, char pattern[PATH_MAX]; int rc = 0; - if (filter == NULL || obd_type == NULL) + if (filter == NULL && type != FILTER_BY_NONE) return -EINVAL; switch (type) { @@ -91,14 +93,20 @@ get_lustre_param_path(const char *obd_type, const char *filter, return -EINVAL; rc = 0; break; - default: + case FILTER_BY_EXACT: if (strlen(filter) + 1 > sizeof(pattern)) return -E2BIG; strncpy(pattern, filter, sizeof(pattern)); break; + case FILTER_BY_NONE: + default: + break; } - if (param_name != NULL) { + if (type == FILTER_BY_NONE) { + if (cfs_get_param_paths(param, "%s", param_name) != 0) + rc = -errno; + } else if (param_name != NULL) { if (cfs_get_param_paths(param, "%s/%s/%s", obd_type, pattern, param_name) != 0) rc = -errno;