Received: by 2002:ab2:6a05:0:b0:1f8:1780:a4ed with SMTP id w5csp450232lqo; Fri, 10 May 2024 05:11:57 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWa5G8rHsH/vmU2M1fjBLzqqX2N/zTTTFRfs2wQuiw5wUcGMnoWt9Kb3X1APWYpcG/5eQoanWjLB0TylGBuKs79wEiiLMUJvT2RagemLw== X-Google-Smtp-Source: AGHT+IHP9MdEhMeazMzMekM3IEspOsd2DDi8eYihxg34Dl5IurijOtBGcBbxP8pUz+VJQDKYm2F+ X-Received: by 2002:a05:6358:341c:b0:17e:69a1:a797 with SMTP id e5c5f4694b2df-193bd00a8d3mr242990355d.30.1715343117245; Fri, 10 May 2024 05:11:57 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1715343117; cv=pass; d=google.com; s=arc-20160816; b=NmOrsq4sC/xrji1kUGndxv/p95tPRzJKPdTN+WJ+Iwydd9jwHBFsuZqtnLY2LqMztI bUKJypL8Q5CqwCjzhmBDhH+i/TOA74/z8DS5ftDdnrvB+JutUOjh+2tj+qd9IRHIDGE7 gsRv70yCQws9inRqrpgmZvELJI/pelWMAxXddsXVzPaRxEJRfH2/DdSqno6srXxfEco1 d6aOouXTGV5kM5MTkvSEIjSDs5jLrUPq+ZaC9yw1w7zlAjK3KPZgnkhVNSw3f090VQDy 0OthAWiAU4SfIC2xLRDw8rD/vLPMXyqBTmcyEemLAsj939nl+urWbI5hELSmclXDIXb1 NAww== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:reply-to:references:in-reply-to :message-id:date:subject:cc:to:from:dkim-signature; bh=P42QJurgga8X3tClV+VU5iyd0pTaBz/Ss0EAkzfZsy4=; fh=bIY840eY7B0fOSkjKMWGpC9OOiCXhjx6zu9LtchQCag=; b=wBSEKvla0HB/G5980UJklrcVjs8XIw8TeVGAO6bqZ3pKYi3o1r3AbCGZJjRE+lfL8R xcsixmgIbOGvH4Kz0Gnh87hxgNefDL/6ezTRqbYlzeXK28VUfkWX4NX+a2qzX28m77u8 CeHqhrlEr7tV4fdKXeFd8Gn6gGv9s5e0N5uuTBKq/xkrmUoo2OmTIwwKTvwCx/3UQ+Rl Si05jsqtViwevpFpL4CDK6r1FglTukkBaYBYJGY4QgaArelLS9bNR83c6tyPYSt91hcz VGgXxtYav0LvBqfts6xWFqwRXjKadl3naZiOGUGr6C/d4Bdurx8ds51E5LNf3Wos7ULf N8Cg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=F7S6kZ7B; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com dmarc=pass fromdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-175711-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-175711-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [147.75.48.161]) by mx.google.com with ESMTPS id 41be03b00d2f7-6341180dc7dsi3476214a12.500.2024.05.10.05.11.56 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 10 May 2024 05:11:57 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-175711-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) client-ip=147.75.48.161; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=F7S6kZ7B; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com dmarc=pass fromdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-175711-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-175711-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sy.mirrors.kernel.org (Postfix) with ESMTPS id 9619BB251C4 for ; Fri, 10 May 2024 11:51:51 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 2576817165C; Fri, 10 May 2024 11:50:20 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="F7S6kZ7B" Received: from mail-pf1-f179.google.com (mail-pf1-f179.google.com [209.85.210.179]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id F194516F26B; Fri, 10 May 2024 11:50:17 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.210.179 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715341819; cv=none; b=XbRp1Qw4k68mr4F1glwHaFDD+JjUj/jJRrOlh1MruoEg11cIadjBkzlCDJHqjQSj+7JNZAhnFwg/Z61/R1ifVVkKDKIE+pvboN/LWyE3A6qjyBt89/WGsb1Vax1qoLnk3/p2PIj0AjAwIWPBnvM6g3Jrt4/kO0VFgC3Y0dUPY+o= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715341819; c=relaxed/simple; bh=1MRIiBP0wDFyNfh4532Vxucv6112mEx/goVx7Jaownk=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=DTwZYE+HiAvGPWuF0QJwZWmm/2cN0P14eolcGWeTojX6aYdIfuJF4GGzQTBQh18oo5uka6Sf2m4WZzsD7aOGrzGpc6y1OzZAkzkf558M54ifuOgzJZKVf48sq51ZMXtdu8wvEczN61+TkA2XR6phOcT/OgNosd0S/JpcVbSkTRw= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=F7S6kZ7B; arc=none smtp.client-ip=209.85.210.179 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-pf1-f179.google.com with SMTP id d2e1a72fcca58-6f44e3fd382so1692418b3a.1; Fri, 10 May 2024 04:50:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1715341817; x=1715946617; darn=vger.kernel.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=F7S6kZ7Br8XjhqdCitErqbXDQ+GeQ0BadVuNOcCxLvZLCcKYFtmCDbEwTAV3xoVrpv IkCVTAzMXlOhnQqaIzcnfsDcu9ZUFMQauFIbJvQgt+jMjETTArJplzhoqlRxuoVASsbf cmUFRI6mZVxRfCOmMQk8ry+oKL5EUCOvv2AbGoH3dWzl4qRyvqmSgo1/Mq4wMRCs3kWM H81rSZXhjlFnVfFFgDwj+YWCTtksVncbZJNP1lB+H2e7gK7s9aOBrZS1+5pDpJsPPIc/ pploIPt6SvA7+XiCUFZiDMqOumvv4f7Bp4YPE7QlzEZxU+1mK79xB7nt36tRZ776XMTg 7uxA== 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=fng64SkjMlzftBfoqOTVqvqrtKT10LHwqX/6VkTKJVwEjH9Ku+MUrntijoD4gjheD4 KWNH8tjUB5UZIBi5lLwAba38i8D0uoUSOEa0XSpRDrkVncTquHsdwGx0sDkm30Y+iDug lt6zHi/LJFfhYowpbgn2DDOGwtD3qYwfzWdsRik1qQ2CY4RKw68KLCcRARCSqqeL0VGQ GKrxqp9uwzoyB2vlvVW8QJZr7HLXwbdkwmC3ncLE3Z3NsqYYghpkRL3tF9u2Fdkexcir Atwd1qCHSEhF5qC2hKMNLs7O8XQa/pYBWMyXO8kqz4Uf7YqiB4SPZOnsHurzBHlY5Qxl UFgw== X-Forwarded-Encrypted: i=1; AJvYcCW45tSyDld0mij1MGoQgzSxpzNLyibnlhqvbTK/SyXA0aFuGfTDWPtGMfd+m+Rsrwos1cF7H3o0t8OG6RLrVBZmn2/UDD+sWZVlcbpHIS3lqFLMxCw0mRJCNezjr2cuwbh6iZdZWyk7MWMl3g== X-Gm-Message-State: AOJu0YzBc197nYnjtcbKeY8rDD+BYPspMA4P6GzjJZHDjQgVW42+yAmq nqzmqNKtDVw4KRi72z27Hy8UxMTIEZuH0HjxH+cX3tpxwjb6B69B 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 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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)) -- 2.45.0