From patchwork Tue May 21 17:58:47 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kairui Song X-Patchwork-Id: 13669613 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 55CF3C25B74 for ; Tue, 21 May 2024 17:59:30 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id E07BF6B0098; Tue, 21 May 2024 13:59:29 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id DB7676B0099; Tue, 21 May 2024 13:59:29 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id C59A26B009A; Tue, 21 May 2024 13:59:29 -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 A651B6B0098 for ; Tue, 21 May 2024 13:59:29 -0400 (EDT) Received: from smtpin08.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay09.hostedemail.com (Postfix) with ESMTP id 1FDFE80F73 for ; Tue, 21 May 2024 17:59:29 +0000 (UTC) X-FDA: 82143165258.08.2BE0BED Received: from mail-pl1-f178.google.com (mail-pl1-f178.google.com [209.85.214.178]) by imf01.hostedemail.com (Postfix) with ESMTP id 431A340002 for ; Tue, 21 May 2024 17:59:26 +0000 (UTC) Authentication-Results: imf01.hostedemail.com; dkim=pass header.d=gmail.com header.s=20230601 header.b=HoU7u37L; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (imf01.hostedemail.com: domain of ryncsn@gmail.com designates 209.85.214.178 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=1716314366; 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=Ai/XQI+ApU8/hPn4qXS7yxENUI5QLepmcyykjqzhrO7CpQESafMMUgiVe2Zb/DxtWqMIK+ n4dacw5D2crMV/VXIDiqkFhN10XH/ahCiQNgCLeFx75hz5oncmnQ1yUIV+Fa31xdx5YRil gn+zjz68cQ1ips+X6TK64XjMspfyeh4= ARC-Authentication-Results: i=1; imf01.hostedemail.com; dkim=pass header.d=gmail.com header.s=20230601 header.b=HoU7u37L; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (imf01.hostedemail.com: domain of ryncsn@gmail.com designates 209.85.214.178 as permitted sender) smtp.mailfrom=ryncsn@gmail.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1716314366; a=rsa-sha256; cv=none; b=l3ttmYmm7rLHR4Wx3sS3dwfEo7rC2h1FTcUj0pHs6ahUJlT4+3f9cpdQGAbk+QmqkhSVK5 mB9m6HLHMQtXiiCI95BTql9cS53gzzg4t5pf5a8ePWKXGOQLd7YLFfi8LpvdRiJZEYufac L8vE97g4qTyf/9tE08WjraKHrMre5HE= Received: by mail-pl1-f178.google.com with SMTP id d9443c01a7336-1ed41eb3382so3746615ad.0 for ; Tue, 21 May 2024 10:59:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1716314365; x=1716919165; 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=HoU7u37LEqiKMvTwMcWIhl1CMsKNqyGd6b1OjrYrw/OCynL9c3j28IZGU0b15xN1Tf f3TNNuT4NihRKTRhA/2AWwMAjnPWgL6K5gIyhSxlXf/TEqh23HZIUgkBEV5+OOuSMCn4 KSKCzgUUdiTDXfSs1FUo/z5ywZ0iaDx2nTkc2yfKikwrTZDkOpZm87EXY+H7+cWfeNQn JJNAt4trNOS2q06GcauJOeehO8tA1WvYK+vTFCYicCszEJY4pvoKGTSPO3Uvw/FPRqOz WT7Gcwnlm5yXKoQO2+GcuIYSwPK8AB7WksD/MbZIUfzx+wNLqpi66UAL99HQDzhkvciz RVyA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1716314365; x=1716919165; 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=W07W6Ttbs42dy0pvrZ8ORfUoPksJoKYJdjLCxzcxtfYgvfTSKjP1cgSanuZZzJ3oGC SXkBAQzcpUN1wK2FFMg9S8K4vwLSV3jE5brvIsZ8XrQCANplTrLgSExepRjkDledvEyU YMA2CYESESEAdspvwwKp+U+ugb61Cx8oEx2fD+tNfriTzaaQlpqfuXJjFaIRrZesHAAZ MyfHY/o1CpgSPdDHBG/97VG959IKpKsq82PHHpXAM5flEQKjK4qX3QThBMTyEKt3SDPy +MR8wTw3QszhaX02GuIY5f6/NWnFKZpQvYkJ1yymd3hvH+CU69CBsN3XFoT3bB4MrBzH VNLg== X-Gm-Message-State: AOJu0YzRZRJLikWC8YvKl6zf3pmtWC3Q33mpiIin6wIF5XMu6QIt+6AJ h85LWHsjIbbc0qDF2jAGOi1EiQ3HcYwidzN6DgXXFJLote0iVhiZq+txPV3bUfs= X-Google-Smtp-Source: AGHT+IF1cRebeOkZju1vxHpZ1ZTdsLqq2r6EkmnYiCv6kOq5t90eVHUHeUPz1jz1sKsUOH9AfM/KuQ== X-Received: by 2002:a17:902:760e:b0:1e5:a025:12f9 with SMTP id d9443c01a7336-1ef43d2836fmr395328615ad.28.1716314364758; Tue, 21 May 2024 10:59:24 -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.20 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Tue, 21 May 2024 10:59:24 -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 v6 05/11] afs: drop usage of folio_file_pos Date: Wed, 22 May 2024 01:58:47 +0800 Message-ID: <20240521175854.96038-6-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: 431A340002 X-Stat-Signature: xrzy6giz7kpp4oz1ehnkqzk8yyydjkqc X-Rspam-User: X-Rspamd-Server: rspam08 X-HE-Tag: 1716314366-410358 X-HE-Meta: U2FsdGVkX1/Cq/81C0aWGcWw24KCGKKCD94MC6a9LO8s9XuBR6Cc1p2H53XDiKn4i190mM1X66GV1rQdWwTubOjWnko+ZSkhco0cDiJS2RNHNjWuXTM6iVBTv7eVs8jO+02S4riz9STqtKvnmVsCUF6ciL7BEx094B8gI3lgMGF4e9rrmk2NSMT9EzN7LosCJBDfTQo/6oVE5bf5r/emUw/Or/D0XfWdPD7wQFT0MJNMra279M0GFiPQhdLDIttNwSYzXM6z9ATBz4AqTL/Nvujj+yhnbz0nXLrnh5uHunD6R782sK/zGMHK457NpKRmBRTwKpADSM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4+V02/dvv4twutKppylQwaGPuOveumscYCPIvvCxpMZ2ccM292sKgcXhw4XcqsZcXGh6WD2pApVN7ahyIz7QyfpRjMe5B9QsAtF1yZO15e9yM2Vq7iqkf2THD/XxG1LXWvU0hGmH/iA1CFTJ8hdOCnRlG5kJk79UaCf5bj6phKxH6cTN/kijn4nLyEu88qbLWGZ9YDn6vbT7Qkb4LilQX2Xd+spvF9rW2IL4OYVIFrexesV3+5U7Muce2BWdHY+sPVT2jlSeKJbAUwUpf6GGnLU3AvCoE01lvQmg1jyeWbdlPPqK6SyktVyoRJJ5qufAL0b1tp4sj7tPc+KspRNV0toAgZCERAP/nm9yHaQ2zR40ilt2GnE4CmLwE8Xb7kaUHSeni6YESQJ51ysnU+L+V/AlsQ+RmfQZ8fvmJIVthmEgnkVUCfMzV21uYRDMYcdBjAIiE1ltGWoH6z34SZCb606LSSuxzktQ/DrM7wuLx26WTvSri1FQQeu2u0r7r+e0AESrIlaUrWzzSuCfNEl6MdwhO5nnMaKFBAnqA= 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))