Whamcloud - gitweb
e2fsck: add support for dirdata feature
[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 #endif
38
39 #endif /* LFSCK_H */