1
2
3
4
5
6
7#ifndef __XFS_ATTR_LEAF_H__
8#define __XFS_ATTR_LEAF_H__
9
10struct attrlist;
11struct xfs_attr_list_context;
12struct xfs_da_args;
13struct xfs_da_state;
14struct xfs_da_state_blk;
15struct xfs_inode;
16struct xfs_trans;
17
18
19
20
21struct xfs_attr3_icleaf_hdr {
22 uint32_t forw;
23 uint32_t back;
24 uint16_t magic;
25 uint16_t count;
26 uint16_t usedbytes;
27
28
29
30
31
32
33 uint32_t firstused;
34 __u8 holes;
35 struct {
36 uint16_t base;
37 uint16_t size;
38 } freemap[XFS_ATTR_LEAF_MAPSIZE];
39};
40
41
42
43
44
45
46
47
48void xfs_attr_shortform_create(struct xfs_da_args *args);
49void xfs_attr_shortform_add(struct xfs_da_args *args, int forkoff);
50int xfs_attr_shortform_lookup(struct xfs_da_args *args);
51int xfs_attr_shortform_getvalue(struct xfs_da_args *args);
52int xfs_attr_shortform_to_leaf(struct xfs_da_args *args,
53 struct xfs_buf **leaf_bp);
54int xfs_attr_shortform_remove(struct xfs_da_args *args);
55int xfs_attr_shortform_allfit(struct xfs_buf *bp, struct xfs_inode *dp);
56int xfs_attr_shortform_bytesfit(struct xfs_inode *dp, int bytes);
57xfs_failaddr_t xfs_attr_shortform_verify(struct xfs_inode *ip);
58void xfs_attr_fork_remove(struct xfs_inode *ip, struct xfs_trans *tp);
59
60
61
62
63int xfs_attr3_leaf_to_node(struct xfs_da_args *args);
64int xfs_attr3_leaf_to_shortform(struct xfs_buf *bp,
65 struct xfs_da_args *args, int forkoff);
66int xfs_attr3_leaf_clearflag(struct xfs_da_args *args);
67int xfs_attr3_leaf_setflag(struct xfs_da_args *args);
68int xfs_attr3_leaf_flipflags(struct xfs_da_args *args);
69
70
71
72
73int xfs_attr3_leaf_split(struct xfs_da_state *state,
74 struct xfs_da_state_blk *oldblk,
75 struct xfs_da_state_blk *newblk);
76int xfs_attr3_leaf_lookup_int(struct xfs_buf *leaf,
77 struct xfs_da_args *args);
78int xfs_attr3_leaf_getvalue(struct xfs_buf *bp, struct xfs_da_args *args);
79int xfs_attr3_leaf_add(struct xfs_buf *leaf_buffer,
80 struct xfs_da_args *args);
81int xfs_attr3_leaf_remove(struct xfs_buf *leaf_buffer,
82 struct xfs_da_args *args);
83int xfs_attr3_leaf_list_int(struct xfs_buf *bp,
84 struct xfs_attr_list_context *context);
85
86
87
88
89int xfs_attr3_leaf_toosmall(struct xfs_da_state *state, int *retval);
90void xfs_attr3_leaf_unbalance(struct xfs_da_state *state,
91 struct xfs_da_state_blk *drop_blk,
92 struct xfs_da_state_blk *save_blk);
93
94
95
96xfs_dahash_t xfs_attr_leaf_lasthash(struct xfs_buf *bp, int *count);
97int xfs_attr_leaf_order(struct xfs_buf *leaf1_bp,
98 struct xfs_buf *leaf2_bp);
99int xfs_attr_leaf_newentsize(struct xfs_da_args *args, int *local);
100int xfs_attr3_leaf_read(struct xfs_trans *tp, struct xfs_inode *dp,
101 xfs_dablk_t bno, struct xfs_buf **bpp);
102void xfs_attr3_leaf_hdr_from_disk(struct xfs_da_geometry *geo,
103 struct xfs_attr3_icleaf_hdr *to,
104 struct xfs_attr_leafblock *from);
105void xfs_attr3_leaf_hdr_to_disk(struct xfs_da_geometry *geo,
106 struct xfs_attr_leafblock *to,
107 struct xfs_attr3_icleaf_hdr *from);
108
109#endif
110