]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
osd: print ops args correctly
authorSage Weil <sage@newdream.net>
Fri, 30 Jan 2009 23:00:45 +0000 (15:00 -0800)
committerSage Weil <sage@newdream.net>
Sat, 31 Jan 2009 00:03:11 +0000 (16:03 -0800)
src/include/types.h

index c6664cabef24615cac2d1e3d4c9196855f7e80c7..5db844084bfed7516c295244996411d8c1d34404 100644 (file)
@@ -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;