#include <linux/lustre_lite.h>
#include <linux/obd_lov.h>
-#warning Max obds per lov currently hardcoded to 1000 in lov/lov_obd.c
+/* XXX Max obds per lov currently hardcoded to 1000 in lov/lov_obd.c */
#define MAX_LOV_UUID_COUNT 1000
#define OBD_NOT_FOUND ((__u32)-1)
else
buflen = lmmlen;
-#warning max ioctl buffer size currently hardcoded to 8192
+ /* XXX max ioctl buffer size currently hardcoded to 8192 */
if (buflen > 8192) {
int nuuids, remaining, nluoinfos;
if (flag != FTW_F)
return 0;
- if ((obdcount == 0) && (getobdindex(path) == OBD_NOT_FOUND)) {
+ if (getobdindex(path) == OBD_NOT_FOUND && obdcount == 0) {
/* terminate nftw walking this tree */
return(1);
}
- if ((fd = open(path, O_RDONLY)) < 0) {
+ if ((fd = open(path, O_RDONLY | O_LOV_DELAY_CREATE)) < 0) {
errMsg("open \"%.20s\" failed.", path);
perror("open");
exit(1);
if ((rc = ioctl(fd, LL_IOC_LOV_GETSTRIPE, (void *)lmm)) < 0) {
errMsg("LL_IOC_LOV_GETSTRIPE ioctl failed.");
perror("ioctl");
- exit(1);
+ return 0;
}
close(fd);
- if (query || verbose || lmm->lmm_objects[obdindex].l_object_id)
+ if (query || verbose ||
+ (obdindex != OBD_NOT_FOUND &&
+ lmm->lmm_objects[obdindex].l_object_id))
printf("%s\n", path);
if (verbose) {
printf("lmm_magic: 0x%x\n", lmm->lmm_magic);
printf("lmm_object_id: "LPX64"\n", lmm->lmm_object_id);
- printf("lmm_stripe_offset: %d\n", lmm->lmm_stripe_offset);
- printf("lmm_stripe_count: %d\n", lmm->lmm_stripe_count);
- printf("lmm_ost_count: %d\n", lmm->lmm_ost_count);
- printf("lmm_stripe_pattern: %d\n", lmm->lmm_stripe_pattern);
+ printf("lmm_stripe_offset: %u\n", (int)lmm->lmm_stripe_offset);
+ printf("lmm_stripe_count: %u\n", (int)lmm->lmm_stripe_count);
+ printf("lmm_stripe_size: %u\n", (int)lmm->lmm_stripe_size);
+ printf("lmm_ost_count: %u\n", lmm->lmm_ost_count);
+ printf("lmm_stripe_pattern: %d\n", lmm->lmm_magic & 0xf);
}
count = lmm->lmm_ost_count;