| .. | .. |
|---|
| 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 | |
|---|