Skip to content

Commit c8d3fe0

Browse files
osandovmasoncl
authored andcommitted
Btrfs: show subvol= and subvolid= in /proc/mounts
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 <[email protected]> Signed-off-by: Omar Sandoval <[email protected]> Signed-off-by: Chris Mason <[email protected]>
1 parent 05dbe68 commit c8d3fe0

File tree

2 files changed

+5
-0
lines changed

2 files changed

+5
-0
lines changed

fs/btrfs/super.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1188,6 +1188,10 @@ static int btrfs_show_options(struct seq_file *seq, struct dentry *dentry)
11881188
seq_puts(seq, ",fatal_errors=panic");
11891189
if (info->commit_interval != BTRFS_DEFAULT_COMMIT_INTERVAL)
11901190
seq_printf(seq, ",commit=%d", info->commit_interval);
1191+
seq_printf(seq, ",subvolid=%llu",
1192+
BTRFS_I(d_inode(dentry))->root->root_key.objectid);
1193+
seq_puts(seq, ",subvol=");
1194+
seq_dentry(seq, dentry, " \t\n\\");
11911195
return 0;
11921196
}
11931197

fs/seq_file.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -538,6 +538,7 @@ int seq_dentry(struct seq_file *m, struct dentry *dentry, const char *esc)
538538

539539
return res;
540540
}
541+
EXPORT_SYMBOL(seq_dentry);
541542

542543
static void *single_start(struct seq_file *p, loff_t *pos)
543544
{

0 commit comments

Comments
 (0)