From nobody Mon Apr 6 18:42:50 2026 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id A975DC6FA83 for ; Sat, 3 Sep 2022 19:32:40 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233014AbiICTcj (ORCPT ); Sat, 3 Sep 2022 15:32:39 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45314 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229698AbiICTch (ORCPT ); Sat, 3 Sep 2022 15:32:37 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A1A2148EA8 for ; Sat, 3 Sep 2022 12:32:36 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 2BFB660D36 for ; Sat, 3 Sep 2022 19:32:36 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 0DA5DC433D6; Sat, 3 Sep 2022 19:32:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1662233555; bh=mh3N+GmFc5Rx9AiBTB6cAzvRqaNHLVykgec3apa4ju4=; h=From:To:Cc:Subject:Date:From; b=CnKY2yCIHdBupTV/FW5lzQ1TBLjhnFNFWKZuiUAGkMH1z9TpnXoKy5fhfSms3ASQp qyHwz1a+tmBKOgLl/GYPmgGcmSrEhekuy9HJ16wesiJbrzKEc+xkETylWGhHQg0gwv p7V4tu1lBldxMmp6OztkTzdwi5n9oxFq7X3OH6lFk92MQn1G4wyhHSRofVtgdn0pwo 5rqrLlbdXIstgskZHtNqWGgF0ogTx9JpIwMMSGWXnKh82X2+Z6o7yu3GJXtHSrnp3J tKWYHsVQby5o/D8uOiXmiagULOpFi3wiMZ5FNWqLTGpwugeZ8PBkm6YErgNeXlkGxa 5y2IDik60CSgQ== From: SeongJae Park To: akpm@linux-foundation.org Cc: willy@infradead.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org, SeongJae Park 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 Message-Id: <20220903193228.172238-1-sj@kernel.org> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 =E2=80=98shmem_swapin_folio=E2=80=99: mm/shmem.c:1738:10: error: implicit declaration of function =E2=80=98sw= ap_cache_get_folio=E2=80=99; did you mean =E2=80=98read_cache_folio=E2=80= =99? [-Werror=3Dimplicit-function-declaration] 1738 | folio =3D swap_cache_get_folio(swap, NULL, 0); | ^~~~~~~~~~~~~~~~~~~~ | read_cache_folio mm/shmem.c:1738:8: warning: assignment to =E2=80=98struct folio *=E2=80= =99 from =E2=80=98int=E2=80=99 makes pointer from integer without a cast [-= Wint-conversion] 1738 | folio =3D 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 (1e6= b789996e7) Signed-off-by: SeongJae Park --- 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, struc= t writeback_control *wbc) return 0; } =20 +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) --=20 2.25.1