From patchwork Mon May 18 09:16:31 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Omar Sandoval X-Patchwork-Id: 6427061 Return-Path: X-Original-To: patchwork-linux-btrfs@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id BBA2E9F1C1 for ; Mon, 18 May 2015 09:17:03 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id DAF782060C for ; Mon, 18 May 2015 09:17:02 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id D16202060B for ; Mon, 18 May 2015 09:17:01 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753039AbbERJQx (ORCPT ); Mon, 18 May 2015 05:16:53 -0400 Received: from mail-pd0-f177.google.com ([209.85.192.177]:36780 "EHLO mail-pd0-f177.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752986AbbERJQt (ORCPT ); Mon, 18 May 2015 05:16:49 -0400 Received: by pdfh10 with SMTP id h10so141401282pdf.3 for ; Mon, 18 May 2015 02:16:48 -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=KnJD9P6iIZQxypdyJQzTN4L7lyD4bdhD17VmMgor8uc=; b=mQwRYMl+v3GXcRqi5CtKTpO1m5LffJIVbgnZjpXxQ3D6BhUqtODyUYJJe5FWXKIdE0 ejdZysMEJL/f+hQaUkOzzrfQX61YhoD1+8qo2pUINRike1UETJBCHcEU6DgCFBuo7P9e CZ12eHBohqbYldOls5cg2Icx8jVjNFp4h+FphWgvf2qSpiG3r9bINgyTZQ7YJix2WxXh GOjpuY+SD8zEgJ0XAcfgYeeKl7wfiydwJMMJ3JmYWrQrCAZcATasv7dOjgslL31Y3MVE +/vQ9yJ3WVO1l8xbUgD0W665W0gYRTjz8u/tC6yXfdsfGBlEzDkbtOoDaQeHGTj47tHi sz8Q== X-Gm-Message-State: ALoCoQmI8/z2dwSfdxh+99rEwD2n7TRnaBzYjx6BCmDQiEr6HBBbOnMX9Kv8Pb1ZUsPgqCaUr3yN X-Received: by 10.68.99.197 with SMTP id es5mr12340629pbb.131.1431940608792; Mon, 18 May 2015 02:16:48 -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 v2sm9377370pdn.90.2015.05.18.02.16.47 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 18 May 2015 02:16:47 -0700 (PDT) From: Omar Sandoval To: Chris Mason , Josef Bacik , David Sterba , linux-btrfs@vger.kernel.org Cc: Qu Wenruo , Omar Sandoval Subject: [PATCH v3 6/6] Btrfs: show subvol= and subvolid= in /proc/mounts Date: Mon, 18 May 2015 02:16:31 -0700 Message-Id: <9336e587b7b0f44b1377bc527afa74911d2d79f8.1431939732.git.osandov@osandov.com> X-Mailer: git-send-email 2.4.1 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. Reviewed-by: David Sterba Signed-off-by: Omar Sandoval --- 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 dc51a51..dd70f75 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) {