From: Sage Weil Date: Thu, 1 Sep 2011 01:00:07 +0000 (-0700) Subject: librbd: cosmetic changes to progress stuff X-Git-Tag: v0.35~140 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=a8ab69ab2084daabfac07c637d3fa19576da8ae0;p=ceph.git librbd: cosmetic changes to progress stuff Signed-off-by: Sage Weil --- diff --git a/src/include/rbd/librbd.h b/src/include/rbd/librbd.h index 8389f98972a7..886e04e86365 100644 --- a/src/include/rbd/librbd.h +++ b/src/include/rbd/librbd.h @@ -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); diff --git a/src/include/rbd/librbd.hpp b/src/include/rbd/librbd.hpp index 956f072576e2..6a685cccf8ba 100644 --- a/src/include/rbd/librbd.hpp +++ b/src/include/rbd/librbd.hpp @@ -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 { diff --git a/src/librbd.cc b/src/librbd.cc index 3846cb7aeae3..0a31e278c1f6 100644 --- a/src/librbd.cc +++ b/src/librbd.cc @@ -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;