注意

本文档适用于 Ceph 开发版本。

引用计数

简介

如 ../deduplication.rst 中所述,去重需要一个方法来维护去重块的目标池,并使用原子引用计数。为此,存在一个 osd 对象类 refcount,负责使用对象类机制来维护去重块的引用计数,并在引用计数达到 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);
    

由 Ceph 基金会带给您

Ceph 文档是一个社区资源,由非盈利的 Ceph 基金会资助和托管Ceph Foundation. 如果您想支持这一点和我们的其他工作,请考虑加入现在加入.