From patchwork Fri May 10 11:47:41 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kairui Song X-Patchwork-Id: 13661469 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 7FCC7C25B10 for ; Fri, 10 May 2024 11:50:21 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 126466B00CA; Fri, 10 May 2024 07:50:21 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 0ADAA6B00CB; Fri, 10 May 2024 07:50:21 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id E8F996B00CC; Fri, 10 May 2024 07:50:20 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0016.hostedemail.com [216.40.44.16]) by kanga.kvack.org (Postfix) with ESMTP id C7F5C6B00CA for ; Fri, 10 May 2024 07:50:20 -0400 (EDT) Received: from smtpin21.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay08.hostedemail.com (Postfix) with ESMTP id 9131A140383 for ; Fri, 10 May 2024 11:50:20 +0000 (UTC) X-FDA: 82102318200.21.9933392 Received: from mail-pg1-f172.google.com (mail-pg1-f172.google.com [209.85.215.172]) by imf05.hostedemail.com (Postfix) with ESMTP id B180B10000A for ; Fri, 10 May 2024 11:50:18 +0000 (UTC) Authentication-Results: imf05.hostedemail.com; dkim=pass header.d=gmail.com header.s=20230601 header.b=BagXCwRt; spf=pass (imf05.hostedemail.com: domain of ryncsn@gmail.com designates 209.85.215.172 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=1715341818; 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=P42QJurgga8X3tClV+VU5iyd0pTaBz/Ss0EAkzfZsy4=; b=rS/37PPNvDZqWbEbuQWequu9e7MqSVAx7mMa50PrhVqLLwO34o3eX45Pp6u9ngLH7meC9x r49Y2LOR414OmMMq4QSMXC9nEIyu4cLuCabWqyuvzA/0mDaImdeQzEq3CfNmKYFbaqSASW 5RAh5HK4FiI2Xk5uLfG2dA6omf3eC50= ARC-Authentication-Results: i=1; imf05.hostedemail.com; dkim=pass header.d=gmail.com header.s=20230601 header.b=BagXCwRt; spf=pass (imf05.hostedemail.com: domain of ryncsn@gmail.com designates 209.85.215.172 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=1715341818; a=rsa-sha256; cv=none; b=7KqoUJS7YUSWodn95pMoYadqyCQWrDhA4c8MSVAlxmJuLuTN0KL/kNxc4iFRW+2ZsG8und bVpn7GO/C4tzPH2FLAR4Gasu3MgdfDA47qyQt1/aG3oyQsUWt1ljVkPqegCdRP2sizkCsU OvrewQQpJa+Jz9EAnHka5EuAnjSHAVg= Received: by mail-pg1-f172.google.com with SMTP id 41be03b00d2f7-6123726725eso1642707a12.3 for ; Fri, 10 May 2024 04:50:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1715341817; x=1715946617; 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=P42QJurgga8X3tClV+VU5iyd0pTaBz/Ss0EAkzfZsy4=; b=BagXCwRt5KtqR2ujnrRH6hDu8621qUDPBfzxFyUcFZgz/bQIBePvmRnLP1tXfKC5k3 ALYjw9/Adr9rl8ssxoJo4auuUO0TAXZluq4hTWnaha4+niIPZyXLyHokEYqID1TNC37R YNRWcybf22sGEXBt422QPzjbPFUvE5kHmhflB5CjE0JR8MIBvjuyVebliKdxAyw64Rh6 KpDyHJSbXVDJFZY0B1OSQ/EfCxHBvan9F8AQA+jEy/aqziB4ogE2XO+/LGjtiCy0ufZI 6eaNdgEjXy5q8jDHDk9t9IYcwCt8KY2zOOz0eW7sIOchWa9r8YySkClTtgZsK9lEaN34 f39Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1715341817; x=1715946617; 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=P42QJurgga8X3tClV+VU5iyd0pTaBz/Ss0EAkzfZsy4=; b=hkGguFVVL/q/8VYtlPdgaQr7Xyw0r6tFKOmv7qfGUU7iV/9pShL2MPbCthsMRGtqrN VazUqDAjBMEcgJS/dSL+oGw2uVFZEVbQtABXTrPt0AVLtBUDgctKz0Ys7Gc+g0CnSpPb W/uR50LnvQGP0S8ZE3aCl3vpre0OYMQ8sHYzWoj0jieMRcfVMmeZ+GbUE5A71+m25qMs kpOyGehhdIUwy8FG7ZYF25EZxtZqe0BXfw0PZs1ss+/Aiw3Z4MHhVpRoySpHZcvsw8rz 2/lBmVzKhsg4/slughg0EyFZekOSlcZRHnha6kYPeX+xjGxQlezVnGX75PW7AzR/mUu1 eq/A== X-Gm-Message-State: AOJu0YwpB0bANNQX7pPE+Xrn8UeWcC6I8gM33Yv90R1zXFuw4t2MH8aN FNT9jkaTYmBLVeiG7PSyoQ9BObSXlRj8pWseAXiah9j1C6yuEJy0WS1LrMqUSpJu3g== X-Google-Smtp-Source: AGHT+IG7UAvfga0ZG2yNv2RJVoigr75WJ+wAKzDPiq9W3zLhf2/XYb9zpcIAAYXrq2V/r060tL2Rzw== X-Received: by 2002:a05:6a21:3991:b0:1a3:dc61:926a with SMTP id adf61e73a8af0-1afde234e8bmr2652358637.54.1715341817254; Fri, 10 May 2024 04:50:17 -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.12 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Fri, 10 May 2024 04:50:16 -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 , Marc Dionne , linux-afs@lists.infradead.org Subject: [PATCH v5 06/12] afs: drop usage of folio_file_pos Date: Fri, 10 May 2024 19:47:41 +0800 Message-ID: <20240510114747.21548-7-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-Rspamd-Queue-Id: B180B10000A X-Rspam-User: X-Rspamd-Server: rspam04 X-Stat-Signature: gy1pytn1pfzn5hjze39hze3ypwp11gkp X-HE-Tag: 1715341818-896433 X-HE-Meta: U2FsdGVkX18qmCM3LiVh3Z4s3nmY7p+FBceA5HCZHDKQzklo5vXBTkRvhIvDgMEj/jftjwVf02MarHbAcE4sRBVLpwEBlwoa1dSc2RTBTRjz0Z91MiCMn+h9v064HUxv+5CsvpjbTswl4hE5BFWyLS8JlLBE94U5dI5EFgYBgSSWEZ1/Mtbjj9aDS2gDjPSI5UGFoFsXLekLtZPP0vrqJTLsJh8trwdUswniDbBJnJ5jQ7S+zHc9FWcIby6SB9/bMHwZ9f4ZkIjBajLyww1fmuFNLCRvAgYTrVmpR6BFypUGTcXZ/3zb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CSiO+1lF0ieaUq5iOfiySwkiME+4k8yJMmfXcE55ndzfa5vQziNXzYeLRflmy0nSfB5Arf4G3ixXQwEaWXMJJ1IRnKcLwwVgsdWIekBQNe7rnWBmkhGH8cEJo16RPemu2KOTY1N0zpKLjTTwXLSRZLMw0p8Bjel8hRLAFWp7yBeLVAmHlye0Ovmvvxhtb0VhmPp2pAjkAv0S5DlXd4XFqZ1WQs68m290omXiC06fzi4A3Cqo1rvHzO26vpebMtjFgMpcG5bimEOScq2Otbpwr0a8eFX4gORmu12GhcA4d1KXvkno/rEmtBRTEtrFQi5p4DB+DoFUgld19hDiXBDNC+guKfVojHtomtC7hkFbm92XB+2ZkCAm4jHt7kmLTpBd3qxd1I4m1ORW7Vinf4w6dK5hwGoDtSvYovGxZ4nuQ== 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 afs. So just drop it and use folio_pos instead. Signed-off-by: Kairui Song Cc: David Howells Cc: Marc Dionne Cc: linux-afs@lists.infradead.org --- fs/afs/dir.c | 6 +++--- fs/afs/dir_edit.c | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/fs/afs/dir.c b/fs/afs/dir.c index 67afe68972d5..f8622ed72e08 100644 --- a/fs/afs/dir.c +++ b/fs/afs/dir.c @@ -533,14 +533,14 @@ static int afs_dir_iterate(struct inode *dir, struct dir_context *ctx, break; } - offset = round_down(ctx->pos, sizeof(*dblock)) - folio_file_pos(folio); + offset = round_down(ctx->pos, sizeof(*dblock)) - folio_pos(folio); size = min_t(loff_t, folio_size(folio), - req->actual_len - folio_file_pos(folio)); + req->actual_len - folio_pos(folio)); do { dblock = kmap_local_folio(folio, offset); ret = afs_dir_iterate_block(dvnode, ctx, dblock, - folio_file_pos(folio) + offset); + folio_pos(folio) + offset); kunmap_local(dblock); if (ret != 1) goto out; diff --git a/fs/afs/dir_edit.c b/fs/afs/dir_edit.c index e2fa577b66fe..a71bff10496b 100644 --- a/fs/afs/dir_edit.c +++ b/fs/afs/dir_edit.c @@ -256,7 +256,7 @@ void afs_edit_dir_add(struct afs_vnode *vnode, folio = folio0; } - block = kmap_local_folio(folio, b * AFS_DIR_BLOCK_SIZE - folio_file_pos(folio)); + block = kmap_local_folio(folio, b * AFS_DIR_BLOCK_SIZE - folio_pos(folio)); /* Abandon the edit if we got a callback break. */ if (!test_bit(AFS_VNODE_DIR_VALID, &vnode->flags)) @@ -417,7 +417,7 @@ void afs_edit_dir_remove(struct afs_vnode *vnode, folio = folio0; } - block = kmap_local_folio(folio, b * AFS_DIR_BLOCK_SIZE - folio_file_pos(folio)); + block = kmap_local_folio(folio, b * AFS_DIR_BLOCK_SIZE - folio_pos(folio)); /* Abandon the edit if we got a callback break. */ if (!test_bit(AFS_VNODE_DIR_VALID, &vnode->flags))