Whamcloud - gitweb
LU-6158 mdt: always shrink_capsule in getxattr_all
[fs/lustre-release.git] / lustre / osp / osp_trans.c
index be7db77..e700acf 100644 (file)
@@ -130,6 +130,9 @@ int osp_object_update_request_create(struct osp_update_request *our,
        if (ours == NULL)
                return -ENOMEM;
 
+       if (size < OUT_UPDATE_INIT_BUFFER_SIZE)
+               size = OUT_UPDATE_INIT_BUFFER_SIZE;
+
        ours->ours_req = object_update_request_alloc(size);
 
        if (IS_ERR(ours->ours_req)) {
@@ -564,7 +567,7 @@ int osp_unplug_async_request(const struct lu_env *env,
                args->oaua_waitq = NULL;
                args->oaua_flow_control = false;
                req->rq_interpret_reply = osp_update_interpret;
-               ptlrpcd_add_req(req, PDL_POLICY_LOCAL, -1);
+               ptlrpcd_add_req(req);
        }
 
        return rc;
@@ -727,9 +730,6 @@ int osp_trans_update_request_create(struct thandle *th)
        oth->ot_our = our;
        our->our_th = oth;
 
-       if (oth->ot_super.th_sync)
-               oth->ot_our->our_flags |= UPDATE_FL_SYNC;
-
        return 0;
 }
 
@@ -964,7 +964,7 @@ static int osp_send_update_req(const struct lu_env *env,
                        atomic_inc(args->oaua_count);
                }
 
-               ptlrpcd_add_req(req, PDL_POLICY_LOCAL, -1);
+               ptlrpcd_add_req(req);
                req = NULL;
        } else {
                osp_thandle_get(oth); /* hold for commit callback */
@@ -982,9 +982,11 @@ static int osp_send_update_req(const struct lu_env *env,
                if (top_device->ld_obd->obd_recovering)
                        req->rq_allow_replay = 1;
 
-               osp_get_rpc_lock(osp);
+               if (osp->opd_connect_mdt)
+                       osp_get_rpc_lock(osp);
                rc = ptlrpc_queue_wait(req);
-               osp_put_rpc_lock(osp);
+               if (osp->opd_connect_mdt)
+                       osp_put_rpc_lock(osp);
                if ((rc == -ENOMEM && req->rq_set == NULL) ||
                    (req->rq_transno == 0 && !req->rq_committed)) {
                        if (args->oaua_update != NULL) {
@@ -1270,6 +1272,8 @@ int osp_trans_start(const struct lu_env *env, struct dt_device *dt,
 {
        struct osp_thandle      *oth = thandle_to_osp_thandle(th);
 
+       if (oth->ot_super.th_sync)
+               oth->ot_our->our_flags |= UPDATE_FL_SYNC;
        /* For remote thandle, if there are local thandle, start it here*/
        if (is_only_remote_trans(th) && oth->ot_storage_th != NULL)
                return dt_trans_start(env, oth->ot_storage_th->th_dev,
@@ -1319,6 +1323,7 @@ int osp_trans_stop(const struct lu_env *env, struct dt_device *dt,
        }
 
        if (!osp->opd_connect_mdt) {
+               osp_trans_callback(env, oth, th->th_result);
                rc = osp_send_update_req(env, osp, oth->ot_our);
                GOTO(out, rc);
        }