[Btrfs-devel] xattr design thoughts

Josef Bacik jbacik at redhat.com
Tue Oct 16 07:26:44 PDT 2007


Hello,

Now that I actually understand whats going on with the generic xattr handling
stuff, I've rethought how to do xattrs.  Currently each individual xattr for a
particular inode has its own item, or if its too large its own inode.  So if I
create file blah and then add "security.mysec", "user.stuff", "trusted.whatever"
to blah, there will be 3 dir_item's, one for each xattr.  I was trying to figure
out why ext3 wasn't storing the prefix on disk with the xattr and I figured it
out, it has its own little object for holding xattrs for the inode.  So instead
of having 3 different locations for its xattrs, it has one big chunk that it
uses for its xattrs.  So this is what I was thinking of doing, having a xattr
disk structure that holds the name, the index (for looking up the
prefix/handler), and the value.  Then we only use one dir_item per inode for
xattrs, and just pack in new entries as they come along, and then once we
outgrow the dir_item just move it all into an inode.  Let me know what you guys
think about this.  Thank you,

Josef



More information about the Btrfs-devel mailing list