0001
0002
0003
0004
0005
0006 #ifndef __XFS_ATTR_SF_H__
0007 #define __XFS_ATTR_SF_H__
0008
0009
0010
0011
0012
0013
0014
0015 typedef struct xfs_attr_sf_hdr xfs_attr_sf_hdr_t;
0016
0017
0018
0019
0020 typedef struct xfs_attr_sf_sort {
0021 uint8_t entno;
0022 uint8_t namelen;
0023 uint8_t valuelen;
0024 uint8_t flags;
0025 xfs_dahash_t hash;
0026 unsigned char *name;
0027 } xfs_attr_sf_sort_t;
0028
0029 #define XFS_ATTR_SF_ENTSIZE_MAX \
0030 ((1 << (NBBY*(int)sizeof(uint8_t))) - 1)
0031
0032
0033 static inline int xfs_attr_sf_entsize_byname(uint8_t nlen, uint8_t vlen)
0034 {
0035 return sizeof(struct xfs_attr_sf_entry) + nlen + vlen;
0036 }
0037
0038
0039 static inline int xfs_attr_sf_entsize(struct xfs_attr_sf_entry *sfep)
0040 {
0041 return struct_size(sfep, nameval, sfep->namelen + sfep->valuelen);
0042 }
0043
0044
0045 static inline struct xfs_attr_sf_entry *
0046 xfs_attr_sf_nextentry(struct xfs_attr_sf_entry *sfep)
0047 {
0048 return (void *)sfep + xfs_attr_sf_entsize(sfep);
0049 }
0050
0051 #endif