Whamcloud - gitweb
LU-8191 ptlrpc: convert functions to static
authorTimothy Day <timday@amazon.com>
Thu, 28 Mar 2024 07:39:48 +0000 (00:39 -0700)
committerAndreas Dilger <adilger@whamcloud.com>
Sat, 30 Mar 2024 07:23:13 +0000 (07:23 +0000)
Static analysis shows that a number of functions
could be made static. This patch declares several
functions in ptlrpc static.

Lustre-change: https://review.whamcloud.com/51353
Lustre-commit: 41d94aa9c9c01fa88ae152625d5ffd97256bab73

Test-Parameters: trivial
Signed-off-by: Timothy Day <timday@amazon.com>
Change-Id: If0d92f7f4e625c146833f360806ae80b8914cc20
Reviewed-on: https://review.whamcloud.com/c/ex/lustre-release/+/54601
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Andreas Dilger <adilger@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

index 1b7cb38..7f5db2b 100644 (file)
@@ -611,7 +611,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 f2994e7..943bf13 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 142438a..9758b1a 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 snprintf(buf, bufsize, "null");
index 9406370..8540146 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 snprintf(buf, bufsize, "sk");
 }
index 0fbd032..245838a 100644 (file)
@@ -133,15 +133,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;
@@ -156,15 +159,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 1b91546..4acffe9 100644 (file)
@@ -2210,7 +2210,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 3ec0c84..ebfe049 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 c6b41b1..ce83b76 100644 (file)
@@ -2771,7 +2771,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;
 
@@ -2961,7 +2961,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);
@@ -3048,7 +3048,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);
@@ -3075,7 +3076,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;