QDNix
Quick’n’dirty *NIX
xfs.h
Go to the documentation of this file.
1 /**
2  * \file xfs.h
3  * XFS file system \cite xfs:algoritm_and_data_structs
4  */
5 #ifndef _SYS_FS_XFS_H
6 # define _SYS_FS_XFS_H 1
7 
8 #include <stdint.h>
9 
10 /** ascii: XFSB */
11 # define XFS_SB_MAGIC 0x58465342
12 /** ascii: XAGF */
13 # define XFS_AGF_MAGIC 0x58414743
14 /** ascii: XAGI */
15 # define XFS_AGI_MAGIC 0x58414749
16 
17 /** inode number */
18 typedef uint64_t xfs_ino_t;
19 /** file offset */
20 typedef int64_t xfs_off_t;
21 /** disk address (sectors) */
22 typedef int64_t xfs_daddr_t;
23 typedef uint32_t xfs_agnumber_t;
24 typedef uint32_t xfs_agblock_t;
25 typedef uint32_t xfs_extlen_t;
26 typedef int32_t xfs_extnum_t;
27 typedef int16_t xfs_aextnum_t;
28 typedef uint32_t xfs_dablk_t;
29 typedef uint32_t xfs_dahash_t;
30 typedef uint64_t xfs_fsblock_t;
31 typedef uint64_t xfs_rfsblock_t;
32 typedef uint64_t xfs_rtblock_t;
33 typedef uint64_t xfs_fileoff_t;
34 typedef uint64_t xfs_fillblks_t;
35 typedef uint8_t uuid_t[16];
36 typedef int64_t xfs_fsize_t;
37 
39 };
40 
42 };
43 
44 typedef struct xfs_da_blkinfo {
46 
48 };
49 
50 typedef struct xfs_da_intnode {
51  struct xfs_da_node_hdr {
52  xfs_da_blkinfo_t info;
53  uint16_t count;
54  uint16_t level;
55  } hdr;
57  xfs_dahash_t hashval;
58  xfs_dablk_t before;
59  } betree[1];
61 
64  struct xfs_da3_blkinfo info;
65  uint16_t count;
66  uint16_t level;
67  uint32_t pad32;
68  } hdr;
69  struct xfs_da_node_entry betree[1];
70 };
71 
73  int32_t t_sec;
74  int32_t t_nsec;
75 };
76 
77 struct xfs_sb {
78  uint32_t sb_magicnum;
79 };
80 
81 xfs_dahash_t xfs_da_hashname(const uint8_t *name, int namelen);
82 
83 
84 #endif /* !_SYS_FS_XFS_H */
Definition: xfs.h:56
Definition: xfs.h:77
int64_t xfs_off_t
Definition: xfs.h:20
int64_t xfs_daddr_t
Definition: xfs.h:22
uint64_t xfs_ino_t
Definition: xfs.h:18