Whamcloud - gitweb
Reserve the EXT4_INCOMPAT_EA_INODE feature flag
authorAndreas Dilger <adilger@sun.com>
Wed, 2 Jun 2010 02:20:22 +0000 (22:20 -0400)
committerTheodore Ts'o <tytso@mit.edu>
Wed, 2 Jun 2010 14:41:37 +0000 (10:41 -0400)
commitcff9690f4e114d95c9031a7468c99fda0ddcb3ec
tree2e2c92bf679e5d5d532fb57de27ef656561a75c8
parenteffb3442419e50b6352fb13cfc8eea03bebf442e
Reserve the EXT4_INCOMPAT_EA_INODE feature flag

Reserve the EXT4_INCOMPAT_EA_INODE feature flag for use with
large extended attributes that are stored in a separate inode.
This changes the on-disk format in several ways:

First, replace the e_value_block field with e_value_inum, so that
an xattr entry can reference an external inode.  This field is
currently unused, as all of the entries live in the same block.

struct ext2_ext_attr_entry {
  __u8 e_name_len; /* length of name */
  __u8 e_name_index; /* attribute name index */
  __le16 e_value_offs; /* offset in disk block of value */
> __le32 e_value_inum; /* inode in which the value is stored */
  __le32 e_value_size; /* size of attribute value */
  __le32 e_hash; /* hash value of name and value */
  char e_name[0]; /* attribute name */
}

Second, add a flag to the inode that indicates it is using a large
(external) extended attribute.  This is needed so that when unlinking
an inode the xattrs will be scanned to unlink the xattr inodes
referenced by the main inode.

Third, for inodes that have a number of xattrs that are larger than
a single block, but not large enough to justify an external inode
(less than 64kB total xattr size, due to e_value_offs limitation)
the ext2_ext_attr_header->h_blocks field can grow beyond a single
block to represent a contiguous allocation of blocks for the xattr.

Signed-off-by: Andreas Dilger <adilger@sun.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
lib/ext2fs/ext2_fs.h