Whamcloud - gitweb
LU-8130 obd: convert obd uuid hash to rhashtable
[fs/lustre-release.git] / lustre / utils / ll_decode_filter_fid.c
index 975868a..eb86e1c 100644 (file)
@@ -87,6 +87,7 @@ int main(int argc, char *argv[])
        for (i = 1; i < argc; i++) {
                char buf[1024]; /* allow xattr that may be larger */
                struct filter_fid *ff = (void *)buf;
+               static int printed;
                int size;
 
                size = getxattr(argv[i], "trusted.fid", buf,
@@ -120,7 +121,8 @@ int main(int argc, char *argv[])
 
                                printf("%s: parent="DFID" stripe=%u "
                                       "stripe_size=%u stripe_count=%u",
-                                      argv[i], loa->loa_parent_fid.f_seq,
+                                      argv[i],
+                                      (unsigned long long)loa->loa_parent_fid.f_seq,
                                       loa->loa_parent_fid.f_oid, 0, /* ver */
                                       loa->loa_parent_fid.f_stripe_idx &
                                                        PFID_STRIPE_COUNT_MASK,
@@ -146,16 +148,21 @@ int main(int argc, char *argv[])
                }
 
                if (size != sizeof(struct filter_fid) &&
-                   size != sizeof(struct filter_fid_old) &&
-                   size != sizeof(struct lu_fid)) {
-                       fprintf(stderr, "%s: warning: fid larger than expected"
-                               " (%d bytes), recompile?\n", argv[i], size);
-                       continue;
+                   size != sizeof(struct filter_fid_18_23) &&
+                   size != sizeof(struct filter_fid_24_29) &&
+                   size != sizeof(struct filter_fid_210) && !printed) {
+                       fprintf(stderr,
+                               "%s: warning: ffid size is unexpected (%d bytes), recompile?\n",
+                               argv[i], size);
+                       printed = 1;
+
+                       if (size < sizeof(struct filter_fid_24_29))
+                               continue;
                }
 
                printf("%s: ", argv[i]);
-               if (size == sizeof(struct filter_fid_old)) {
-                       struct filter_fid_old *ffo = (void *)buf;
+               if (size == sizeof(struct filter_fid_18_23)) {
+                       struct filter_fid_18_23 *ffo = (void *)buf;
 
                        printf("objid=%llu seq=%llu ",
                               (unsigned long long)__le64_to_cpu(ffo->ff_objid),
@@ -168,7 +175,7 @@ int main(int argc, char *argv[])
                       /* this is stripe_nr actually */
                       __le32_to_cpu(ff->ff_parent.f_stripe_idx));
 
-               if (size >= sizeof(struct filter_fid)) {
+               if (size >= sizeof(struct filter_fid_210)) {
                        struct ost_layout *ol = &ff->ff_layout;
 
                        /* new filter_fid, support PFL */
@@ -183,6 +190,10 @@ int main(int argc, char *argv[])
                                       __le64_to_cpu(ol->ol_comp_start),
                                       __le64_to_cpu(ol->ol_comp_end));
                }
+               if (size >= sizeof(struct filter_fid))
+                       printf(" layout_version=%u range=%u",
+                              __le32_to_cpu(ff->ff_layout_version),
+                              __le32_to_cpu(ff->ff_range));
 
                printf("\n");
        }