From patchwork Mon Apr 29 19:04:55 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kairui Song X-Patchwork-Id: 13647546 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 5105CC4345F for ; Mon, 29 Apr 2024 19:07:24 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id D90A46B009A; Mon, 29 Apr 2024 15:07:23 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id D40E26B009B; Mon, 29 Apr 2024 15:07:23 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id C2F6B6B009C; Mon, 29 Apr 2024 15:07:23 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0012.hostedemail.com [216.40.44.12]) by kanga.kvack.org (Postfix) with ESMTP id A30B76B009A for ; Mon, 29 Apr 2024 15:07:23 -0400 (EDT) Received: from smtpin06.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay10.hostedemail.com (Postfix) with ESMTP id 2B011C0221 for ; Mon, 29 Apr 2024 19:07:23 +0000 (UTC) X-FDA: 82063502766.06.AA374DF Received: from mail-pl1-f174.google.com (mail-pl1-f174.google.com [209.85.214.174]) by imf23.hostedemail.com (Postfix) with ESMTP id 50F8C14000E for ; Mon, 29 Apr 2024 19:07:20 +0000 (UTC) Authentication-Results: imf23.hostedemail.com; dkim=pass header.d=gmail.com header.s=20230601 header.b=lIV15d0o; spf=pass (imf23.hostedemail.com: domain of ryncsn@gmail.com designates 209.85.214.174 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=1714417640; 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=/ZAdz4nacsjUfg+kmWc7WaK5L40TR/d1vDMSfySNIi0=; b=0E4Cm7X930woVwOj/v2AwIZAo1tCI17zzNKwucRDEWne4MY29gbzpnKgbSNJzXX45skqTk RM4u6TsCywcP5OsoVQ7kSQNvGrnwKzKXb5O6NBeE1e/ZD2Jvfw7ob79HMpad6Yx/2197Xt ajrbt2pzLPIMrsmOJAoi+OK0iOL0vkE= ARC-Authentication-Results: i=1; imf23.hostedemail.com; dkim=pass header.d=gmail.com header.s=20230601 header.b=lIV15d0o; spf=pass (imf23.hostedemail.com: domain of ryncsn@gmail.com designates 209.85.214.174 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=1714417640; a=rsa-sha256; cv=none; b=OlegaPLEiK1X8+hoJvokgV7H2XPGKmh5pUzMUmjE8qYX4jFihN4f86xdyDk2u/LmjfUN8Z vZygbJG8vpVS0Okn/NTqKOEIuwxyQWm4bWjSjeVSYtP1lhXyd0v/fvd6dvkrG3p3HOfQAz EBBX20fFAgiOyQ+UCwGMu6B/72eUpFM= Received: by mail-pl1-f174.google.com with SMTP id d9443c01a7336-1e4c4fb6af3so33046585ad.0 for ; Mon, 29 Apr 2024 12:07:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1714417639; x=1715022439; 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=/ZAdz4nacsjUfg+kmWc7WaK5L40TR/d1vDMSfySNIi0=; b=lIV15d0oki8whmpM9/6491Z39Ubka+1H5NEDLjJGec9YE1Uh9QvBvpcLL3221YpsAJ QNrmBjPFnL+UYCu82LUWTxtPm8J5nH2NO8i5KFGjegeW7wXVf94MAnvtoCBzzyZup+lp YXKtfnqIGXM4T/5HVf0g3kmnxbDMZpvf97kg4XSlzZ+3BJrSk+PLrmcTXKGoEdlDvMhB Rnd0AGw/nyMVJ4wKwtY8zCUtSaRt44yWVrURkXwlDlRbBcQmUFLy+H8Os0C5G90/HLwl IuajdJMMhFEcKaL60QFOwvfXW53FMz8RSruDsPQaeZ1j1waJnlNrQbg506Xjn7vc33kG M9Uw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1714417639; x=1715022439; 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=/ZAdz4nacsjUfg+kmWc7WaK5L40TR/d1vDMSfySNIi0=; b=w6iQTohLUFD2M4kjDWByv230nmxMv2BK/zqF8lRIRv/pzCe3WKfMhu8mvf5alWNscv MIWqYPp2LmcrbiVVBdzX/b7nDZK9TsCBal7VsL84wv6i4uSeW0NBA40kqhDcexEHBnfk mAWLMohLRXJ4EbJunzXpjsk1IpogkbLek6TVJjg6DADkGAdxuS4PZZ5CAAM/DY3U9tQ0 yo6RJr/KUbP67e38kzS2/Z12gEcv/EMKB1EzCHTgFyNUhA4gqF+Ax3TSwF4tYF6KlYzo rKY1T5OeyWuEfr8LzD/rTpzbjdpYlYmE4lmiK/d/e4Tzj7qVkBv6TcqfOGhWTfJX2Kb1 PY5g== X-Gm-Message-State: AOJu0YxbnGqjuJTylW6rqblSp+hUGsJ4qM2+8RDrN7dy/RX61R5CkveX CxHqvEhIx8jVfo9BxUAI4bZVZfr5GIKC4i7/GIQD2uXW/QOTs61T66GyedCce5w= X-Google-Smtp-Source: AGHT+IEmVRDgcLWQ+6tPsCb7ZBjy6NSNZhmYZz0nvDiJO9htXZ6R1aiOcZHSzS635P8dLMc8xNX3jg== X-Received: by 2002:a17:902:d489:b0:1ea:964f:9b0b with SMTP id c9-20020a170902d48900b001ea964f9b0bmr870204plg.5.1714417638707; Mon, 29 Apr 2024 12:07:18 -0700 (PDT) Received: from KASONG-MB2.tencent.com ([1.203.116.31]) by smtp.gmail.com with ESMTPSA id y4-20020a170902864400b001e49428f313sm20619356plt.261.2024.04.29.12.07.14 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Mon, 29 Apr 2024 12:07:17 -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 , David Howells , Jeff Layton , netfs@lists.linux.dev Subject: [PATCH v3 07/12] netfs: drop usage of folio_file_pos Date: Tue, 30 Apr 2024 03:04:55 +0800 Message-ID: <20240429190500.30979-8-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-Stat-Signature: z3pt6atf5h4e56x89bd1ibcn85msf1gw X-Rspam-User: X-Rspamd-Queue-Id: 50F8C14000E X-Rspamd-Server: rspam05 X-HE-Tag: 1714417640-809980 X-HE-Meta: U2FsdGVkX1+dBu27LWBs3jlmoMStrXrUStVmZbMw2GY9nEzOu31fsKAXpaZ54GYoihVfgQpUFrMVBARnZUUwgStnaLrKL1AvvGu+Y0DAIAwyRPwNLxs2XVJbGl/2cpdsSa2+lvJ7c0eijlgKJWCKO1sP1hgau7o2vV0B5qP93i/itRXVpJMpe0NnNhv+1E661Fdi3loZv3LosOcrWkM/2Zzwac6P2huBjB6KFXyVdd3x/ZwdiEAGLaF9A5z7ioZ+meGIWlxDiq1mlnt9Wcq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sKlcMGtWB413KIDRm6Z+cqHcAGE7/S2GQkGf0gljwxbAAsZYvNCUK5UxXz36OWdbWKjaTrbYIgCxGvrpv3zOJEtPdJgja1tvJhhNUJxpxGilTYg1IrM+lKTVpFucZyUAFDWmWvDKQuzUjvCBphamCVqVouF3W6QRudNnyzt6TPXDDc+cz+9tcrI3vRG41DLjwv8dIXfKVSJohvnojfJM4iZAK64ZjnWqLjeovlIeD79vgzfiI8A1zzQ6su/wV0tIHgQ2sRtScxpsIUW0a+1YF5eAaK983oOVlBBde9v5YemoNEin7ko1XUiI0WAygk8InK2HbOYEUhqZqF3OAEKNZJZ7MimiBZQEc8wS7QoWviQiKKN/cbLKGk6J/V7hoCFm8tM0G5JnvqMbkkRZQQBcKBsqZ15fKCmtXp9NoCDnIP 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 cache is never exposed to 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("");