]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
librados: rename cookie to handle in api
authorYehuda Sadeh <yehuda@hq.newdream.net>
Mon, 1 Nov 2010 17:02:35 +0000 (10:02 -0700)
committerYehuda Sadeh <yehuda@hq.newdream.net>
Wed, 24 Nov 2010 00:54:59 +0000 (16:54 -0800)
src/include/librados.h
src/include/librados.hpp
src/librados.cc

index 9152437a85485f31a68f704d85c6b73dbeb3e3d2..1cb64fc1052877f0bbca735cbdfb3fe34e80fc5b 100644 (file)
@@ -120,9 +120,9 @@ int rados_aio_read(rados_pool_t pool, const char *oid,
 
 /* watch/notify */
 typedef void (*rados_watchcb_t)(uint8_t opcode, uint64_t ver, void *arg);
-int rados_watch(rados_pool_t pool, const char *o, uint64_t ver, uint64_t *cookie,
+int rados_watch(rados_pool_t pool, const char *o, uint64_t ver, uint64_t *handle,
                 rados_watchcb_t watchcb, void *arg);
-int rados_unwatch(rados_pool_t pool, const char *o, uint64_t cookie);
+int rados_unwatch(rados_pool_t pool, const char *o, uint64_t handle);
 int rados_notify(rados_pool_t pool, const char *o, uint64_t ver);
 
 #ifdef __cplusplus
index 0af7f72e371a3532d666eda15840439f93783dd5..00cc10aea323b5ded9e54bbaf1bcc64c20ba77a0 100644 (file)
@@ -150,8 +150,8 @@ public:
   };
 
   // watch/notify
-  int watch(pool_t pool, const string& o, uint64_t ver, uint64_t *cookie, librados::Rados::WatchCtx *ctx);
-  int unwatch(pool_t pool, const string& o, uint64_t cookie);
+  int watch(pool_t pool, const string& o, uint64_t ver, uint64_t *handle, librados::Rados::WatchCtx *ctx);
+  int unwatch(pool_t pool, const string& o, uint64_t handle);
   int notify(pool_t pool, const string& o, uint64_t ver);
 };
 
index ab2210be207841b3766b762d7167a1cc754b50e9..bce1e026df87c0790f2f590f394ea53f2fabe4a0 100644 (file)
@@ -2168,8 +2168,9 @@ int Rados::watch(pool_t pool, const string& o,
   return client->watch(*(RadosClient::PoolCtx *)pool, oid, ver, cookie, ctx);
 }
 
-int Rados::unwatch(pool_t pool, const string& o, uint64_t cookie)
+int Rados::unwatch(pool_t pool, const string& o, uint64_t handle)
 {
+  uint64_t cookie = handle;
   if (!client)
     return -EINVAL;
   object_t oid(o);
@@ -2671,17 +2672,19 @@ struct C_WatchCB : public librados::Rados::WatchCtx {
   }
 };
 
-int rados_watch(rados_pool_t pool, const char *o, uint64_t ver, uint64_t *cookie,
+int rados_watch(rados_pool_t pool, const char *o, uint64_t ver, uint64_t *handle,
                 rados_watchcb_t watchcb, void *arg)
 {
+  uint64_t *cookie = handle;
   RadosClient::PoolCtx *ctx = (RadosClient::PoolCtx *)pool;
   object_t oid(o);
   C_WatchCB *wc = new C_WatchCB(watchcb, arg);
   return radosp->watch(*ctx, oid, ver, cookie, wc);
 }
 
-int rados_unwatch(rados_pool_t pool, const char *o, uint64_t cookie)
+int rados_unwatch(rados_pool_t pool, const char *o, uint64_t handle)
 {
+  uint64_t cookie = handle;
   RadosClient::PoolCtx *ctx = (RadosClient::PoolCtx *)pool;
   object_t oid(o);
   return radosp->unwatch(*ctx, oid, cookie);