int i;
FILE *fp;
- fp = popen("\\ls -d /proc/fs/lustre/lov/*clilov* | head -1", "r");
+ fp = popen("\\ls -d /proc/fs/lustre/lov/*lov* | head -1", "r");
if (!fp) {
llapi_err(LLAPI_MSG_ERROR,
- "open(lustre/lov/*clilov*) failed: %s\n");
+ "open(lustre/lov/*lov*) failed: %s\n");
return 2;
}
if (fscanf(fp, "%s", lov_path) < 1) {
- llapi_err(LLAPI_MSG_ERROR,
- "read(lustre/lov/*clilov*) failed: %s\n");
+ llapi_err(LLAPI_MSG_ERROR,"read lustre/lov/*lov* failed: %s\n");
pclose(fp);
return 3;
}
pclose(fp);
- snprintf(tmp_path, sizeof(tmp_path) - 1, "%s/stripecount",
- lov_path);
+ 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);
stripe_count = def_stripe_count;
min_stripe_count = -1;
} else {
- stripe_count = (signed short)lum_dir->lmm_stripe_count;
+ stripe_count = (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);
-
if (stripe_count == 0) {
min_stripe_count = -1;
stripe_count = 1;
}
if (lum_file1->lmm_stripe_count < stripe_count)
- llapi_err(LLAPI_MSG_WARN, "warning: file1 used fewer stripes"
- " %d < dir %d (likely due to bug 4900)\n",
+ llapi_err(LLAPI_MSG_WARN, "warning: file1 used fewer stripes "
+ "%d < dir %d (likely due to bug 4900)\n",
lum_file1->lmm_stripe_count, stripe_count);
if (lum_dir != NULL)
if (idx != next) {
llapi_err(LLAPI_MSG_WARN, "warning: non-sequential "
"file1 stripe[%d] %d != file2 stripe[0] %d\n",
- stripe, lum_file1->lmm_objects[stripe].l_ost_idx,
+ stripe,
+ lum_file1->lmm_objects[stripe].l_ost_idx,
idx);
}
}
return rc;
}
- lum_size = lov_mds_md_size(MAX_LOV_UUID_COUNT);
+ lum_size = lov_mds_md_size(MAX_LOV_UUID_COUNT, LOV_MAGIC);
if ((lum_dir = (struct lov_user_md *)malloc(lum_size)) == NULL) {
rc = ENOMEM;
llapi_err(LLAPI_MSG_ERROR, "error: can't allocate %d bytes "