From patchwork Tue May 21 17:58:48 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kairui Song X-Patchwork-Id: 13669614 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 BE190C25B74 for ; Tue, 21 May 2024 17:59:33 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 5561E6B009A; Tue, 21 May 2024 13:59:33 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 505746B009B; Tue, 21 May 2024 13:59:33 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 3A6156B009C; Tue, 21 May 2024 13:59:33 -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 168DD6B009A for ; Tue, 21 May 2024 13:59:33 -0400 (EDT) Received: from smtpin24.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay10.hostedemail.com (Postfix) with ESMTP id C23DBC08EF for ; Tue, 21 May 2024 17:59:32 +0000 (UTC) X-FDA: 82143165384.24.EA6DA52 Received: from mail-pf1-f179.google.com (mail-pf1-f179.google.com [209.85.210.179]) by imf21.hostedemail.com (Postfix) with ESMTP id 2318B1C0012 for ; Tue, 21 May 2024 17:59:30 +0000 (UTC) Authentication-Results: imf21.hostedemail.com; dkim=pass header.d=gmail.com header.s=20230601 header.b=W3N0kn8v; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (imf21.hostedemail.com: domain of ryncsn@gmail.com designates 209.85.210.179 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=1716314371; 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=Xg2lyZdavS/xqDWMBFosXrNzMBl51D2SBqOTVmsbmqo=; b=BpiWvSO2ftHpt3iplyYiEavYwHn+rIwI2tGJX8b8TxsHczMpV6dPhf+rsUyEGQyuLQCY/Y ZAxjhRkgc2LR0zcvDnGJzMFkAX+17R4vfz5dAB+gjdVbOFGHSecnDzabXs7utZh4U7eRkK 1txq6SkO5ywxQNEZrxn/XfA8zJ41oW4= ARC-Authentication-Results: i=1; imf21.hostedemail.com; dkim=pass header.d=gmail.com header.s=20230601 header.b=W3N0kn8v; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (imf21.hostedemail.com: domain of ryncsn@gmail.com designates 209.85.210.179 as permitted sender) smtp.mailfrom=ryncsn@gmail.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1716314371; a=rsa-sha256; cv=none; b=FwP7AdAcmXuqDOP+OtegEJbbf7Yh2JI4xn5FF549rNVwsQkNrezTdTb+f8nw590ZIjRdpc +zEq33a/7y9Ig6bi1+ld3Mfh1eu61XEYCt1MNnBlz0jZ+lwJ1iEYoTwJXx8Pl8LIzSMd3P jPJGvojnzCXKUR7pZy3d2UnuYiIAmwM= Received: by mail-pf1-f179.google.com with SMTP id d2e1a72fcca58-6f6911d16b4so709850b3a.3 for ; Tue, 21 May 2024 10:59:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1716314370; x=1716919170; 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=Xg2lyZdavS/xqDWMBFosXrNzMBl51D2SBqOTVmsbmqo=; b=W3N0kn8v+5Vwb2D5QlIw7/x+1i9pwr7qZ+/+ZdJ+clPgr53mwjwnDTyBvluAIWejW/ AsCokFIEcc0DJySqQfPbekSEBz+vLz7L3+87NzlGsPsit2ytIBp2ls+MXEWYP2W08MT+ zgMzcY1kK7UHvWSNhf5yHjqNCMlcrC0AMHixkTj/2+LZCjuO0hYKUJRMYgXJkvFGmT5u xD5f8lwe4hhel2dTVbCbLVtLc+Atl3fyA683HtaLb2+bvGwwaI4b3H0yYTAir+Jy2lzi vZwYYwnwLzAttyL5YvtII3aV9IaeC7qFOrWJU2LhP/ja4lBcF2k7+GsL39Q7qQuccacu 7yDw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1716314370; x=1716919170; 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=Xg2lyZdavS/xqDWMBFosXrNzMBl51D2SBqOTVmsbmqo=; b=G258Kj0Gh5jDd9yfHHl+qeNbVvLxkYkz1j4jYjix4w+3mlHIXucRUh/VoiYlTU9GUK GqoovIbHQT+0HS3x7pEh7/8SVzS1g66byKZZ7XKcc5itFgV0gOgGbIQwSklfz3dPbihu LUd3y3HNNW47rpSFTgsnpmlvYkSOZHEis4fe90n/z0E0r8oGhWxvynUYWR8aD/n4/0rO mH5wFxNWeZnW404j+0kAYkswRmesSRLjLXq8VoVQhR2yOVF+Pe4zS8qWetQgDOjH97u0 jPmC7olgzvLqHeoqjfaADkrbxnYDA54hGe2VuYUwhpPiOmrXJxdqj8FpXDQlC0ahbwnK jBrg== X-Gm-Message-State: AOJu0Yxod72dc+Y7O1k4bSJGbyC878aIspkDRc4fHXQcarIWtj4xy+Fh OB7KUmEjhP7O1mZJbTQlY/s0oooqB2ECKSgQna4lLPGI8NVfvixaqCKoj5l8YQY= X-Google-Smtp-Source: AGHT+IFJcbaL2RYoor2pNfsZrFdmKgf74KAMgNVGow1v7hTBzhmhyuQsxHRR2tBe0moomC0BGjEz7g== X-Received: by 2002:a17:902:d4c4:b0:1f2:eff9:cd4 with SMTP id d9443c01a7336-1f2eff910a4mr117995375ad.0.1716314369672; Tue, 21 May 2024 10:59:29 -0700 (PDT) Received: from localhost.localdomain ([101.32.222.185]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-1f2fcdf87besm44646935ad.105.2024.05.21.10.59.25 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Tue, 21 May 2024 10:59:29 -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 v6 06/11] netfs: drop usage of folio_file_pos Date: Wed, 22 May 2024 01:58:48 +0800 Message-ID: <20240521175854.96038-7-ryncsn@gmail.com> X-Mailer: git-send-email 2.45.0 In-Reply-To: <20240521175854.96038-1-ryncsn@gmail.com> References: <20240521175854.96038-1-ryncsn@gmail.com> Reply-To: Kairui Song MIME-Version: 1.0 X-Rspamd-Queue-Id: 2318B1C0012 X-Stat-Signature: xkfeu36mypyituyophsbbkqxicii4j7b X-Rspam-User: X-Rspamd-Server: rspam11 X-HE-Tag: 1716314370-481328 X-HE-Meta: U2FsdGVkX184ve+XnwajKFEzFhuCo3ojbOlOTF2K/UA6YMYnWn2fG4LG6fyuXAenmvCqr2JxSAIAwOwXiOe+WM7t7c4aNhctyPpmJftYUlVwac7hCmpBl9nQCBKJzIlfb+dCG4hXy4cv1GaehwBrljQiX41PPy2VMAdIOjx2HZnf0L6hs1i8CzGo0sQxNAODfs8QaeLUu6KQ5OXSHnVowS7+hUMKWNqpYnCQh/qJn1Mfb2/wc/qkYOK1ikVUkFJgq+99ij6j3NmSUljfm795bLqf1ALScmd+w43xDSk+mVL8k6OewQa6g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vRxCZja/lGgOZOl9xumXfuAU4Cv6t46FrTCFluRCo65rS00oN+3zq24FEs= 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 a6bb03bea920..a688d4c75d99 100644 --- a/fs/netfs/buffered_read.c +++ b/fs/netfs/buffered_read.c @@ -271,7 +271,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); @@ -470,7 +470,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 1121601536d1..b3a6b7b41192 100644 --- a/fs/netfs/buffered_write.c +++ b/fs/netfs/buffered_write.c @@ -54,7 +54,7 @@ static enum netfs_how_to_modify netfs_how_to_modify(struct netfs_inode *ctx, { struct netfs_folio *finfo = netfs_folio_info(folio); struct netfs_group *group = netfs_folio_group(folio); - loff_t pos = folio_file_pos(folio); + loff_t pos = folio_pos(folio); _enter("");