return ret;
}
-/**
- * Any write op which is in progress at the start of this call shall no longer
- * be in progress when this call ends. Operations started after the start
- * of this call may still be in progress when this call ends.
- *
- * @return the latest possible epoch in which a cancelled op could have existed
- */
+
epoch_t Objecter::op_cancel_writes(int r, int64_t pool)
{
rwlock.get_write();
return _osdmap_full_flag();
}
+bool Objecter::osdmap_pool_full(const int64_t pool_id) const
+{
+ RWLock::RLocker rl(rwlock);
+
+ if (_osdmap_full_flag()) {
+ return true;
+ }
+
+ const pg_pool_t *pool = osdmap->get_pg_pool(pool_id);
+ if (pool == NULL) {
+ ldout(cct, 4) << __func__ << ": DNE pool " << pool_id << dendl;
+ return false;
+ }
+
+ return pool->has_flag(pg_pool_t::FLAG_FULL);
+}
+
/**
* Wrapper around osdmap->test_flag for special handling of the FULL flag.
*/
bool osdmap_full_flag() const;
+ /**
+ * Test pg_pool_t::FLAG_FULL on a pool
+ *
+ * @return true if the pool exists and has the flag set, or
+ * the global full flag is set, else false
+ */
+ bool osdmap_pool_full(const int64_t pool_id) const;
+
private:
map<uint64_t, LingerOp*> linger_ops;
// we use this just to confirm a cookie is valid before dereferencing the ptr