- continue;
- }
- if (size > sizeof(*ff))
- fprintf(stderr, "%s: warning: fid larger than expected "
- "(%d bytes), recompile?\n", argv[i], size);
-
- printf("%s: objid="LPU64" seq="LPU64" parent="DFID"\n",
- argv[i], le64_to_cpu(ff->ff_objid),
- le64_to_cpu(ff->ff_seq),
- le64_to_cpu(ff->ff_parent.f_seq),
- le32_to_cpu(ff->ff_parent.f_oid),
- le32_to_cpu(ff->ff_parent.f_ver));
+ continue;
+ }
+
+ if (size != sizeof(struct filter_fid) &&
+ 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_18_23)) {
+ struct filter_fid_18_23 *ffo = (void *)buf;
+
+ printf("objid=%llu seq=%llu ",
+ (unsigned long long)__le64_to_cpu(ffo->ff_objid),
+ (unsigned long long)__le64_to_cpu(ffo->ff_seq));
+ }
+
+ printf("parent="DFID" stripe=%u",
+ (unsigned long long)__le64_to_cpu(ff->ff_parent.f_seq),
+ __le32_to_cpu(ff->ff_parent.f_oid), 0, /* ver */
+ /* this is stripe_nr actually */
+ __le32_to_cpu(ff->ff_parent.f_stripe_idx));
+
+ if (size >= sizeof(struct filter_fid_210)) {
+ struct ost_layout *ol = &ff->ff_layout;
+
+ /* new filter_fid, support PFL */
+ printf(" stripe_size=%u stripe_count=%u",
+ __le32_to_cpu(ol->ol_stripe_size),
+ __le32_to_cpu(ol->ol_stripe_count));
+ if (ol->ol_comp_id != 0)
+ printf(" component_id=%u "
+ "component_start=%llu "
+ "component_end=%llu",
+ __le32_to_cpu(ol->ol_comp_id),
+ __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");