All of lore.kernel.org
 help / color / mirror / Atom feed
* [lustre-devel] [PATCH 0/3] staging: lustre: fix (non-)static symbols issues
@ 2015-09-22 21:35 Anton Gerasimov
  2015-09-22 21:40 ` [lustre-devel] [PATCH 1/3] staging: lustre: add shared variables to the header Anton Gerasimov
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Anton Gerasimov @ 2015-09-22 21:35 UTC (permalink / raw)
  To: lustre-devel

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(-)

-- 
2.5.1

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [lustre-devel] [PATCH 1/3] staging: lustre: add shared variables to the header
  2015-09-22 21:35 [lustre-devel] [PATCH 0/3] staging: lustre: fix (non-)static symbols issues Anton Gerasimov
@ 2015-09-22 21:40 ` Anton Gerasimov
  2015-09-23 13:13   ` Dilger, Andreas
  2015-09-22 21:41 ` [lustre-devel] [PATCH 2/3] staging: lustre: include header with local ptlrpc declarations Anton Gerasimov
  2015-09-22 21:41 ` [lustre-devel] [PATCH 3/3] staging: lustre: make non-exported functions static Anton Gerasimov
  2 siblings, 1 reply; 6+ messages in thread
From: Anton Gerasimov @ 2015-09-22 21:40 UTC (permalink / raw)
  To: lustre-devel

This patch adds declarations for variables used in several files
across the ptlrpc module to the local header.

Signed-off-by: Anton Gerasimov <anton.gerasimov@openmailbox.org>
---
 drivers/staging/lustre/lustre/ptlrpc/ptlrpc_internal.h | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/drivers/staging/lustre/lustre/ptlrpc/ptlrpc_internal.h b/drivers/staging/lustre/lustre/ptlrpc/ptlrpc_internal.h
index 34c7e28..4e35b14 100644
--- a/drivers/staging/lustre/lustre/ptlrpc/ptlrpc_internal.h
+++ b/drivers/staging/lustre/lustre/ptlrpc/ptlrpc_internal.h
@@ -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);
 
-- 
2.5.1

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [lustre-devel] [PATCH 2/3] staging: lustre: include header with local ptlrpc declarations
  2015-09-22 21:35 [lustre-devel] [PATCH 0/3] staging: lustre: fix (non-)static symbols issues Anton Gerasimov
  2015-09-22 21:40 ` [lustre-devel] [PATCH 1/3] staging: lustre: add shared variables to the header Anton Gerasimov
@ 2015-09-22 21:41 ` Anton Gerasimov
  2015-09-22 21:41 ` [lustre-devel] [PATCH 3/3] staging: lustre: make non-exported functions static Anton Gerasimov
  2 siblings, 0 replies; 6+ messages in thread
From: Anton Gerasimov @ 2015-09-22 21:41 UTC (permalink / raw)
  To: lustre-devel

Include the header with declaations of variables that are shared between
several sources in ptlrpc module into the appropriate source files.

Signed-off-by: Anton Gerasimov <anton.gerasimov@openmailbox.org>
---
 drivers/staging/lustre/lustre/ptlrpc/sec_null.c | 2 ++
 drivers/staging/lustre/lustre/ptlrpc/wiretest.c | 2 ++
 2 files changed, 4 insertions(+)

diff --git a/drivers/staging/lustre/lustre/ptlrpc/sec_null.c b/drivers/staging/lustre/lustre/ptlrpc/sec_null.c
index ce1c563d..0f3c693 100644
--- a/drivers/staging/lustre/lustre/ptlrpc/sec_null.c
+++ b/drivers/staging/lustre/lustre/ptlrpc/sec_null.c
@@ -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;
diff --git a/drivers/staging/lustre/lustre/ptlrpc/wiretest.c b/drivers/staging/lustre/lustre/ptlrpc/wiretest.c
index b2313af..40f720c 100644
--- a/drivers/staging/lustre/lustre/ptlrpc/wiretest.c
+++ b/drivers/staging/lustre/lustre/ptlrpc/wiretest.c
@@ -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'
-- 
2.5.1

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [lustre-devel] [PATCH 3/3] staging: lustre: make non-exported functions static
  2015-09-22 21:35 [lustre-devel] [PATCH 0/3] staging: lustre: fix (non-)static symbols issues Anton Gerasimov
  2015-09-22 21:40 ` [lustre-devel] [PATCH 1/3] staging: lustre: add shared variables to the header Anton Gerasimov
  2015-09-22 21:41 ` [lustre-devel] [PATCH 2/3] staging: lustre: include header with local ptlrpc declarations Anton Gerasimov
