Skip to contentSkip to conversation

ceph: add column 'mds' to show caps in more user friendly

PATCH In review Yanhu Cao 2 participants 2 messages Aug 24, 2020 Ceph client

lore
Share & tools
lore

Yanhu Cao

author
#0 lore raw

PATCH 1/1 ceph: add column 'mds' to show caps in more user friendly

In multi-mds, the 'caps' debugfs file will have duplicate ino, add the 'mds' column to indicate which mds session the cap belongs to.

---
 fs/ceph/debugfs.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)
fs/ceph/debugfs.c +4 -3
index 97539b497e4c..47f8971a9c52 100644
@@ -202,7 +202,8 @@ static int caps_show_cb(struct inode *inode, struct ceph_cap *cap, void *p)
 {
 	struct seq_file *s = p;
 
-	seq_printf(s, "0x%-17lx%-17s%-17s\n", inode->i_ino,
+	seq_printf(s, "0x%-17lx%-3d%-17s%-17s\n", inode->i_ino,
+		   cap->session->s_mds,
 		   ceph_cap_string(cap->issued),
 		   ceph_cap_string(cap->implemented));
 	return 0;
@@ -222,8 +223,8 @@ static int caps_show(struct seq_file *s, void *p)
 		   "reserved\t%d\n"
 		   "min\t\t%d\n\n",
 		   total, avail, used, reserved, min);
-	seq_printf(s, "ino                issued           implemented\n");
-	seq_printf(s, "-----------------------------------------------\n");
+	seq_printf(s, "ino              mds  issued           implemented\n");
+	seq_printf(s, "--------------------------------------------------\n");
 
 	mutex_lock(&mdsc->mutex);
 	for (i = 0; i < mdsc->max_sessions; i++) {
Signature · 1 line
2.24.3 (Apple Git-128)
#1 lore raw
Quoted 23 lines · Yanhu Cao

In multi-mds, the 'caps' debugfs file will have duplicate ino, add the 'mds' column to indicate which mds session the cap belongs to.

---
 fs/ceph/debugfs.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)
fs/ceph/debugfs.c +2 -1
index 97539b497e4c..47f8971a9c52 100644
@@ -202,7 +202,8 @@ static int caps_show_cb(struct inode *inode, struct ceph_cap *cap, void *p)
 {
 	struct seq_file *s = p;
 
-	seq_printf(s, "0x%-17lx%-17s%-17s\n", inode->i_ino,
+	seq_printf(s, "0x%-17lx%-3d%-17s%-17s\n", inode->i_ino,
+		   cap->session->s_mds,
 		   ceph_cap_string(cap->issued),
 		   ceph_cap_string(cap->implemented));
 	return 0;

fs/ceph/debugfs.c static int caps_show(struct seq_file *s, void *p) · line 230

Quoted 10 lines
fs/ceph/debugfs.c +2 -2
@@ -222,8 +223,8 @@ static int caps_show(struct seq_file *s, void *p)
 		   "reserved\t%d\n"
 		   "min\t\t%d\n\n",
 		   total, avail, used, reserved, min);
-	seq_printf(s, "ino                issued           implemented\n");
-	seq_printf(s, "-----------------------------------------------\n");
+	seq_printf(s, "ino              mds  issued           implemented\n");
+	seq_printf(s, "--------------------------------------------------\n");
 
 	mutex_lock(&mdsc->mutex);
 	for (i = 0; i < mdsc->max_sessions; i++) {

Looks good. Merged.

Thanks!

Signature · 1 line
Jeff Layton <[email protected]>