- int (*moo_permission)(const struct lu_env *env,
- struct md_object *pobj, struct md_object *cobj,
- struct md_attr *attr, int mask);
-
- int (*moo_attr_get)(const struct lu_env *env, struct md_object *obj,
- struct md_attr *attr);
-
- int (*moo_attr_set)(const struct lu_env *env, struct md_object *obj,
- const struct md_attr *attr);
-
- int (*moo_xattr_get)(const struct lu_env *env, struct md_object *obj,
- struct lu_buf *buf, const char *name);
-
- int (*moo_xattr_list)(const struct lu_env *env, struct md_object *obj,
- struct lu_buf *buf);
-
- int (*moo_xattr_set)(const struct lu_env *env, struct md_object *obj,
- const struct lu_buf *buf, const char *name,
- int fl);
-
- int (*moo_xattr_del)(const struct lu_env *env, struct md_object *obj,
- const char *name);
-
- int (*moo_readpage)(const struct lu_env *env, struct md_object *obj,
- const struct lu_rdpg *rdpg);
-
- int (*moo_readlink)(const struct lu_env *env, struct md_object *obj,
- struct lu_buf *buf);
-
- /** part of cross-ref operation */
- int (*moo_object_create)(const struct lu_env *env,
- struct md_object *obj,
- const struct md_op_spec *spec,
- struct md_attr *ma);
-
- int (*moo_ref_add)(const struct lu_env *env,
- struct md_object *obj,
- const struct md_attr *ma);
-
- int (*moo_ref_del)(const struct lu_env *env,
- struct md_object *obj,
- struct md_attr *ma);
-
- int (*moo_open)(const struct lu_env *env,
- struct md_object *obj, int flag);
-
- int (*moo_close)(const struct lu_env *env, struct md_object *obj,
- struct md_attr *ma);
-
- int (*moo_capa_get)(const struct lu_env *, struct md_object *,
- struct lustre_capa *, int renewal);
-
- int (*moo_object_sync)(const struct lu_env *, struct md_object *);
- dt_obj_version_t (*moo_version_get)(const struct lu_env *,
- struct md_object *);
- void (*moo_version_set)(const struct lu_env *, struct md_object *,
- dt_obj_version_t);
- int (*moo_path)(const struct lu_env *env, struct md_object *obj,
- char *path, int pathlen, __u64 *recno, int *linkno);
+ int (*moo_permission)(const struct lu_env *env,
+ struct md_object *pobj, struct md_object *cobj,
+ struct md_attr *attr, int mask);
+
+ int (*moo_attr_get)(const struct lu_env *env, struct md_object *obj,
+ struct md_attr *attr);
+
+ int (*moo_attr_set)(const struct lu_env *env, struct md_object *obj,
+ const struct md_attr *attr);
+
+ int (*moo_xattr_get)(const struct lu_env *env, struct md_object *obj,
+ struct lu_buf *buf, const char *name);
+
+ int (*moo_xattr_list)(const struct lu_env *env, struct md_object *obj,
+ struct lu_buf *buf);
+
+ int (*moo_xattr_set)(const struct lu_env *env, struct md_object *obj,
+ const struct lu_buf *buf, const char *name,
+ int fl);
+
+ int (*moo_xattr_del)(const struct lu_env *env, struct md_object *obj,
+ const char *name);
+
+ /** This method is used to swap the layouts between 2 objects */
+ int (*moo_swap_layouts)(const struct lu_env *env,
+ struct md_object *obj1, struct md_object *obj2,
+ __u64 flags);
+
+ /** \retval number of bytes actually read upon success */
+ int (*moo_readpage)(const struct lu_env *env, struct md_object *obj,
+ const struct lu_rdpg *rdpg);
+
+ int (*moo_readlink)(const struct lu_env *env, struct md_object *obj,
+ struct lu_buf *buf);
+
+ int (*moo_changelog)(const struct lu_env *env,
+ enum changelog_rec_type type,
+ enum changelog_rec_flags clf_flags,
+ struct md_device *m, const struct lu_fid *fid);
+
+ int (*moo_open)(const struct lu_env *env, struct md_object *obj,
+ u64 open_flags, struct md_op_spec*);
+
+ int (*moo_close)(const struct lu_env *env, struct md_object *obj,
+ struct md_attr *ma, u64 open_flags);
+
+ int (*moo_object_sync)(const struct lu_env *, struct md_object *);
+
+ int (*moo_object_lock)(const struct lu_env *env, struct md_object *obj,
+ struct lustre_handle *lh,
+ struct ldlm_enqueue_info *einfo,
+ union ldlm_policy_data *policy);
+ int (*moo_object_unlock)(const struct lu_env *env,
+ struct md_object *obj,
+ struct ldlm_enqueue_info *einfo,
+ union ldlm_policy_data *policy);
+
+ int (*moo_invalidate)(const struct lu_env *env, struct md_object *obj);
+ /**
+ * Trying to write to un-instantiated layout component.
+ *
+ * The caller should have held layout lock.
+ *
+ * This API can be extended to support every other layout changing
+ * operations, such as component {add,del,change}, layout swap,
+ * layout merge, etc. One of the benefits by doing this is that the MDT
+ * no longer needs to understand layout.
+ *
+ * However, layout creation, removal, and fetch should still use
+ * xattr_{get,set}() because they don't interpret layout on the
+ * MDT layer.
+ *
+ * \param[in] env execution environment
+ * \param[in] obj MD object
+ * \param[in] layout data structure to describe the changes to
+ * the MD object's layout
+ *
+ * \retval 0 success
+ * \retval -ne error code
+ */
+ int (*moo_layout_change)(const struct lu_env *env,
+ struct md_object *obj,
+ struct md_layout_change *layout);