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>
}
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);
+ }
}