Received: by 2002:ab2:1689:0:b0:1f7:5705:b850 with SMTP id d9csp1571451lqa; Mon, 29 Apr 2024 12:13:45 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCUm3J10OzTNMmoRv5TY/TJdih5BUvwPzzo9C8dcsSm175kWPfVARO69NVwABsBgDlkbNxXO0oFgolAZ1DVY5RJUTUq+TNaQEE0qJ5sV8g== X-Google-Smtp-Source: AGHT+IFNZGTq0pYHA7gq2Hob7p7CH8uZdaWxa1YPGBeuEvLc8Gv0jFL9FcV78nxgdKti3f0fHx6q X-Received: by 2002:a05:6870:cb95:b0:23c:58bb:be68 with SMTP id ov21-20020a056870cb9500b0023c58bbbe68mr6576876oab.6.1714418025304; Mon, 29 Apr 2024 12:13:45 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1714418025; cv=pass; d=google.com; s=arc-20160816; b=cRVq6j/ON2Fd+MG6zWwZHb8MIqpnMGQgNcSjnXeDYuNXE/5dTD5GB5xzwFf+8IAprK B1vNCWfSQM6n1Y860XghUaBqTMlQn7Qt+e5+fzzpZZULg20WbYLWDqdiB7/0PURSDudC xxn+uXBvTti9Df89dubd9xUez9TGSPeT141yyuTgPfyg23kMYKTu+We1RliUdSZebmON hn1MoYxutAq2p1PAcFlHU/1ehFc+ao3mUw3+shB2LLC+sMgbsqWJmVM4ti8cGQ+Sv4HS SskbFuPk+sC1JW8Z6xl2oQPMjxk/SYjf8Ci6THNa4CkLFJdHjA8LRoTjBbCn/WA6iiHq MTXg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:reply-to:references:in-reply-to :message-id:date:subject:cc:to:from:dkim-signature; bh=hcA4nZ293WdWUF1yQsfhWEusCPbJDpQqrWzNvwMbGT0=; fh=oyaXJkFlDy1KvW07YxbziCYaZ68F2WX7I/JPoKSiuHE=; b=PLgTSsWDQLYaxJGy1ILh6amAYiNhvAlwTocHQnrTvvFJTkrOcsIdiWQE2AA1uA2VOE Ktmw0aSSkxXw1hkOFm58x6UNO0SujWdO20Gvb0OgLBgp+pNjNoy3WCbG92p7kzKe0i2H vOFNf4WUahYhotrcG1+jE9v3LtQ/FgxJU/ZNKTCS38D0UWAHt21tjIGeMSPwofALH9Ym Y+8CF4tz7qywbvAnBY2/DsA5bwDiehfSVvwF+zcBH5Vxoxs/HMRwYt8kVW3lgDrCeCkc CxTKot4YXU2HqVODQvIE5IP01+v0Dt+6r2rlqF01ntWfAWFV7nTD2fugsOzO9tui6Dc3 JKVg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=V7bsrhX6; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com dmarc=pass fromdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-162891-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-162891-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id c8-20020a637248000000b0061236ca7f83si3634704pgn.389.2024.04.29.12.13.45 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 29 Apr 2024 12:13:45 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-162891-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=V7bsrhX6; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com dmarc=pass fromdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-162891-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-162891-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id 91246286C64 for ; Mon, 29 Apr 2024 19:13:44 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 738C113BAE9; Mon, 29 Apr 2024 19:13:23 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="V7bsrhX6" Received: from mail-pf1-f169.google.com (mail-pf1-f169.google.com [209.85.210.169]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 5AD7413B598; Mon, 29 Apr 2024 19:13:21 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.210.169 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714418002; cv=none; b=U/nQgI2ti31phiqgS7EPYLVaGmUSQ772ySxHm8o/CJpkqCz+XbUmJYdqVhVUh7lEItW82RllVZylcNF62xPDlxxHi9SN5976qBzN1ah20aKMBABr+TWF5EU7FqCQnuvNajJbqrvvbtVrLO7bujbOTDXMvA2YkyapmB9fA6CxhVU= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714418002; c=relaxed/simple; bh=sgR0dU15JB8rGvD/MDR+dhiv67zgFby0JOYk45sAObs=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=W2mxemUD0n0d+XMMEUrXY5pxIj/CPwWY6IZwDlZuCtCPmz4vGB4ET8220m1PGrKo0/It17YHZQigxsf7EHf0pkCU3u20Go14AWumHNCn7P7KsWJMwZdgwvXGjcwXiZwzJiT6WGU2qdzKjSp63jC7AxG911fbtv0VuHxq3+rECyE= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=V7bsrhX6; arc=none smtp.client-ip=209.85.210.169 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-pf1-f169.google.com with SMTP id d2e1a72fcca58-6f4081574d6so1065517b3a.2; Mon, 29 Apr 2024 12:13:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1714418001; x=1715022801; darn=vger.kernel.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=V7bsrhX6LZVEC3aKL2uLuwxn1avCMvO4nQyQmHDEHK/9wAOFISJFAGPs8cF58mm/YK bGJDhsTFRM4Ztjing/WgQUm2pN0Nlbap8RfW+oZjR2TY61KBAySKWa4OsVCHLrkYaLwo wJDwJL1gyBsZYlAV2jPMVdMMHZXvbITdEkTdf3fZvLBJulnecZKAWAgqVjt28ZS7FWjT +BszWc8w4dZKNmInqx5UknpsmllyuUiX9Fhq95s/32VHYGPTbfB6jrKFzeag3ROvtTgF Z2193ziC6mo7LCVlnoo5tmA7j438r1CILHzrQbSVyBE5IeR0jRpvfh8PN+6eF9wdvD4A Qang== 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=djDtbODSML5P7EZMV9n8FaC9mh4MSXIh0/DMQ/M2Vcp145u3jE++iPxn8M0B3UMGuu whBavL8qJB9FFsV6kLWvbIhaPqHvMzbD2M3zWKWXq7DWJrsQo/5R7TI50R74iSy7IZEk OPw0yzPrgTW8JQpEeirjIeeKhTs2qww16iQuyUnYk0QwJAlxHQbz0hpFgiiyTMwKCB3x DGVktH6stP8JO27ifFrJDNdqvEZ0cYcvQxLgJ8BTHJVf1QjDU74l7Icw/4kDcP9U0vRT oYdxudDkmVZqsmftZd5tQ4r6vGUwoMk+EWt3fgMSoQA6CbiksJo5hrTIAzEs5lQ8zjgr ujcQ== X-Forwarded-Encrypted: i=1; AJvYcCV3VOzoqNYfqzlFEJGZQgAfG7v3ra4PMaWCgqtanoDc+ECuB+KYYRciQAQyJ8yegRL/h0utwyG1COJQyBdU2KH60ReQ2gjrepM/h/+PwVC+Pb5F42tZUu580Dyz5goz5umgYxsmXce8ibpSlg== X-Gm-Message-State: AOJu0Yx2zMyUdZjS+J3CnVj93O/LI4IRLyUutXsoLz+LRkgi34AC4PGS OweHxJCRnAskid8+NlF+8nMw+OdSYqWr6Qn6hGrhf+UxylB7NRkh 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 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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). */ -- 2.44.0