1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19#ifndef __XFS_SHARED_H__
20#define __XFS_SHARED_H__
21
22
23
24
25
26struct xfs_ifork;
27struct xfs_buf;
28struct xfs_buf_ops;
29struct xfs_mount;
30struct xfs_trans;
31struct xfs_inode;
32
33
34
35
36extern const struct xfs_buf_ops xfs_agf_buf_ops;
37extern const struct xfs_buf_ops xfs_agi_buf_ops;
38extern const struct xfs_buf_ops xfs_agf_buf_ops;
39extern const struct xfs_buf_ops xfs_agfl_buf_ops;
40extern const struct xfs_buf_ops xfs_allocbt_buf_ops;
41extern const struct xfs_buf_ops xfs_attr3_leaf_buf_ops;
42extern const struct xfs_buf_ops xfs_attr3_rmt_buf_ops;
43extern const struct xfs_buf_ops xfs_bmbt_buf_ops;
44extern const struct xfs_buf_ops xfs_da3_node_buf_ops;
45extern const struct xfs_buf_ops xfs_dquot_buf_ops;
46extern const struct xfs_buf_ops xfs_symlink_buf_ops;
47extern const struct xfs_buf_ops xfs_agi_buf_ops;
48extern const struct xfs_buf_ops xfs_inobt_buf_ops;
49extern const struct xfs_buf_ops xfs_inode_buf_ops;
50extern const struct xfs_buf_ops xfs_inode_buf_ra_ops;
51extern const struct xfs_buf_ops xfs_dquot_buf_ops;
52extern const struct xfs_buf_ops xfs_dquot_buf_ra_ops;
53extern const struct xfs_buf_ops xfs_sb_buf_ops;
54extern const struct xfs_buf_ops xfs_sb_quiet_buf_ops;
55extern const struct xfs_buf_ops xfs_symlink_buf_ops;
56extern const struct xfs_buf_ops xfs_rtbuf_ops;
57
58
59
60
61
62
63
64
65struct xfs_log_item_desc {
66 struct xfs_log_item *lid_item;
67 struct list_head lid_trans;
68 unsigned char lid_flags;
69};
70
71#define XFS_LID_DIRTY 0x1
72
73
74int xfs_log_calc_unit_res(struct xfs_mount *mp, int unit_bytes);
75int xfs_log_calc_minimum_size(struct xfs_mount *);
76
77
78
79
80
81#define XFS_TRANS_DIRTY 0x01
82#define XFS_TRANS_SB_DIRTY 0x02
83#define XFS_TRANS_PERM_LOG_RES 0x04
84#define XFS_TRANS_SYNC 0x08
85#define XFS_TRANS_DQ_DIRTY 0x10
86#define XFS_TRANS_RESERVE 0x20
87#define XFS_TRANS_NO_WRITECOUNT 0x40
88#define XFS_TRANS_NOFS 0x80
89
90
91
92
93#define XFS_TRANS_SB_ICOUNT 0x00000001
94#define XFS_TRANS_SB_IFREE 0x00000002
95#define XFS_TRANS_SB_FDBLOCKS 0x00000004
96#define XFS_TRANS_SB_RES_FDBLOCKS 0x00000008
97#define XFS_TRANS_SB_FREXTENTS 0x00000010
98#define XFS_TRANS_SB_RES_FREXTENTS 0x00000020
99#define XFS_TRANS_SB_DBLOCKS 0x00000040
100#define XFS_TRANS_SB_AGCOUNT 0x00000080
101#define XFS_TRANS_SB_IMAXPCT 0x00000100
102#define XFS_TRANS_SB_REXTSIZE 0x00000200
103#define XFS_TRANS_SB_RBMBLOCKS 0x00000400
104#define XFS_TRANS_SB_RBLOCKS 0x00000800
105#define XFS_TRANS_SB_REXTENTS 0x00001000
106#define XFS_TRANS_SB_REXTSLOG 0x00002000
107
108
109
110
111
112
113#define XFS_AGF_REF 4
114#define XFS_AGI_REF 4
115#define XFS_AGFL_REF 3
116#define XFS_INO_BTREE_REF 3
117#define XFS_ALLOC_BTREE_REF 2
118#define XFS_BMAP_BTREE_REF 2
119#define XFS_DIR_BTREE_REF 2
120#define XFS_INO_REF 2
121#define XFS_ATTR_BTREE_REF 1
122#define XFS_DQUOT_REF 1
123
124
125
126
127#define XFS_ICHGTIME_MOD 0x1
128#define XFS_ICHGTIME_CHG 0x2
129#define XFS_ICHGTIME_CREATE 0x4
130
131
132
133
134
135int xfs_symlink_blocks(struct xfs_mount *mp, int pathlen);
136int xfs_symlink_hdr_set(struct xfs_mount *mp, xfs_ino_t ino, uint32_t offset,
137 uint32_t size, struct xfs_buf *bp);
138bool xfs_symlink_hdr_ok(xfs_ino_t ino, uint32_t offset,
139 uint32_t size, struct xfs_buf *bp);
140void xfs_symlink_local_to_remote(struct xfs_trans *tp, struct xfs_buf *bp,
141 struct xfs_inode *ip, struct xfs_ifork *ifp);
142
143#endif
144