+ FILE *fp;
+
+ fp = popen("\\ls -d /proc/fs/lustre/lov/*clilov* | head -1", "r");
+ if (!fp) {
+ llapi_err(LLAPI_MSG_ERROR,
+ "open(lustre/lov/*clilov*) failed: %s\n");
+ return 2;
+ }
+ if (fscanf(fp, "%s", lov_path) < 1) {
+ llapi_err(LLAPI_MSG_ERROR,
+ "read(lustre/lov/*clilov*) failed: %s\n");
+ pclose(fp);
+ return 3;
+ }
+ pclose(fp);
+
+ snprintf(tmp_path, sizeof(tmp_path) - 1, "%s/stripecount",
+ lov_path);
+ if (read_proc_entry(tmp_path, buf, sizeof(buf)) < 0)
+ return 5;
+ def_stripe_count = (short)atoi(buf);
+
+ snprintf(tmp_path, sizeof(tmp_path) - 1, "%s/numobd", lov_path);
+ if (read_proc_entry(tmp_path, buf, sizeof(buf)) < 0)
+ return 6;
+ ost_count = atoi(buf);
+
+ if (lum_dir == NULL) {
+ stripe_count = def_stripe_count;
+ min_stripe_count = -1;
+ } else {
+ stripe_count = (signed short)lum_dir->lmm_stripe_count;
+ printf("dir stripe %d, ", stripe_count);
+ min_stripe_count = 1;
+ }
+
+ printf("default stripe %d, ost count %d\n",
+ def_stripe_count, ost_count);