Hi all,
I maintain kernel module on top of VFS.
When action executes, e.g vfs_rename, i get dentry object.
I need to get the fsid from the dentry object.
Since I maintain the same code for alot of suse distro and kernels
(11.4, 12.0, 12.1, 12.2), i have many #if macros,
My question is in SLES 12.2 kernel 4.4.103*, How do i get BTRFS dentry FSID ?
In previous kernels I did:
1. dentry->d_inode->i_op->getattr(NULL, dentry, &kstat)
2. btrfsInode->root->anon_super.s_dev
3. btrfsInode->root->anon_dev
I cast Inode to btrfs inode:
struct btrfs_inode *btrfsInode;
btrfsInode = BTRFS_I(dentry->d_inode);
On this version 4.4.103*,, there is the operation:
dentry->d_inode->i_sb->s_op->get_inode_dev(dentry->d_inode);
I have 2 questions,
1. Is this the proper way to obtain it ?
2. In some dentries, after casting inode to btrfsInode, the
btrfsInode->root is null, how could that be ? shouldn't the cast fail
(return null) ?
Thanks
--
To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html