summaryrefslogtreecommitdiffstats
path: root/net/ceph/debugfs.c
diff options
context:
space:
mode:
authorIlya Dryomov <idryomov@gmail.com>2017-06-15 16:30:53 +0200
committerIlya Dryomov <idryomov@gmail.com>2017-07-07 17:25:15 +0200
commitdc98ff7230e5ccf11c621dff0d590e83574a7184 (patch)
treebc98e0f8cf3c0d5800ac6b6d57519d99ffacfc6f /net/ceph/debugfs.c
parent8e48cf00c48fdefb01f70db81f31438cd0c29dcc (diff)
downloadlinux-dc98ff7230e5ccf11c621dff0d590e83574a7184.tar.bz2
libceph: introduce ceph_spg, ceph_pg_to_primary_shard()
Store both raw pgid and actual spgid in ceph_osd_request_target. Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
Diffstat (limited to 'net/ceph/debugfs.c')
-rw-r--r--net/ceph/debugfs.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/net/ceph/debugfs.c b/net/ceph/debugfs.c
index 71ba13927b3d..50ab1bdb16e2 100644
--- a/net/ceph/debugfs.c
+++ b/net/ceph/debugfs.c
@@ -147,11 +147,20 @@ static int monc_show(struct seq_file *s, void *p)
return 0;
}
+static void dump_spgid(struct seq_file *s, const struct ceph_spg *spgid)
+{
+ seq_printf(s, "%llu.%x", spgid->pgid.pool, spgid->pgid.seed);
+ if (spgid->shard != CEPH_SPG_NOSHARD)
+ seq_printf(s, "s%d", spgid->shard);
+}
+
static void dump_target(struct seq_file *s, struct ceph_osd_request_target *t)
{
int i;
- seq_printf(s, "osd%d\t%llu.%x\t[", t->osd, t->pgid.pool, t->pgid.seed);
+ seq_printf(s, "osd%d\t%llu.%x\t", t->osd, t->pgid.pool, t->pgid.seed);
+ dump_spgid(s, &t->spgid);
+ seq_puts(s, "\t[");
for (i = 0; i < t->up.size; i++)
seq_printf(s, "%s%d", (!i ? "" : ","), t->up.osds[i]);
seq_printf(s, "]/%d\t[", t->up.primary);