-/**
- * If subdir count is up to ddp_max_nlink, then enable MNLINK_OBJ flag and
- * assign i_nlink to 1 which means the i_nlink for subdir count is incredible
- * (maybe too large to be represented). It is a trick to break through the
- * "i_nlink" limitation for subdir count.
- */
-void __mdd_ref_add(const struct lu_env *env, struct mdd_object *obj,
- struct thandle *handle)
-{
- struct lu_attr *tmp_la = &mdd_env_info(env)->mti_la;
- struct mdd_device *m = mdd_obj2mdd_dev(obj);
-
- if (!mdd_is_mnlink(obj)) {
- if (S_ISDIR(mdd_object_type(obj))) {
- if (mdd_la_get(env, obj, tmp_la, BYPASS_CAPA))
- return;
-
- if (tmp_la->la_nlink >= m->mdd_dt_conf.ddp_max_nlink) {
- obj->mod_flags |= MNLINK_OBJ;
- tmp_la->la_nlink = 1;
- tmp_la->la_valid = LA_NLINK;
- mdd_attr_set_internal(env, obj, tmp_la, handle,
- 0);
- return;
- }
- }
- mdo_ref_add(env, obj, handle);
- }
-}
-
-void __mdd_ref_del(const struct lu_env *env, struct mdd_object *obj,
- struct thandle *handle, int is_dot)
-{
- if (!mdd_is_mnlink(obj) || is_dot)
- mdo_ref_del(env, obj, handle);
-}
-