@ 2015-09-22 21:41 ` Anton Gerasimov
  2 siblings, 0 replies; 6+ messages in thread
From: Anton Gerasimov @ 2015-09-22 21:41 UTC (permalink / raw)
  To: lustre-devel

Declare non-exported functions in pack_generic.c as static.

Signed-off-by: Anton Gerasimov <anton.gerasimov@openmailbox.org>
---
 drivers/staging/lustre/lustre/ptlrpc/pack_generic.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/staging/lustre/lustre/ptlrpc/pack_generic.c b/drivers/staging/lustre/lustre/ptlrpc/pack_generic.c
index f138061..dd31215 100644
--- a/drivers/staging/lustre/lustre/ptlrpc/pack_generic.c
+++ b/drivers/staging/lustre/lustre/ptlrpc/pack_generic.c
@@ -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);
-- 
2.5.1

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [lustre-devel] [PATCH 1/3] staging: lustre: add shared variables to the header
@ 2015-09-22 22:24 Anton Gerasimov
  0 siblings, 0 replies; 6+ messages in thread
From: Anton Gerasimov @ 2015-09-22 22:24 UTC (permalink / raw)
  To: lustre-devel

This patch adds declarations for variables used in several files
across the ptlrpc module to the local header.

Signed-off-by: Anton Gerasimov <anton.gerasimov@openmailbox.org>
---
 drivers/staging/lustre/lustre/ptlrpc/ptlrpc_internal.h | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/drivers/staging/lustre/lustre/ptlrpc/ptlrpc_internal.h b/drivers/staging/lustre/lustre/ptlrpc/ptlrpc_internal.h
index 34c7e28..4e35b14 100644
--- a/drivers/staging/lustre/lustre/ptlrpc/ptlrpc_internal.h
+++ b/drivers/staging/lustre/lustre/ptlrpc/ptlrpc_internal.h
@@ -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);
 
-- 
2.5.1

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [lustre-devel] [PATCH 1/3] staging: lustre: add shared variables to the header
  2015-09-22 21:40 ` [lustre-devel] [PATCH 1/3] staging: lustre: add shared variables to the header Anton Gerasimov
@ 2015-09-23 13:13   ` Dilger, Andreas
  0 siblings, 0 replies; 6+ messages in thread
From: Dilger, Andreas @ 2015-09-23 13:13 UTC (permalink / raw)
  To: lustre-devel

On 2015/09/22, 11:40 PM, "Anton Gerasimov"
<anton.gerasimov@openmailbox.org> wrote:

>This patch adds declarations for variables used in several files
>across the ptlrpc module to the local header.
>
>Signed-off-by: Anton Gerasimov <anton.gerasimov@openmailbox.org>
>---
> drivers/staging/lustre/lustre/ptlrpc/ptlrpc_internal.h | 6 ++++++
> 1 file changed, 6 insertions(+)
>
>diff --git a/drivers/staging/lustre/lustre/ptlrpc/ptlrpc_internal.h
>b/drivers/staging/lustre/lustre/ptlrpc/ptlrpc_internal.h
>index 34c7e28..4e35b14 100644
>--- a/drivers/staging/lustre/lustre/ptlrpc/ptlrpc_internal.h
>+++ b/drivers/staging/lustre/lustre/ptlrpc/ptlrpc_internal.h
>@@ -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

> 
> 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);
> 
>-- 
>2.5.1
>
>


Cheers, Andreas
-- 
Andreas Dilger

Lustre Software Architect
Intel High Performance Data Division

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2015-09-23 13:13 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-09-22 21:35 [lustre-devel] [PATCH 0/3] staging: lustre: fix (non-)static symbols issues Anton Gerasimov
2015-09-22 21:40 ` [lustre-devel] [PATCH 1/3] staging: lustre: add shared variables to the header Anton Gerasimov
2015-09-23 13:13   ` Dilger, Andreas
2015-09-22 21:41 ` [lustre-devel] [PATCH 2/3] staging: lustre: include header with local ptlrpc declarations Anton Gerasimov
2015-09-22 21:41 ` [lustre-devel] [PATCH 3/3] staging: lustre: make non-exported functions static Anton Gerasimov
  -- strict thread matches above, loose matches on Subject: below --
2015-09-22 22:24 [lustre-devel] [PATCH 1/3] staging: lustre: add shared variables to the header Anton Gerasimov

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.