Whamcloud - gitweb
LU-8191 target: convert functions to static 75/51475/2
authorTimothy Day <timday@amazon.com>
Fri, 23 Jun 2023 20:41:36 +0000 (20:41 +0000)
committerOleg Drokin <green@whamcloud.com>
Fri, 14 Jul 2023 03:08:40 +0000 (03:08 +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.

Test-Parameters: trivial
Signed-off-by: Timothy Day <timday@amazon.com>
Change-Id: I1823df3562cb181b275788560166c92b63483637
Reviewed-on: https://review.whamcloud.com/c/fs/lustre-release/+/51475
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Neil Brown <neilb@suse.de>
Reviewed-by: Arshad Hussain <arshad.hussain@aeoncomputing.com>
Reviewed-by: jsimmons <jsimmons@infradead.org>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
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
lustre/target/tgt_mount.c

index 1ace636..6b764ee 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 24652ea..69074f8 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 af2ce7f..f16604f 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 8f347a3..062d7d6 100644 (file)
@@ -1149,11 +1149,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 ab33166..01a70ce 100644 (file)
@@ -562,11 +562,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 861b0d6..187e631 100644 (file)
@@ -137,8 +137,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);
@@ -160,8 +160,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);
@@ -191,8 +191,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);
@@ -214,8 +215,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);
index ee7120e..606add6 100644 (file)
@@ -57,6 +57,8 @@
 #include <obd.h>
 #include <obd_class.h>
 
+#include "tgt_internal.h"
+
 /*********** mount lookup *********/
 
 static DEFINE_MUTEX(lustre_mount_info_lock);
@@ -1781,7 +1783,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;