RETURN(-EINVAL);
}
- if (lum.lmm_stripe_size & (PAGE_SIZE - 1)) {
- CDEBUG(D_IOCTL, "stripe size %u not multiple of %lu\n",
- lum.lmm_stripe_size, PAGE_SIZE);
+ /* 64kB is the largest common page size we see (ia64), and matches the
+ * check in lfs */
+ if (lum.lmm_stripe_size & (65536 - 1)) {
+ CDEBUG(D_IOCTL, "stripe size %u not multiple of 64kB\n",
+ lum.lmm_stripe_size);
RETURN(-EINVAL);
}
long st_size;
int st_offset, st_count;
char *end;
- int page_size;
+ int page_size;
if (argc != 5)
return CMD_HELP;
argv[0], argv[2]);
return CMD_HELP;
}
- page_size = getpagesize();
- if (st_size % page_size)
- fprintf(stderr, "WARNING: stripe size %ld is not "
- "an increment of page size %d\n", st_size, page_size);
+ /* 64 KB is the largest common page size I'm aware of (on ia64), but
+ * check the local page size just in case. */
+ page_size = 65536;
+ if (getpagesize() > page_size) {
+ fprintf(stderr, "WARNING: your page size (%d) is larger than "
+ "expected.\n");
+ page_size = getpagesize();
+ }
+ if (st_size % page_size) {
+ fprintf(stderr, "FATAL: stripe_size must be an even multiple "
+ "of %d bytes.\n", page_size);
+ return CMD_HELP;
+ }
// get the stripe offset
st_offset = strtoul(argv[3], &end, 0);