From: Timothy Day Date: Fri, 23 Jun 2023 20:41:36 +0000 (+0000) Subject: LU-8191 target: convert functions to static X-Git-Tag: 2.15.57~66 X-Git-Url: https://git.whamcloud.com/?a=commitdiff_plain;h=bcbf31a9e1bd6399053a5a757b406152f0d65a42;p=fs%2Flustre-release.git LU-8191 target: convert functions to static 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 Change-Id: I1823df3562cb181b275788560166c92b63483637 Reviewed-on: https://review.whamcloud.com/c/fs/lustre-release/+/51475 Tested-by: jenkins Tested-by: Maloo Reviewed-by: Neil Brown Reviewed-by: Arshad Hussain Reviewed-by: jsimmons Reviewed-by: Oleg Drokin --- diff --git a/lustre/target/barrier.c b/lustre/target/barrier.c index 1ace636..6b764ee 100644 --- a/lustre/target/barrier.c +++ b/lustre/target/barrier.c @@ -41,6 +41,8 @@ #include #include +#include "tgt_internal.h" + static LIST_HEAD(barrier_instance_list); static DEFINE_SPINLOCK(barrier_instance_lock); diff --git a/lustre/target/out_lib.c b/lustre/target/out_lib.c index 24652ea..69074f8 100644 --- a/lustre/target/out_lib.c +++ b/lustre/target/out_lib.c @@ -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; diff --git a/lustre/target/tgt_fmd.c b/lustre/target/tgt_fmd.c index af2ce7f..f16604f 100644 --- a/lustre/target/tgt_fmd.c +++ b/lustre/target/tgt_fmd.c @@ -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; diff --git a/lustre/target/tgt_handler.c b/lustre/target/tgt_handler.c index 8f347a3..062d7d6 100644 --- a/lustre/target/tgt_handler.c +++ b/lustre/target/tgt_handler.c @@ -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); diff --git a/lustre/target/tgt_lastrcvd.c b/lustre/target/tgt_lastrcvd.c index ab33166..01a70ce 100644 --- a/lustre/target/tgt_lastrcvd.c +++ b/lustre/target/tgt_lastrcvd.c @@ -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) diff --git a/lustre/target/tgt_main.c b/lustre/target/tgt_main.c index 861b0d6..187e631 100644 --- a/lustre/target/tgt_main.c +++ b/lustre/target/tgt_main.c @@ -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); diff --git a/lustre/target/tgt_mount.c b/lustre/target/tgt_mount.c index ee7120e..606add6 100644 --- a/lustre/target/tgt_mount.c +++ b/lustre/target/tgt_mount.c @@ -57,6 +57,8 @@ #include #include +#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;