linux-btrfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [RFC][PATCH 2/2] Subject: btrfs: Introduce btrfs_get_maps_dev()
@ 2011-05-13 23:20 Mark Fasheh
  0 siblings, 0 replies; only message in thread
From: Mark Fasheh @ 2011-05-13 23:20 UTC (permalink / raw)
  To: linux-btrfs; +Cc: Chris Mason, linux-fsdevel, Mark Fasheh

Use this to return the subvolume superblock in proc instead of the global
superblock which is automatically taken today. This fixes a userspace
breakage where discrepancies between the devices two would confuse software
such as lsof.

Signed-off-by: Mark Fasheh <mfasheh@suse.com>
---
 fs/btrfs/super.c |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)

diff --git a/fs/btrfs/super.c b/fs/btrfs/super.c
index 58e7de9..d241fb0 100644
--- a/fs/btrfs/super.c
+++ b/fs/btrfs/super.c
@@ -1115,6 +1115,11 @@ static int btrfs_unfreeze(struct super_block *sb)
 	return 0;
 }
 
+static dev_t btrfs_get_maps_dev(struct inode *inode)
+{
+	return BTRFS_I(inode)->root->anon_super.s_dev;
+}
+
 static const struct super_operations btrfs_super_ops = {
 	.drop_inode	= btrfs_drop_inode,
 	.evict_inode	= btrfs_evict_inode,
@@ -1129,6 +1134,7 @@ static const struct super_operations btrfs_super_ops = {
 	.remount_fs	= btrfs_remount,
 	.freeze_fs	= btrfs_freeze,
 	.unfreeze_fs	= btrfs_unfreeze,
+	.get_maps_dev	= btrfs_get_maps_dev,
 };
 
 static const struct file_operations btrfs_ctl_fops = {
-- 
1.6.4.2


^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2011-05-13 23:20 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-05-13 23:20 [RFC][PATCH 2/2] Subject: btrfs: Introduce btrfs_get_maps_dev() Mark Fasheh

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).