]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
librados: define CEPH_OSD_WATCH_OP_*
authorSage Weil <sage@redhat.com>
Fri, 10 Oct 2014 01:11:44 +0000 (18:11 -0700)
committerSage Weil <sage@redhat.com>
Thu, 4 Dec 2014 18:32:37 +0000 (10:32 -0800)
Signed-off-by: Sage Weil <sage@redhat.com>
src/common/ceph_strings.cc
src/include/rados.h
src/osd/osd_types.cc

index 88567e4494af0cf8b692ae9d855a1c8d689cf6e0..172c4b6307a66a496218d000380326b0f4e5fe17 100644 (file)
@@ -42,6 +42,18 @@ const char *ceph_osd_state_name(int s)
        }       
 }
 
+const char *ceph_osd_watch_op_name(int o)
+{
+       switch (o) {
+       case CEPH_OSD_WATCH_OP_UNWATCH:
+               return "unwatch";
+       case CEPH_OSD_WATCH_OP_WATCH:
+               return "watch";
+       default:
+               return "???";
+       }
+}
+
 const char *ceph_mds_state_name(int s)
 {
        switch (s) {
index 21e994db036635d3ce6f8a78c8001276998d4499..9153f887dd018275ec08ad18617b3f0433a84f08 100644 (file)
@@ -446,6 +446,13 @@ enum {
        CEPH_OSD_TMAP2OMAP_NULLOK = 1,
 };
 
+enum {
+       CEPH_OSD_WATCH_OP_UNWATCH = 0,
+       CEPH_OSD_WATCH_OP_WATCH = 1,
+};
+
+const char *ceph_osd_watch_op_name(int o);
+
 /*
  * an individual object operation.  each may be accompanied by some data
  * payload
index 8f1b9eae27d3a85eb31818a9ac29eb49cf9f92a7..b88ef20066cfd6eb295bf7faf4b5b058883617e4 100644 (file)
@@ -4554,8 +4554,8 @@ ostream& operator<<(ostream& out, const OSDOp& op)
       out << " " << snapid_t(op.op.snap.snapid);
       break;
     case CEPH_OSD_OP_WATCH:
-      out << (op.op.watch.flag ? " add":" remove")
-         << " cookie " << op.op.watch.cookie << " ver " << op.op.watch.ver;
+      out << " " << ceph_osd_watch_op_name(op.op.watch.op)
+         << " cookie " << op.op.watch.cookie;
       break;
     case CEPH_OSD_OP_COPY_GET:
     case CEPH_OSD_OP_COPY_GET_CLASSIC: