Skip to content

Commit

Permalink
ceph: add column 'mds' to show caps in more user friendly
Browse files Browse the repository at this point in the history
In multi-mds, the 'caps' debugfs file will have duplicate ino,
add the 'mds' column to indicate which mds session the cap belongs to.

Signed-off-by: Yanhu Cao <gmayyyha@gmail.com>
Reviewed-by: Jeff Layton <jlayton@kernel.org>
Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
  • Loading branch information
Yanhu Cao authored and Ilya Dryomov committed Oct 12, 2020
1 parent 3986f9a commit 3a8ebe0
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions fs/ceph/debugfs.c
Original file line number Diff line number Diff line change
Expand Up @@ -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%-17llx%-17s%-17s\n", ceph_ino(inode),
seq_printf(s, "0x%-17llx%-3d%-17s%-17s\n", ceph_ino(inode),
cap->session->s_mds,
ceph_cap_string(cap->issued),
ceph_cap_string(cap->implemented));
return 0;
Expand All @@ -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++) {
Expand Down

0 comments on commit 3a8ebe0

Please sign in to comment.