X-Git-Url: https://git.whamcloud.com/?a=blobdiff_plain;f=lustre%2Finclude%2Flustre_nrs.h;h=fd80e408bd40116d6d650e3c4ed13a799b242f6d;hb=50f28f81b5aa8f8ad1c8585bd7e262910f936e50;hp=6f913d2406c4e3201793ca9da75423ccfd13b602;hpb=e7ab554c1ca887e1a3fa9da5250b2debb4eee2d6;p=fs%2Flustre-release.git diff --git a/lustre/include/lustre_nrs.h b/lustre/include/lustre_nrs.h index 6f913d2..fd80e40 100644 --- a/lustre/include/lustre_nrs.h +++ b/lustre/include/lustre_nrs.h @@ -63,7 +63,16 @@ enum ptlrpc_nrs_ctl { * Policies can start using opcodes from this value and onwards for * their own purposes; the assigned value itself is arbitrary. */ - PTLRPC_NRS_CTL_1ST_POL_SPEC = 0x20, + PTLRPC_NRS_CTL_POL_SPEC_01 = 0x20, + PTLRPC_NRS_CTL_POL_SPEC_02, + PTLRPC_NRS_CTL_POL_SPEC_03, + PTLRPC_NRS_CTL_POL_SPEC_04, + PTLRPC_NRS_CTL_POL_SPEC_05, + PTLRPC_NRS_CTL_POL_SPEC_06, + PTLRPC_NRS_CTL_POL_SPEC_07, + PTLRPC_NRS_CTL_POL_SPEC_08, + PTLRPC_NRS_CTL_POL_SPEC_09, + PTLRPC_NRS_CTL_POL_SPEC_10 }; /** @@ -269,16 +278,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 +298,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) }; @@ -672,9 +681,22 @@ enum { }; #include +/** + * 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 #include #include +#endif /* HAVE_SERVER_SUPPORT */ +#include /** * NRS request @@ -700,7 +722,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 @@ -711,6 +733,7 @@ struct ptlrpc_nrs_request { * Fields for the FIFO policy */ struct nrs_fifo_req fifo; +#ifdef HAVE_SERVER_SUPPORT /** * CRR-N request defintion */ @@ -721,6 +744,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