Whamcloud - gitweb
LU-9679 nrs: remove ts_opcodes bitmap. 75/38975/2
authorMr NeilBrown <neilb@suse.de>
Wed, 29 Apr 2020 02:46:43 +0000 (12:46 +1000)
committerOleg Drokin <green@whamcloud.com>
Sat, 4 Jul 2020 03:02:45 +0000 (03:02 +0000)
This bitmap is never used.  There is one place that tests if it has
been allocated or not, but that place can easily be satisfied by a
strcmp().

So discard the field.

Signed-off-by: Mr NeilBrown <neilb@suse.de>
Change-Id: I97ca6753236f106d1865d514034b72a679f9b28a
Reviewed-on: https://review.whamcloud.com/38975
Tested-by: jenkins <devops@whamcloud.com>
Reviewed-by: James Simmons <jsimmons@infradead.org>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Arshad Hussain <arshad.super@gmail.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
lustre/include/lustre_nrs_tbf.h
lustre/ptlrpc/nrs_tbf.c

index 7141146..e4bbf8a 100644 (file)
@@ -306,7 +306,6 @@ struct nrs_tbf_cmd {
                        char                    *ts_jobids_str;
                        struct list_head         ts_ids;
                        char                    *ts_ids_str;
-                       struct cfs_bitmap       *ts_opcodes;
                        char                    *ts_opcodes_str;
                        struct list_head         ts_conds;
                        char                    *ts_conds_str;
index d28c11d..76c8e4c 100644 (file)
@@ -2182,7 +2182,6 @@ nrs_tbf_opcode_startup(struct ptlrpc_nrs_policy *policy,
        if (head->th_cli_hash == NULL)
                return -ENOMEM;
 
-       start.u.tc_start.ts_opcodes = NULL;
        start.u.tc_start.ts_opcodes_str = "*";
 
        start.u.tc_start.ts_rpc_rate = tbf_rate;
@@ -2265,7 +2264,7 @@ nrs_tbf_opcode_list_parse(char *str, int len, struct cfs_bitmap **bitmaptr)
                        break;
        }
 
-       if (rc == 0)
+       if (rc == 0 && bitmaptr)
                *bitmaptr = opcodes;
        else
                CFS_FREE_BITMAP(opcodes);
@@ -2275,9 +2274,6 @@ nrs_tbf_opcode_list_parse(char *str, int len, struct cfs_bitmap **bitmaptr)
 
 static void nrs_tbf_opcode_cmd_fini(struct nrs_tbf_cmd *cmd)
 {
-       if (cmd->u.tc_start.ts_opcodes)
-               CFS_FREE_BITMAP(cmd->u.tc_start.ts_opcodes);
-
        if (cmd->u.tc_start.ts_opcodes_str)
                OBD_FREE(cmd->u.tc_start.ts_opcodes_str,
                         strlen(cmd->u.tc_start.ts_opcodes_str) + 1);
@@ -2304,7 +2300,7 @@ static int nrs_tbf_opcode_parse(struct nrs_tbf_cmd *cmd, char *id)
        /* parse opcode list */
        rc = nrs_tbf_opcode_list_parse(cmd->u.tc_start.ts_opcodes_str,
                                       strlen(cmd->u.tc_start.ts_opcodes_str),
-                                      &cmd->u.tc_start.ts_opcodes);
+                                      NULL);
        if (rc)
                nrs_tbf_opcode_cmd_fini(cmd);
 
@@ -2337,7 +2333,7 @@ static int nrs_tbf_opcode_rule_init(struct ptlrpc_nrs_policy *policy,
                strlen(start->u.tc_start.ts_opcodes_str) + 1);
 
        /* Default rule '*' */
-       if (start->u.tc_start.ts_opcodes == NULL)
+       if (strcmp(start->u.tc_start.ts_opcodes_str, "*") == 0)
                return 0;
 
        rc = nrs_tbf_opcode_list_parse(rule->tr_opcodes_str,