1
2
3
4
5
6
7 #ifndef __XFS_SHARED_H__
8 #define __XFS_SHARED_H__
9
10
11
12
13
14 struct xfs_ifork;
15 struct xfs_buf;
16 struct xfs_buf_ops;
17 struct xfs_mount;
18 struct xfs_trans;
19 struct xfs_inode;
20
21
22
23
24 extern const struct xfs_buf_ops xfs_agf_buf_ops;
25 extern const struct xfs_buf_ops xfs_agi_buf_ops;
26 extern const struct xfs_buf_ops xfs_agf_buf_ops;
27 extern const struct xfs_buf_ops xfs_agfl_buf_ops;
28 extern const struct xfs_buf_ops xfs_bnobt_buf_ops;
29 extern const struct xfs_buf_ops xfs_cntbt_buf_ops;
30 extern const struct xfs_buf_ops xfs_rmapbt_buf_ops;
31 extern const struct xfs_buf_ops xfs_refcountbt_buf_ops;
32 extern const struct xfs_buf_ops xfs_attr3_leaf_buf_ops;
33 extern const struct xfs_buf_ops xfs_attr3_rmt_buf_ops;
34 extern const struct xfs_buf_ops xfs_bmbt_buf_ops;
35 extern const struct xfs_buf_ops xfs_da3_node_buf_ops;
36 extern const struct xfs_buf_ops xfs_dquot_buf_ops;
37 extern const struct xfs_buf_ops xfs_symlink_buf_ops;
38 extern const struct xfs_buf_ops xfs_agi_buf_ops;
39 extern const struct xfs_buf_ops xfs_inobt_buf_ops;
40 extern const struct xfs_buf_ops xfs_finobt_buf_ops;
41 extern const struct xfs_buf_ops xfs_inode_buf_ops;
42 extern const struct xfs_buf_ops xfs_inode_buf_ra_ops;
43 extern const struct xfs_buf_ops xfs_dquot_buf_ops;
44 extern const struct xfs_buf_ops xfs_dquot_buf_ra_ops;
45 extern const struct xfs_buf_ops xfs_sb_buf_ops;
46 extern const struct xfs_buf_ops xfs_sb_quiet_buf_ops;
47 extern const struct xfs_buf_ops xfs_symlink_buf_ops;
48 extern const struct xfs_buf_ops xfs_rtbuf_ops;
49
50
51 int xfs_log_calc_unit_res(struct xfs_mount *mp, int unit_bytes);
52 int xfs_log_calc_minimum_size(struct xfs_mount *);
53
54 struct xfs_trans_res;
55 void xfs_log_get_max_trans_res(struct xfs_mount *mp,
56 struct xfs_trans_res *max_resp);
57
58
59
60
61 #define XFS_TRANS_DIRTY 0x01
62 #define XFS_TRANS_SB_DIRTY 0x02
63 #define XFS_TRANS_PERM_LOG_RES 0x04
64 #define XFS_TRANS_SYNC 0x08
65 #define XFS_TRANS_DQ_DIRTY 0x10
66 #define XFS_TRANS_RESERVE 0x20
67 #define XFS_TRANS_NO_WRITECOUNT 0x40
68
69
70
71
72
73
74
75
76
77
78
79 #define XFS_TRANS_LOWMODE 0x100
80
81
82
83
84 #define XFS_TRANS_SB_ICOUNT 0x00000001
85 #define XFS_TRANS_SB_IFREE 0x00000002
86 #define XFS_TRANS_SB_FDBLOCKS 0x00000004
87 #define XFS_TRANS_SB_RES_FDBLOCKS 0x00000008
88 #define XFS_TRANS_SB_FREXTENTS 0x00000010
89 #define XFS_TRANS_SB_RES_FREXTENTS 0x00000020
90 #define XFS_TRANS_SB_DBLOCKS 0x00000040
91 #define XFS_TRANS_SB_AGCOUNT 0x00000080
92 #define XFS_TRANS_SB_IMAXPCT 0x00000100
93 #define XFS_TRANS_SB_REXTSIZE 0x00000200
94 #define XFS_TRANS_SB_RBMBLOCKS 0x00000400
95 #define XFS_TRANS_SB_RBLOCKS 0x00000800
96 #define XFS_TRANS_SB_REXTENTS 0x00001000
97 #define XFS_TRANS_SB_REXTSLOG 0x00002000
98
99
100
101
102
103
104 #define XFS_AGF_REF 4
105 #define XFS_AGI_REF 4
106 #define XFS_AGFL_REF 3
107 #define XFS_INO_BTREE_REF 3
108 #define XFS_ALLOC_BTREE_REF 2
109 #define XFS_BMAP_BTREE_REF 2
110 #define XFS_RMAP_BTREE_REF 2
111 #define XFS_DIR_BTREE_REF 2
112 #define XFS_INO_REF 2
113 #define XFS_ATTR_BTREE_REF 1
114 #define XFS_DQUOT_REF 1
115 #define XFS_REFC_BTREE_REF 1
116 #define XFS_SSB_REF 0
117
118
119
120
121 #define XFS_ICHGTIME_MOD 0x1
122 #define XFS_ICHGTIME_CHG 0x2
123 #define XFS_ICHGTIME_CREATE 0x4
124
125
126
127
128
129 int xfs_symlink_blocks(struct xfs_mount *mp, int pathlen);
130 int xfs_symlink_hdr_set(struct xfs_mount *mp, xfs_ino_t ino, uint32_t offset,
131 uint32_t size, struct xfs_buf *bp);
132 bool xfs_symlink_hdr_ok(xfs_ino_t ino, uint32_t offset,
133 uint32_t size, struct xfs_buf *bp);
134 void xfs_symlink_local_to_remote(struct xfs_trans *tp, struct xfs_buf *bp,
135 struct xfs_inode *ip, struct xfs_ifork *ifp);
136 xfs_failaddr_t xfs_symlink_shortform_verify(struct xfs_inode *ip);
137
138
139 struct xfs_ino_geometry {
140
141 uint64_t maxicount;
142
143
144 unsigned int inode_cluster_size;
145
146
147
148
149
150
151
152 unsigned int inode_cluster_size_raw;
153
154
155 unsigned int inodes_per_cluster;
156 unsigned int blocks_per_cluster;
157
158
159 unsigned int cluster_align;
160 unsigned int cluster_align_inodes;
161 unsigned int inoalign_mask;
162
163 unsigned int inobt_mxr[2];
164 unsigned int inobt_mnr[2];
165 unsigned int inobt_maxlevels;
166
167
168 unsigned int ialloc_inos;
169 unsigned int ialloc_blks;
170
171
172 unsigned int ialloc_min_blks;
173
174
175 unsigned int ialloc_align;
176
177 unsigned int agino_log;
178 };
179
180 #endif