staging/lustre/ldlm: Reinstate ldlm_enqueue_pack()
authorOleg Drokin <green@linuxhacker.ru>
Thu, 3 Nov 2016 01:24:57 +0000 (21:24 -0400)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 7 Nov 2016 10:36:46 +0000 (11:36 +0100)
The function becomes used again with the next patch, so bring it back
from dead, only this time make it static.

Reverts: bf2a033360f7 ("staging/lustre/ldlm: Remove unused ldlm_enqueue_pack()")
Signed-off-by: Oleg Drokin <green@linuxhacker.ru>
Reviewed-by: James Simmons <jsimmons@infradead.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/lustre/lustre/ldlm/ldlm_request.c

index 6e704c7eac0a9b9a0213434b1c0a95b913dda265..1b9ae77849f94545bea9fb18141381e7e866e78e 100644 (file)
@@ -657,6 +657,27 @@ int ldlm_prep_enqueue_req(struct obd_export *exp, struct ptlrpc_request *req,
 }
 EXPORT_SYMBOL(ldlm_prep_enqueue_req);
 
+static struct ptlrpc_request *ldlm_enqueue_pack(struct obd_export *exp,
+                                               int lvb_len)
+{
+       struct ptlrpc_request *req;
+       int rc;
+
+       req = ptlrpc_request_alloc(class_exp2cliimp(exp), &RQF_LDLM_ENQUEUE);
+       if (!req)
+               return ERR_PTR(-ENOMEM);
+
+       rc = ldlm_prep_enqueue_req(exp, req, NULL, 0);
+       if (rc) {
+               ptlrpc_request_free(req);
+               return ERR_PTR(rc);
+       }
+
+       req_capsule_set_size(&req->rq_pill, &RMF_DLM_LVB, RCL_SERVER, lvb_len);
+       ptlrpc_request_set_replen(req);
+       return req;
+}
+
 /**
  * Client-side lock enqueue.
  *