+/**
+ * Implementation of dt_body_operations::dbo_declare_write
+ *
+ * Declare an object write. In DNE phase I, it will pack the write
+ * object update into the RPC.
+ *
+ * \param[in] env execution environment
+ * \param[in] dt object to be written
+ * \param[in] buf buffer to write which includes an embedded size field
+ * \param[in] pos offet in the object to start writing at
+ * \param[in] th transaction handle
+ *
+ * \retval 0 if the insertion succeeds.
+ * \retval negative errno if the insertion fails.
+ */
+static ssize_t osp_md_declare_write(const struct lu_env *env,
+ struct dt_object *dt,
+ const struct lu_buf *buf,
+ loff_t pos, struct thandle *th)
+{
+ struct dt_update_request *update;
+ ssize_t rc;
+
+ update = thandle_to_dt_update_request(th);
+ LASSERT(update != NULL);
+
+ rc = out_write_pack(env, &update->dur_buf, lu_object_fid(&dt->do_lu),
+ buf, pos, update->dur_batchid);
+
+ return rc;
+
+}
+
+/**
+ * Implementation of dt_body_operations::dbo_write
+ *
+ * Return the buffer size. In DNE phase I, remote updates
+ * are actually executed during transaction start, the buffer has
+ * already been written when this method is being called.
+ *
+ * \param[in] env execution environment
+ * \param[in] dt object to be written
+ * \param[in] buf buffer to write which includes an embedded size field
+ * \param[in] pos offet in the object to start writing at
+ * \param[in] th transaction handle
+ * \param[in] ignore_quota quota enforcement for this write
+ *
+ * \retval the buffer size in bytes.
+ */
+static ssize_t osp_md_write(const struct lu_env *env, struct dt_object *dt,
+ const struct lu_buf *buf, loff_t *pos,
+ struct thandle *handle, int ignore_quota)
+{
+ *pos += buf->lb_len;
+ return buf->lb_len;
+}
+
+/* These body operation will be used to write symlinks during migration etc */
+struct dt_body_operations osp_md_body_ops = {
+ .dbo_declare_write = osp_md_declare_write,
+ .dbo_write = osp_md_write,
+};