[PATCH] Include subvolume= and metadata_ratio= in /cat/proc

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxxxxxxxxxxxxxxx>
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: signature.asc
Description: This is a digitally signed message part.


[Index of Archives]     [Linux Filesystem Development]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux