]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
librbd: remove unnecessary argument to trim_image
authorJosh Durgin <josh.durgin@dreamhost.com>
Wed, 2 Feb 2011 02:52:17 +0000 (18:52 -0800)
committerYehuda Sadeh <yehuda.sadeh@dreamhost.com>
Mon, 7 Feb 2011 23:13:01 +0000 (15:13 -0800)
src/librbd.cc

index b601d8130fd6994859ebc5989ab294ef008c62bd..2a4dc9c70380ec5df5efc797fa7f6706c919fd6f 100644 (file)
@@ -112,7 +112,7 @@ public:
   int open_pools(const char *poolname, PoolCtx *pp);
   void close_pools(PoolCtx *pp);
 
-  void trim_image(PoolCtx *pp, const char *imgname, rbd_obj_header_ondisk *header, uint64_t newsize);
+  void trim_image(PoolCtx *pp, rbd_obj_header_ondisk *header, uint64_t newsize);
   int read_rbd_info(PoolCtx *pp, string& info_oid, struct rbd_info *info);
 
   int touch_rbd_info(librados::pool_t pool, string& info_oid);
@@ -221,7 +221,7 @@ int librbd::RBDClient::init_rbd_info(struct rbd_info *info)
   return 0;
 }
 
-void librbd::RBDClient::trim_image(PoolCtx *pp, const char *imgname, rbd_obj_header_ondisk *header, uint64_t newsize)
+void librbd::RBDClient::trim_image(PoolCtx *pp, rbd_obj_header_ondisk *header, uint64_t newsize)
 {
   uint64_t numseg = get_max_block(header);
   uint64_t start = get_block_num(header, newsize);
@@ -534,7 +534,7 @@ int librbd::RBDClient::remove(PoolCtx *pp, const char *imgname)
   struct rbd_obj_header_ondisk header;
   int r = read_header(pp->md, md_oid, &header, NULL);
   if (r >= 0) {
-    trim_image(pp, imgname, &header, 0);
+    trim_image(pp, &header, 0);
     cout << "\rremoving header..." << std::endl;
     rados.remove(pp->md, md_oid);
   }
@@ -570,7 +570,7 @@ int librbd::RBDClient::resize(PoolCtx *pp, ImageCtx *ictx, uint64_t size)
     ictx->header.image_size = size;
   } else {
     cout << "shrinking image " << size << " -> " << ictx->header.image_size << " objects" << std::endl;
-    trim_image(pp, ictx->name.c_str(), &(ictx->header), size);
+    trim_image(pp, &(ictx->header), size);
     ictx->header.image_size = size;
   }