Whamcloud - gitweb
LU-3536 osp: move update packing into out_lib.c
[fs/lustre-release.git] / lustre / osp / osp_sync.c
index 8bbd938..2d03418 100644 (file)
@@ -44,6 +44,7 @@
 #define DEBUG_SUBSYSTEM S_MDS
 
 #include <lustre_log.h>
+#include <lustre_update.h>
 #include "osp_internal.h"
 
 static int osp_sync_id_traction_init(struct osp_device *d);
@@ -553,25 +554,25 @@ static int osp_prep_unlink_update_req(const struct lu_env *env,
        struct llog_unlink64_rec        *rec = (struct llog_unlink64_rec *)h;
        struct dt_update_request        *update = NULL;
        struct ptlrpc_request           *req;
-       const char                      *buf;
        struct llog_cookie              lcookie;
-       int                             size;
+       const void                      *buf;
+       __u16                           size;
        int                             rc;
        ENTRY;
 
-       update = out_create_update_req(&osp->opd_dt_dev);
+       update = dt_update_request_create(&osp->opd_dt_dev);
        if (IS_ERR(update))
                RETURN(PTR_ERR(update));
 
        /* This can only happens for unlink slave directory, so decrease
         * ref for ".." and "." */
-       rc = out_insert_update(env, update, OUT_REF_DEL, &rec->lur_fid, 0,
-                              NULL, NULL);
+       rc = out_update_pack(env, &update->dur_buf, OUT_REF_DEL, &rec->lur_fid,
+                            0, NULL, NULL, 0);
        if (rc != 0)
                GOTO(out, rc);
 
-       rc = out_insert_update(env, update, OUT_REF_DEL, &rec->lur_fid, 0,
-                              NULL, NULL);
+       rc = out_update_pack(env, &update->dur_buf, OUT_REF_DEL, &rec->lur_fid,
+                            0, NULL, NULL, 0);
        if (rc != 0)
                GOTO(out, rc);
 
@@ -579,15 +580,15 @@ static int osp_prep_unlink_update_req(const struct lu_env *env,
        lcookie.lgc_subsys = LLOG_MDS_OST_ORIG_CTXT;
        lcookie.lgc_index = h->lrh_index;
        size = sizeof(lcookie);
-       buf = (const char *)&lcookie;
+       buf = &lcookie;
 
-       rc = out_insert_update(env, update, OUT_DESTROY, &rec->lur_fid, 1,
-                              &size, &buf);
+       rc = out_update_pack(env, &update->dur_buf, OUT_DESTROY, &rec->lur_fid,
+                            1, &size, &buf, 0);
        if (rc != 0)
                GOTO(out, rc);
 
        rc = out_prep_update_req(env, osp->opd_obd->u.cli.cl_import,
-                                update->dur_req, &req);
+                                update->dur_buf.ub_req, &req);
        if (rc != 0)
                GOTO(out, rc);
 
@@ -602,7 +603,7 @@ static int osp_prep_unlink_update_req(const struct lu_env *env,
        *reqp = req;
 out:
        if (update != NULL)
-               out_destroy_update_req(update);
+               dt_update_request_destroy(update);
 
        RETURN(rc);
 }