From patchwork Fri May 13 23:20:17 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mark Fasheh X-Patchwork-Id: 784492 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter1.kernel.org (8.14.4/8.14.3) with ESMTP id p4DNNDLg012755 for ; Fri, 13 May 2011 23:23:13 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1758429Ab1EMXXI (ORCPT ); Fri, 13 May 2011 19:23:08 -0400 Received: from cantor2.suse.de ([195.135.220.15]:39411 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1758423Ab1EMXXI (ORCPT ); Fri, 13 May 2011 19:23:08 -0400 Received: from relay2.suse.de (charybdis-ext.suse.de [195.135.221.2]) by mx2.suse.de (Postfix) with ESMTP id 399B18765C; Sat, 14 May 2011 01:23:07 +0200 (CEST) From: Mark Fasheh To: linux-btrfs Cc: Chris Mason , linux-fsdevel , Mark Fasheh Subject: [RFC][PATCH 2/2] Subject: btrfs: Introduce btrfs_get_maps_dev() Date: Fri, 13 May 2011 16:20:17 -0700 Message-Id: <1305328817-10067-2-git-send-email-mfasheh@suse.com> X-Mailer: git-send-email 1.6.4.2 Sender: linux-btrfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-btrfs@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.6 (demeter1.kernel.org [140.211.167.41]); Fri, 13 May 2011 23:23:14 +0000 (UTC) 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 --- 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 = {