return NULL;
}
- if ((xattr_ref->ea_size + EXT4_XATTR_SIZE(data_size) +
- EXT4_XATTR_LEN(item->name_len)
- >
- ext4_xattr_inode_space(xattr_ref) -
- sizeof(struct ext4_xattr_ibody_header))
- &&
- (xattr_ref->ea_size + EXT4_XATTR_SIZE(data_size) +
- EXT4_XATTR_LEN(item->name_len) >
- ext4_xattr_block_space(xattr_ref) -
- sizeof(struct ext4_xattr_header))) {
- ext4_xattr_item_free(item);
-
- if (err)
- *err = ENOSPC;
-
- return NULL;
- }
item->in_inode = true;
if (xattr_ref->inode_size_rem <
EXT4_XATTR_SIZE(data_size) +
/*
* Check if we can hold this entry in both in-inode and
- * on-block form
- */
- if ((xattr_ref->ea_size - EXT4_XATTR_SIZE(old_data_size) +
- EXT4_XATTR_SIZE(new_data_size)
- >
- ext4_xattr_inode_space(xattr_ref) -
- sizeof(struct ext4_xattr_ibody_header))
- &&
- (xattr_ref->ea_size - EXT4_XATTR_SIZE(old_data_size) +
- EXT4_XATTR_SIZE(new_data_size)
- >
- ext4_xattr_block_space(xattr_ref) -
- sizeof(struct ext4_xattr_header))) {
-
- return ENOSPC;
- }
-
- /*
+ * on-block form.
+ *
* More complicated case: we do not allow entries stucking in
* the middle between in-inode space and on-block space, so
* the entry has to stay in either inode space or block space.
}
RB_FOREACH_SAFE(item, ext4_xattr_tree, &xattr_ref->root, save_item)
{
- if (EXT4_XATTR_SIZE(item->data_size) +
- EXT4_XATTR_LEN(item->name_len) <=
- inode_size_rem) {
+ if (item->in_inode) {
ibody_data = (char *)ibody_data -
EXT4_XATTR_SIZE(item->data_size);
ext4_xattr_set_inode_entry(item, ibody_header, entry,