File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1313#define BTRFS_SUPER_MAGIC 0x9123683E
1414#define BTRFS_MAGIC 0x4D5F53665248425FULL
1515
16+ #define XFS_SUPER_MAGIC 0x58465342
17+
1618/**
1719 * Retrieve the inode and device numbers and return them as a new key.
1820 *
@@ -35,6 +37,15 @@ __always_inline static inode_key_t inode_to_key(struct inode* inode) {
3537
3638 unsigned long magic = inode -> i_sb -> s_magic ;
3739 switch (magic ) {
40+ case XFS_SUPER_MAGIC : {
41+ // XFS uses a major at bit 20 in kernel space, but puts it at bit
42+ // 8 in userspace.
43+ uint64_t major = inode -> i_sb -> s_dev >> 20 ;
44+ uint64_t minor = inode -> i_sb -> s_dev & 0xFFFFF ;
45+ key .dev = (major << 8 ) | minor ;
46+ key .inode = inode -> i_ino ;
47+ break ;
48+ }
3849 case BTRFS_MAGIC :
3950 case BTRFS_SUPER_MAGIC :
4051 if (bpf_core_type_exists (struct btrfs_inode )) {
You can’t perform that action at this time.
0 commit comments