X-Git-Url: https://git.whamcloud.com/?a=blobdiff_plain;f=lustre%2Finclude%2Flustre_nrs_tbf.h;h=0e5c929b321d42a5ea2616e6342ee03cd1cbdd22;hb=a5a7890093ea2509db15f8aa8a8c9d9c86133209;hp=04998c319a6b54631dce7b4242dfa8877e0b6038;hpb=839360d35e27087e8266b02c5dd69e5e940577c5;p=fs%2Flustre-release.git diff --git a/lustre/include/lustre_nrs_tbf.h b/lustre/include/lustre_nrs_tbf.h index 04998c3..0e5c929 100644 --- a/lustre/include/lustre_nrs_tbf.h +++ b/lustre/include/lustre_nrs_tbf.h @@ -79,7 +79,7 @@ struct nrs_tbf_client { /** List of queued requests. */ struct list_head tc_list; /** Node in binary heap. */ - cfs_binheap_node_t tc_node; + struct cfs_binheap_node tc_node; /** Whether the client is in heap. */ bool tc_in_heap; /** Sequence of the newest rule. */ @@ -150,6 +150,7 @@ struct nrs_tbf_ops { #define NRS_TBF_TYPE_JOBID "jobid" #define NRS_TBF_TYPE_NID "nid" #define NRS_TBF_TYPE_MAX_LEN 20 +#define NRS_TBF_FLAG_INVALID 0 #define NRS_TBF_FLAG_JOBID 0x0000001 #define NRS_TBF_FLAG_NID 0x0000002 @@ -200,7 +201,7 @@ struct nrs_tbf_head { /** * Heap of queues. */ - cfs_binheap_t *th_binheap; + struct cfs_binheap *th_binheap; /** * Hash of clients. */ @@ -226,19 +227,28 @@ struct nrs_tbf_head { enum nrs_tbf_cmd_type { NRS_CTL_TBF_START_RULE = 0, NRS_CTL_TBF_STOP_RULE, - NRS_CTL_TBF_CHANGE_RATE, + NRS_CTL_TBF_CHANGE_RULE, }; struct nrs_tbf_cmd { - enum nrs_tbf_cmd_type tc_cmd; - char *tc_name; - __u64 tc_rpc_rate; - struct list_head tc_nids; - char *tc_nids_str; - struct list_head tc_jobids; - char *tc_jobids_str; - __u32 tc_valid_types; - __u32 tc_rule_flags; + enum nrs_tbf_cmd_type tc_cmd; + char *tc_name; + union { + struct nrs_tbf_cmd_start { + __u64 ts_rpc_rate; + struct list_head ts_nids; + char *ts_nids_str; + struct list_head ts_jobids; + char *ts_jobids_str; + __u32 ts_valid_type; + __u32 ts_rule_flags; + char *ts_next_name; + } tc_start; + struct nrs_tbf_cmd_change { + __u64 tc_rpc_rate; + char *tc_next_name; + } tc_change; + } u; }; struct nrs_tbf_req { @@ -264,6 +274,10 @@ enum nrs_ctl_tbf { * Write the the data of a TBF policy. */ NRS_CTL_TBF_WR_RULE, + /** + * Read the TBF policy type preset by proc entry "nrs_policies". + */ + NRS_CTL_TBF_RD_TYPE_FLAG, }; /** @} tbf */