All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] Include subvolume= and metadata_ratio= in /cat/proc
@ 2010-01-14 19:59 Goffredo Baroncelli
  0 siblings, 0 replies; only message in thread
From: Goffredo Baroncelli @ 2010-01-14 19:59 UTC (permalink / raw)
  To: linux-btrfs

[-- Attachment #1: Type: Text/Plain, Size: 1435 bytes --]

Hi all,

this patch include in /proc/mount the info about which subvolume is mounted 
and which metadata_ratio value is used.

$ cat /proc/mounts
rootfs / rootfs rw 0 0
[...]
/dev/sdc /tmp/t4 btrfs rw,relatime,metadata_ratio=20 0 0
/dev/sdc /mnt/btrfs btrfs rw,relatime,degraded,metadata_ratio=20,subvol=snap-
of-root 0 0

BR
G.Baroncelli

commit 3d7ea7bbd70a66c4d0f369b2879c503b722e8834
Author: ghigo <ghigo@kreijack.homelinux.net>
Date:   Thu Jan 14 20:27:41 2010 +0100

    Add info about metadata_ratio and subvolume name

diff --git a/fs/btrfs/super.c b/fs/btrfs/super.c
index 3f9b457..faeaa7f 100644
--- a/fs/btrfs/super.c
+++ b/fs/btrfs/super.c
@@ -461,6 +461,16 @@ static int btrfs_show_options(struct seq_file *seq, 
struct vfsmount *vfs)
 		seq_puts(seq, ",discard");
 	if (!(root->fs_info->sb->s_flags & MS_POSIXACL))
 		seq_puts(seq, ",noacl");
+	if( root->fs_info->metadata_ratio )
+		seq_printf(seq, ",metadata_ratio=%d", 
+			root->fs_info->metadata_ratio);
+	spin_lock(&vfs->mnt_root->d_lock);
+	if (vfs->mnt_root->d_name.len != 1 ||
+	    vfs->mnt_root->d_name.name[0] != '/'){
+		seq_puts(seq, ",subvol=");
+		seq_puts(seq, vfs->mnt_root->d_name.name);
+	}
+	spin_unlock(&vfs->mnt_root->d_lock);
 	return 0;
 }
 



-- 
gpg key@ keyserver.linux.it: Goffredo Baroncelli (ghigo) <kreijackATinwind.it>
Key fingerprint = 4769 7E51 5293 D36C 814E  C054 BF04 F161 3DC5 0512

[-- Attachment #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 189 bytes --]

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2010-01-14 19:59 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-01-14 19:59 [PATCH] Include subvolume= and metadata_ratio= in /cat/proc Goffredo Baroncelli

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.