target.version = info.version;
}
-bool ObjectCache::remove(const DoutPrefixProvider *dpp, const string& name)
+// WARNING: This function /must not/ be modified to cache a
+// negative lookup. It must only invalidate.
+bool ObjectCache::invalidate_remove(const DoutPrefixProvider *dpp, const string& name)
{
std::unique_lock l{lock};
enum {
UPDATE_OBJ,
- REMOVE_OBJ,
+ INVALIDATE_OBJ,
};
#define CACHE_FLAG_DATA 0x01
}
void put(const DoutPrefixProvider *dpp, const std::string& name, ObjectCacheInfo& bl, rgw_cache_entry_info *cache_info);
- bool remove(const DoutPrefixProvider *dpp, const std::string& name);
+ bool invalidate_remove(const DoutPrefixProvider *dpp, const std::string& name);
void set_ctx(CephContext *_cct) {
cct = _cct;
lru_window = cct->_conf->rgw_cache_lru_size / 2;
normalize_pool_and_obj(obj.pool, obj.oid, pool, oid);
string name = normal_name(pool, oid);
- cache.remove(dpp, name);
+ cache.invalidate_remove(dpp, name);
ObjectCacheInfo info;
- int r = distribute_cache(dpp, name, obj, info, REMOVE_OBJ, y);
+ int r = distribute_cache(dpp, name, obj, info, INVALIDATE_OBJ, y);
if (r < 0) {
ldpp_dout(dpp, 0) << "ERROR: " << __func__ << "(): failed to distribute cache: r=" << r << dendl;
}
if (r < 0)
ldpp_dout(dpp, 0) << "ERROR: failed to distribute cache for " << obj << dendl;
} else {
- cache.remove(dpp, name);
+ cache.invalidate_remove(dpp, name);
}
return ret;
if (r < 0)
ldpp_dout(dpp, 0) << "ERROR: failed to distribute cache for " << obj << dendl;
} else {
- cache.remove(dpp, name);
+ cache.invalidate_remove(dpp, name);
}
return ret;
if (r < 0)
ldpp_dout(dpp, 0) << "ERROR: failed to distribute cache for " << obj << dendl;
} else {
- cache.remove(dpp, name);
+ cache.invalidate_remove(dpp, name);
}
return ret;
case UPDATE_OBJ:
cache.put(dpp, name, info.obj_info, NULL);
break;
- case REMOVE_OBJ:
- cache.remove(dpp, name);
+ case INVALIDATE_OBJ:
+ cache.invalidate_remove(dpp, name);
break;
default:
ldpp_dout(dpp, 0) << "WARNING: got unknown notification op: " << info.op << dendl;
int RGWSI_SysObj_Cache::ASocketHandler::call_erase(const std::string& target)
{
- return svc->cache.remove(dpp, target);
+ return svc->cache.invalidate_remove(dpp, target);
}
int RGWSI_SysObj_Cache::ASocketHandler::call_zap()