From: SeongJae Park <sj@kernel.org>
To: akpm@linux-foundation.org
Cc: willy@infradead.org, linux-mm@kvack.org,
linux-kernel@vger.kernel.org, SeongJae Park <sj@kernel.org>
Subject: [PATCH for-mm-unstable] mm/swap.h: Define swap_cache_get_folio() for !CONFIG_SWAP
Date: Sat, 3 Sep 2022 19:32:28 +0000 [thread overview]
Message-ID: <20220903193228.172238-1-sj@kernel.org> (raw)
Commit 4d3cb611e6df ("swap: add swap_cache_get_folio()") in mm-unstable
tree defines 'swap_cache_get_folio()' for CONFIG_SWAP only, and as a
result build fails on !CONFIG_SWAP as below, after following commits
using the function under !CONFIG_SWAP is applied.
mm/shmem.c: In function ‘shmem_swapin_folio’:
mm/shmem.c:1738:10: error: implicit declaration of function ‘swap_cache_get_folio’; did you mean ‘read_cache_folio’? [-Werror=implicit-function-declaration]
1738 | folio = swap_cache_get_folio(swap, NULL, 0);
| ^~~~~~~~~~~~~~~~~~~~
| read_cache_folio
mm/shmem.c:1738:8: warning: assignment to ‘struct folio *’ from ‘int’ makes pointer from integer without a cast [-Wint-conversion]
1738 | folio = swap_cache_get_folio(swap, NULL, 0);
| ^
cc1: some warnings being treated as errors
This commit fixes the issue by defining the function for !CONFIG_SWAP
case.
Fixes:4d3cb611e6df ("swap: add swap_cache_get_folio()") in mm-unstable (1e6b789996e7)
Signed-off-by: SeongJae Park <sj@kernel.org>
---
Note: This patch does not cleanly applicable on top of the mm-unstable
but the fixing commit.
mm/swap.h | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/mm/swap.h b/mm/swap.h
index 2d6fe6c44ad9..ccd8d9a9ad36 100644
--- a/mm/swap.h
+++ b/mm/swap.h
@@ -101,6 +101,12 @@ static inline int swap_writepage(struct page *p, struct writeback_control *wbc)
return 0;
}
+static inline struct folio *swap_cache_get_folio(swp_entry_t entry,
+ struct vm_area_struct *vma, unsigned long addr)
+{
+ return NULL;
+}
+
static inline struct page *lookup_swap_cache(swp_entry_t swp,
struct vm_area_struct *vma,
unsigned long addr)
--
2.25.1
reply other threads:[~2022-09-03 19:32 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20220903193228.172238-1-sj@kernel.org \
--to=sj@kernel.org \
--cc=akpm@linux-foundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=willy@infradead.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox