From 61295974fe1eb20b7e5525cf553fa2bfc43f3ba6 Mon Sep 17 00:00:00 2001 From: NeilBrown Date: Mon, 1 Jul 2019 13:10:26 -0400 Subject: [PATCH] LU-4423 ptlrpc: remove inline on non-inlined functions. These three functions are never inlined. The only time they are used, their address is taken, and this forces them to be compiled as stand-alone functions. So having the "inline" declaration is misleading. Move the functions to the place where their address is used, and remove the 'inline' tag. Test-Parameters: trivial Change-Id: I0824d362f05e7397dd828f06464ad5aa156673d4 Signed-off-by: NeilBrown Reviewed-on: https://review.whamcloud.com/35296 Tested-by: jenkins Tested-by: Maloo Reviewed-by: Andreas Dilger Reviewed-by: Sebastien Buisson Reviewed-by: Oleg Drokin --- lustre/include/lustre_net.h | 21 --------------------- lustre/ptlrpc/client.c | 22 ++++++++++++++++++++++ lustre/ptlrpc/nodemap_storage.c | 8 ++++---- 3 files changed, 26 insertions(+), 25 deletions(-) diff --git a/lustre/include/lustre_net.h b/lustre/include/lustre_net.h index 29a1fb1..cf9b7e3 100644 --- a/lustre/include/lustre_net.h +++ b/lustre/include/lustre_net.h @@ -2177,30 +2177,9 @@ int ptlrpc_prep_bulk_frag(struct ptlrpc_bulk_desc *desc, void __ptlrpc_prep_bulk_page(struct ptlrpc_bulk_desc *desc, struct page *page, int pageoffset, int len, int pin); -static inline void ptlrpc_prep_bulk_page_pin(struct ptlrpc_bulk_desc *desc, - struct page *page, int pageoffset, - int len) -{ - __ptlrpc_prep_bulk_page(desc, page, pageoffset, len, 1); -} - -static inline void ptlrpc_prep_bulk_page_nopin(struct ptlrpc_bulk_desc *desc, - struct page *page, int pageoffset, - int len) -{ - __ptlrpc_prep_bulk_page(desc, page, pageoffset, len, 0); -} void ptlrpc_free_bulk(struct ptlrpc_bulk_desc *bulk); -static inline void ptlrpc_release_bulk_page_pin(struct ptlrpc_bulk_desc *desc) -{ - int i; - - for (i = 0; i < desc->bd_iov_count ; i++) - put_page(BD_GET_KIOV(desc, i).kiov_page); -} - static inline void ptlrpc_release_bulk_noop(struct ptlrpc_bulk_desc *desc) { } diff --git a/lustre/ptlrpc/client.c b/lustre/ptlrpc/client.c index b02e9a3..2523468 100644 --- a/lustre/ptlrpc/client.c +++ b/lustre/ptlrpc/client.c @@ -46,6 +46,28 @@ #include "ptlrpc_internal.h" +static void ptlrpc_prep_bulk_page_pin(struct ptlrpc_bulk_desc *desc, + struct page *page, int pageoffset, + int len) +{ + __ptlrpc_prep_bulk_page(desc, page, pageoffset, len, 1); +} + +static void ptlrpc_prep_bulk_page_nopin(struct ptlrpc_bulk_desc *desc, + struct page *page, int pageoffset, + int len) +{ + __ptlrpc_prep_bulk_page(desc, page, pageoffset, len, 0); +} + +static void ptlrpc_release_bulk_page_pin(struct ptlrpc_bulk_desc *desc) +{ + int i; + + for (i = 0; i < desc->bd_iov_count ; i++) + put_page(BD_GET_KIOV(desc, i).kiov_page); +} + const struct ptlrpc_bulk_frag_ops ptlrpc_bulk_kiov_pin_ops = { .add_kiov_frag = ptlrpc_prep_bulk_page_pin, .release_frags = ptlrpc_release_bulk_page_pin, diff --git a/lustre/ptlrpc/nodemap_storage.c b/lustre/ptlrpc/nodemap_storage.c index 72ce072..55e46ee 100644 --- a/lustre/ptlrpc/nodemap_storage.c +++ b/lustre/ptlrpc/nodemap_storage.c @@ -1460,6 +1460,7 @@ EXPORT_SYMBOL(nodemap_index_read); int nodemap_get_config_req(struct obd_device *mgs_obd, struct ptlrpc_request *req) { + const struct ptlrpc_bulk_frag_ops *frag_ops = &ptlrpc_bulk_kiov_pin_ops; struct mgs_config_body *body; struct mgs_config_res *res; struct lu_rdpg rdpg; @@ -1523,14 +1524,13 @@ int nodemap_get_config_req(struct obd_device *mgs_obd, desc = ptlrpc_prep_bulk_exp(req, page_count, 1, PTLRPC_BULK_PUT_SOURCE | PTLRPC_BULK_BUF_KIOV, - MGS_BULK_PORTAL, - &ptlrpc_bulk_kiov_pin_ops); + MGS_BULK_PORTAL, frag_ops); if (desc == NULL) GOTO(out, rc = -ENOMEM); for (i = 0; i < page_count && bytes > 0; i++) { - ptlrpc_prep_bulk_page_pin(desc, rdpg.rp_pages[i], 0, - min_t(int, bytes, PAGE_SIZE)); + frag_ops->add_kiov_frag(desc, rdpg.rp_pages[i], 0, + min_t(int, bytes, PAGE_SIZE)); bytes -= PAGE_SIZE; } -- 1.8.3.1