Whamcloud - gitweb
LU-6142 lustre: use init_wait(), not init_waitqueue_entry()
[fs/lustre-release.git] / lustre / quota / qsd_request.c
index 1259071..b4243ff 100644 (file)
@@ -21,7 +21,7 @@
  * GPL HEADER END
  */
 /*
- * Copyright (c) 2012, 2015, Intel Corporation.
+ * Copyright (c) 2012, 2016, Intel Corporation.
  * Use is subject to license terms.
  *
  * Author: Johann Lombardi <johann.lombardi@intel.com>
@@ -119,8 +119,7 @@ int qsd_send_dqacq(const struct lu_env *env, struct obd_export *exp,
 
        ptlrpc_request_set_replen(req);
 
-       CLASSERT(sizeof(*aa) <= sizeof(req->rq_async_args));
-       aa = ptlrpc_req_async_args(req);
+       aa = ptlrpc_req_async_args(aa, req);
        aa->aa_exp = exp;
        aa->aa_qqi = qqi;
        aa->aa_arg = (void *)lqe;
@@ -322,8 +321,7 @@ int qsd_intent_lock(const struct lu_env *env, struct obd_export *exp,
                break;
        }
 
-       CLASSERT(sizeof(*aa) <= sizeof(req->rq_async_args));
-       aa = ptlrpc_req_async_args(req);
+       aa = ptlrpc_req_async_args(aa, req);
        aa->aa_exp = exp;
        aa->aa_qqi = qqi;
        aa->aa_arg = arg;
@@ -389,13 +387,11 @@ int qsd_fetch_index(const struct lu_env *env, struct obd_export *exp,
 
        /* allocate bulk descriptor */
        desc = ptlrpc_prep_bulk_imp(req, npages, 1,
-                                   PTLRPC_BULK_PUT_SINK | PTLRPC_BULK_BUF_KIOV,
+                                   PTLRPC_BULK_PUT_SINK,
                                    MDS_BULK_PORTAL,
                                    &ptlrpc_bulk_kiov_pin_ops);
-       if (desc == NULL) {
-               ptlrpc_request_free(req);
-               RETURN(-ENOMEM);
-       }
+       if (desc == NULL)
+               GOTO(out, rc = -ENOMEM);
 
        /* req now owns desc and will free it when it gets freed */
        for (i = 0; i < npages; i++)