1#include <sys/types.h>
2
3#define EXT4_XATTR_MAGIC 0xEA020000
4#define EXT4_XATTR_INDEX_SECURITY 6
5
6struct ext4_xattr_entry {
7    __u8 e_name_len;
8    __u8 e_name_index;
9    __le16 e_value_offs;
10    __le32 e_value_block;
11    __le32 e_value_size;
12    __le32 e_hash;
13    char e_name[0];
14};
15
16#define EXT4_XATTR_PAD_BITS 2
17#define EXT4_XATTR_PAD (1<<EXT4_XATTR_PAD_BITS)
18#define EXT4_XATTR_ROUND (EXT4_XATTR_PAD-1)
19#define EXT4_XATTR_LEN(name_len) \
20    (((name_len) + EXT4_XATTR_ROUND + \
21    sizeof(struct ext4_xattr_entry)) & ~EXT4_XATTR_ROUND)
22#define EXT4_XATTR_SIZE(size) \
23    (((size) + EXT4_XATTR_ROUND) & ~EXT4_XATTR_ROUND)
24