]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
librbd: kill legacy striping helpers
authorSage Weil <sage@inktank.com>
Wed, 3 Oct 2012 21:19:32 +0000 (14:19 -0700)
committerSage Weil <sage@inktank.com>
Mon, 15 Oct 2012 22:34:05 +0000 (15:34 -0700)
These are replaced by ImageCtx accessors or the use of the Filer striping
helper.

Signed-off-by: Sage Weil <sage@inktank.com>
src/librbd/internal.cc
src/librbd/internal.h

index 69c280cbfc4d9dc7870b9b5fbcf27e309ef0a964..135efece95fa45e3b27ca2f0c6052b7b78b96af6 100644 (file)
@@ -113,7 +113,7 @@ namespace librbd {
     ictx->snap_lock.Unlock();
     ictx->md_lock.Unlock();
     info.obj_size = 1ULL << obj_order;
-    info.num_objs = howmany(info.size, get_block_size(obj_order));
+    info.num_objs = howmany(info.size, ictx->get_object_size());
     info.order = obj_order;
     memcpy(&info.block_name_prefix, ictx->object_prefix.c_str(),
           min((size_t)RBD_MAX_BLOCK_NAME_SIZE,
@@ -143,40 +143,6 @@ namespace librbd {
     return num;
   }
 
-  uint64_t offset_of_object(const string &oid, const string &object_prefix,
-                           uint8_t order)
-  {
-    uint64_t num, offset;
-    num = oid_to_object_no(oid, object_prefix);
-    offset = num * (1ULL << order);
-    return offset;
-  }
-
-  uint64_t get_max_block(uint64_t size, uint8_t obj_order)
-  {
-    uint64_t block_size = 1ULL << obj_order;
-    uint64_t numseg = (size + block_size - 1) >> obj_order;
-    return numseg;
-  }
-
-  uint64_t get_block_ofs(uint8_t order, uint64_t ofs)
-  {
-    uint64_t block_size = 1ULL << order;
-    return ofs & (block_size - 1);
-  }
-
-  uint64_t get_block_size(uint8_t order)
-  {
-    return 1ULL << order;
-  }
-
-  uint64_t get_block_num(uint8_t order, uint64_t ofs)
-  {
-    uint64_t num = ofs >> order;
-
-    return num;
-  }
-
   int init_rbd_info(struct rbd_info *info)
   {
     memset(info, 0, sizeof(*info));
index eb35c80d4c977387a91bcd26818c6ef516f6143a..7c3b2c7d6ad4c51e2e0ec8dd12ca1b8380758dc9 100644 (file)
@@ -155,12 +155,6 @@ namespace librbd {
   std::string get_block_oid(const std::string &object_prefix, uint64_t num,
                            bool old_format);
   uint64_t oid_to_object_no(const string& oid, const string& object_prefix);
-  uint64_t offset_of_object(const string &oid, const string &object_prefix,
-                           uint8_t order);
-  uint64_t get_max_block(uint64_t size, uint8_t obj_order);
-  uint64_t get_block_size(uint8_t order);
-  uint64_t get_block_num(uint8_t order, uint64_t ofs);
-  uint64_t get_block_ofs(uint8_t order, uint64_t ofs);
   int check_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,