]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
Btrfs: show subvol= and subvolid= in /proc/mounts
authorOmar Sandoval <osandov@osandov.com>
Mon, 18 May 2015 09:16:31 +0000 (02:16 -0700)
committerChuck Anderson <chuck.anderson@oracle.com>
Thu, 8 Jun 2017 06:21:34 +0000 (23:21 -0700)
Orabug: 26088734

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 <dsterba@suse.cz>
Signed-off-by: Omar Sandoval <osandov@osandov.com>
Signed-off-by: Chris Mason <clm@fb.com>
(cherry picked from commit c8d3fe028f64054d75c72566efb9ecf3c75ee161)
Signed-off-by: Liu Bo <bo.li.liu@oracle.com>
fs/btrfs/super.c
fs/seq_file.c

index a40b454aea44333f9d5ad976a86acf8adf5704ef..0fd6508d30a549f40860a3c6389dbb2216c1845c 100644 (file)
@@ -1108,6 +1108,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;
 }
 
index 555f82155be80d4e27eb62785af0926093de6b04..52b492721603db1e37a8fb424a7f112a4932da2f 100644 (file)
@@ -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)
 {