rc = -EEXIST;
LASSERT(ergo(rc == 0, lu_object_exists(ctxt, &obj->mod_obj.mo_lu)));
+ /* increase the nlink for directory */
+ if (rc == 0 && dt_is_dir(ctxt, mdd_object_child(obj)))
+ rc = __mdd_ref_add(ctxt, obj, handle);
/*XXX increase the refcount of the object or not?*/
RETURN(rc);
}
if (rc)
RETURN(rc);
}
-
+
mdd_txn_param_build(ctxt, &MDD_TXN_MKDIR);
handle = mdd_trans_start(ctxt, mdd);
if (IS_ERR(handle))
GOTO(cleanup, rc);
created = 1;
+
rc = __mdd_index_insert(ctxt, mdo, lu_object_fid(&child->mo_lu),
name, handle);