From patchwork Fri May 10 11:47:45 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kairui Song X-Patchwork-Id: 13661473 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 DCA02C25B10 for ; Fri, 10 May 2024 11:50:38 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 6EF8C6B00D2; Fri, 10 May 2024 07:50:38 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 69F586B00D3; Fri, 10 May 2024 07:50:38 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 519676B00D4; Fri, 10 May 2024 07:50:38 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0011.hostedemail.com [216.40.44.11]) by kanga.kvack.org (Postfix) with ESMTP id 2DDEC6B00D2 for ; Fri, 10 May 2024 07:50:38 -0400 (EDT) Received: from smtpin20.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay02.hostedemail.com (Postfix) with ESMTP id D6EB71217EF for ; Fri, 10 May 2024 11:50:37 +0000 (UTC) X-FDA: 82102318914.20.6FC6549 Received: from mail-pl1-f171.google.com (mail-pl1-f171.google.com [209.85.214.171]) by imf01.hostedemail.com (Postfix) with ESMTP id 0E59A4001B for ; Fri, 10 May 2024 11:50:35 +0000 (UTC) Authentication-Results: imf01.hostedemail.com; dkim=pass header.d=gmail.com header.s=20230601 header.b=cWLYwChc; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (imf01.hostedemail.com: domain of ryncsn@gmail.com designates 209.85.214.171 as permitted sender) smtp.mailfrom=ryncsn@gmail.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1715341836; h=from:from:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=APhN0fulocDUETiygz2oAEV3IjS3U4+qkKHyL+coV+Q=; b=KrTfxWFTNNxSGKiv0Mdhmy+uZlskEjXhvbJE9dNISbCQraYYuTQ2U2Y+tbK44pvJuyR8mm wwcetm9iOCt1o6D6BMOp1e98lJ1/bfhC9MIDHujKApHS2/ZFAs4ZdCYts4zNwgU0fRtvtK tVhYyFgPT3ImAdZJ6xznT37WPWy1P10= ARC-Authentication-Results: i=1; imf01.hostedemail.com; dkim=pass header.d=gmail.com header.s=20230601 header.b=cWLYwChc; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (imf01.hostedemail.com: domain of ryncsn@gmail.com designates 209.85.214.171 as permitted sender) smtp.mailfrom=ryncsn@gmail.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1715341836; a=rsa-sha256; cv=none; b=ksgmu2R9h+yras3LmhcRXLfbc0bLReXoaVK6T4jS29LgN9rSm7zN/VdS4dXhXJ2S+qVbfa rBbiKouKdgqyh90npkEJYJaLGhgNIHjduaCbeE7NoKw8jcFGkR3zEmWZobCK+uLaTCXDz0 g8v3/rx0hZa8NhNpb5MU/U1KE4x42zU= Received: by mail-pl1-f171.google.com with SMTP id d9443c01a7336-1edf506b216so14400275ad.2 for ; Fri, 10 May 2024 04:50:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1715341834; x=1715946634; darn=kvack.org; h=content-transfer-encoding:mime-version:reply-to:references :in-reply-to:message-id:date:subject:cc:to:from:from:to:cc:subject :date:message-id:reply-to; bh=APhN0fulocDUETiygz2oAEV3IjS3U4+qkKHyL+coV+Q=; b=cWLYwChcvYxN6sC8YPLdRArxH1IF9zOSK/nDhwMqgqbSWx5sFeV3PRn2UatgxMs3f2 hQ8hOyNady4Iu8ODRyIxF3msH81vrxjCZYz8UnXUhHmZyDF4AV3r8haUdJaUhRemCZe+ OaIMAH7yjhze93JZo8719MvNgCFZyczSrN/sq8bHO8OEraKFPy4F3E9BCj4KBWYbdKK1 cM5A0DCzajwCuQxdRgvWb4Xj/OifrpKk8S1qYtDEvqSGcX8fYJW2iih6gquNzZm6jRRi qAL2EkHvaU8zq+R+v4Rl6LM0bGcPqgMm4/AEo+7Aqne6gkBbzjAfaRh++cbTPImtZWQq 7vpw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1715341834; x=1715946634; h=content-transfer-encoding:mime-version:reply-to:references :in-reply-to:message-id:date:subject:cc:to:from:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=APhN0fulocDUETiygz2oAEV3IjS3U4+qkKHyL+coV+Q=; b=w7pW8Q0HNImAarOuq1m5WI+r7ToWsbDmpPG5rQA0kxZAhgftiAJ3I3Z0ADUYwGdMsO mC9oozZRIWfgNMcFTh+1pZkEWwmizNSJtEoJbkLJ14Z7YyUt44mCJZ3rjsZPjQwpriK7 riQwvjTdIRXQI4mGXUJJ4r3dT0dE59tzmcuTlgjNkhoDKUwY7Aa+m9nDe1OiuLAgQAcq PTEof9uZEZSXfGSZpfy/w5x3VSSInWcbMNcR+bMRhWCsFpA8c8TTKPdJmtSj5kMjPKpI C+m4OtJAZllfFlTFX42SeZ9bevwDVL0SQLxWD1vCgwNdGzTbES625qMz8XV7OLvgKhnH NlrQ== X-Gm-Message-State: AOJu0YxfMZNOCbs39RPHCU1ki9HiFZFpAs2EpNKSqW2j+oHqhRWG/Bnx yFEFIGiPYXx2kQ9uhlwVuLC70eGKu/Mq87MB7np319/b02IcUKIe/JRPabAOYfdoMQ== X-Google-Smtp-Source: AGHT+IGRhm5V0At8lTwKdrzoZNWdcS6HhlYsyuvWhECri1epnW5oHdn3nfMF9ycJerAmcOjLLrBH8A== X-Received: by 2002:a17:902:720a:b0:1ee:b47e:4ea with SMTP id d9443c01a7336-1ef43f3d39cmr21286825ad.38.1715341834585; Fri, 10 May 2024 04:50:34 -0700 (PDT) Received: from KASONG-MC4.tencent.com ([43.132.141.20]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-1ef0c134155sm30183825ad.231.2024.05.10.04.50.30 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Fri, 10 May 2024 04:50:34 -0700 (PDT) From: Kairui Song To: linux-mm@kvack.org Cc: Andrew Morton , "Huang, Ying" , Matthew Wilcox , Chris Li , Barry Song , Ryan Roberts , Neil Brown , Minchan Kim , David Hildenbrand , Hugh Dickins , Yosry Ahmed , linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, Kairui Song Subject: [PATCH v5 10/12] mm: remove page_file_offset and folio_file_pos Date: Fri, 10 May 2024 19:47:45 +0800 Message-ID: <20240510114747.21548-11-ryncsn@gmail.com> X-Mailer: git-send-email 2.45.0 In-Reply-To: <20240510114747.21548-1-ryncsn@gmail.com> References: <20240510114747.21548-1-ryncsn@gmail.com> Reply-To: Kairui Song MIME-Version: 1.0 X-Rspam-User: X-Rspamd-Server: rspam09 X-Rspamd-Queue-Id: 0E59A4001B X-Stat-Signature: dtd159zpmaoifxbmxd8r6k5c93gw5y1r X-HE-Tag: 1715341835-549946 X-HE-Meta: U2FsdGVkX19OqY9grPulcu1QEQIuUIRU8rfa+J/V47CO2tVCsiAADR0/6rfOlCJWCo4u3tXfu2FrgBfp6PqXSEl14FSCz4NFoxaLR41uONAPlx/HG7cN7G7rk+FEmAc1LRS06unYhj/LfRPsRMYZRjkhNkx0K/kdORhRThlHCU/60oYkh5PLj2k488H0UWylA+Oc01I/3uXifnLIq7jSXFILHmGWaCR5SSzY74M+TPcetwnMLlfwv19TYi3O1o8fGlqEqWvrSkM+h6WORDIRrOKcAv49LIc+GNm/A2/8FHDfyzHH3/OvbEqQnRYiqALn3AVI1Ify/DG/r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Y3RepQArbsa55s8dUF/qVZKfmp7UffcDnF+RRp7GLKevqEXCDngne7MDC2H8KTSR78ldle9x3Y3FGVQZ2WxdIf/zZfO10ns96kqtSGAZFX0UK4Ov05QyFuaEXPwOMcywBR/nuUxgp8g9mxPTa29hpHVUisMPDXpwD4Vcod3WvAgah6sEa7yzrO8UPxxnVk71KLf6AYeaLD+Q96pBkUYGzAVr2gbYAJddiKyf3prCz/23617Bj1LESNAAjccq5nMGIgnztTAkBcAxLQx+HQ0TXN 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: List-Subscribe: List-Unsubscribe: From: Kairui Song These two helpers were useful for mixed usage of swap cache and page cache, which help retrieve the corresponding file or swap device offset of a page or folio. They were introduced in commit f981c5950fa8 ("mm: methods for teaching filesystems about PG_swapcache pages") and used in commit d56b4ddf7781 ("nfs: teach the NFS client how to treat PG_swapcache pages"), suppose to be used with direct_IO for swap over fs. But after commit e1209d3a7a67 ("mm: introduce ->swap_rw and use it for reads from SWP_FS_OPS swap-space"), swap with direct_IO is no more, and swap cache mapping is never exposed to fs. Now we have dropped all users of page_file_offset and folio_file_pos, so they can be deleted. Signed-off-by: Kairui Song Reviewed-by: "Huang, Ying" --- include/linux/pagemap.h | 17 ----------------- 1 file changed, 17 deletions(-) diff --git a/include/linux/pagemap.h b/include/linux/pagemap.h index 850d32057939..a324582ea702 100644 --- a/include/linux/pagemap.h +++ b/include/linux/pagemap.h @@ -918,11 +918,6 @@ static inline loff_t page_offset(struct page *page) return ((loff_t)page->index) << PAGE_SHIFT; } -static inline loff_t page_file_offset(struct page *page) -{ - return ((loff_t)page_index(page)) << PAGE_SHIFT; -} - /** * folio_pos - Returns the byte position of this folio in its file. * @folio: The folio. @@ -932,18 +927,6 @@ static inline loff_t folio_pos(struct folio *folio) return page_offset(&folio->page); } -/** - * folio_file_pos - Returns the byte position of this folio in its file. - * @folio: The folio. - * - * This differs from folio_pos() for folios which belong to a swap file. - * NFS is the only filesystem today which needs to use folio_file_pos(). - */ -static inline loff_t folio_file_pos(struct folio *folio) -{ - return page_file_offset(&folio->page); -} - /* * Get the offset in PAGE_SIZE (even for hugetlb folios). */