Whamcloud - gitweb
LU-14291 ptlrpc: support nrs_delay for client-only builds 27/41127/4
authorMr NeilBrown <neilb@suse.de>
Thu, 29 Oct 2020 03:41:18 +0000 (14:41 +1100)
committerOleg Drokin <green@whamcloud.com>
Fri, 26 Feb 2021 21:06:59 +0000 (21:06 +0000)
nrs_delay is intended for use on the client, but is currently disabled
for client-only builds.  So move the ptlrpc_nrs_policy_register() call
outside of the #ifdef.

Also change the nrs modules that *are* server-only to not have #ifdef
in the C file, but that rather to be identified in the Makefile as
only being built when server code is wanted.

Test-Parameters: trivial
Signed-off-by: Mr NeilBrown <neilb@suse.de>
Change-Id: Ie25ed5ac837ff5f891824fad31ab258923840ec0
Reviewed-on: https://review.whamcloud.com/41127
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: James Simmons <jsimmons@infradead.org>
Reviewed-by: Chris Horn <chris.horn@hpe.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
lustre/ptlrpc/Makefile.in
lustre/ptlrpc/nrs.c
lustre/ptlrpc/nrs_crr.c
lustre/ptlrpc/nrs_orr.c
lustre/ptlrpc/nrs_tbf.c
lustre/ptlrpc/ptlrpc_internal.h

index 12abf31..aeea155 100644 (file)
@@ -22,15 +22,17 @@ ptlrpc_objs += events.o ptlrpc_module.o service.o pinger.o
 ptlrpc_objs += llog_net.o llog_client.o llog_server.o import.o ptlrpcd.o
 ptlrpc_objs += pers.o lproc_ptlrpc.o wiretest.o layout.o
 ptlrpc_objs += sec.o sec_ctx.o sec_bulk.o sec_gc.o sec_config.o sec_lproc.o
 ptlrpc_objs += llog_net.o llog_client.o llog_server.o import.o ptlrpcd.o
 ptlrpc_objs += pers.o lproc_ptlrpc.o wiretest.o layout.o
 ptlrpc_objs += sec.o sec_ctx.o sec_bulk.o sec_gc.o sec_config.o sec_lproc.o
-ptlrpc_objs += sec_null.o sec_plain.o nrs.o nrs_fifo.o nrs_crr.o nrs_orr.o
-ptlrpc_objs += nrs_tbf.o nrs_delay.o errno.o
+ptlrpc_objs += sec_null.o sec_plain.o nrs.o nrs_fifo.o nrs_delay.o
+ptlrpc_objs += errno.o
+
+nrs_server_objs := nrs_crr.o nrs_orr.o nrs_tbf.o
 
 nodemap_objs := nodemap_handler.o nodemap_lproc.o nodemap_range.o
 nodemap_objs += nodemap_idmap.o nodemap_rbtree.o nodemap_member.o
 nodemap_objs += nodemap_storage.o
 
 ptlrpc-objs := $(ldlm_objs) $(ptlrpc_objs) $(TARGET)barrier.o $(target_pool_objs)
 
 nodemap_objs := nodemap_handler.o nodemap_lproc.o nodemap_range.o
 nodemap_objs += nodemap_idmap.o nodemap_rbtree.o nodemap_member.o
 nodemap_objs += nodemap_storage.o
 
 ptlrpc-objs := $(ldlm_objs) $(ptlrpc_objs) $(TARGET)barrier.o $(target_pool_objs)
-@SERVER_TRUE@ptlrpc-objs += $(target_objs) $(nodemap_objs)
+@SERVER_TRUE@ptlrpc-objs += $(target_objs) $(nodemap_objs) $(nrs_server_objs)
 
 @GSS_TRUE@obj-m += gss/
 
 
 @GSS_TRUE@obj-m += gss/
 
@@ -53,6 +55,7 @@ barrier.c: @LUSTRE@/target/barrier.c
 
 EXTRA_DIST := $(ptlrpc_objs:.o=.c) ptlrpc_internal.h
 EXTRA_DIST += $(nodemap_objs:.o=.c) nodemap_internal.h
 
 EXTRA_DIST := $(ptlrpc_objs:.o=.c) ptlrpc_internal.h
 EXTRA_DIST += $(nodemap_objs:.o=.c) nodemap_internal.h
+EXTRA_DIST += $(nrs_server_objs:.o=.c)
 
 EXTRA_PRE_CFLAGS := -I@LUSTRE@/ldlm -I@LUSTRE@/target
 
 
 EXTRA_PRE_CFLAGS := -I@LUSTRE@/ldlm -I@LUSTRE@/target
 
