scoutfs-utils: hidden and indexed xattrs

Add support for the xattr tags which can hide or index xattrs by their
name.  We get an item that indexes inodes by the presence of an xattr, a
listxattr_raw ioctl which can show hidden xattrs, and an ioctl that
finds inodes which have an xattr.

Signed-off-by: Zach Brown <zab@versity.com>
This commit is contained in:
Zach Brown
2019-06-24 10:08:35 -07:00
parent 8d505668fe
commit 674224d454
6 changed files with 329 additions and 3 deletions
+12 -3
View File
@@ -108,6 +108,11 @@ struct scoutfs_key {
#define skii_major _sk_second
#define skii_ino _sk_third
/* xattr index */
#define skxi_hash _sk_first
#define skxi_ino _sk_second
#define skxi_id _sk_third
/* node free extent */
#define sknf_node_id _sk_first
#define sknf_major _sk_second
@@ -351,9 +356,10 @@ struct scoutfs_segment_block {
* Keys are first sorted by major key zones.
*/
#define SCOUTFS_INODE_INDEX_ZONE 1
#define SCOUTFS_NODE_ZONE 2
#define SCOUTFS_FS_ZONE 3
#define SCOUTFS_LOCK_ZONE 4
#define SCOUTFS_XATTR_INDEX_ZONE 2
#define SCOUTFS_NODE_ZONE 3
#define SCOUTFS_FS_ZONE 4
#define SCOUTFS_LOCK_ZONE 5
#define SCOUTFS_MAX_ZONE 8 /* power of 2 is efficient */
/* inode index zone */
@@ -361,6 +367,9 @@ struct scoutfs_segment_block {
#define SCOUTFS_INODE_INDEX_DATA_SEQ_TYPE 2
#define SCOUTFS_INODE_INDEX_NR 3 /* don't forget to update */
/* xattr index zone */
#define SCOUTFS_XATTR_INDEX_NAME_TYPE 1
/* node zone (also used in server alloc btree) */
#define SCOUTFS_FREE_EXTENT_BLKNO_TYPE 1
#define SCOUTFS_FREE_EXTENT_BLOCKS_TYPE 2