]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
librbd: Fix incorrect api declaration
authorHaomai Wang <haomaiwang@gmail.com>
Thu, 6 Aug 2015 03:14:46 +0000 (11:14 +0800)
committerHaomai Wang <haomai@xsky.com>
Tue, 1 Dec 2015 02:03:10 +0000 (10:03 +0800)
Signed-off-by: Haomai Wang <haomaiwang@gmail.com>
src/include/rbd/librbd.h
src/include/rbd/librbd.hpp
src/librbd/internal.cc
src/librbd/internal.h
src/librbd/librbd.cc

index 41d671e4bca5890c7e92ff94d8b3d0a75a24d771..456ed1c48f0dd95ffd44cc8ba059a1ea4fbfc211 100644 (file)
@@ -500,7 +500,7 @@ CEPH_RBD_API int rbd_aio_flush(rbd_image_t image, rbd_completion_t c);
  */
 CEPH_RBD_API int rbd_invalidate_cache(rbd_image_t image);
 
-CEPH_RBD_API int rbd_poll_io_events(rbd_image_t image, rbd_completion_t *comps, int numcomp, int max);
+CEPH_RBD_API int rbd_poll_io_events(rbd_image_t image, rbd_completion_t *comps, int numcomp);
 
 CEPH_RBD_API int rbd_metadata_get(rbd_image_t image, const char *key, char *value, size_t *val_len);
 CEPH_RBD_API int rbd_metadata_set(rbd_image_t image, const char *key, const char *value);
index 70fcf13e0760490347935ff53cd394c7ee92d118..e04bbe47c619488e6eecb33f7ee05df33820a818 100644 (file)
@@ -285,7 +285,7 @@ public:
    */
   int invalidate_cache();
 
-  int poll_io_events(RBD::AioCompletion **comps, int numcomp, int max);
+  int poll_io_events(RBD::AioCompletion **comps, int numcomp);
 
   int metadata_get(const std::string &key, std::string *value);
   int metadata_set(const std::string &key, const std::string &value);
index 0ff32c23ee6dc584dfcb270ddb022457892afe0b..543837a5b6828b4c3f0b37e198e6c053e33c7fe7 100644 (file)
@@ -3432,15 +3432,15 @@ int invoke_async_request(ImageCtx *ictx, const std::string& request_type,
     return r;
   }
 
-  int poll_io_events(ImageCtx *ictx, AioCompletion **comps, int numcomp, int max)
+  int poll_io_events(ImageCtx *ictx, AioCompletion **comps, int numcomp)
   {
-    if (numcomp < max || numcomp <= 0)
+    if (numcomp <= 0)
       return -EINVAL;
     CephContext *cct = ictx->cct;
-    ldout(cct, 20) << __func__ << " " << ictx << " numcomp = " << numcomp << " max " << max << dendl;
+    ldout(cct, 20) << __func__ << " " << ictx << " numcomp = " << numcomp << dendl;
     int i = 0;
     Mutex::Locker l(ictx->completed_reqs_lock);
-    while (i < max) {
+    while (i < numcomp) {
       if (ictx->completed_reqs.empty())
         break;
       comps[i++] = ictx->completed_reqs.front();
index adf03061413b9f88afd14366448918641ffd1dd0..bd76e48ddd617dd7a03918b2a7c38ddbec419a1a 100644 (file)
@@ -210,7 +210,7 @@ namespace librbd {
 
   int flush(ImageCtx *ictx);
   int invalidate_cache(ImageCtx *ictx);
-  int poll_io_events(ImageCtx *ictx, AioCompletion **comps, int numcomp, int max);
+  int poll_io_events(ImageCtx *ictx, AioCompletion **comps, int numcomp);
   int metadata_list(ImageCtx *ictx, const string &last, uint64_t max, map<string, bufferlist> *pairs);
   int metadata_get(ImageCtx *ictx, const std::string &key, std::string *value);
   int metadata_set(ImageCtx *ictx, const std::string &key, const std::string &value);
index 88380960f4efefc7a93d9b762ac3276d78e93ccf..0e450c73421792e67e6367ea01bb999c5b4657d7 100644 (file)
@@ -997,12 +997,12 @@ namespace librbd {
     return r;
   }
 
-  int Image::poll_io_events(RBD::AioCompletion **comps, int numcomp, int max)
+  int Image::poll_io_events(RBD::AioCompletion **comps, int numcomp)
   {
     AioCompletion *cs[numcomp];
     ImageCtx *ictx = (ImageCtx *)ctx;
-    tracepoint(librbd, poll_io_events_enter, numcomp, max);
-    int r = librbd::poll_io_events(ictx, cs, numcomp, max);
+    tracepoint(librbd, poll_io_events_enter, numcomp);
+    int r = librbd::poll_io_events(ictx, cs, numcomp);
     tracepoint(librbd, poll_io_events_exit, r);
     if (r > 0) {
       for (int i = 0; i < numcomp; ++i)
@@ -2150,12 +2150,12 @@ extern "C" int rbd_invalidate_cache(rbd_image_t image)
   return r;
 }
 
-extern "C" int rbd_poll_io_events(rbd_image_t image, rbd_completion_t *comps, int numcomp, int max)
+extern "C" int rbd_poll_io_events(rbd_image_t image, rbd_completion_t *comps, int numcomp)
 {
   librbd::ImageCtx *ictx = (librbd::ImageCtx *)image;
   librbd::AioCompletion *cs[numcomp];
-  tracepoint(librbd, poll_io_events_enter, numcomp, max);
-  int r = librbd::poll_io_events(ictx, cs, numcomp, max);
+  tracepoint(librbd, poll_io_events_enter, numcomp);
+  int r = librbd::poll_io_events(ictx, cs, numcomp);
   tracepoint(librbd, poll_io_events_exit, r);
   if (r > 0) {
     for (int i = 0; i < r; ++i)