From: NeilBrown Date: Sun, 23 Jun 2019 13:41:25 +0000 (-0400) Subject: LU-4423 ptlrpc: make ptlrpc_bulk_frag_ops always const. X-Git-Tag: 2.12.56~64 X-Git-Url: https://git.whamcloud.com/?p=fs%2Flustre-release.git;a=commitdiff_plain;h=490f0dd33b2244029f8bf17050f7a86bc76986d6 LU-4423 ptlrpc: make ptlrpc_bulk_frag_ops always const. There is one place where a non-const pointer to this struct exists, and that causes a cast to be required. Make it always const, and discard the cast. Test-Parameters: trivial Change-Id: Ic48ff6a1f759abdddc75298feee2b68c60bf3e7b Signed-off-by: NeilBrown Reviewed-on: https://review.whamcloud.com/35295 Tested-by: Jenkins Tested-by: Maloo Reviewed-by: Petros Koutoupis Reviewed-by: Shaun Tancheff Reviewed-by: Sebastien Buisson Reviewed-by: Oleg Drokin --- diff --git a/lustre/include/lustre_net.h b/lustre/include/lustre_net.h index dce8c6e..9c50743 100644 --- a/lustre/include/lustre_net.h +++ b/lustre/include/lustre_net.h @@ -1458,7 +1458,7 @@ struct ptlrpc_bulk_desc { struct obd_import *bd_import; /** Back pointer to the request */ struct ptlrpc_request *bd_req; - struct ptlrpc_bulk_frag_ops *bd_frag_ops; + const struct ptlrpc_bulk_frag_ops *bd_frag_ops; wait_queue_head_t bd_waitq; /* server side only WQ */ int bd_iov_count; /* # entries in bd_iov */ int bd_max_iov; /* allocated size of bd_iov */ diff --git a/lustre/ptlrpc/client.c b/lustre/ptlrpc/client.c index bc983ac..b9b73cc 100644 --- a/lustre/ptlrpc/client.c +++ b/lustre/ptlrpc/client.c @@ -154,7 +154,7 @@ struct ptlrpc_bulk_desc *ptlrpc_new_bulk(unsigned int nfrags, desc->bd_portal = portal; desc->bd_type = type; desc->bd_md_count = 0; - desc->bd_frag_ops = (struct ptlrpc_bulk_frag_ops *)ops; + desc->bd_frag_ops = ops; LASSERT(max_brw > 0); desc->bd_md_max_brw = min(max_brw, PTLRPC_BULK_OPS_COUNT); /*