From: Mr NeilBrown Date: Thu, 29 Oct 2020 03:41:18 +0000 (+1100) Subject: LU-14291 ptlrpc: support nrs_delay for client-only builds X-Git-Tag: 2.14.51~131 X-Git-Url: https://git.whamcloud.com/?a=commitdiff_plain;h=daa388b5399b4e2979865717d4cc0ee7cb3fa1db;p=fs%2Flustre-release.git LU-14291 ptlrpc: support nrs_delay for client-only builds 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 Change-Id: Ie25ed5ac837ff5f891824fad31ab258923840ec0 Reviewed-on: https://review.whamcloud.com/41127 Tested-by: jenkins Tested-by: Maloo Reviewed-by: James Simmons Reviewed-by: Chris Horn Reviewed-by: Oleg Drokin --- diff --git a/lustre/ptlrpc/Makefile.in b/lustre/ptlrpc/Makefile.in index 12abf31..aeea155 100644 --- a/lustre/ptlrpc/Makefile.in +++ b/lustre/ptlrpc/Makefile.in @@ -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 += 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) -@SERVER_TRUE@ptlrpc-objs += $(target_objs) $(nodemap_objs) +@SERVER_TRUE@ptlrpc-objs += $(target_objs) $(nodemap_objs) $(nrs_server_objs) @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 += $(nrs_server_objs:.o=.c) EXTRA_PRE_CFLAGS := -I@LUSTRE@/ldlm -I@LUSTRE@/target diff --git a/lustre/ptlrpc/nrs.c b/lustre/ptlrpc/nrs.c index 52d3225..102d2e8 100644 --- a/lustre/ptlrpc/nrs.c +++ b/lustre/ptlrpc/nrs.c @@ -1813,11 +1813,11 @@ int ptlrpc_nrs_init(void) 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); -#endif /* HAVE_SERVER_SUPPORT */ RETURN(rc); fail: diff --git a/lustre/ptlrpc/nrs_crr.c b/lustre/ptlrpc/nrs_crr.c index 41d0cb6..ec0f5fc 100644 --- a/lustre/ptlrpc/nrs_crr.c +++ b/lustre/ptlrpc/nrs_crr.c @@ -38,7 +38,6 @@ * \addtogoup nrs * @{ */ -#ifdef HAVE_SERVER_SUPPORT #define DEBUG_SUBSYSTEM S_RPC #include @@ -829,5 +828,3 @@ struct ptlrpc_nrs_pol_conf nrs_conf_crrn = { /** @} CRR-N policy */ /** @} nrs */ - -#endif /* HAVE_SERVER_SUPPORT */ diff --git a/lustre/ptlrpc/nrs_orr.c b/lustre/ptlrpc/nrs_orr.c index 9324dbd..4fcc6bb 100644 --- a/lustre/ptlrpc/nrs_orr.c +++ b/lustre/ptlrpc/nrs_orr.c @@ -35,7 +35,6 @@ * Author: Liang Zhen * Author: Nikitas Angelinas */ -#ifdef HAVE_SERVER_SUPPORT /** * \addtogoup nrs @@ -1969,5 +1968,3 @@ struct ptlrpc_nrs_pol_conf nrs_conf_trr = { /** @} ORR/TRR policy */ /** @} nrs */ - -#endif /* HAVE_SERVER_SUPPORT */ diff --git a/lustre/ptlrpc/nrs_tbf.c b/lustre/ptlrpc/nrs_tbf.c index 9521d69..b922583 100644 --- a/lustre/ptlrpc/nrs_tbf.c +++ b/lustre/ptlrpc/nrs_tbf.c @@ -31,8 +31,6 @@ * */ -#ifdef HAVE_SERVER_SUPPORT - /** * \addtogoup nrs * @{ @@ -3702,5 +3700,3 @@ struct ptlrpc_nrs_pol_conf nrs_conf_tbf = { /** @} tbf */ /** @} nrs */ - -#endif /* HAVE_SERVER_SUPPORT */ diff --git a/lustre/ptlrpc/ptlrpc_internal.h b/lustre/ptlrpc/ptlrpc_internal.h index c3d817a..c702767 100644 --- a/lustre/ptlrpc/ptlrpc_internal.h +++ b/lustre/ptlrpc/ptlrpc_internal.h @@ -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 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; -extern struct ptlrpc_nrs_pol_conf nrs_conf_delay; #endif /* HAVE_SERVER_SUPPORT */ /**