]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
librbd: cosmetic changes to progress stuff
authorSage Weil <sage@newdream.net>
Thu, 1 Sep 2011 01:00:07 +0000 (18:00 -0700)
committerSage Weil <sage@newdream.net>
Thu, 1 Sep 2011 16:43:50 +0000 (09:43 -0700)
Signed-off-by: Sage Weil <sage@newdream.net>
src/include/rbd/librbd.h
src/include/rbd/librbd.hpp
src/librbd.cc

index 8389f98972a75ae73f83e00c6900a20563d304a1..886e04e863659412fe8c9adb5283b36f849e099c 100644 (file)
@@ -37,8 +37,7 @@ extern "C" {
 typedef void *rbd_snap_t;
 typedef void *rbd_image_t;
 
-typedef int (*librbd_copy_progress_fn_t)(uint64_t offset, uint64_t src_size,
-                                        void *data);
+typedef int (*librbd_progress_fn_t)(uint64_t offset, uint64_t total, void *ptr);
 
 typedef struct {
   uint64_t id;
@@ -73,7 +72,7 @@ int rbd_resize(rbd_image_t image, uint64_t size);
 int rbd_stat(rbd_image_t image, rbd_image_info_t *info, size_t infosize);
 int rbd_copy(rbd_image_t image, rados_ioctx_t dest_io_ctx, const char *destname);
 int rbd_copy_with_progress(rbd_image_t image, rados_ioctx_t dest_p,
-           const char *destname, librbd_copy_progress_fn_t fn, void *data);
+                          const char *destname, librbd_progress_fn_t fn, void *data);
 
 /* snapshots */
 int rbd_snap_list(rbd_image_t image, rbd_snap_info_t *snaps, int *max_snaps);
index 956f072576e281b8eb9a7489d633bde450ae3bac..6a685cccf8ba57f9b57e15498bad3e103e66974a 100644 (file)
@@ -41,12 +41,12 @@ namespace librbd {
 
   typedef rbd_image_info_t image_info_t;
 
-class ProgressContext
-{
-public:
-  virtual ~ProgressContext();
-  virtual int update_progress(uint64_t offset, uint64_t src_size) = 0;
-};
+  class ProgressContext
+  {
+  public:
+    virtual ~ProgressContext();
+    virtual int update_progress(uint64_t offset, uint64_t total) = 0;
+  };
 
 class RBD
 {
index 3846cb7aeae302a967da5a24c27fe772e533d9bf..0a31e278c1f6e03825f816ac54764f61140246fc 100644 (file)
@@ -1053,7 +1053,7 @@ public:
 class CProgressContext : public librbd::ProgressContext
 {
 public:
-  CProgressContext(librbd_copy_progress_fn_t fn, void *data)
+  CProgressContext(librbd_progress_fn_t fn, void *data)
     : m_fn(fn), m_data(data)
   {
   }
@@ -1062,7 +1062,7 @@ public:
     return m_fn(offset, src_size, m_data);
   }
 private:
-  librbd_copy_progress_fn_t m_fn;
+  librbd_progress_fn_t m_fn;
   void *m_data;
 };
 
@@ -1761,7 +1761,7 @@ extern "C" int rbd_copy(rbd_image_t image, rados_ioctx_t dest_p, const char *des
 }
 
 extern "C" int rbd_copy_with_progress(rbd_image_t image, rados_ioctx_t dest_p,
-             const char *destname, librbd_copy_progress_fn_t fn, void *data)
+             const char *destname, librbd_progress_fn_t fn, void *data)
 {
   librbd::ImageCtx *ictx = (librbd::ImageCtx *)image;
   librados::IoCtx dest_io_ctx;