From 95f63ea3c7c27b7b8247fc96e2948526e49b80ca Mon Sep 17 00:00:00 2001 From: Sage Weil Date: Fri, 30 Jan 2009 15:00:45 -0800 Subject: [PATCH] osd: print ops args correctly --- src/include/types.h | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/src/include/types.h b/src/include/types.h index c6664cabef246..5db844084bfed 100644 --- a/src/include/types.h +++ b/src/include/types.h @@ -381,12 +381,20 @@ inline ostream& operator<<(ostream& out, const ceph_fsid_t& f) { inline ostream& operator<<(ostream& out, const ceph_osd_op& op) { out << ceph_osd_op_name(op.op); if (ceph_osd_op_type_data(op.op)) { - if (op.op == CEPH_OSD_OP_SETTRUNC || - op.op == CEPH_OSD_OP_MASKTRUNC || - op.op == CEPH_OSD_OP_TRIMTRUNC) + switch (op.op) { + case CEPH_OSD_OP_DELETE: + break; + case CEPH_OSD_OP_TRUNCATE: + out << " " << op.offset; + break; + case CEPH_OSD_OP_SETTRUNC: + case CEPH_OSD_OP_MASKTRUNC: + case CEPH_OSD_OP_TRIMTRUNC: out << " " << op.truncate_seq << "@" << op.truncate_size; - else + break; + default: out << " " << op.offset << "~" << op.length; + } } else if (ceph_osd_op_type_attr(op.op)) out << " " << op.name_len << "+" << op.value_len; return out; -- 2.39.5