LINUX-5.7: replace __pagevec_lru_add with lru_cache_add_file 59/14159/8
authorCheyenne Wills <cwills@sinenomine.net>
Thu, 30 Apr 2020 16:31:17 +0000 (10:31 -0600)
committerBenjamin Kaduk <kaduk@mit.edu>
Fri, 15 May 2020 16:09:40 +0000 (12:09 -0400)
commit17b42fe67c18fab0003fb712092d36f06c93f2eb
treeecb3b55b972f5350b2d9591c3ae13bc405de0afc
parentdca95bcb7efdff38564dcff3e8f4189735f13b3a
LINUX-5.7: replace __pagevec_lru_add with lru_cache_add_file

The Linux function __pagevec_lru_add is no longer exported in Linux
5.7-rc1 commit bde07cfc65da5fe6c63fe23f035f5ccc0ffd89e0
"mm/swap.c: not necessary to export __pagevec_lru_add()".

As a replacement, the Linux function lru_cache_add_file can be used for
adding a page to the lru cache.  The internal processing of
lru_cache_add_file manages its own internal pagevec and performs the
following:
     get_page(...)
     if(!pagevec_add(...))
        __pagevec_lru_add_file(...)

Introduce an autoconf test for lru_cache_add_file and replace the calls
associated with __pagevec_lru_add with lru_cache_add_file.

NOTE: see Linux commit a0b8cab3b9b2efadabdcff264c450ca515e2619c
"mm: remove lru parameter from __pagevec_lru_add and remove parts of
pagevec API" as a reference for this change.

The lru_cache_add_file was introduced in Linux 2.6.28, therefore this
change affects systems with Linux 2.6.28 kernels and later.

Change-Id: I12b32fd5061fc136f8b96ef3605e0bab736ca9ed
Reviewed-on: https://gerrit.openafs.org/14159
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
src/afs/LINUX/osi_vnodeops.c
src/cf/linux-kernel-func.m4