1
2
3
4
5
6 #ifndef __XFS_ATTR_SF_H__
7 #define __XFS_ATTR_SF_H__
8
9
10
11
12
13
14
15 typedef struct xfs_attr_sf_hdr xfs_attr_sf_hdr_t;
16 typedef struct xfs_attr_sf_entry xfs_attr_sf_entry_t;
17
18
19
20
21 typedef struct xfs_attr_sf_sort {
22 uint8_t entno;
23 uint8_t namelen;
24 uint8_t valuelen;
25 uint8_t flags;
26 xfs_dahash_t hash;
27 unsigned char *name;
28 } xfs_attr_sf_sort_t;
29
30 #define XFS_ATTR_SF_ENTSIZE_BYNAME(nlen,vlen) \
31 (((int)sizeof(xfs_attr_sf_entry_t)-1 + (nlen)+(vlen)))
32 #define XFS_ATTR_SF_ENTSIZE_MAX \
33 ((1 << (NBBY*(int)sizeof(uint8_t))) - 1)
34 #define XFS_ATTR_SF_ENTSIZE(sfep) \
35 ((int)sizeof(xfs_attr_sf_entry_t)-1 + (sfep)->namelen+(sfep)->valuelen)
36 #define XFS_ATTR_SF_NEXTENTRY(sfep) \
37 ((xfs_attr_sf_entry_t *)((char *)(sfep) + XFS_ATTR_SF_ENTSIZE(sfep)))
38 #define XFS_ATTR_SF_TOTSIZE(dp) \
39 (be16_to_cpu(((xfs_attr_shortform_t *) \
40 ((dp)->i_afp->if_u1.if_data))->hdr.totsize))
41
42 #endif