コード例 #1
0
static int osdc_show(struct seq_file *s, void *pp)
{
	struct ceph_client *client = s->private;
	struct ceph_osd_client *osdc = &client->osdc;
	struct rb_node *p;

	mutex_lock(&osdc->request_mutex);
	for (p = rb_first(&osdc->requests); p; p = rb_next(p)) {
		struct ceph_osd_request *req;
		struct ceph_osd_request_head *head;
		struct ceph_osd_op *op;
		int num_ops;
		int opcode, olen;
		int i;

		req = rb_entry(p, struct ceph_osd_request, r_node);

		seq_printf(s, "%lld\tosd%d\t%d.%x\t", req->r_tid,
			   req->r_osd ? req->r_osd->o_osd : -1,
			   le32_to_cpu(req->r_pgid.pool),
			   le16_to_cpu(req->r_pgid.ps));

		head = req->r_request->front.iov_base;
		op = (void *)(head + 1);

		num_ops = le16_to_cpu(head->num_ops);
		olen = le32_to_cpu(head->object_len);
		seq_printf(s, "%.*s", olen,
			   (const char *)(head->ops + num_ops));

		if (req->r_reassert_version.epoch)
			seq_printf(s, "\t%u'%llu",
			   (unsigned)le32_to_cpu(req->r_reassert_version.epoch),
			   le64_to_cpu(req->r_reassert_version.version));
		else
			seq_printf(s, "\t");

		for (i = 0; i < num_ops; i++) {
			opcode = le16_to_cpu(op->op);
			seq_printf(s, "\t%s", ceph_osd_op_name(opcode));
			op++;
		}

		seq_printf(s, "\n");
	}
	mutex_unlock(&osdc->request_mutex);
	return 0;
}
コード例 #2
0
ファイル: debugfs.c プロジェクト: Lyude/linux
static void dump_request(struct seq_file *s, struct ceph_osd_request *req)
{
	int i;

	seq_printf(s, "%llu\t", req->r_tid);
	dump_target(s, &req->r_t);

	seq_printf(s, "\t%d", req->r_attempts);

	for (i = 0; i < req->r_num_ops; i++) {
		struct ceph_osd_req_op *op = &req->r_ops[i];

		seq_printf(s, "%s%s", (i == 0 ? "\t" : ","),
			   ceph_osd_op_name(op->op));
		if (op->op == CEPH_OSD_OP_WATCH)
			seq_printf(s, "-%s",
				   ceph_osd_watch_op_name(op->watch.op));
	}

	seq_putc(s, '\n');
}
コード例 #3
0
ファイル: debugfs.c プロジェクト: 383530895/linux
static int osdc_show(struct seq_file *s, void *pp)
{
	struct ceph_client *client = s->private;
	struct ceph_osd_client *osdc = &client->osdc;
	struct rb_node *p;

	mutex_lock(&osdc->request_mutex);
	for (p = rb_first(&osdc->requests); p; p = rb_next(p)) {
		struct ceph_osd_request *req;
		unsigned int i;
		int opcode;

		req = rb_entry(p, struct ceph_osd_request, r_node);

		seq_printf(s, "%lld\tosd%d\t%lld.%x\t", req->r_tid,
			   req->r_osd ? req->r_osd->o_osd : -1,
			   req->r_pgid.pool, req->r_pgid.seed);

		seq_printf(s, "%.*s", req->r_base_oid.name_len,
			   req->r_base_oid.name);

		if (req->r_reassert_version.epoch)
			seq_printf(s, "\t%u'%llu",
			   (unsigned int)le32_to_cpu(req->r_reassert_version.epoch),
			   le64_to_cpu(req->r_reassert_version.version));
		else
			seq_printf(s, "\t");

		for (i = 0; i < req->r_num_ops; i++) {
			opcode = req->r_ops[i].op;
			seq_printf(s, "%s%s", (i == 0 ? "\t" : ","),
				   ceph_osd_op_name(opcode));
		}

		seq_printf(s, "\n");
	}
	mutex_unlock(&osdc->request_mutex);
	return 0;
}