index 52d3225..102d2e8 100644 (file)
@@ -1813,11 +1813,11 @@ int ptlrpc_nrs_init(void)
        rc = ptlrpc_nrs_policy_register(&nrs_conf_tbf);
        if (rc != 0)
                GOTO(fail, rc);
        rc = ptlrpc_nrs_policy_register(&nrs_conf_tbf);
        if (rc != 0)
                GOTO(fail, rc);
+#endif /* HAVE_SERVER_SUPPORT */
 
        rc = ptlrpc_nrs_policy_register(&nrs_conf_delay);
        if (rc != 0)
                GOTO(fail, rc);
 
        rc = ptlrpc_nrs_policy_register(&nrs_conf_delay);
        if (rc != 0)
                GOTO(fail, rc);
-#endif /* HAVE_SERVER_SUPPORT */
 
        RETURN(rc);
 fail:
 
        RETURN(rc);
 fail:
index 41d0cb6..ec0f5fc 100644 (file)
@@ -38,7 +38,6 @@
  * \addtogoup nrs
  * @{
  */
  * \addtogoup nrs
  * @{
  */
-#ifdef HAVE_SERVER_SUPPORT
 
 #define DEBUG_SUBSYSTEM S_RPC
 #include <obd_support.h>
 
 #define DEBUG_SUBSYSTEM S_RPC
 #include <obd_support.h>
@@ -829,5 +828,3 @@ struct ptlrpc_nrs_pol_conf nrs_conf_crrn = {
 /** @} CRR-N policy */
 
 /** @} nrs */
 /** @} CRR-N policy */
 
 /** @} nrs */
-
-#endif /* HAVE_SERVER_SUPPORT */
index 9324dbd..4fcc6bb 100644 (file)
@@ -35,7 +35,6 @@
  * Author: Liang Zhen <liang@whamcloud.com>
  * Author: Nikitas Angelinas <nikitas_angelinas@xyratex.com>
  */
  * Author: Liang Zhen <liang@whamcloud.com>
  * Author: Nikitas Angelinas <nikitas_angelinas@xyratex.com>
  */
-#ifdef HAVE_SERVER_SUPPORT
 
 /**
  * \addtogoup nrs
 
 /**
  * \addtogoup nrs
@@ -1969,5 +1968,3 @@ struct ptlrpc_nrs_pol_conf nrs_conf_trr = {
 /** @} ORR/TRR policy */
 
 /** @} nrs */
 /** @} ORR/TRR policy */
 
 /** @} nrs */
-
-#endif /* HAVE_SERVER_SUPPORT */
index 9521d69..b922583 100644 (file)
@@ -31,8 +31,6 @@
  *
  */
 
  *
  */
 
-#ifdef HAVE_SERVER_SUPPORT
-
 /**
  * \addtogoup nrs
  * @{
 /**
  * \addtogoup nrs
  * @{
@@ -3702,5 +3700,3 @@ struct ptlrpc_nrs_pol_conf nrs_conf_tbf = {
 /** @} tbf */
 
 /** @} nrs */
 /** @} tbf */
 
 /** @} nrs */
-
-#endif /* HAVE_SERVER_SUPPORT */
index c3d817a..c702767 100644 (file)
@@ -45,13 +45,13 @@ extern int test_req_buffer_pressure;
 extern struct list_head ptlrpc_all_services;
 extern struct mutex ptlrpc_all_services_mutex;
 extern struct ptlrpc_nrs_pol_conf nrs_conf_fifo;
 extern struct list_head ptlrpc_all_services;
 extern struct mutex ptlrpc_all_services_mutex;
 extern struct ptlrpc_nrs_pol_conf nrs_conf_fifo;
+extern struct ptlrpc_nrs_pol_conf nrs_conf_delay;
 
 #ifdef HAVE_SERVER_SUPPORT
 extern struct ptlrpc_nrs_pol_conf nrs_conf_crrn;
 extern struct ptlrpc_nrs_pol_conf nrs_conf_orr;
 extern struct ptlrpc_nrs_pol_conf nrs_conf_trr;
 extern struct ptlrpc_nrs_pol_conf nrs_conf_tbf;
 
 #ifdef HAVE_SERVER_SUPPORT
 extern struct ptlrpc_nrs_pol_conf nrs_conf_crrn;
 extern struct ptlrpc_nrs_pol_conf nrs_conf_orr;
 extern struct ptlrpc_nrs_pol_conf nrs_conf_trr;
 extern struct ptlrpc_nrs_pol_conf nrs_conf_tbf;
-extern struct ptlrpc_nrs_pol_conf nrs_conf_delay;
 #endif /* HAVE_SERVER_SUPPORT */
 
 /**
 #endif /* HAVE_SERVER_SUPPORT */
 
 /**