4 /* This is unfortunately needed for older lustre_user.h to be usable */
5 #define LASSERT(cond) do { } while (0)
7 #ifdef HAVE_LUSTRE_LUSTREAPI_H
8 #include <lustre/lustreapi.h>
9 #elif HAVE_LUSTRE_LIBLUSTREAPI_H
10 #include <lustre/liblustreapi.h>
14 #define DFID "[%#llx:0x%x:0x%x]"
15 #define PFID(fid) (unsigned long long)fid_seq(fid), fid_oid(fid), fid_ver(fid)
23 /* Unfortunately, neither the 1.8 or 2.x lustre_idl.h file is suitable
24 * for inclusion by userspace programs because of external dependencies.
25 * Define the minimum set of replacement functions here until that is fixed. */
26 #ifndef HAVE_LUSTRE_LUSTRE_IDL_H
27 #define fid_seq(fid) ((fid)->f_seq)
28 #define fid_oid(fid) ((fid)->f_oid)
29 #define fid_ver(fid) ((fid)->f_ver)
31 static inline void fid_be_to_cpu(struct lu_fid *dst, struct lu_fid *src)
33 dst->f_seq = ext2fs_be64_to_cpu(src->f_seq);
34 dst->f_oid = ext2fs_be32_to_cpu(src->f_oid);
35 dst->f_ver = ext2fs_be32_to_cpu(src->f_ver);
38 static inline void fid_le_to_cpu(struct lu_fid *dst, struct lu_fid *src)
40 dst->f_seq = ext2fs_le64_to_cpu(src->f_seq);
41 dst->f_oid = ext2fs_le32_to_cpu(src->f_oid);
42 dst->f_ver = ext2fs_le32_to_cpu(src->f_ver);
44 #endif /* HAVE_LUSTRE_LUSTRE_IDL_H */
46 #define LUSTRE_XATTR_MDT_LOV "lov"
47 #define LUSTRE_XATTR_MDT_LMA "lma"
48 #define LUSTRE_XATTR_MDT_LINK "link"
49 #define LUSTRE_XATTR_OST_FID "fid"
52 #ifndef LMA_INCOMPAT_SUPP
53 struct lustre_mdt_attrs {
56 struct lu_fid lma_self_fid;
58 struct lustre_ost_attrs {
59 struct lustre_mdt_attrs loa_lma;
60 struct lu_fid loa_parent_fid;
61 __u32 loa_stripe_size;
68 struct filter_fid_old {
69 struct lu_fid ff_parent;
75 struct lu_fid ff_parent;
77 __u32 ff_stripe_count;
83 #define LMA_OLD_SIZE 64
84 #endif /* !LMA_OLD_SIZE */
86 #define PFID_STRIPE_IDX_BITS 16
87 #define PFID_STRIPE_COUNT_MASK ((1 << PFID_STRIPE_IDX_BITS) - 1)