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

Also, remove an unused function tgt_obd_log_cancel(),
and add some headers where they were missing.

Lustre-change: https://review.whamcloud.com/51475
Lustre-commit: bcbf31a9e1bd6399053a5a757b406152f0d65a42

Test-Parameters: trivial
Signed-off-by: Timothy Day <timday@amazon.com>
Change-Id: I1823df3562cb181b275788560166c92b63483637
Reviewed-on: https://review.whamcloud.com/c/ex/lustre-release/+/54614
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
lustre/obdclass/obd_mount_server.c
lustre/target/barrier.c
lustre/target/out_lib.c
lustre/target/tgt_fmd.c
lustre/target/tgt_handler.c
lustre/target/tgt_lastrcvd.c
lustre/target/tgt_main.c

index 666712b..886cac0 100644 (file)
@@ -1734,7 +1734,7 @@ static int server_statfs(struct dentry *dentry, struct kstatfs *buf)
        RETURN(0);
 }
 
-int server_show_options(struct seq_file *seq, struct dentry *dentry)
+static int server_show_options(struct seq_file *seq, struct dentry *dentry)
 {
        struct lustre_sb_info *lsi;
        struct lustre_mount_data *lmd;
index 6ed91f7..83e5bf7 100644 (file)
@@ -41,6 +41,8 @@
 #include <lustre_barrier.h>
 #include <uapi/linux/lustre/lustre_barrier_user.h>
 
+#include "tgt_internal.h"
+
 static LIST_HEAD(barrier_instance_list);
 static DEFINE_SPINLOCK(barrier_instance_lock);
 
index 068756f..ccaedf9 100644 (file)
@@ -90,14 +90,14 @@ EXPORT_SYMBOL(update_op_str);
  * \retval                     0 if packing succeeds.
  * \retval                     -E2BIG if packing exceeds the maximum length.
  */
-int out_update_header_pack(const struct lu_env *env,
-                          struct object_update *update,
-                          size_t *max_update_size,
-                          enum update_type update_op,
-                          const struct lu_fid *fid,
-                          unsigned int param_count,
-                          __u16 *param_sizes,
-                          __u32 reply_size)
+static int out_update_header_pack(const struct lu_env *env,
+                                 struct object_update *update,
+                                 size_t *max_update_size,
+                                 enum update_type update_op,
+                                 const struct lu_fid *fid,
+                                 unsigned int param_count,
+                                 __u16 *param_sizes,
+                                 __u32 reply_size)
 {
        struct object_update_param      *param;
        unsigned int                    i;
index afbf668..87413d9 100644 (file)
@@ -82,7 +82,7 @@ static inline void tgt_fmd_put_nolock(struct obd_export *exp,
  * \param[in] exp      OBD export
  * \param[in] fmd      FMD to put
  */
-void tgt_fmd_put(struct obd_export *exp, struct tgt_fmd_data *fmd)
+static void tgt_fmd_put(struct obd_export *exp, struct tgt_fmd_data *fmd)
 {
        struct tg_export_data *ted = &exp->exp_target_data;
 
@@ -191,8 +191,8 @@ static struct tgt_fmd_data *tgt_fmd_find_nolock(struct obd_export *exp,
  * \retval             struct tgt_fmd_data found by FID
  * \retval             NULL indicates FMD is not found
  */
-struct tgt_fmd_data *tgt_fmd_find(struct obd_export *exp,
-                                 const struct lu_fid *fid)
+static struct tgt_fmd_data *tgt_fmd_find(struct obd_export *exp,
+                                        const struct lu_fid *fid)
 {
        struct tg_export_data *ted = &exp->exp_target_data;
        struct tgt_fmd_data *fmd;
@@ -220,8 +220,8 @@ struct tgt_fmd_data *tgt_fmd_find(struct obd_export *exp,
  * \retval             struct tgt_fmd_data found by FID
  * \retval             NULL indicates FMD is not found
  */
-struct tgt_fmd_data *tgt_fmd_get(struct obd_export *exp,
-                                const struct lu_fid *fid)
+static struct tgt_fmd_data *tgt_fmd_get(struct obd_export *exp,
+                                       const struct lu_fid *fid)
 {
        struct tg_export_data *ted = &exp->exp_target_data;
        struct tgt_fmd_data *found = NULL, *fmd_new = NULL;
index 69dc7b0..b59ffb9 100644 (file)
@@ -1148,11 +1148,6 @@ int tgt_obd_ping(struct tgt_session_info *tsi)
 }
 EXPORT_SYMBOL(tgt_obd_ping);
 
-int tgt_obd_log_cancel(struct tgt_session_info *tsi)
-{
-       return err_serious(-EOPNOTSUPP);
-}
-
 int tgt_send_buffer(struct tgt_session_info *tsi, struct lu_rdbuf *rdbuf)
 {
        struct ptlrpc_request   *req = tgt_ses_req(tsi);
index 1ab6065..e5b850b 100644 (file)
@@ -551,11 +551,11 @@ static void tgt_cb_new_client(struct lu_env *env, struct thandle *th,
        OBD_FREE_PTR(ccb);
 }
 
-int tgt_new_client_cb_add(struct thandle *th, struct obd_export *exp)
+static int tgt_new_client_cb_add(struct thandle *th, struct obd_export *exp)
 {
-       struct tgt_new_client_callback  *ccb;
-       struct dt_txn_commit_cb         *dcb;
-       int                              rc;
+       struct tgt_new_client_callback *ccb;
+       struct dt_txn_commit_cb *dcb;
+       int rc;
 
        OBD_ALLOC_PTR(ccb);
        if (ccb == NULL)
index b6ee1d6..05fad34 100644 (file)
@@ -136,8 +136,8 @@ LUSTRE_RW_ATTR(sync_lock_cancel);
  * \retval             0 and buffer filled with data on success
  * \retval             negative value on error
  */
-ssize_t tgt_fmd_count_show(struct kobject *kobj, struct attribute *attr,
-                          char *buf)
+static ssize_t tgt_fmd_count_show(struct kobject *kobj, struct attribute *attr,
+                                 char *buf)
 {
        struct obd_device *obd = container_of(kobj, struct obd_device,
                                              obd_kset.kobj);
@@ -159,8 +159,8 @@ ssize_t tgt_fmd_count_show(struct kobject *kobj, struct attribute *attr,
  * \retval             \a count on success
  * \retval             negative value on error
  */
-ssize_t tgt_fmd_count_store(struct kobject *kobj, struct attribute *attr,
-                           const char *buffer, size_t count)
+static ssize_t tgt_fmd_count_store(struct kobject *kobj, struct attribute *attr,
+                                  const char *buffer, size_t count)
 {
        struct obd_device *obd = container_of(kobj, struct obd_device,
                                              obd_kset.kobj);
@@ -190,8 +190,9 @@ LUSTRE_RW_ATTR(tgt_fmd_count);
  * \retval             0 and buffer filled with data on success
  * \retval             negative value on error
  */
-ssize_t tgt_fmd_seconds_show(struct kobject *kobj, struct attribute *attr,
-                            char *buf)
+static ssize_t tgt_fmd_seconds_show(struct kobject *kobj,
+                                   struct attribute *attr,
+                                   char *buf)
 {
        struct obd_device *obd = container_of(kobj, struct obd_device,
                                              obd_kset.kobj);
@@ -213,8 +214,9 @@ ssize_t tgt_fmd_seconds_show(struct kobject *kobj, struct attribute *attr,
  * \retval             \a count on success
  * \retval             negative number on error
  */
-ssize_t tgt_fmd_seconds_store(struct kobject *kobj, struct attribute *attr,
-                             const char *buffer, size_t count)
+static ssize_t tgt_fmd_seconds_store(struct kobject *kobj,
+                                    struct attribute *attr,
+                                    const char *buffer, size_t count)
 {
        struct obd_device *obd = container_of(kobj, struct obd_device,
                                              obd_kset.kobj);