| .. | .. |
|---|
| 48 | 48 | __le32 e_value_inum; /* inode in which the value is stored */ |
|---|
| 49 | 49 | __le32 e_value_size; /* size of attribute value */ |
|---|
| 50 | 50 | __le32 e_hash; /* hash value of name and value */ |
|---|
| 51 | | - char e_name[0]; /* attribute name */ |
|---|
| 51 | + char e_name[]; /* attribute name */ |
|---|
| 52 | 52 | }; |
|---|
| 53 | 53 | |
|---|
| 54 | 54 | #define EXT4_XATTR_PAD_BITS 2 |
|---|
| .. | .. |
|---|
| 95 | 95 | |
|---|
| 96 | 96 | #define EXT4_ZERO_XATTR_VALUE ((void *)-1) |
|---|
| 97 | 97 | |
|---|
| 98 | +/* |
|---|
| 99 | + * If we want to add an xattr to the inode, we should make sure that |
|---|
| 100 | + * i_extra_isize is not 0 and that the inode size is not less than |
|---|
| 101 | + * EXT4_GOOD_OLD_INODE_SIZE + extra_isize + pad. |
|---|
| 102 | + * EXT4_GOOD_OLD_INODE_SIZE extra_isize header entry pad data |
|---|
| 103 | + * |--------------------------|------------|------|---------|---|-------| |
|---|
| 104 | + */ |
|---|
| 105 | +#define EXT4_INODE_HAS_XATTR_SPACE(inode) \ |
|---|
| 106 | + ((EXT4_I(inode)->i_extra_isize != 0) && \ |
|---|
| 107 | + (EXT4_GOOD_OLD_INODE_SIZE + EXT4_I(inode)->i_extra_isize + \ |
|---|
| 108 | + sizeof(struct ext4_xattr_ibody_header) + EXT4_XATTR_PAD <= \ |
|---|
| 109 | + EXT4_INODE_SIZE((inode)->i_sb))) |
|---|
| 110 | + |
|---|
| 98 | 111 | struct ext4_xattr_info { |
|---|
| 99 | 112 | const char *name; |
|---|
| 100 | 113 | const void *value; |
|---|
| .. | .. |
|---|
| 118 | 131 | |
|---|
| 119 | 132 | struct ext4_xattr_inode_array { |
|---|
| 120 | 133 | unsigned int count; /* # of used items in the array */ |
|---|
| 121 | | - struct inode *inodes[0]; |
|---|
| 134 | + struct inode *inodes[]; |
|---|
| 122 | 135 | }; |
|---|
| 123 | 136 | |
|---|
| 124 | 137 | extern const struct xattr_handler ext4_xattr_user_handler; |
|---|
| 125 | 138 | extern const struct xattr_handler ext4_xattr_trusted_handler; |
|---|
| 126 | 139 | extern const struct xattr_handler ext4_xattr_security_handler; |
|---|
| 140 | +extern const struct xattr_handler ext4_xattr_hurd_handler; |
|---|
| 127 | 141 | |
|---|
| 128 | 142 | #define EXT4_XATTR_NAME_ENCRYPTION_CONTEXT "c" |
|---|
| 129 | 143 | |
|---|
| .. | .. |
|---|
| 177 | 191 | |
|---|
| 178 | 192 | extern int ext4_expand_extra_isize_ea(struct inode *inode, int new_extra_isize, |
|---|
| 179 | 193 | struct ext4_inode *raw_inode, handle_t *handle); |
|---|
| 194 | +extern void ext4_evict_ea_inode(struct inode *inode); |
|---|
| 180 | 195 | |
|---|
| 181 | 196 | extern const struct xattr_handler *ext4_xattr_handlers[]; |
|---|
| 182 | 197 | |
|---|
| .. | .. |
|---|
| 185 | 200 | extern int ext4_xattr_ibody_get(struct inode *inode, int name_index, |
|---|
| 186 | 201 | const char *name, |
|---|
| 187 | 202 | void *buffer, size_t buffer_size); |
|---|
| 188 | | -extern int ext4_xattr_ibody_inline_set(handle_t *handle, struct inode *inode, |
|---|
| 189 | | - struct ext4_xattr_info *i, |
|---|
| 190 | | - struct ext4_xattr_ibody_find *is); |
|---|
| 203 | +extern int ext4_xattr_ibody_set(handle_t *handle, struct inode *inode, |
|---|
| 204 | + struct ext4_xattr_info *i, |
|---|
| 205 | + struct ext4_xattr_ibody_find *is); |
|---|
| 191 | 206 | |
|---|
| 192 | 207 | extern struct mb_cache *ext4_xattr_create_cache(void); |
|---|
| 193 | 208 | extern void ext4_xattr_destroy_cache(struct mb_cache *); |
|---|