注意
本文档适用于 Ceph 的开发版本。
引用计数
简介
如 ../deduplication.rst 中所述,重复数据删除需要一种方法来维护一个 dedupe 块的目标池,并使用原子引用计数。为此,存在一个 osd 对象类 refcount,它负责使用对象类机制来维护 dedupe 块上的引用计数,并在引用计数达到 0 时最终删除它们。
类接口
请参阅 cls/refcount/cls_refcount_client*
cls_refcount_get
原子性地增加具有指定标签的引用计数
void cls_refcount_get(librados::ObjectWriteOperation& op, const string& tag, bool implicit_ref = false);
cls_refcount_put
原子性地减少由传入标签指定的引用计数
void cls_refcount_put(librados::ObjectWriteOperation& op, const string& tag, bool implicit_ref = false);
cls_refcount_Set
原子性地设置具有传入标签列表的引用计数集
void cls_refcount_set(librados::ObjectWriteOperation& op, list<string>& refs);
cls_refcount_read
转储对象的当前引用标签集
int cls_refcount_read(librados::IoCtx& io_ctx, string& oid, list<string> *refs, bool implicit_ref = false);