summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSage Weil <sage@newdream.net>2011-08-31 18:00:07 -0700
committerSage Weil <sage@newdream.net>2011-09-01 09:43:50 -0700
commita8ab69ab2084daabfac07c637d3fa19576da8ae0 (patch)
treea35693cb86b17ce52ba08189386e199b17e4f0e4
parent2255a9a107c8e8187b6e6f529e248eb07f016451 (diff)
downloadceph-a8ab69ab2084daabfac07c637d3fa19576da8ae0.tar.gz
librbd: cosmetic changes to progress stuff
Signed-off-by: Sage Weil <sage@newdream.net>
-rw-r--r--src/include/rbd/librbd.h5
-rw-r--r--src/include/rbd/librbd.hpp12
-rw-r--r--src/librbd.cc6
3 files changed, 11 insertions, 12 deletions
diff --git a/src/include/rbd/librbd.h b/src/include/rbd/librbd.h
index 8389f98972a..886e04e8636 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 956f072576e..6a685cccf8b 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 3846cb7aeae..0a31e278c1f 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;