From: Shaun Tancheff Date: Fri, 25 Oct 2019 20:11:37 +0000 (-0500) Subject: LU-12904 build: account_page_dirtied is not exported X-Git-Tag: 2.13.51~51 X-Git-Url: https://git.whamcloud.com/?p=fs%2Flustre-release.git;a=commitdiff_plain;h=c38ab030d086e865a82c7d5236548062df47d7b1 LU-12904 build: account_page_dirtied is not exported Linux 5.2 does not export account_page_dirtied mm: remove the account_page_dirtied export Use symbol_get() to access account_page_dirtied for Lustre kernel-commit: ac1c3e49a9a734150b33297eeca5b43d92fd5be8 Test-Parameters: trivial Cray-bug-id: LUS-8042 Signed-off-by: Shaun Tancheff Change-Id: I9cd432556e183d06784537b000a4bda657116d88 Reviewed-on: https://review.whamcloud.com/36575 Tested-by: jenkins Tested-by: Maloo Reviewed-by: Andreas Dilger Reviewed-by: Petros Koutoupis Reviewed-by: James Simmons Reviewed-by: Oleg Drokin --- diff --git a/lustre/autoconf/lustre-core.m4 b/lustre/autoconf/lustre-core.m4 index 3bb9411..ab9bbae 100644 --- a/lustre/autoconf/lustre-core.m4 +++ b/lustre/autoconf/lustre-core.m4 @@ -2879,6 +2879,23 @@ EXTRA_KCFLAGS="$tmp_flags" ]) # LC_HAS_LINUX_SELINUX_ENABLED # +# LC_ACCOUNT_PAGE_DIRTIED +# +# After 5.2 kernel page dirtied is not exported +# +AC_DEFUN([LC_ACCOUNT_PAGE_DIRTIED], [ +LB_CHECK_COMPILE([if 'account_page_dirtied' is exported], +account_page_dirtied, [ + #include +],[ + account_page_dirtied(NULL, NULL); +],[ + AC_DEFINE(HAVE_ACCOUNT_PAGE_DIRTIED, 1, + [account_page_dirtied is available]) +]) +]) # LC_ACCOUNT_PAGE_DIRTIED + +# # LC_BIO_BI_PHYS_SEGMENTS # # kernel 5.3-rc1 commit 14ccb66b3f585b2bc21e7256c96090abed5a512c @@ -3152,6 +3169,9 @@ AC_DEFUN([LC_PROG_LINUX], [ # 5.1 LC_HAS_LINUX_SELINUX_ENABLED + # 5.2 + LC_ACCOUNT_PAGE_DIRTIED + # 5.3 LC_BIO_BI_PHYS_SEGMENTS LC_LM_COMPARE_OWNER_EXISTS diff --git a/lustre/llite/vvp_io.c b/lustre/llite/vvp_io.c index c68d809..9ae162f 100644 --- a/lustre/llite/vvp_io.c +++ b/lustre/llite/vvp_io.c @@ -920,6 +920,7 @@ static int vvp_io_commit_sync(const struct lu_env *env, struct cl_io *io, /* * Kernels 4.2 - 4.5 pass memcg argument to account_page_dirtied() + * Kernel v5.2-5678-gac1c3e4 no longer exports account_page_dirtied */ static inline void ll_account_page_dirtied(struct page *page, struct address_space *mapping) @@ -929,8 +930,19 @@ static inline void ll_account_page_dirtied(struct page *page, account_page_dirtied(page, mapping, memcg); mem_cgroup_end_page_stat(memcg); +#elif defined HAVE_ACCOUNT_PAGE_DIRTIED + account_page_dirtied(page, mapping, memcg); #else - account_page_dirtied(page, mapping); + typedef unsigned int (dirtied_t)(struct page *pg, + struct address_space *as); + const char *symbol = "account_page_dirtied"; + static dirtied_t *dirtied = NULL; + + if (!dirtied) + dirtied = (dirtied_t *)symbol_get(symbol); + + if (dirtied) + dirtied(page, mapping); #endif }