@@ -410,6 +410,7 @@ enum {
pool uses pool snaps */
CEPH_OSD_FLAG_REDIRECTED = 0x200000, /* op has been redirected */
CEPH_OSD_FLAG_KNOWN_REDIR = 0x400000, /* redirect bit is authoritative */
+ CEPH_OSD_FLAG_TIER_NOCACHE = 0x800000, /* DO NOT cache data in any cache-mode */
};
enum {
@@ -120,6 +120,7 @@ enum {
LIBRADOS_OPERATION_IGNORE_CACHE = 8,
LIBRADOS_OPERATION_SKIPRWLOCKS = 16,
LIBRADOS_OPERATION_IGNORE_OVERLAY = 32,
+ LIBRADOS_OPERATION_TIER_NOCACHE = 64,
};
/** @} */
@@ -259,6 +259,7 @@ namespace librados
OPERATION_IGNORE_CACHE = LIBRADOS_OPERATION_IGNORE_CACHE,
OPERATION_SKIPRWLOCKS = LIBRADOS_OPERATION_SKIPRWLOCKS,
OPERATION_IGNORE_OVERLAY = LIBRADOS_OPERATION_IGNORE_OVERLAY,
+ OPERATION_TIER_NOCACHE = LIBRADOS_OPERATION_TIER_NOCACHE,
};
/*
@@ -1290,6 +1290,8 @@ static int translate_flags(int flags)
op_flags |= CEPH_OSD_FLAG_SKIPRWLOCKS;
if (flags & librados::OPERATION_IGNORE_OVERLAY)
op_flags |= CEPH_OSD_FLAG_IGNORE_OVERLAY;
+ if (flags & librados::OPERATION_TIER_NOCACHE)
+ op_flags |= CEPH_OSD_FLAG_TIER_NOCACHE;
return op_flags;
}
@@ -1807,6 +1807,11 @@ bool ReplicatedPG::maybe_handle_cache(OpRequestRef op,
MOSDOp *m = static_cast<MOSDOp*>(op->get_req());
const object_locator_t& oloc = m->get_object_locator();
+ if (m->has_flag(CEPH_OSD_FLAG_TIER_NOCACHE)) {
+ do_cache_redirect(op);
+ return true;
+ }
+
if (must_promote || op->need_promote()) {
promote_object(obc, missing_oid, oloc, op);
return true;
@@ -50,6 +50,7 @@ const char *ceph_osd_flag_name(unsigned flag)
case CEPH_OSD_FLAG_ENFORCE_SNAPC: return "enforce_snapc";
case CEPH_OSD_FLAG_REDIRECTED: return "redirected";
case CEPH_OSD_FLAG_KNOWN_REDIR: return "known_if_redirected";
+ case CEPH_OSD_FLAG_TIER_NOCACHE: return "tier_nocache";
default: return "???";
}
}