]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
osdc/ObjectCacher: invoke flush_set_callback on purge_set
authorJohn Spray <john.spray@redhat.com>
Thu, 9 Oct 2014 10:25:21 +0000 (11:25 +0100)
committerJohn Spray <john.spray@redhat.com>
Tue, 16 Dec 2014 20:45:58 +0000 (20:45 +0000)
For the benefit of Client, so that it can get its
caps released when using purge_set to deal with
an ENOSPC condition.  Does not affect librbd because
librbd doesn't provide flush_set_callback.

Signed-off-by: John Spray <john.spray@redhat.com>
src/osdc/ObjectCacher.cc

index 01cf2baba0835bcc5050c853cadd53b2466b1660..d94bd31a3982bd2daae5c9eb9f85ab2c6aa3f514 100644 (file)
@@ -1723,12 +1723,20 @@ void ObjectCacher::purge_set(ObjectSet *oset)
   }
 
   ldout(cct, 10) << "purge_set " << oset << dendl;
+  const bool were_dirty = oset->dirty_or_tx > 0;
 
   for (xlist<Object*>::iterator i = oset->objects.begin();
        !i.end(); ++i) {
     Object *ob = *i;
        purge(ob);
   }
+
+  // Although we have purged rather than flushed, caller should still
+  // drop any resources associate with dirty data.
+  assert(oset->dirty_or_tx == 0);
+  if (flush_set_callback && were_dirty) {
+    flush_set_callback(flush_set_callback_arg, oset);
+  }
 }