]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
librbd: removed unused method declarations and definitions
authorJason Dillaman <dillaman@redhat.com>
Mon, 6 Jul 2015 23:28:49 +0000 (19:28 -0400)
committerJason Dillaman <dillaman@redhat.com>
Fri, 13 Nov 2015 01:17:52 +0000 (20:17 -0500)
Signed-off-by: Jason Dillaman <dillaman@redhat.com>
src/librbd/internal.cc
src/librbd/internal.h

index d714aa30f6c2d0bb3ed6ca3d7e1102c8817de2df..82bd61b942e6615685fa1b883fd2fbe082d4eac6 100644 (file)
@@ -314,12 +314,6 @@ int invoke_async_request(ImageCtx *ictx, const std::string& request_type,
     return num;
   }
 
-  int init_rbd_info(struct rbd_info *info)
-  {
-    memset(info, 0, sizeof(*info));
-    return 0;
-  }
-
   void trim_image(ImageCtx *ictx, uint64_t newsize, ProgressContext& prog_ctx)
   {
     assert(ictx->owner_lock.is_locked());
@@ -340,25 +334,6 @@ int invoke_async_request(ImageCtx *ictx, const std::string& request_type,
     }
   }
 
-  int read_rbd_info(IoCtx& io_ctx, const string& info_oid,
-                   struct rbd_info *info)
-  {
-    int r;
-    bufferlist bl;
-    r = io_ctx.read(info_oid, bl, sizeof(*info), 0);
-    if (r < 0)
-      return r;
-    if (r == 0) {
-      return init_rbd_info(info);
-    }
-
-    if (r < (int)sizeof(*info))
-      return -EIO;
-
-    memcpy(info, bl.c_str(), r);
-    return 0;
-  }
-
   int read_header_bl(IoCtx& io_ctx, const string& header_oid,
                     bufferlist& header, uint64_t *ver)
   {
@@ -414,16 +389,6 @@ int invoke_async_request(ImageCtx *ictx, const std::string& request_type,
     return 0;
   }
 
-  int write_header(IoCtx& io_ctx, const string& header_oid, bufferlist& header)
-  {
-    bufferlist bl;
-    int r = io_ctx.write(header_oid, header, header.length(), 0);
-
-    notify_change(io_ctx, header_oid, NULL);
-
-    return r;
-  }
-
   int tmap_set(IoCtx& io_ctx, const string& imgname)
   {
     bufferlist cmdbl, emptybl;
@@ -3556,17 +3521,6 @@ reprotect_and_return_err:
     return r;
   }
 
-  int simple_read_cb(uint64_t ofs, size_t len, const char *buf, void *arg)
-  {
-    char *dest_buf = (char *)arg;
-    if (buf)
-      memcpy(dest_buf + ofs, buf, len);
-    else
-      memset(dest_buf + ofs, 0, len);
-
-    return 0;
-  }
-
   ssize_t read(ImageCtx *ictx, uint64_t ofs, size_t len, char *buf, int op_flags)
   {
     ssize_t ret;
@@ -3670,67 +3624,6 @@ reprotect_and_return_err:
     return mylen;
   }
 
-  ssize_t handle_sparse_read(CephContext *cct,
-                            bufferlist data_bl,
-                            uint64_t block_ofs,
-                            const map<uint64_t, uint64_t> &data_map,
-                            uint64_t buf_ofs,   // offset into buffer
-                            size_t buf_len,     // length in buffer (not size of buffer!)
-                            char *dest_buf)
-  {
-    uint64_t bl_ofs = 0;
-    size_t buf_left = buf_len;
-
-    for (map<uint64_t, uint64_t>::const_iterator iter = data_map.begin();
-        iter != data_map.end();
-        ++iter) {
-      uint64_t extent_ofs = iter->first;
-      size_t extent_len = iter->second;
-
-      ldout(cct, 10) << "extent_ofs=" << extent_ofs
-                    << " extent_len=" << extent_len << dendl;
-      ldout(cct, 10) << "block_ofs=" << block_ofs << dendl;
-
-      /* a hole? */
-      if (extent_ofs > block_ofs) {
-       uint64_t gap = extent_ofs - block_ofs;
-       ldout(cct, 10) << "<1>zeroing " << buf_ofs << "~" << gap << dendl;
-       memset(dest_buf + buf_ofs, 0, gap);
-
-       buf_ofs += gap;
-       buf_left -= gap;
-       block_ofs = extent_ofs;
-      } else if (extent_ofs < block_ofs) {
-       assert(0 == "osd returned data prior to what we asked for");
-       return -EIO;
-      }
-
-      if (bl_ofs + extent_len > (buf_ofs + buf_left)) {
-       assert(0 == "osd returned more data than we asked for");
-       return -EIO;
-      }
-
-      /* data */
-      ldout(cct, 10) << "<2>copying " << buf_ofs << "~" << extent_len
-                    << " from ofs=" << bl_ofs << dendl;
-      memcpy(dest_buf + buf_ofs, data_bl.c_str() + bl_ofs, extent_len);
-
-      bl_ofs += extent_len;
-      buf_ofs += extent_len;
-      assert(buf_left >= extent_len);
-      buf_left -= extent_len;
-      block_ofs += extent_len;
-    }
-
-    /* last hole */
-    if (buf_left > 0) {
-      ldout(cct, 10) << "<3>zeroing " << buf_ofs << "~" << buf_left << dendl;
-      memset(dest_buf + buf_ofs, 0, buf_left);
-    }
-
-    return buf_len;
-  }
-
   void rados_req_cb(rados_completion_t c, void *arg)
   {
     AioRequest *req = reinterpret_cast<AioRequest *>(arg);
index 3197c8e5d29dbce4fbd227e1c1df114ed4a412f6..33d24011e3690883227a120a7091c671cce97042 100644 (file)
@@ -153,8 +153,6 @@ namespace librbd {
   int open_image(ImageCtx *ictx);
   int close_image(ImageCtx *ictx);
 
-  int copyup_block(ImageCtx *ictx, uint64_t offset, size_t len,
-                  const char *buf);
   int flatten(ImageCtx *ictx, ProgressContext &prog_ctx);
 
   int rebuild_object_map(ImageCtx *ictx, ProgressContext &prog_ctx);
@@ -173,8 +171,6 @@ namespace librbd {
                 const std::string& cookie);
 
   void trim_image(ImageCtx *ictx, uint64_t newsize, ProgressContext& prog_ctx);
-  int read_rbd_info(librados::IoCtx& io_ctx, const std::string& info_oid,
-                   struct rbd_info *info);
 
   int read_header_bl(librados::IoCtx& io_ctx, const std::string& md_oid,
                     ceph::bufferlist& header, uint64_t *ver);
@@ -182,8 +178,6 @@ namespace librbd {
                    ImageCtx *ictx);
   int read_header(librados::IoCtx& io_ctx, const std::string& md_oid,
                  struct rbd_obj_header_ondisk *header, uint64_t *ver);
-  int write_header(librados::IoCtx& io_ctx, const std::string& md_oid,
-                  ceph::bufferlist& header);
   int tmap_set(librados::IoCtx& io_ctx, const std::string& imgname);
   int tmap_rm(librados::IoCtx& io_ctx, const std::string& imgname);
   void rollback_object(ImageCtx *ictx, uint64_t snap_id, const string& oid,
@@ -191,12 +185,9 @@ namespace librbd {
   int rollback_image(ImageCtx *ictx, uint64_t snap_id,
                     ProgressContext& prog_ctx);
   void image_info(const ImageCtx *ictx, image_info_t& info, size_t info_size);
-  std::string get_block_oid(const std::string &object_prefix, uint64_t num,
-                           bool old_format);
   uint64_t oid_to_object_no(const std::string& oid,
                            const std::string& object_prefix);
   int clip_io(ImageCtx *ictx, uint64_t off, uint64_t *len);
-  int init_rbd_info(struct rbd_info *info);
   void init_rbd_header(struct rbd_obj_header_ondisk& ondisk,
                       uint64_t size, int order, uint64_t bid);
 
@@ -237,21 +228,12 @@ namespace librbd {
   int metadata_set(ImageCtx *ictx, const std::string &key, const std::string &value);
   int metadata_remove(ImageCtx *ictx, const std::string &key);
 
-  ssize_t handle_sparse_read(CephContext *cct,
-                            ceph::bufferlist data_bl,
-                            uint64_t block_ofs,
-                            const std::map<uint64_t, uint64_t> &data_map,
-                            uint64_t buf_ofs,
-                            size_t buf_len,
-                            char *dest_buf);
-
   AioCompletion *aio_create_completion();
   AioCompletion *aio_create_completion(void *cb_arg, callback_t cb_complete);
   AioCompletion *aio_create_completion_internal(void *cb_arg,
                                                callback_t cb_complete);
 
   // raw callbacks
-  int simple_read_cb(uint64_t ofs, size_t len, const char *buf, void *arg);
   void rados_req_cb(rados_completion_t cb, void *arg);
   void rados_ctx_cb(rados_completion_t cb, void *arg);
   void rbd_req_cb(completion_t cb, void *arg);