+/**
+ * Set directory .do_index_ops.
+ *
+ * Set directory index operations, if the caller knows directory exists,
+ * \a check should be set to ensure object is directory and exists, while for
+ * new directories, skip check and the index operations will be used to create
+ * ".." under directory.
+ *
+ * Normally this is called before dt_lookup() to ensure directory objects
+ * exists and .do_index_ops is correctly set.
+ *
+ * \param env lu_env object.
+ * \param obj dt object.
+ * \param check check \a obj existence and type, return if index ops is set.
+ * \retval 1 on success.
+ * \retval 0 on error.
+ */
+int dt_try_as_dir(const struct lu_env *env, struct dt_object *obj, bool check)