1
2
3
4
5
6 #ifndef __XFS_INODE_BUF_H__
7 #define __XFS_INODE_BUF_H__
8
9 struct xfs_inode;
10 struct xfs_dinode;
11
12
13
14
15
16
17
18 struct xfs_icdinode {
19 int8_t di_version;
20 int8_t di_format;
21 uint16_t di_flushiter;
22 uint32_t di_uid;
23 uint32_t di_gid;
24 uint16_t di_projid_lo;
25 uint16_t di_projid_hi;
26 xfs_fsize_t di_size;
27 xfs_rfsblock_t di_nblocks;
28 xfs_extlen_t di_extsize;
29 xfs_extnum_t di_nextents;
30 xfs_aextnum_t di_anextents;
31 uint8_t di_forkoff;
32 int8_t di_aformat;
33 uint32_t di_dmevmask;
34 uint16_t di_dmstate;
35 uint16_t di_flags;
36
37 uint64_t di_flags2;
38 uint32_t di_cowextsize;
39
40 xfs_ictimestamp_t di_crtime;
41 };
42
43
44
45
46
47 struct xfs_imap {
48 xfs_daddr_t im_blkno;
49 unsigned short im_len;
50 unsigned short im_boffset;
51 };
52
53 int xfs_imap_to_bp(struct xfs_mount *, struct xfs_trans *,
54 struct xfs_imap *, struct xfs_dinode **,
55 struct xfs_buf **, uint, uint);
56 int xfs_iread(struct xfs_mount *, struct xfs_trans *,
57 struct xfs_inode *, uint);
58 void xfs_dinode_calc_crc(struct xfs_mount *, struct xfs_dinode *);
59 void xfs_inode_to_disk(struct xfs_inode *ip, struct xfs_dinode *to,
60 xfs_lsn_t lsn);
61 void xfs_inode_from_disk(struct xfs_inode *ip, struct xfs_dinode *from);
62 void xfs_log_dinode_to_disk(struct xfs_log_dinode *from,
63 struct xfs_dinode *to);
64
65 bool xfs_dinode_good_version(struct xfs_mount *mp, __u8 version);
66
67 #if defined(DEBUG)
68 void xfs_inobp_check(struct xfs_mount *, struct xfs_buf *);
69 #else
70 #define xfs_inobp_check(mp, bp)
71 #endif
72
73 xfs_failaddr_t xfs_dinode_verify(struct xfs_mount *mp, xfs_ino_t ino,
74 struct xfs_dinode *dip);
75 xfs_failaddr_t xfs_inode_validate_extsize(struct xfs_mount *mp,
76 uint32_t extsize, uint16_t mode, uint16_t flags);
77 xfs_failaddr_t xfs_inode_validate_cowextsize(struct xfs_mount *mp,
78 uint32_t cowextsize, uint16_t mode, uint16_t flags,
79 uint64_t flags2);
80
81 #endif