[lustre-devel] [PATCH 097/622] lustre: ptlrpc: replace simple_strtol with kstrtol

James Simmons jsimmons at infradead.org
Thu Feb 27 13:09:25 PST 2020


Eventually simple_strtol() will be removed so replace its use in
the ptlrpc with kstrtoXXX() class of functions.

WC-bug-id: https://jira.whamcloud.com/browse/LU-9325
Lustre-commit: 8f37d64b6bc9 ("LU-9325 ptlrpc: replace simple_strtol with kstrtol")
Signed-off-by: James Simmons <uja.ornl at yahoo.com>
Reviewed-on: https://review.whamcloud.com/32785
Reviewed-by: Andreas Dilger <adilger at whamcloud.com>
Reviewed-by: Nikitas Angelinas <nikitas.angelinas at gmail.com>
Signed-off-by: James Simmons <jsimmons at infradead.org>
---
 fs/lustre/ptlrpc/lproc_ptlrpc.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/fs/lustre/ptlrpc/lproc_ptlrpc.c b/fs/lustre/ptlrpc/lproc_ptlrpc.c
index 6af3384..eb0ecc0 100644
--- a/fs/lustre/ptlrpc/lproc_ptlrpc.c
+++ b/fs/lustre/ptlrpc/lproc_ptlrpc.c
@@ -1303,13 +1303,13 @@ int lprocfs_wr_import(struct file *file, const char __user *buffer,
 	ptr = strstr(uuid, "::");
 	if (ptr) {
 		u32 inst;
-		char *endptr;
+		int rc;
 
 		*ptr = 0;
 		do_reconn = 0;
 		ptr += strlen("::");
-		inst = simple_strtoul(ptr, &endptr, 10);
-		if (*endptr) {
+		rc = kstrtouint(ptr, 10, &inst);
+		if (rc) {
 			CERROR("config: wrong instance # %s\n", ptr);
 		} else if (inst != imp->imp_connect_data.ocd_instance) {
 			CDEBUG(D_INFO,
-- 
1.8.3.1



More information about the lustre-devel mailing list