From patchwork Mon Apr 29 19:11:36 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kairui Song X-Patchwork-Id: 13647563 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 4A300C4345F for ; Mon, 29 Apr 2024 19:13:25 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id D210A6B00A0; Mon, 29 Apr 2024 15:13:24 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id CA9416B00A1; Mon, 29 Apr 2024 15:13:24 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id B48B76B00A2; Mon, 29 Apr 2024 15:13:24 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0010.hostedemail.com [216.40.44.10]) by kanga.kvack.org (Postfix) with ESMTP id 93BCE6B00A0 for ; Mon, 29 Apr 2024 15:13:24 -0400 (EDT) Received: from smtpin30.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay10.hostedemail.com (Postfix) with ESMTP id 45977C0343 for ; Mon, 29 Apr 2024 19:13:24 +0000 (UTC) X-FDA: 82063517928.30.B79DBDC Received: from mail-pg1-f173.google.com (mail-pg1-f173.google.com [209.85.215.173]) by imf09.hostedemail.com (Postfix) with ESMTP id 6E1E714001C for ; Mon, 29 Apr 2024 19:13:22 +0000 (UTC) Authentication-Results: imf09.hostedemail.com; dkim=pass header.d=gmail.com header.s=20230601 header.b=gZ6szn0S; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (imf09.hostedemail.com: domain of ryncsn@gmail.com designates 209.85.215.173 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=1714418002; 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=hcA4nZ293WdWUF1yQsfhWEusCPbJDpQqrWzNvwMbGT0=; b=Xp+LLLTQzGaCAOOmh98+gbQB17ceq56L04A7x+WW2rcCl8nZ49d+8OwfymzFKyiuiNBXui qpaVrBo4f3kMSunVdriox+0ZfJIHyg/0xX+ploJ613skJ9kZ0GDT3p7VokdZBvNanowKj1 J7ukMYOygmAuunyTG3dCA9YrYHfBtno= ARC-Authentication-Results: i=1; imf09.hostedemail.com; dkim=pass header.d=gmail.com header.s=20230601 header.b=gZ6szn0S; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (imf09.hostedemail.com: domain of ryncsn@gmail.com designates 209.85.215.173 as permitted sender) smtp.mailfrom=ryncsn@gmail.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1714418002; a=rsa-sha256; cv=none; b=GYJRjbgxw8hAQ9xjYjwzILWF9uBNI+WmRw0QN5KLFk8td0M14VLTxI1lhawYuBvS+VPuF1 wRKw7Y97fI3KmJZAvc36BtElwPsaIFmWPumiWxLdXX8w5lSDWAR1O6xr/0J1NSBKlDvJfg io9lE5grNdUY9llMgFXSx1JLQV4KmAU= Received: by mail-pg1-f173.google.com with SMTP id 41be03b00d2f7-60275a82611so3564618a12.1 for ; Mon, 29 Apr 2024 12:13:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1714418001; x=1715022801; 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=hcA4nZ293WdWUF1yQsfhWEusCPbJDpQqrWzNvwMbGT0=; b=gZ6szn0S5+qFJ+5GxfPBPOJlqYadP86hbayu5E3xPxb86fnqBTeVvD4RC8EWkN1JIw +imccwEjJ2K84kCkNG3EEtCdPuDs5zHNtGygSfGkPaHlVKmYDwuPiRvCqWuUDZAYtgRU X05nCQyjTmh75TwABvr/kvqGitbn4ZXfSKr0CCvUisxrfU7HGCb/R8GZ2KkwKZkn+rbt gQdEl8pkK7zxXvj2P+4qw5bb6Tzs+wczSvdje1l/A5DRZ96bvwwLOm0aTQjqOkrOCdRt iNhmbYDJbq2VizAWHDE892/K7uTBFBJW3ii18k71D8ARA7ppPziWFo81A9u3UCs8oyM3 YA3w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1714418001; x=1715022801; 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=hcA4nZ293WdWUF1yQsfhWEusCPbJDpQqrWzNvwMbGT0=; b=dsmISWNYvLAK3q4tWk6mEYGBq+lr7wNeZmjbgZJz7JG7H2jLkI+n/9mjXb+rreyXgd 3wqUbQQ6jiZDJSUN43NJj6VRcKLOrwDIPzqG/KTuXHw2KyUnQggjsvpDdk4MqBhL2EBq n+lhd4z9e3olci+Td0Yoc0JeUygjUHtgKLQj8WpNOHgvWE4vC4jIXjrbI6uj/KQ+x9fM z69UZ+/t43i0g1jhlMaFMfgFct/6Rd8G9gJN2AFER7YMIThu2Hk6WXw18WbTghWaLOJA 6XJ79E4/895oZ/8HmTSWEqE/A0kNUTFvYVejlYfdhTaxLGN89gQ4A+Pq5HZ8cTFb6rP3 /eJA== X-Gm-Message-State: AOJu0YyyUsoJBb5iG08W2YlpZaEoGIbh0qQs9Wk2MPeBA9Q3hiZdddjo UJVzyD6JzFawuo/WFwhGxX//It6xbmOsTigWO+Pohsmz8gfCecnBJfjzH+oRdGc= X-Google-Smtp-Source: AGHT+IHLvjgAnYI9Ysv2ceA6BnVwlRDqXI0/taYU8YoY6DhE56amomjz9GVryhH/eJ61mj48VwV1lw== X-Received: by 2002:a05:6a20:2d0a:b0:1aa:930d:3dd7 with SMTP id g10-20020a056a202d0a00b001aa930d3dd7mr14861872pzl.6.1714418000676; Mon, 29 Apr 2024 12:13:20 -0700 (PDT) Received: from KASONG-MB2.tencent.com ([1.203.116.31]) by smtp.gmail.com with ESMTPSA id e10-20020aa7980a000000b006ed38291aebsm20307988pfl.178.2024.04.29.12.13.16 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Mon, 29 Apr 2024 12:13:20 -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 , Hugh Dickins , David Hildenbrand , Yosry Ahmed , linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, Kairui Song Subject: [PATCH v3 10/12] mm: remove page_file_offset and folio_file_pos Date: Tue, 30 Apr 2024 03:11:36 +0800 Message-ID: <20240429191138.34123-3-ryncsn@gmail.com> X-Mailer: git-send-email 2.44.0 In-Reply-To: <20240429190500.30979-1-ryncsn@gmail.com> References: <20240429190500.30979-1-ryncsn@gmail.com> Reply-To: Kairui Song MIME-Version: 1.0 X-Rspamd-Server: rspam01 X-Stat-Signature: tpekn9idpe8uohunf3gps5p694dj8s1q X-Rspam-User: X-Rspamd-Queue-Id: 6E1E714001C X-HE-Tag: 1714418002-99342 X-HE-Meta: U2FsdGVkX1+nZjZIQLPz3CTeKP5iGmOpSFwzkWn/UZtfXwg+9mUn/7jwCDYsC/Mjih8R+WOF5wHWDOVfDTRJd9nWAQfyqJ1vIuWRfP8RhIqOMTEgDxbHJuUyLULxwy7Os4z0jlhI2okM/frg9XmaFuon4Nf1A340XmTnrbev+wMy0B7/9g/fHUmMqPAVX/ZvCO0ghW+ric/Z1U+z6Hs8F/VW1iEE5RHg7v6dUwSW8hwhuNua8+BEuNzzQHyV1ZuUcwy3uNzPpwEKcT8yodEdISW+sjs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gNkoey2u9R7OPG9Y9C7+UQ3WE67kD8fLy6NW1X8S/YsAsv542n1B4x+5kQVbuVm1rUyYnHpdn9oLBa0ATM5KFyXg4OP5oN7obGckkYGCeC88rJ3Rhz73ydG+MWFtAjrUgtQuBw5okTTePSVSV3Bxg0IM8lx/5f++3mhV/dFKVPOS3T1hb9mGrnWnmAytWE+8ROYBU/Kz1853FCto2c3GJFlgAxTFRl89Ko0cXWha6Eo0Y5SnPSn1d6U4XSPn5o6Lj4GHqxqjLop36R1fDdc+qCjNnAbXLPoLAIryZXPOQZOQQBSxRtMYJ1LiQtKkVP91qBEA= 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 --- include/linux/pagemap.h | 17 ----------------- 1 file changed, 17 deletions(-) diff --git a/include/linux/pagemap.h b/include/linux/pagemap.h index 4e85f33721c4..91474dcc6cce 100644 --- a/include/linux/pagemap.h +++ b/include/linux/pagemap.h @@ -917,11 +917,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. @@ -931,18 +926,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). */