- /**
- * For the upstream client the parameter files locations
- * are split between under both /sys/kernel/debug/lustre
- * and /sys/fs/lustre. The parameter files containing
- * small amounts of data, less than a page in size, are
- * located under /sys/fs/lustre and in the case of large
- * parameter data files, think stats for example, are
- * located in the debugfs tree. Since the files are split
- * across two trees the directories are often duplicated
- * which means these directories are listed twice which
- * leads to duplicate output to the user. To avoid scanning
- * a directory twice we have to cache any directory and
- * check if a search has been requested twice.
- */
- if (S_ISDIR(st.st_mode)) {
- int j;
-
- for (j = 0; j < dir_count; j++) {
- if (!strcmp(dir_cache[j], param_name))
- break;
- }
- if (j != dir_count) {
- free(param_name);
- param_name = NULL;
- continue;
- }
- dir_cache[dir_count++] = strdup(param_name);
- }
-