]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
librbd: use ImageCtx members instead of the old header in resize()
authorJosh Durgin <josh.durgin@inktank.com>
Fri, 8 Jun 2012 14:56:59 +0000 (07:56 -0700)
committerJosh Durgin <josh.durgin@inktank.com>
Fri, 8 Jun 2012 23:38:23 +0000 (16:38 -0700)
Signed-off-by: Josh Durgin <josh.durgin@inktank.com>
src/librbd.cc

index 0d357fa222cb56c67f8cafcccf7d2e785bfa2192..8a5bf855d235adb0cfe5db7ae65e26f7e6ae5094 100644 (file)
@@ -1205,14 +1205,15 @@ int resize_helper(ImageCtx *ictx, uint64_t size, ProgressContext& prog_ctx)
 int resize(ImageCtx *ictx, uint64_t size, ProgressContext& prog_ctx)
 {
   CephContext *cct = ictx->cct;
-  ldout(cct, 20) << "resize " << ictx << " " << ictx->header.image_size << " -> " << size << dendl;
+  ldout(cct, 20) << "resize " << ictx << " " << ictx->size << " -> "
+                << size << dendl;
 
   int r = ictx_check(ictx);
   if (r < 0)
     return r;
 
   Mutex::Locker l(ictx->lock);
-  if (size < ictx->header.image_size && ictx->object_cacher) {
+  if (size < ictx->size && ictx->object_cacher) {
     // need to invalidate since we're deleting objects, and
     // ObjectCacher doesn't track non-existent objects
     ictx->invalidate_cache();