Whamcloud - gitweb
LU-8191 ptlrpc: convert functions to static 53/51353/2
authorTimothy Day <timday@amazon.com>
Mon, 19 Jun 2023 03:44:02 +0000 (03:44 +0000)
committerOleg Drokin <green@whamcloud.com>
Wed, 28 Jun 2023 21:49:44 +0000 (21:49 +0000)
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 <timday@amazon.com>
Change-Id: If0d92f7f4e625c146833f360806ae80b8914cc20
Reviewed-on: https://review.whamcloud.com/c/fs/lustre-release/+/51353
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Reviewed-by: Sebastien Buisson <sbuisson@ddn.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
lustre/ptlrpc/events.c
lustre/ptlrpc/gss/gss_krb5_mech.c
lustre/ptlrpc/gss/gss_null_mech.c
lustre/ptlrpc/gss/gss_sk_mech.c
lustre/ptlrpc/gss/lproc_gss.c
lustre/ptlrpc/layout.c
lustre/ptlrpc/nodemap_storage.c
lustre/ptlrpc/pack_generic.c
lustre/ptlrpc/pack_server.c

index f0c9fa7..124202e 100644 (file)
@@ -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;
index d959249..a82b090 100644 (file)
@@ -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;
index 6362673..232d877 100644 (file)
@@ -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");
index 1059df7..1d0b3eb 100644 (file)
@@ -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");
 }
index e401985..185174a 100644 (file)
@@ -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;
index cb8ee5f..cb4e150 100644 (file)
@@ -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;
index f06ee82..c982eee 100644 (file)
@@ -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,
index 8e37ca4..c46ad30 100644 (file)
@@ -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);
index ec1c20d..3cc4fcf 100644 (file)
@@ -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;