X-Git-Url: https://git.whamcloud.com/?a=blobdiff_plain;f=lustre%2Futils%2Fll_decode_filter_fid.c;h=eb86e1c6105f0bcdf7351a36cfc5af69b1279d38;hb=21d671b3af09af65d38a454e677c5da9830e0c7a;hp=ea10e6d845b1ab7b8c8b0b86d968763731ff102c;hpb=db5661e8aad397317f4a0763655ffc0164956097;p=fs%2Flustre-release.git diff --git a/lustre/utils/ll_decode_filter_fid.c b/lustre/utils/ll_decode_filter_fid.c index ea10e6d..eb86e1c 100644 --- a/lustre/utils/ll_decode_filter_fid.c +++ b/lustre/utils/ll_decode_filter_fid.c @@ -23,7 +23,7 @@ * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved. * Use is subject to license terms. * - * Copyright (c) 2011, 2014, Intel Corporation. + * Copyright (c) 2011, 2017, Intel Corporation. */ /* * This file is part of Lustre, http://www.lustre.org/ @@ -43,7 +43,7 @@ #include #include #include -#include +#include #define PFID_STRIPE_IDX_BITS 16 #define PFID_STRIPE_COUNT_MASK ((1 << PFID_STRIPE_IDX_BITS) - 1) @@ -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"); }