From patchwork Fri May 10 11:47:42 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kairui Song X-Patchwork-Id: 13661470 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 89A47C25B74 for ; Fri, 10 May 2024 11:50:26 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 1BE7E6B009B; Fri, 10 May 2024 07:50:26 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 16F2B6B00A1; Fri, 10 May 2024 07:50:26 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 035B46B00CE; Fri, 10 May 2024 07:50:25 -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 D7F7C6B00CC for ; Fri, 10 May 2024 07:50:25 -0400 (EDT) Received: from smtpin11.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay05.hostedemail.com (Postfix) with ESMTP id 8BFE841310 for ; Fri, 10 May 2024 11:50:25 +0000 (UTC) X-FDA: 82102318410.11.B2067C1 Received: from mail-pl1-f181.google.com (mail-pl1-f181.google.com [209.85.214.181]) by imf25.hostedemail.com (Postfix) with ESMTP id 9E1EAA000F for ; Fri, 10 May 2024 11:50:23 +0000 (UTC) Authentication-Results: imf25.hostedemail.com; dkim=pass header.d=gmail.com header.s=20230601 header.b="kT2U/2Cv"; spf=pass (imf25.hostedemail.com: domain of ryncsn@gmail.com designates 209.85.214.181 as permitted sender) smtp.mailfrom=ryncsn@gmail.com; dmarc=pass (policy=none) header.from=gmail.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1715341823; 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=r4pI/dLra8+Fx5rO5TUtIiOfN5ranfVQtnPo5N4NowI=; b=UxbJpMpOk060jkXK7p2EJaOvgq78MK69JH1pxcnH8PjHMIA9KmcTqCWguDMz9qKqVbs0ri IUsLz2VevE0GZfyrNkvyUvaOq676AVgbYwO4Y/QCH2/UNOu9HBp5gMzfpcMu86cG+X6dxv l4cUiKZT6wskBK/ZLQnZx4QjitrvcGw= ARC-Authentication-Results: i=1; imf25.hostedemail.com; dkim=pass header.d=gmail.com header.s=20230601 header.b="kT2U/2Cv"; spf=pass (imf25.hostedemail.com: domain of ryncsn@gmail.com designates 209.85.214.181 as permitted sender) smtp.mailfrom=ryncsn@gmail.com; dmarc=pass (policy=none) header.from=gmail.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1715341823; a=rsa-sha256; cv=none; b=RLNXDTCo6yrjRcHkJWd3IiAesOwDSYbMZxe3zn0vRnF+5fi96Vssf0bO3kJIbSxpKbq/or TGI8/E1A786YlstJfX3hlUg9M2H2OG7qAkMjc21KeGfTYQqJ555s4vgwDxKl7Qj5L6jgr+ c8WGSqZumeYU3SwpHn055MllrQY6x94= Received: by mail-pl1-f181.google.com with SMTP id d9443c01a7336-1e3c3aa8938so13526225ad.1 for ; Fri, 10 May 2024 04:50:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1715341822; x=1715946622; 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=r4pI/dLra8+Fx5rO5TUtIiOfN5ranfVQtnPo5N4NowI=; b=kT2U/2CvH0JDwG9IPh9K1kAb51Ew0Od8B2NXJQ1dSam7+k1k5qiokSVz4XjXZncWxS rtfI/6bX9N6kDrD+9tOtKAowFq0c7djEHlIuY9vH6y5yr8QNUYeEnKtmA57hmz72mJKW zZeRyRILT/y2WNuw/HTidUOIAPtpxXhHtCDYK6PusdIbkH4IeFwkWDpzrCSKmNa/qIBV +7YnyUWjJvfbMVo6Rwm0H9WXX0E0J0uIhyB+XE/NHhpdLEMKv7TvNy8E5UCR28D+rmJC LPGGK1O8B9vb0Rek4pmL4zfkt3HZEktE4dZLhrRbqXdjIPPKYr91j8EWW/wVB+a6u3PJ Mxrw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1715341822; x=1715946622; 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=r4pI/dLra8+Fx5rO5TUtIiOfN5ranfVQtnPo5N4NowI=; b=CscMvvBlkM/E4cw4JWbnXO+7WPTqCkuqQdIjV0gL6IzF5AY/9ft+ptKJxeaC3DJ2Bs /hri72xkjsleGoHlaroooPR0TTDzfG0uI2zPUhiifGcpRz/9lwWeMV+SlJ0AY1/8wJz0 X7kWyGm4r91FGDbqV5Dl22ImC3wmvR3GmW6Hemr6xWiKu4DBrC2CJE1y2m0BShjYcNyG h1PXjJS8bWdHBljmSPYGFXf5YG195r4iJpt5gk3jC8OE1gduy/rPuMxXMCjIRGVKZXl3 MwnEbybhimBQo9SLQDABFHJKiOi4V2EasQ7tYRUO5G/kV9vX9PkW6cDdW3SnnZ5hvj+R LNHw== X-Gm-Message-State: AOJu0Yzi926sLLspAgFNuvdN7ZeGo796AI7l9ki9tJv0EVhmB1KgJqpx 9uNwfj15+GSoTnhQTwzaaVQXpdDhKknuQ2RRAtYU6EYuEx+VjR1VNUhuX+yUFmkBJg== X-Google-Smtp-Source: AGHT+IHSu4vf1uCLF5qFTJHXuHSvWwDd6wRy4AQCNalBLaHz4N+8wZRkLwQ24nQsMv4SDXunk7nJRA== X-Received: by 2002:a17:902:dacd:b0:1e5:62:7aaa with SMTP id d9443c01a7336-1ef43d185e9mr29151095ad.20.1715341821906; Fri, 10 May 2024 04:50:21 -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.17 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Fri, 10 May 2024 04:50:21 -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 , David Howells , Jeff Layton , netfs@lists.linux.dev Subject: [PATCH v5 07/12] netfs: drop usage of folio_file_pos Date: Fri, 10 May 2024 19:47:42 +0800 Message-ID: <20240510114747.21548-8-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-Stat-Signature: jjkt5td9j4it6dpf5zz93z39cnt7kohi X-Rspamd-Queue-Id: 9E1EAA000F X-Rspamd-Server: rspam10 X-Rspam-User: X-HE-Tag: 1715341823-567671 X-HE-Meta: U2FsdGVkX18U3dAd23ZGiM8hHPmV1gP4u2t7ueOzxjtvzwTNQHolLOdX5fVdwOKd1pxqEQhscVTd8BDouUf8mB19ECUxPiqkgfDdjp1LbUQolQaK9VkH/p6jjnE/w8v/MTcWdTqPXCBooxpSFFp437ZZ+TrHHWMRvgJvw0m2gnJB5PW/CiE7loKqU+XD1NKM+QUuckpvd9u9xOojqLELUXGjCNC3zhvJdO5W7LUdgrEKbAjjXRr54s1sQUVpx2pUnZZbXfebJpcwDq9TeC5C2GGZdQn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MrX03SK/kYmQJXYkRWCBBZjiS5o6j/tEZeCz28cZwF/0MenzR0eG+wwLW2Aspp2hF1FeyiIOzmCRJHh2SiADLmNFfqx7GMGUwPznMSOsn3BKbj+bRbQea+2pYTqsGk6xTgQ2mc/R4UmAS67Vz63dXdaC6CssEyfaDgMKd8kFTFHzofEB2TSdjzlBmbxssnDNO3RbUv5uG2Hvb7D9jotZXfcuIQS/NXfOGXrtO61cmiHgQaeJ2SSAshMBRryVV6ivPM8siUA3Oc+HsUCiElAR9ffuPXKzjZYKZDuoDv1++/1AfJ7njg/HZNHYr4vjdUodtRJ9k+wsVRO/bD6Zp946VriH07jTZk9btNJ0MVyRAf0xUseDS66j4hCKRUaBhWBt65 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 folio_file_pos is only needed for mixed usage of page cache and swap cache, for pure page cache usage, the caller can just use folio_pos instead. It can't be a swap cache page here. Swap mapping may only call into fs through swap_rw and that is not supported for netfs. So just drop it and use folio_pos instead. Signed-off-by: Kairui Song Cc: David Howells Cc: Jeff Layton Cc: netfs@lists.linux.dev --- fs/netfs/buffered_read.c | 4 ++-- fs/netfs/buffered_write.c | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/fs/netfs/buffered_read.c b/fs/netfs/buffered_read.c index 3298c29b5548..d3687d81229f 100644 --- a/fs/netfs/buffered_read.c +++ b/fs/netfs/buffered_read.c @@ -255,7 +255,7 @@ int netfs_read_folio(struct file *file, struct folio *folio) _enter("%lx", folio->index); rreq = netfs_alloc_request(mapping, file, - folio_file_pos(folio), folio_size(folio), + folio_pos(folio), folio_size(folio), NETFS_READPAGE); if (IS_ERR(rreq)) { ret = PTR_ERR(rreq); @@ -454,7 +454,7 @@ int netfs_write_begin(struct netfs_inode *ctx, } rreq = netfs_alloc_request(mapping, file, - folio_file_pos(folio), folio_size(folio), + folio_pos(folio), folio_size(folio), NETFS_READ_FOR_WRITE); if (IS_ERR(rreq)) { ret = PTR_ERR(rreq); diff --git a/fs/netfs/buffered_write.c b/fs/netfs/buffered_write.c index 9a0d32e4b422..859a22a740c3 100644 --- a/fs/netfs/buffered_write.c +++ b/fs/netfs/buffered_write.c @@ -63,7 +63,7 @@ static enum netfs_how_to_modify netfs_how_to_modify(struct netfs_inode *ctx, bool maybe_trouble) { struct netfs_folio *finfo = netfs_folio_info(folio); - loff_t pos = folio_file_pos(folio); + loff_t pos = folio_pos(folio); _enter("");