From patchwork Thu Apr 9 21:34:56 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Omar Sandoval X-Patchwork-Id: 6190961 Return-Path: X-Original-To: patchwork-linux-btrfs@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 1A666BF4A6 for ; Thu, 9 Apr 2015 21:36:10 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 3E25A2037E for ; Thu, 9 Apr 2015 21:36:09 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 516732037A for ; Thu, 9 Apr 2015 21:36:08 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754005AbbDIVfh (ORCPT ); Thu, 9 Apr 2015 17:35:37 -0400 Received: from mail-pa0-f43.google.com ([209.85.220.43]:33453 "EHLO mail-pa0-f43.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753643AbbDIVfb (ORCPT ); Thu, 9 Apr 2015 17:35:31 -0400 Received: by paboj16 with SMTP id oj16so406258pab.0 for ; Thu, 09 Apr 2015 14:35:30 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:in-reply-to:references; bh=TbS/Z8PvtmCzIgaAMsBnYa0LMDiCPdpZyokNpsT/a8s=; b=kgLxPXvXqjTJLPcPnP5mLDaf0RMiW/mVVsyS7gkkzbU+PElBc1DwWG5RhNmVKLQ/cQ 5xWviatKwf9px7/++Z5Rk2myi9VNzzYW5SjBW/xe3P+VjVRZJDiFHHjf6XI87Aerbrlj piD5CxYKRmfciYCq6hiDZDMXCDMRrsEGC3qrvThnbEBjazOvbfTeZtm1uhQk2d+rHq1O b4C8UnekYmFjyhjqqzZWCTKI5tzhCB6/VYnyRqslEHhN8w6uxvAG96NYQm7NavlwtQzZ v2AScqmkb5j75Bps173GRFPVkAVxROvp1zk9E4o8Kud8yXsni3XGhWsY2D+hhvrR9GWK cfxA== X-Gm-Message-State: ALoCoQldqtwMXGLu/AXAQcukf/dOVcbGpGHwp61YTNRDSjUw4QT0F866V97+gepTAvnLxBfZq0/K X-Received: by 10.68.68.176 with SMTP id x16mr29424760pbt.95.1428615330026; Thu, 09 Apr 2015 14:35:30 -0700 (PDT) Received: from mew.localdomain (c-76-104-211-44.hsd1.wa.comcast.net. [76.104.211.44]) by mx.google.com with ESMTPSA id ot6sm15540730pdb.28.2015.04.09.14.35.28 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 09 Apr 2015 14:35:29 -0700 (PDT) From: Omar Sandoval To: Chris Mason , Josef Bacik , David Sterba , linux-btrfs@vger.kernel.org Cc: linux-kernel@vger.kernel.org, Qu Wenruo , Omar Sandoval Subject: [PATCH v2 6/6] Btrfs: show subvol= and subvolid= in /proc/mounts Date: Thu, 9 Apr 2015 14:34:56 -0700 Message-Id: <229b56bc5f19138a74e92869c22934224575216f.1428614837.git.osandov@osandov.com> X-Mailer: git-send-email 2.3.5 In-Reply-To: References: In-Reply-To: References: Sender: linux-btrfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-btrfs@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Now that we're guaranteed to have a meaningful root dentry, we can just export seq_dentry() and use it in btrfs_show_options(). The subvolume ID is easy to get and can also be useful, so put that in there, too. Signed-off-by: Omar Sandoval Reviewed-by: David Sterba --- fs/btrfs/super.c | 4 ++++ fs/seq_file.c | 1 + 2 files changed, 5 insertions(+) diff --git a/fs/btrfs/super.c b/fs/btrfs/super.c index 80a8047..f334cc4 100644 --- a/fs/btrfs/super.c +++ b/fs/btrfs/super.c @@ -1193,6 +1193,10 @@ static int btrfs_show_options(struct seq_file *seq, struct dentry *dentry) seq_puts(seq, ",fatal_errors=panic"); if (info->commit_interval != BTRFS_DEFAULT_COMMIT_INTERVAL) seq_printf(seq, ",commit=%d", info->commit_interval); + seq_printf(seq, ",subvolid=%llu", + BTRFS_I(d_inode(dentry))->root->root_key.objectid); + seq_puts(seq, ",subvol="); + seq_dentry(seq, dentry, " \t\n\\"); return 0; } diff --git a/fs/seq_file.c b/fs/seq_file.c index 555f821..52b4927 100644 --- a/fs/seq_file.c +++ b/fs/seq_file.c @@ -538,6 +538,7 @@ int seq_dentry(struct seq_file *m, struct dentry *dentry, const char *esc) return res; } +EXPORT_SYMBOL(seq_dentry); static void *single_start(struct seq_file *p, loff_t *pos) {