From: Timothy Day Date: Mon, 19 Jun 2023 03:44:02 +0000 (+0000) Subject: LU-8191 ptlrpc: convert functions to static X-Git-Tag: 2.15.57~106 X-Git-Url: https://git.whamcloud.com/gitweb?a=commitdiff_plain;h=refs%2Fchanges%2F53%2F51353%2F2;p=fs%2Flustre-release.git LU-8191 ptlrpc: convert functions to static Static analysis shows that a number of functions could be made static. This patch declares several functions in ptlrpc static. Test-Parameters: trivial Signed-off-by: Timothy Day Change-Id: If0d92f7f4e625c146833f360806ae80b8914cc20 Reviewed-on: https://review.whamcloud.com/c/fs/lustre-release/+/51353 Tested-by: jenkins Tested-by: Maloo Reviewed-by: Andreas Dilger Reviewed-by: Sebastien Buisson Reviewed-by: Oleg Drokin --- diff --git a/lustre/ptlrpc/events.c b/lustre/ptlrpc/events.c index f0c9fa7..124202e 100644 --- a/lustre/ptlrpc/events.c +++ b/lustre/ptlrpc/events.c @@ -599,7 +599,7 @@ lnet_pid_t ptl_get_pid(void) return LNET_PID_LUSTRE; } -int ptlrpc_ni_init(void) +static int ptlrpc_ni_init(void) { int rc; lnet_pid_t pid; diff --git a/lustre/ptlrpc/gss/gss_krb5_mech.c b/lustre/ptlrpc/gss/gss_krb5_mech.c index d959249..a82b090 100644 --- a/lustre/ptlrpc/gss/gss_krb5_mech.c +++ b/lustre/ptlrpc/gss/gss_krb5_mech.c @@ -1524,9 +1524,8 @@ __u32 gss_unwrap_bulk_kerberos(struct gss_ctx *gctx, return GSS_S_COMPLETE; } -int gss_display_kerberos(struct gss_ctx *ctx, - char *buf, - int bufsize) +static int gss_display_kerberos(struct gss_ctx *ctx, + char *buf, int bufsize) { struct krb5_ctx *kctx = ctx->internal_ctx_id; int written; diff --git a/lustre/ptlrpc/gss/gss_null_mech.c b/lustre/ptlrpc/gss/gss_null_mech.c index 6362673..232d877 100644 --- a/lustre/ptlrpc/gss/gss_null_mech.c +++ b/lustre/ptlrpc/gss/gss_null_mech.c @@ -145,6 +145,7 @@ void gss_delete_sec_context_null(void *internal_context) OBD_FREE_PTR(null_context); } +static int gss_display_null(struct gss_ctx *gss_context, char *buf, int bufsize) { return scnprintf(buf, bufsize, "null"); diff --git a/lustre/ptlrpc/gss/gss_sk_mech.c b/lustre/ptlrpc/gss/gss_sk_mech.c index 1059df7..1d0b3eb 100644 --- a/lustre/ptlrpc/gss/gss_sk_mech.c +++ b/lustre/ptlrpc/gss/gss_sk_mech.c @@ -118,7 +118,7 @@ static int sk_verify_header(struct sk_hdr *skh) return GSS_S_COMPLETE; } -void sk_construct_rfc3686_iv(__u8 *iv, __u32 nonce, __u64 partial_iv) +static void sk_construct_rfc3686_iv(__u8 *iv, __u32 nonce, __u64 partial_iv) { __u32 ctr = cpu_to_be32(1); @@ -884,7 +884,7 @@ void gss_delete_sec_context_sk(void *internal_context) sk_delete_context(sk_context); } -int gss_display_sk(struct gss_ctx *gss_context, char *buf, int bufsize) +static int gss_display_sk(struct gss_ctx *gss_context, char *buf, int bufsize) { return scnprintf(buf, bufsize, "sk"); } diff --git a/lustre/ptlrpc/gss/lproc_gss.c b/lustre/ptlrpc/gss/lproc_gss.c index e401985..185174a 100644 --- a/lustre/ptlrpc/gss/lproc_gss.c +++ b/lustre/ptlrpc/gss/lproc_gss.c @@ -132,15 +132,18 @@ static const struct file_operations gss_proc_secinit = { .write = gss_proc_write_secinit, }; -int sptlrpc_krb5_allow_old_client_csum_seq_show(struct seq_file *m, void *data) +static int +sptlrpc_krb5_allow_old_client_csum_seq_show(struct seq_file *m, + void *data) { seq_printf(m, "%u\n", krb5_allow_old_client_csum); return 0; } -ssize_t sptlrpc_krb5_allow_old_client_csum_seq_write(struct file *file, - const char __user *buffer, - size_t count, loff_t *off) +static ssize_t +sptlrpc_krb5_allow_old_client_csum_seq_write(struct file *file, + const char __user *buffer, + size_t count, loff_t *off) { bool val; int rc; @@ -155,15 +158,15 @@ ssize_t sptlrpc_krb5_allow_old_client_csum_seq_write(struct file *file, LPROC_SEQ_FOPS(sptlrpc_krb5_allow_old_client_csum); #ifdef HAVE_GSS_KEYRING -int sptlrpc_gss_check_upcall_ns_seq_show(struct seq_file *m, void *data) +static int sptlrpc_gss_check_upcall_ns_seq_show(struct seq_file *m, void *data) { seq_printf(m, "%u\n", gss_check_upcall_ns); return 0; } -ssize_t sptlrpc_gss_check_upcall_ns_seq_write(struct file *file, - const char __user *buffer, - size_t count, loff_t *off) +static ssize_t sptlrpc_gss_check_upcall_ns_seq_write(struct file *file, + const char __user *buffer, + size_t count, loff_t *off) { bool val; int rc; diff --git a/lustre/ptlrpc/layout.c b/lustre/ptlrpc/layout.c index cb8ee5f..cb4e150 100644 --- a/lustre/ptlrpc/layout.c +++ b/lustre/ptlrpc/layout.c @@ -2321,7 +2321,7 @@ static void *__req_capsule_get(struct req_capsule *pill, /** * Dump a request and/or reply */ -void __req_capsule_dump(struct req_capsule *pill, enum req_location loc) +static void __req_capsule_dump(struct req_capsule *pill, enum req_location loc) { const struct req_format *fmt; const struct req_msg_field *field; diff --git a/lustre/ptlrpc/nodemap_storage.c b/lustre/ptlrpc/nodemap_storage.c index f06ee82..c982eee 100644 --- a/lustre/ptlrpc/nodemap_storage.c +++ b/lustre/ptlrpc/nodemap_storage.c @@ -1108,9 +1108,10 @@ out: /** * Step through active config and write to disk. */ -struct dt_object *nodemap_save_config_cache(const struct lu_env *env, - struct dt_device *dev, - struct local_oid_storage *los) +static struct dt_object * +nodemap_save_config_cache(const struct lu_env *env, + struct dt_device *dev, + struct local_oid_storage *los) { struct dt_object *o; struct lu_nodemap *nodemap; @@ -1579,7 +1580,6 @@ out: return rc; } - int nodemap_index_read(struct lu_env *env, struct nm_config_file *ncf, struct idx_info *ii, diff --git a/lustre/ptlrpc/pack_generic.c b/lustre/ptlrpc/pack_generic.c index 8e37ca4..c46ad30 100644 --- a/lustre/ptlrpc/pack_generic.c +++ b/lustre/ptlrpc/pack_generic.c @@ -2738,7 +2738,7 @@ void dump_rniobuf(struct niobuf_remote *nb) nb->rnb_offset, nb->rnb_len, nb->rnb_flags); } -void dump_obdo(struct obdo *oa) +static void dump_obdo(struct obdo *oa) { u64 valid = oa->o_valid; @@ -2939,7 +2939,7 @@ void lustre_swab_hsm_user_item(struct hsm_user_item *hui) lustre_swab_hsm_extent(&hui->hui_extent); } -void lustre_swab_lu_extent(struct lu_extent *le) +static void lustre_swab_lu_extent(struct lu_extent *le) { __swab64s(&le->e_start); __swab64s(&le->e_end); diff --git a/lustre/ptlrpc/pack_server.c b/lustre/ptlrpc/pack_server.c index ec1c20d..3cc4fcf 100644 --- a/lustre/ptlrpc/pack_server.c +++ b/lustre/ptlrpc/pack_server.c @@ -53,7 +53,6 @@ void lustre_swab_object_update(struct object_update *ou) object_update_param_size(param)); } } - int lustre_swab_object_update_request(struct object_update_request *our, __u32 len) { @@ -87,7 +86,8 @@ int lustre_swab_object_update_request(struct object_update_request *our, return size; } -void lustre_swab_object_update_result(struct object_update_result *our) +static void +lustre_swab_object_update_result_no_len(struct object_update_result *our) { __swab32s(&our->our_rc); __swab16s(&our->our_datalen); @@ -114,7 +114,7 @@ int lustre_swab_object_update_reply(struct object_update_reply *our, __u32 len) ourp = object_update_result_get(our, i, NULL); if (ourp == NULL) return -EPROTO; - lustre_swab_object_update_result(ourp); + lustre_swab_object_update_result_no_len(ourp); } return size;