From patchwork Sat Sep 3 19:32:28 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: SeongJae Park X-Patchwork-Id: 12965046 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 kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id D044EECAAD4 for ; Sat, 3 Sep 2022 19:32:38 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id CF57880166; Sat, 3 Sep 2022 15:32:37 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id CA56E8015A; Sat, 3 Sep 2022 15:32:37 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id B467E80166; Sat, 3 Sep 2022 15:32:37 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0013.hostedemail.com [216.40.44.13]) by kanga.kvack.org (Postfix) with ESMTP id A110E8015A for ; Sat, 3 Sep 2022 15:32:37 -0400 (EDT) Received: from smtpin25.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay08.hostedemail.com (Postfix) with ESMTP id 6B32E1402E8 for ; Sat, 3 Sep 2022 19:32:37 +0000 (UTC) X-FDA: 79871771154.25.DA58E71 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by imf04.hostedemail.com (Postfix) with ESMTP id 0AE1840062 for ; Sat, 3 Sep 2022 19:32:36 +0000 (UTC) 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 2244160CF7; 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 ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1662233557; a=rsa-sha256; cv=none; b=GhpsG9pXBIyZzHtnXmMiDZ5DINmQYwVWSZ8Nt5PXV7YsbqJGztoTtjxUlpqiZrfkWMAoD/ ROLet6ciSiCayFX4mQk/+wo5kC7izLbTslKYafT8OQXfQgjGtDyo6BpKbE6RDl25uw/8wG czoPMHPxedJjGm6lR7oXEIhGyj8Jh+g= ARC-Authentication-Results: i=1; imf04.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=CnKY2yCI; spf=pass (imf04.hostedemail.com: domain of sj@kernel.org designates 139.178.84.217 as permitted sender) smtp.mailfrom=sj@kernel.org; dmarc=pass (policy=none) header.from=kernel.org ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1662233557; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding:in-reply-to: references:dkim-signature; bh=IxUv5EwFy81Y3nWZZg9aleWijfYeE+DldXSJhkm0Ua0=; b=PgLvXovz0oUZbgPSqmc/gVrgbDERDQ5CWAXF5Nny5DrDrWDwID+NmwqABHRFEEQTmBuHQF 6lrfY1cjVkRSnT0WsMG0jaQLYgGM1jOcQZ5UjUJYpeKtnjo+OQjkb4SeNVrGc0oTl95EpS ow6id/9U1Pkp1RPm0TSsiW1Wgxs95tY= X-Stat-Signature: bkfif9hy81oxu19dr9qyymr9ixoh9ero X-Rspamd-Queue-Id: 0AE1840062 X-Rspam-User: Authentication-Results: imf04.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=CnKY2yCI; spf=pass (imf04.hostedemail.com: domain of sj@kernel.org designates 139.178.84.217 as permitted sender) smtp.mailfrom=sj@kernel.org; dmarc=pass (policy=none) header.from=kernel.org X-Rspamd-Server: rspam01 X-HE-Tag: 1662233556-132957 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: 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 --- 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)