Whamcloud - gitweb
LU-15914 lnet: Fix null md deref for finalized message
[fs/lustre-release.git] / lustre / include / lustre_nrs.h
index 6552518..80f9f6b 100644 (file)
@@ -269,16 +269,16 @@ enum nrs_policy_flags {
         * service. The flag cannot be used on policies that use
         * \e PTLRPC_NRS_FL_REG_EXTERN
         */
-       PTLRPC_NRS_FL_FALLBACK          = (1 << 0),
+       PTLRPC_NRS_FL_FALLBACK          = BIT(0),
        /**
         * Start policy immediately after registering.
         */
-       PTLRPC_NRS_FL_REG_START         = (1 << 1),
+       PTLRPC_NRS_FL_REG_START         = BIT(1),
        /**
         * This is a policy registering from a module different to the one NRS
         * core ships in (currently ptlrpc).
         */
-       PTLRPC_NRS_FL_REG_EXTERN        = (1 << 2),
+       PTLRPC_NRS_FL_REG_EXTERN        = BIT(2),
 };
 
 /**
@@ -289,8 +289,8 @@ enum nrs_policy_flags {
  * in a service.
  */
 enum ptlrpc_nrs_queue_type {
-       PTLRPC_NRS_QUEUE_REG    = (1 << 0),
-       PTLRPC_NRS_QUEUE_HP     = (1 << 1),
+       PTLRPC_NRS_QUEUE_REG    = BIT(0),
+       PTLRPC_NRS_QUEUE_HP     = BIT(1),
        PTLRPC_NRS_QUEUE_BOTH   = (PTLRPC_NRS_QUEUE_REG | PTLRPC_NRS_QUEUE_HP)
 };
 
@@ -380,6 +380,7 @@ struct ptlrpc_nrs {
 };
 
 #define NRS_POL_NAME_MAX               16
+#define NRS_POL_ARG_MAX                        16
 
 struct ptlrpc_nrs_pol_desc;
 
@@ -549,6 +550,10 @@ struct ptlrpc_nrs_pol_info {
         */
        char                            pi_name[NRS_POL_NAME_MAX];
        /**
+        * Policy argument
+        */
+       char                            pi_arg[NRS_POL_ARG_MAX];
+       /**
         * Current policy state
         */
        enum ptlrpc_nrs_pol_state       pi_state;
@@ -604,6 +609,10 @@ struct ptlrpc_nrs_policy {
         */
        long                            pol_ref;
        /**
+        * Human-readable policy argument
+        */
+       char                            pol_arg[NRS_POL_ARG_MAX];
+       /**
         * The NRS head this policy has been created at
         */
        struct ptlrpc_nrs              *pol_nrs;
@@ -663,9 +672,22 @@ enum {
 };
 
 #include <lustre_nrs_fifo.h>
+/**
+ * Binary heap node.
+ *
+ * Objects of this type are embedded into objects of the ordered set that is to
+ * be maintained by a \e struct binheap instance.
+ */
+struct binheap_node {
+       /** Index into the binary tree */
+       unsigned int    chn_index;
+};
+#ifdef HAVE_SERVER_SUPPORT
 #include <lustre_nrs_tbf.h>
 #include <lustre_nrs_crr.h>
 #include <lustre_nrs_orr.h>
+#endif /* HAVE_SERVER_SUPPORT */
+#include <lustre_nrs_delay.h>
 
 /**
  * NRS request
@@ -691,7 +713,7 @@ struct ptlrpc_nrs_request {
        unsigned                        nr_enqueued:1;
        unsigned                        nr_started:1;
        unsigned                        nr_finalized:1;
-       cfs_binheap_node_t              nr_node;
+       struct binheap_node             nr_node;
 
        /**
         * Policy-specific fields, used for determining a request's scheduling
@@ -702,6 +724,7 @@ struct ptlrpc_nrs_request {
                 * Fields for the FIFO policy
                 */
                struct nrs_fifo_req     fifo;
+#ifdef HAVE_SERVER_SUPPORT
                /**
                 * CRR-N request defintion
                 */
@@ -712,6 +735,11 @@ struct ptlrpc_nrs_request {
                 * TBF request definition
                 */
                struct nrs_tbf_req      tbf;
+#endif /* HAVE_SERVER_SUPPORT */
+               /**
+                * Fields for the delay policy
+                */
+               struct nrs_delay_req    delay;
        } nr_u;
        /**
         * Externally-registering policies may want to use this to allocate