Whamcloud - gitweb
debugfs: dump "fid" and "lma" xattrs on inode stat
[tools/e2fsprogs.git] / lib / ext2fs / lfsck.h
1 #ifndef LFSCK_H
2 #define LFSCK_H
3
4 /* This is unfortunately needed for older lustre_user.h to be usable */
5 #define LASSERT(cond)           do { } while (0)
6
7 #ifdef HAVE_LUSTRE_LUSTREAPI_H
8 #include <lustre/lustreapi.h>
9 #elif HAVE_LUSTRE_LIBLUSTREAPI_H
10 #include <lustre/liblustreapi.h>
11 #endif
12
13 #ifndef DFID
14 #define DFID "[%#llx:0x%x:0x%x]"
15 #define PFID(fid) (unsigned long long)fid_seq(fid), fid_oid(fid), fid_ver(fid)
16 struct lu_fid {
17         __u64   f_seq;
18         __u32   f_oid;
19         __u32   f_ver;
20 };
21 #endif /* !DFID */
22
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)
30
31 static inline void fid_be_to_cpu(struct lu_fid *dst, struct lu_fid *src)
32 {
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);
36 }
37
38 static inline void fid_le_to_cpu(struct lu_fid *dst, struct lu_fid *src)
39 {
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);
43 }
44 #endif /* HAVE_LUSTRE_LUSTRE_IDL_H */
45
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"
50
51 #ifndef LMA_OLD_SIZE
52 #ifndef LMA_INCOMPAT_SUPP
53 struct lustre_mdt_attrs {
54         __u32           lma_compat;
55         __u32           lma_incompat;
56         struct lu_fid   lma_self_fid;
57 };
58 struct lustre_ost_attrs {
59         struct lustre_mdt_attrs loa_lma;
60         struct lu_fid           loa_parent_fid;
61         __u32                   loa_stripe_size;
62         __u32                   loa_pfl_id;
63         __u64                   loa_pfl_start;
64         __u64                   loa_pfl_end;
65 };
66 #endif
67
68 struct filter_fid_old {
69         struct lu_fid   ff_parent;
70         __u64           ff_objid;
71         __u64           ff_seq;
72 };
73
74 struct filter_fid {
75         struct lu_fid   ff_parent;
76         __u32           ff_stripe_size;
77         __u32           ff_stripe_count;
78         __u64           ff_pfl_start;
79         __u64           ff_pfl_end;
80         __u32           ff_pfl_id;
81 };
82
83 #define LMA_OLD_SIZE 64
84 #endif /* !LMA_OLD_SIZE */
85
86 #define PFID_STRIPE_IDX_BITS    16
87 #define PFID_STRIPE_COUNT_MASK  ((1 << PFID_STRIPE_IDX_BITS) - 1)
88
89 #endif /* LFSCK_H */