Declare as static
cover Declare as static
These patches declare the functions and structures which are not used anywhere else as static.
Shraddha Barke (8):
Staging: lustre: ptlrpc: nrs: Declare as static
Staging: lustre: ptlrpc: events: Declare as static
Staging: lustre: ptlrpc: pinger: Declare as static
Staging: lustre: ptlrpc: layout: Declare as static
Staging: lustre: ptlrpc: niobuf: Declare as static
Staging: lustre: obdclass: genops: Declare as static
Staging: lustre: obdclass: class_obd: Declare as static
Staging: lustre: obdclass: obd_mount: Declare as static
.../staging/lustre/lustre/include/lustre_disk.h | 5 ----- drivers/staging/lustre/lustre/include/lustre_net.h | 7 ------ .../staging/lustre/lustre/include/lustre_param.h | 3 --- .../lustre/lustre/include/lustre_req_layout.h | 4 ---- drivers/staging/lustre/lustre/include/obd_class.h | 3 --- drivers/staging/lustre/lustre/obdclass/class_obd.c | 2 +- drivers/staging/lustre/lustre/obdclass/genops.c | 5 ++--- drivers/staging/lustre/lustre/obdclass/obd_mount.c | 25 +++++++++++----------- drivers/staging/lustre/lustre/ptlrpc/events.c | 2 +- drivers/staging/lustre/lustre/ptlrpc/layout.c | 10 ++++----- drivers/staging/lustre/lustre/ptlrpc/niobuf.c | 3 +-- drivers/staging/lustre/lustre/ptlrpc/nrs.c | 3 +-- drivers/staging/lustre/lustre/ptlrpc/pinger.c | 4 ++-- 13 files changed, 24 insertions(+), 52 deletions(-)
Signature · 1 line
2.1.4
PATCH 1/8 Staging: lustre: ptlrpc: nrs: Declare as static
Declare ptlrpc_nrs_policy_register as static since it is used only in this particular file. Also remove corresponding declaration from header files.
--- drivers/staging/lustre/lustre/include/lustre_net.h | 5 ----- drivers/staging/lustre/lustre/ptlrpc/nrs.c | 3 +-- 2 files changed, 1 insertion(+), 7 deletions(-)
drivers/staging/lustre/lustre/include/lustre_net.h +0 -5
@@ -1528,11 +1528,6 @@ static inline int ptlrpc_req_interpret(const struct lu_env *env,return rc; } -/** \addtogroup nrs -* @{ -*/ -int ptlrpc_nrs_policy_register (struct ptlrpc_nrs_pol_conf *conf); -/* * Can the request be moved from the regular NRS head to the high-priority NRS * head (of the same PTLRPC service partition), if any?
drivers/staging/lustre/lustre/ptlrpc/nrs.c +1 -2
@@ -1111,7 +1111,7 @@ again:* \retval -ve error * \retval 0 success */ -int ptlrpc_nrs_policy_register (struct ptlrpc_nrs_pol_conf *conf) +static int ptlrpc_nrs_policy_register (struct ptlrpc_nrs_pol_conf *conf) {struct ptlrpc_service *svc;struct ptlrpc_nrs_pol_desc *desc;
@@ -1247,7 +1247,6 @@ fail:return rc; } -EXPORT_SYMBOL (ptlrpc_nrs_policy_register);/** * Setup NRS heads on all service partitions of service \a svc, and register
Signature · 1 line
2.1.4
PATCH 2/8 Staging: lustre: ptlrpc: events: Declare as static
In reply to Shraddha BarkeDeclare ptl_get_pid as static since it is used only in this particular file. Also remove declaration from corresponding header file
--- drivers/staging/lustre/lustre/include/lustre_net.h | 1 - drivers/staging/lustre/lustre/ptlrpc/events.c | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-)
drivers/staging/lustre/lustre/include/lustre_net.h +0 -1
@@ -2289,7 +2289,6 @@ int ptlrpc_connection_put(struct ptlrpc_connection *c);struct ptlrpc_connection *ptlrpc_connection_addref (struct ptlrpc_connection *);int ptlrpc_connection_init (void );void ptlrpc_connection_fini (void ); -lnet_pid_t ptl_get_pid (void );/* ptlrpc/niobuf.c */ /**
drivers/staging/lustre/lustre/ptlrpc/events.c +1 -1
@@ -521,7 +521,7 @@ static void ptlrpc_ni_fini(void)/* notreached */ } -lnet_pid_t ptl_get_pid (void ) +static lnet_pid_t ptl_get_pid (void ) {lnet_pid_t pid;
Signature · 1 line
2.1.4
PATCH 3/8 Staging: lustre: ptlrpc: pinger: Declare as static
In reply to Shraddha BarkeDeclare ptlrpc_pinger_remove_timeouts as static since it is used only in this particular file.
--- drivers/staging/lustre/lustre/ptlrpc/pinger.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/staging/lustre/lustre/ptlrpc/pinger.c +2 -2
@@ -313,7 +313,7 @@ int ptlrpc_start_pinger(void)return 0 ; } -int ptlrpc_pinger_remove_timeouts (void ); +static int ptlrpc_pinger_remove_timeouts (void );int ptlrpc_stop_pinger (void ) {
@@ -497,7 +497,7 @@ int ptlrpc_del_timeout_client(struct list_head *obd_list, }EXPORT_SYMBOL (ptlrpc_del_timeout_client); -int ptlrpc_pinger_remove_timeouts (void ) +static int ptlrpc_pinger_remove_timeouts (void ) {struct timeout_item *item, *tmp;
Signature · 1 line
2.1.4
PATCH 4/8 Staging: lustre: ptlrpc: layout: Declare as static
In reply to Shraddha BarkeDeclare req_capsule_init_area and req_capsule_field_present as static since they are used only in this particular file. Also remove the corresponding declarations from header files.
--- drivers/staging/lustre/lustre/include/lustre_req_layout.h | 4 ---- drivers/staging/lustre/lustre/ptlrpc/layout.c | 10 ++++------ 2 files changed, 4 insertions(+), 10 deletions(-)
drivers/staging/lustre/lustre/include/lustre_req_layout.h +0 -4
@@ -80,7 +80,6 @@ void req_capsule_init(struct req_capsule *pill, struct ptlrpc_request *req,void req_capsule_fini (struct req_capsule *pill);void req_capsule_set (struct req_capsule *pill,const struct req_format *fmt); -void req_capsule_init_area (struct req_capsule *pill);int req_capsule_filled_sizes (struct req_capsule *pill,enum req_location loc);int req_capsule_server_pack (struct req_capsule *pill);
@@ -118,9 +117,6 @@ void req_capsule_extend(struct req_capsule *pill, const struct req_format *fmt);int req_capsule_has_field (const struct req_capsule *pill,const struct req_msg_field *field,enum req_location loc); -int req_capsule_field_present (const struct req_capsule *pill, -const struct req_msg_field *field, -enum req_location loc); void req_capsule_shrink(struct req_capsule *pill, const struct req_msg_field *field, unsigned int newlen,
drivers/staging/lustre/lustre/ptlrpc/layout.c +4 -6
@@ -1679,7 +1679,7 @@ EXPORT_SYMBOL(req_layout_fini);* req_capsule_msg_size(). The \a rc_area information is used by. * ptlrpc_request_set_replen(). */ -void req_capsule_init_area (struct req_capsule *pill) +static void req_capsule_init_area (struct req_capsule *pill) {int i;
@@ -1688,7 +1688,6 @@ void req_capsule_init_area(struct req_capsule *pill) pill->rc_area[RCL_SERVER ][i] =-1 ; } } -EXPORT_SYMBOL (req_capsule_init_area);/** * Initialize a pill.
@@ -2260,9 +2259,9 @@ EXPORT_SYMBOL(req_capsule_has_field);* Returns a non-zero value if the given \a field is present in the given \a * pill's PTLRPC request or reply (\a loc), else it returns 0. */ -int req_capsule_field_present (const struct req_capsule *pill, -const struct req_msg_field *field, -enum req_location loc) +static int req_capsule_field_present (const struct req_capsule *pill, +const struct req_msg_field *field, +enum req_location loc) {int offset;
@@ -2272,7 +2271,6 @@ int req_capsule_field_present(const struct req_capsule *pill, offset =__req_capsule_offset (pill, field, loc);return lustre_msg_bufcount (__req_msg (pill, loc)) > offset; } -EXPORT_SYMBOL (req_capsule_field_present);/** * This function shrinks the size of the _buffer_ of the \a pill's PTLRPC
Signature · 1 line
2.1.4
PATCH 5/8 Staging: lustre: ptlrpc: niobuf: Declare as static
In reply to Shraddha BarkeDeclare ptlrpc_register_bulk as static since it is used only in this particular file.Also remove the declaration from header file
--- drivers/staging/lustre/lustre/include/lustre_net.h | 1 - drivers/staging/lustre/lustre/ptlrpc/niobuf.c | 3 +-- 2 files changed, 1 insertion(+), 3 deletions(-)
drivers/staging/lustre/lustre/include/lustre_net.h +0 -1
@@ -2296,7 +2296,6 @@ void ptlrpc_connection_fini(void);* @{ */ -int ptlrpc_register_bulk (struct ptlrpc_request *req);int ptlrpc_unregister_bulk (struct ptlrpc_request *req,int async);static inline int ptlrpc_client_bulk_active (struct ptlrpc_request *req)
drivers/staging/lustre/lustre/ptlrpc/niobuf.c +1 -2
@@ -111,7 +111,7 @@ static void mdunlink_iterate_helper(lnet_handle_md_t *bd_mds, int count)* Register bulk at the sender for later transfer. * Returns 0 on success or error code. */ -int ptlrpc_register_bulk (struct ptlrpc_request *req) +static int ptlrpc_register_bulk (struct ptlrpc_request *req) {struct ptlrpc_bulk_desc *desc = req->rq_bulk;lnet_process_id_t peer;
@@ -232,7 +232,6 @@ int ptlrpc_register_bulk(struct ptlrpc_request *req)return 0 ; } -EXPORT_SYMBOL (ptlrpc_register_bulk);/** * Disconnect a bulk desc from the network. Idempotent. Not
Signature · 1 line
2.1.4
PATCH 6/8 Staging: lustre: obdclass: genops: Declare as static
In reply to Shraddha BarkeDeclare obd_export_nid2str and obd_zombie_impexp_cull as static since they are used only in this particular file. Also remove the corresponding declarations from header file
--- drivers/staging/lustre/lustre/include/obd_class.h | 3 --- drivers/staging/lustre/lustre/obdclass/genops.c | 5 ++--- 2 files changed, 2 insertions(+), 6 deletions(-)
drivers/staging/lustre/lustre/include/obd_class.h +0 -3
@@ -92,13 +92,10 @@ struct obd_device *class_num2obd(int num);int class_notify_sptlrpc_conf (const char *fsname,int namelen); -char *obd_export_nid2str (struct obd_export *exp); -int obd_connect_flags2str (char *page,int count,__u64 flags,char *sep);int obd_zombie_impexp_init (void );void obd_zombie_impexp_stop (void ); -void obd_zombie_impexp_cull (void );void obd_zombie_barrier (void );struct llog_handle ;
drivers/staging/lustre/lustre/obdclass/genops.c +2 -3
@@ -1108,14 +1108,13 @@ void class_fail_export(struct obd_export *exp) }EXPORT_SYMBOL (class_fail_export); -char *obd_export_nid2str (struct obd_export *exp) +static char *obd_export_nid2str (struct obd_export *exp) {if (exp->exp_connection !=NULL )return libcfs_nid2str (exp->exp_connection->c_peer.nid);return "(no nid)" ; } -EXPORT_SYMBOL (obd_export_nid2str);#if LUSTRE_TRACKS_LOCK_EXP_REFS void (*class_export_dump_hook)(struct obd_export *) =NULL ;
@@ -1178,7 +1177,7 @@ static int zombies_count;/** * kill zombie imports and exports */ -void obd_zombie_impexp_cull (void ) +static void obd_zombie_impexp_cull (void ) {struct obd_import *import;struct obd_export *export;
Signature · 1 line
2.1.4
Greg KH
maintainerRe: [Outreachy kernel] [PATCH 6/8] Staging: lustre: obdclass: genops: Declare as static
Quoted 49 lines · Shraddha Barke
Declare
obd_export_nid2strandobd_zombie_impexp_cullas static since they are used only in this particular file. Also remove the corresponding declarations from header fileSigned-off-by Shraddha Barke <[email protected]>--- drivers/staging/lustre/lustre/include/obd_class.h | 3 --- drivers/staging/lustre/lustre/obdclass/genops.c | 5 ++--- 2 files changed, 2 insertions(+), 6 deletions(-)drivers/staging/lustre/lustre/include/obd_class.h +0
-3@@ -92,13 +92,10 @@ struct obd_device *class_num2obd(int num);int class_notify_sptlrpc_conf (const char *fsname,int namelen); -char *obd_export_nid2str (struct obd_export *exp); -int obd_connect_flags2str (char *page,int count,__u64 flags,char *sep);int obd_zombie_impexp_init (void );void obd_zombie_impexp_stop (void ); -void obd_zombie_impexp_cull (void );void obd_zombie_barrier (void );struct llog_handle ;drivers/staging/lustre/lustre/obdclass/genops.c +1
-2@@ -1108,14 +1108,13 @@ void class_fail_export(struct obd_export *exp) }EXPORT_SYMBOL (class_fail_export); -char *obd_export_nid2str (struct obd_export *exp) +static char *obd_export_nid2str (struct obd_export *exp) {if (exp->exp_connection !=NULL )return libcfs_nid2str (exp->exp_connection->c_peer.nid);return "(no nid)" ; } -EXPORT_SYMBOL (obd_export_nid2str);#if LUSTRE_TRACKS_LOCK_EXP_REFS void (*class_export_dump_hook)(struct obd_export *) =NULL ;
drivers/staging/lustre/lustre/obdclass/genops.c static int zombies_count; · line 1183
Quoted 8 lines
drivers/staging/lustre/lustre/obdclass/genops.c +1
-1@@ -1178,7 +1177,7 @@ static int zombies_count;/** * kill zombie imports and exports */ -void obd_zombie_impexp_cull (void ) +static void obd_zombie_impexp_cull (void ) {struct obd_import *import;struct obd_export *export;
This patch now causes a build warning in my tree. Can you fix it up by just deleting the function as I don't think anyone uses it anymore.
thanks,
greg k-h
PATCH 7/8 Staging: lustre: obdclass: class_obd: Declare as static
In reply to Shraddha BarkeDeclare obd_init_checks as static since it is used only in this particular file.
--- drivers/staging/lustre/lustre/obdclass/class_obd.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/staging/lustre/lustre/obdclass/class_obd.c +1 -1
@@ -403,7 +403,7 @@ int class_handle_ioctl(unsigned int cmd, unsigned long arg) }/* class_handle_ioctl */ #define OBD_INIT_CHECK -int obd_init_checks (void ) +static int obd_init_checks (void ) {__u64 u64val, div64val;char buf[64 ];
Signature · 1 line
2.1.4
PATCH 8/8 Staging: lustre: obdclass: obd_mount: Declare as static
In reply to Shraddha BarkeDeclare lustre_fs_type, do_lcfg, lustre_fill_super, lustre_put_lsi, lustre_init_lsi, lustre_start_simple, server_name2index and server_name2fsname as static since they are used only in this particular file.Also remove corresponding declarations from header files.
--- .../staging/lustre/lustre/include/lustre_disk.h | 5 ----- .../staging/lustre/lustre/include/lustre_param.h | 3 --- drivers/staging/lustre/lustre/obdclass/obd_mount.c | 25 +++++++++++----------- 3 files changed, 12 insertions(+), 21 deletions(-)
drivers/staging/lustre/lustre/include/lustre_disk.h +0 -5
@@ -383,12 +383,7 @@ struct lustre_mount_info {/****************** prototypes *********************/ /* obd_mount.c */ -int server_name2fsname (const char *svname,char *fsname,const char **endptr); -int server_name2index (const char *svname,__u32 *idx,const char **endptr); -int lustre_put_lsi (struct super_block *sb); -int lustre_start_simple (char *obdname,char *type,char *uuid, -char *s1,char *s2,char *s3,char *s4);int lustre_start_mgc (struct super_block *sb);void lustre_register_client_fill_super (int (*cfs)(struct super_block *sb,struct vfsmount *mnt));
drivers/staging/lustre/lustre/include/lustre_param.h +0 -3
@@ -59,9 +59,6 @@ int class_find_param(char *buf, char *key, char **valp);int class_match_param (char *buf,char *key,char **valp);int class_parse_nid (char *buf,lnet_nid_t *nid,char **endh);int class_parse_nid_quiet (char *buf,lnet_nid_t *nid,char **endh); -/* obd_mount.c */ -int do_lcfg (char *cfgname,lnet_nid_t nid,int cmd, -char *s1,char *s2,char *s3,char *s4);
drivers/staging/lustre/lustre/obdclass/obd_mount.c +12 -13
@@ -143,8 +143,8 @@ EXPORT_SYMBOL(lustre_end_log);/** lustre_cfg_bufs are a holdover from 1.4; we can still set these up from * lctl (and do for echo cli/srv. */ -int do_lcfg (char *cfgname,lnet_nid_t nid,int cmd, -char *s1,char *s2,char *s3,char *s4) +static int do_lcfg (char *cfgname,lnet_nid_t nid,int cmd, +char *s1,char *s2,char *s3,char *s4) {struct lustre_cfg_bufs bufs;struct lustre_cfg *lcfg =NULL ;
@@ -169,13 +169,12 @@ int do_lcfg(char *cfgname, lnet_nid_t nid, int cmd,lustre_cfg_free (lcfg);return rc; } -EXPORT_SYMBOL (do_lcfg);/** Call class_attach and class_setup. These methods in turn call * obd type-specific methods. */ -int lustre_start_simple (char *obdname,char *type,char *uuid, -char *s1,char *s2,char *s3,char *s4) +static int lustre_start_simple (char *obdname,char *type,char *uuid, +char *s1,char *s2,char *s3,char *s4) {int rc;CDEBUG (D_MOUNT ,"Starting obd %s (typ=%s)\n" , obdname, type);
@@ -488,7 +487,7 @@ out:/***************** lustre superblock **************/ -struct lustre_sb_info *lustre_init_lsi (struct super_block *sb) +static struct lustre_sb_info *lustre_init_lsi (struct super_block *sb) {struct lustre_sb_info *lsi;
@@ -547,7 +546,7 @@ static int lustre_free_lsi(struct super_block *sb)/* The lsi has one reference for every server that is using the disk - e.g. MDT, MGS, and potentially MGC */ -int lustre_put_lsi (struct super_block *sb) +static int lustre_put_lsi (struct super_block *sb) {struct lustre_sb_info *lsi =s2lsi (sb);
@@ -577,7 +576,8 @@ int lustre_put_lsi(struct super_block *sb)* @param [out] endptr if endptr isn't NULL it is set to end of fsname * rc < 0 on error */ -int server_name2fsname (const char *svname,char *fsname,const char **endptr) +static int server_name2fsname (const char *svname,char *fsname, +const char **endptr) {const char *dash;
@@ -597,13 +597,13 @@ int server_name2fsname(const char *svname, char *fsname, const char **endptr)return 0 ; } -EXPORT_SYMBOL (server_name2fsname);/* Get the index from the obd name. rc = server type, or rc < 0 on error if endptr isn't NULL it is set to end of name */ -int server_name2index (const char *svname,__u32 *idx,const char **endptr) +static int server_name2index (const char *svname,__u32 *idx, +const char **endptr) {unsigned long index;int rc;
@@ -642,7 +642,6 @@ int server_name2index(const char *svname, __u32 *idx, const char **endptr)return rc; } -EXPORT_SYMBOL (server_name2index);/*************** mount common between server and client ***************/
@@ -1074,7 +1073,7 @@ struct lustre_mount_data2 {* and this is where we start setting things up. * @param data Mount options (e.g. -o flock,abort_recov) */ -int lustre_fill_super (struct super_block *sb,void *data,int silent) +static int lustre_fill_super (struct super_block *sb,void *data,int silent) {struct lustre_mount_data *lmd;struct lustre_mount_data2 *lmd2 = data;
@@ -1185,7 +1184,7 @@ static void lustre_kill_super(struct super_block *sb)/** Register the "lustre" fs type */ -struct file_system_type lustre_fs_type = { +static struct file_system_type lustre_fs_type = { .owner =THIS_MODULE , .name ="lustre" , .mount = lustre_mount,
Signature · 1 line
2.1.4