staging: lustre: fix (non-)static symbols issues
cover staging: lustre: fix (non-)static symbols issues
This series of patches eliminates some sparse warnings concerning static variables in lustre rtlrpc module where it seemed reasonable. Symbols that are really local to a source file are made static and declarations added to a header for symbols that are shared between source files.
Anton Gerasimov (3):
staging: lustre: add shared variables to the header
staging: lustre: include header with local ptlrpc declarations
staging: lustre: make non-exported functions static
drivers/staging/lustre/lustre/ptlrpc/pack_generic.c | 8 ++++---- drivers/staging/lustre/lustre/ptlrpc/ptlrpc_internal.h | 6 ++++++ drivers/staging/lustre/lustre/ptlrpc/sec_null.c | 2 ++ drivers/staging/lustre/lustre/ptlrpc/wiretest.c | 2 ++ 4 files changed, 14 insertions(+), 4 deletions(-)
Signature · 1 line
2.5.1
PATCH 1/3 staging: lustre: add shared variables to the header
This patch adds declarations for variables used in several files across the ptlrpc module to the local header.
--- drivers/staging/lustre/lustre/ptlrpc/ptlrpc_internal.h | 6 ++++++ 1 file changed, 6 insertions(+)
drivers/staging/lustre/lustre/ptlrpc/ptlrpc_internal.h +6 -0
@@ -47,6 +47,10 @@ struct ldlm_res_id;struct ptlrpc_request_set ;extern int test_req_buffer_pressure;extern struct mutex ptlrpc_all_services_mutex; +extern struct list_head ptlrpc_all_services; + +extern struct mutex ptlrpcd_mutex; +extern struct mutex pinger_mutex;int ptlrpc_start_thread (struct ptlrpc_service_part *svcpt,int wait);/* ptlrpcd.c */
@@ -110,6 +114,8 @@ struct nrs_core { }; +extern struct nrs_core nrs_core; +int ptlrpc_service_nrs_setup (struct ptlrpc_service *svc);void ptlrpc_service_nrs_cleanup (struct ptlrpc_service *svc);
Signature · 1 line
2.5.1
Dilger
PATCH 1/3 staging: lustre: add shared variables to the header
Quoted 14 lines · Anton Gerasimov
This patch adds declarations for variables used in several files across the ptlrpc module to the local header.
Signed-off-by Anton Gerasimov <[email protected]>---
drivers/staging/lustre/lustre/ptlrpc/ptlrpc_internal.h| 6 ++++++1 file changed, 6 insertions(+)drivers/staging/lustre/lustre/ptlrpc/ptlrpc_internal.h +0
-0
drivers/staging/lustre/lustre/ptlrpc/ptlrpc_internal.h struct ldlm_res_id; · line 53
Quoted 7 lines
drivers/staging/lustre/lustre/ptlrpc/ptlrpc_internal.h +4
-0@@ -47,6 +47,10 @@ struct ldlm_res_id;struct ptlrpc_request_set ;extern int test_req_buffer_pressure;extern struct mutex ptlrpc_all_services_mutex; +extern struct list_head ptlrpc_all_services; + +extern struct mutex ptlrpcd_mutex; +extern struct mutex pinger_mutex;
Your patch adds these declarations to ptlrpc_internal.h but it doesn't remove the corresponding "extern" declaration lines from the .c files. Could you please remove these (now redundant) lines and resubmit the patch.
Cheers, Andreas
Quoted 16 lines
drivers/staging/lustre/lustre/ptlrpc/ptlrpc_internal.h +2
-0int ptlrpc_start_thread (struct ptlrpc_service_part *svcpt,int wait);/* ptlrpcd.c */ @@ -110,6 +114,8 @@ struct nrs_core { }; +extern struct nrs_core nrs_core; +int ptlrpc_service_nrs_setup (struct ptlrpc_service *svc);void ptlrpc_service_nrs_cleanup (struct ptlrpc_service *svc);Signature · 1 line
2.5.1
Cheers, Andreas
Signature · 4 lines
Andreas Dilger Lustre Software Architect Intel High Performance Data Division
PATCH 2/3 staging: lustre: include header with local ptlrpc declarations
In reply to Anton GerasimovInclude the header with declaations of variables that are shared between several sources in ptlrpc module into the appropriate source files.
--- drivers/staging/lustre/lustre/ptlrpc/sec_null.c | 2 ++ drivers/staging/lustre/lustre/ptlrpc/wiretest.c | 2 ++ 2 files changed, 4 insertions(+)
drivers/staging/lustre/lustre/ptlrpc/sec_null.c +2 -0
@@ -47,6 +47,8 @@#include "../include/lustre_net.h" #include "../include/lustre_sec.h" +#include "ptlrpc_internal.h" +static struct ptlrpc_sec_policy null_policy;static struct ptlrpc_sec null_sec;static struct ptlrpc_cli_ctx null_cli_ctx;
drivers/staging/lustre/lustre/ptlrpc/wiretest.c +2 -0
@@ -43,6 +43,8 @@#include "../include/obd_class.h" #include "../include/lustre_net.h" #include "../include/lustre_disk.h" +#include "ptlrpc_internal.h" +void lustre_assert_wire_constants (void ) {/* Wire protocol assertions generated by 'wirecheck'
Signature · 1 line
2.5.1
PATCH 3/3 staging: lustre: make non-exported functions static
In reply to Anton GerasimovDeclare non-exported functions in pack_generic.c as static.
--- drivers/staging/lustre/lustre/ptlrpc/pack_generic.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
drivers/staging/lustre/lustre/ptlrpc/pack_generic.c +4 -4
@@ -442,8 +442,8 @@ void *lustre_msg_buf(struct lustre_msg *m, int n, int min_size) }EXPORT_SYMBOL (lustre_msg_buf); -int lustre_shrink_msg_v2 (struct lustre_msg_v2 *msg,int segment, -unsigned int newlen,int move_data) +static int lustre_shrink_msg_v2 (struct lustre_msg_v2 *msg,int segment, +unsigned int newlen,int move_data) {char *tail =NULL , *newpos;int tail_len =0 , n;
@@ -1929,7 +1929,7 @@ void lustre_swab_fid2path(struct getinfo_fid2path *gf) }EXPORT_SYMBOL (lustre_swab_fid2path); -void lustre_swab_fiemap_extent (struct ll_fiemap_extent *fm_extent) +static void lustre_swab_fiemap_extent (struct ll_fiemap_extent *fm_extent) {__swab64s (&fm_extent->fe_logical);__swab64s (&fm_extent->fe_physical);
@@ -2405,7 +2405,7 @@ void lustre_swab_hsm_state_set(struct hsm_state_set *hss) }EXPORT_SYMBOL (lustre_swab_hsm_state_set); -void lustre_swab_hsm_extent (struct hsm_extent *extent) +static void lustre_swab_hsm_extent (struct hsm_extent *extent) {__swab64s (&extent->offset);__swab64s (&extent->length);
Signature · 1 line
2.5.1