.PP
.SS Device Operations
.TP
-.BI list_param " [-F|-R] <param_path ...>"
+.BI list_param " [-F|-R] <param_search ...>"
List the Lustre or LNet parameter name
-.br
.B -F
Add '/', '@' or '=' for dirs, symlinks and writeable files, respectively.
.br
.B -R
-Recursively list all parameters under the specified path. If
-.I param_path
+Recursively list all parameters under the specified parameter search string. If
+.I param_search
is unspecified, all the parameters will be shown.
.br
.B Examples:
.br
debug=
.br
-.B
+.B
# lctl list_param -R mdt
.br
mdt
.br
...
.TP
-.BI get_param " [-n|-N|-F] <param_path ...>"
-Get the value of Lustre or LNET parameter from the specified path.
+.BI get_param " [-n|-N|-F] <parameter ...>"
+Get the value of Lustre or LNET parameter.
.br
.B -n
Print only the value and not parameter name.
.br
lctl "get_param -NF" is equivalent to "list_param -F".
.TP
-.BI set_param " [-n] <param_path=value ...>"
-Set the value of Lustre or LNET parameter from the specified path.
+.BI set_param " [-n] <parameter=value ...>"
+Set the value of Lustre or LNET parameter.
.br
.B -n
Disable printing of the key name when printing values.
return 0
}
-export ORIG_CSUM_TYPE="`lctl get_param -n osc/*osc-[^mM]*/checksum_type |
+export ORIG_CSUM_TYPE="`lctl get_param -n osc.*osc-[^mM]*.checksum_type |
sed 's/.*\[\(.*\)\].*/\1/g' | head -n1`"
CKSUM_TYPES=${CKSUM_TYPES:-"crc32 adler"}
[ "$ORIG_CSUM_TYPE" = "crc32c" ] && CKSUM_TYPES="$CKSUM_TYPES crc32c"
done
echo ""
lctl set_param -n $NSDIR.pool.lock_volume_factor $OLD_LVF
- local LRU_SIZE_A=`lctl get_param -n $NSDIR/lru_size`
+ local LRU_SIZE_A=`lctl get_param -n $NSDIR.lru_size`
[ $LRU_SIZE_B -gt $LRU_SIZE_A ] || {
error "No locks dropped in ${SLEEP}s. LRU size: $LRU_SIZE_A"
}
}
+/* Supporting file paths creates perilous behavoir: LU-888.
+ * Path support is deprecated.
+ * If a path is supplied it must begin with /proc. */
+static void lprocfs_param_pattern(const char *cmd, const char *path, char *buf,
+ size_t buf_size)
+{
+ /* test path to see if it begins with '/proc/' */
+ if (strncmp(path, "/proc/", strlen("/proc/")) == 0) {
+ static int warned;
+ if (!warned) {
+ fprintf(stderr, "%s: specifying parameters via "
+ "full paths is deprecated.\n", cmd);
+#if LUSTRE_VERSION_CODE >= OBD_OCD_VERSION(2,6,50,0)
+#warning "remove deprecated full path tunable access"
+#endif
+ warned = 1;
+ }
+ snprintf(buf, buf_size, "%s", path);
+ } else {
+ snprintf(buf, buf_size, "/proc/{fs,sys}/{lnet,lustre}/%s",
+ path);
+ }
+}
+
struct param_opts {
int only_path:1;
int show_path:1;
int jt_lcfg_listparam(int argc, char **argv)
{
- int fp;
int rc = 0, i;
struct param_opts popt;
char pattern[PATH_MAX];
clean_path(path);
- /* If the entire path is specified as input */
- fp = open(path, O_RDONLY);
- if (fp < 0) {
- snprintf(pattern, PATH_MAX, "/proc/{fs,sys}/{lnet,lustre}/%s",
- path);
- } else {
- strcpy(pattern, path);
- close(fp);
- }
+ lprocfs_param_pattern(argv[0], path, pattern, sizeof(pattern));
rc = listparam_display(&popt, pattern);
if (rc < 0)
int jt_lcfg_getparam(int argc, char **argv)
{
- int fp;
int rc = 0, i;
struct param_opts popt;
char pattern[PATH_MAX];
clean_path(path);
- /* If the entire path is specified as input */
- fp = open(path, O_RDONLY);
- if (fp < 0) {
- snprintf(pattern, PATH_MAX, "/proc/{fs,sys}/{lnet,lustre}/%s",
- path);
- } else {
- strcpy(pattern, path);
- close(fp);
- }
+ lprocfs_param_pattern(argv[0], path, pattern, sizeof(pattern));
if (popt.only_path)
rc = listparam_display(&popt, pattern);
int jt_lcfg_setparam(int argc, char **argv)
{
- int fp;
int rc = 0, i;
struct param_opts popt;
char pattern[PATH_MAX];
clean_path(path);
- /* If the entire path is specified as input */
- fp = open(path, O_RDONLY);
- if (fp < 0) {
- snprintf(pattern, PATH_MAX, "/proc/{fs,sys}/{lnet,lustre}/%s",
- path);
- } else {
- strcpy(pattern, path);
- close(fp);
- }
+ lprocfs_param_pattern(argv[0], path, pattern, sizeof(pattern));
rc = setparam_display(&popt, pattern, value);
path = NULL;
return 0;
}
+