Jeff Mahoney 6c14ee
From: Jeff Mahoney <jeffm@suse.com>
Jeff Mahoney 6c14ee
Subject: btrfs: provide super_operations->inode_get_dev
Jeff Mahoney 6c14ee
References: bsc#927455
Jeff Mahoney fa0111
Patch-mainline: No, upstream wants a super_block per anon dev
Jeff Mahoney 6c14ee
Jeff Mahoney 6c14ee
In order to ensure that the per-subvolume anonymous dev_t gets published
Jeff Mahoney 6c14ee
to userspace, we need to provide the super_operations->get_inode_dev
Jeff Mahoney 6c14ee
operation.
Jeff Mahoney 6c14ee
Jeff Mahoney 6c14ee
Signed-off-by: Jeff Mahoney <jeffm@suse.com>
Jeff Mahoney 6c14ee
---
Jeff Mahoney 08ca98
 fs/btrfs/super.c |    6 ++++++
Jeff Mahoney 08ca98
 1 file changed, 6 insertions(+)
Jeff Mahoney 6c14ee
Jeff Mahoney 6c14ee
--- a/fs/btrfs/super.c
Jeff Mahoney 6c14ee
+++ b/fs/btrfs/super.c
Jeff Mahoney 08ca98
@@ -2264,6 +2264,11 @@ static int btrfs_show_devname(struct seq
Jeff Mahoney 6c14ee
 	return 0;
Jeff Mahoney 6c14ee
 }
Jeff Mahoney 6c14ee
 
Jeff Mahoney 6c14ee
+static dev_t btrfs_get_inode_dev(const struct inode *inode)
Jeff Mahoney 6c14ee
+{
Jeff Mahoney 6c14ee
+	return BTRFS_I(inode)->root->anon_dev;
Jeff Mahoney 6c14ee
+}
Jeff Mahoney 6c14ee
+
Jeff Mahoney 6c14ee
 static const struct super_operations btrfs_super_ops = {
Jeff Mahoney 6c14ee
 	.drop_inode	= btrfs_drop_inode,
Jeff Mahoney 6c14ee
 	.evict_inode	= btrfs_evict_inode,
Jeff Mahoney 08ca98
@@ -2278,6 +2283,7 @@ static const struct super_operations btr
Jeff Mahoney 6c14ee
 	.remount_fs	= btrfs_remount,
Jeff Mahoney 6c14ee
 	.freeze_fs	= btrfs_freeze,
Jeff Mahoney fa0111
 	.unfreeze_fs	= btrfs_unfreeze,
Jeff Mahoney 6c14ee
+	.get_inode_dev	= btrfs_get_inode_dev,
Jeff Mahoney 6c14ee
 };
Jeff Mahoney 6c14ee
 
Jeff Mahoney 6c14ee
 static const struct file_operations btrfs_ctl_fops = {