Whamcloud - gitweb
LU-9859 ptlrpc: simplify nrs_tbf_check_id_value and callers 36/50836/4
authorMr NeilBrown <neilb@suse.de>
Tue, 24 Nov 2020 05:17:33 +0000 (16:17 +1100)
committerOleg Drokin <green@whamcloud.com>
Wed, 19 Jul 2023 16:43:22 +0000 (16:43 +0000)
commitd5112af7369e3110ea52c9c05fb6179dd67c767d
treefb9d1d95adab7f7da3eec5ac806d2833deac9ff9
parent44cc78222d51346899436dee01c252bf18ee3e77
LU-9859 ptlrpc: simplify nrs_tbf_check_id_value and callers

The string passed down to nrs_tbf_check_id_value() is always "token"
in nrs_tbf_id_parse(), which is in 'buffer' in nrs_tbf_parse_cmd() and
is modified in-place there and in
ptlrpc_lprocfs_nrs_tbf_rule_seq_write().

So it must be safe to modify the string in nrs_tbf_check_id_value()
too.  So change that function to parse it using the primitives
commonly used in the kernel such as strsep and strim.

Change all callers to use "char *" rather than "struct cfs_lstr".

Test-Parameters: trivial
Signed-off-by: Mr NeilBrown <neilb@suse.de>
Change-Id: Ie67dba002530e4bdfb3c3601a15dc49904f1adcf
Reviewed-on: https://review.whamcloud.com/c/fs/lustre-release/+/50836
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Timothy Day <timday@amazon.com>
Reviewed-by: James Simmons <jsimmons@infradead.org>
Reviewed-by: Etienne AUJAMES <eaujames@ddn.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
lustre/ptlrpc/nrs_tbf.c