EXIT;
}
+static int ptlrpc_hpreq_check(struct ptlrpc_request *req)
+{
+ return 1;
+}
+
+static struct ptlrpc_hpreq_ops ptlrpc_hpreq_common = {
+ .hpreq_lock_match = NULL,
+ .hpreq_check = ptlrpc_hpreq_check,
+ .hpreq_fini = NULL,
+};
+
+/* Hi-Priority RPC check by RPC operation code. */
+int ptlrpc_hpreq_handler(struct ptlrpc_request *req)
+{
+ int opc = lustre_msg_get_opc(req->rq_reqmsg);
+
+ /* Check for export to let only reconnects for not yet evicted
+ * export to become a HP rpc. */
+ if ((req->rq_export != NULL) &&
+ (opc == OBD_PING || opc == MDS_CONNECT || opc == OST_CONNECT))
+ req->rq_ops = &ptlrpc_hpreq_common;
+
+ return 0;
+}
+EXPORT_SYMBOL(ptlrpc_hpreq_handler);
+
/**
* Make the request a high priority one.
*
static int ptlrpc_server_hpreq_check(struct ptlrpc_service *svc,
struct ptlrpc_request *req)
{
- ENTRY;
-
- /* Check by request opc. */
- if (OBD_PING == lustre_msg_get_opc(req->rq_reqmsg))
- RETURN(1);
-
- RETURN(ptlrpc_hpreq_init(svc, req));
+ return ptlrpc_hpreq_init(svc, req);
}
/** Check if a request is a high priority one. */