Received: by 2002:ab2:6d45:0:b0:1fb:d597:ff75 with SMTP id d5csp338560lqr; Wed, 5 Jun 2024 07:36:27 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXetix2ZGCELczi2qBJS0K1+Lul12JYWNl9qRfCABBtHkG/BAC0rv/bTgTlGReJVswze2aMBeVtvp5rO27zbyTYxMPKKAC6/vUZ/qoYVg== X-Google-Smtp-Source: AGHT+IFM+zMlhVBnSt4YsrckMt9bZnPRAZNFnW+mAkCYoqqTzMUf8K3sPBc0gyNQU1189zVOLmHg X-Received: by 2002:a17:902:d503:b0:1f6:7a56:eefd with SMTP id d9443c01a7336-1f6a5a84875mr34242205ad.63.1717598186947; Wed, 05 Jun 2024 07:36:26 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1717598186; cv=pass; d=google.com; s=arc-20160816; b=VSb7veJnTS91jXd2HNARNRr02hLi1JBWzFqY+pBTgYdg4iX62wTZ9kw4cXaGlmqB9F Y92+yMwczB+M2+LpqVa/OOuS2Bi1zCFIt0pUgMA008BPyYEjIfyxcdZcgGARskivpUEW BoWcWGlOdYxIYaJod0i3+wzDoH1Y5epq5KeU7DWNihxqg8/7Dw3WpFtPsm7AvgVW8Nan myOPM2d1VaIQfkISjUBdoLfVz2z7gIERHAlX8J80PolP17nrXb00V4EL8Gs3vyPCZDF5 6mMDzI3OM/TxokhLDREeS9UGBl0hGPf5K1aOxwCUB9WAQZU9GK54tgaKk3PrkETwJNt9 YSiw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:list-unsubscribe:list-subscribe:list-id:precedence :subject:date:from; bh=lIYhLPhDACS5S3WiEv4gpp9ka+wmTQUeOJx3H2AvDpY=; fh=rGNDJZb1nSiEdfyWc06+mRz8yQWgtAYCce7RLeLNqQ4=; b=yHnNdgOLi+KdpmC/G+wqD5b/c8o1G3mQf/Ka1Qhc7GvFNc7RPojbKgZn6KY89jDyK+ ZAyg9vGnbxGRb3Mq/oK5j7JKiCyDRgadjKbDjfJgk+DbMhyjTeuvwavI6J4Fv9mtqvSu tIaX0RHgmSPRqXC0h6vjVvyzF6ff4b+0UnB2UdlMvfZgdi8lMGDLj+JJpp506fu/VKot FiT1QWz3Cl6AZ9GEmUtLbqGg/48+8NNoEkXVaAO5ncJ8m2eqngqGayiihzd8jfTFGEq2 jiLnk2iv2hNOodMvN4SNog3kmV9qGzN5Ru2PJBdCaoJ3e6RyP6BiQpK/8HHcljcul+vp rpkA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1 spf=pass spfdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-202690-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-202690-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [147.75.48.161]) by mx.google.com with ESMTPS id d9443c01a7336-1f63233d3fcsi4527395ad.56.2024.06.05.07.36.26 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 05 Jun 2024 07:36:26 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-202690-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; arc=pass (i=1 spf=pass spfdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-202690-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-202690-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org 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 6A1BDB2C466 for ; Wed, 5 Jun 2024 13:40:34 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 6E4C119938D; Wed, 5 Jun 2024 13:17:59 +0000 (UTC) Received: from mail-ed1-f45.google.com (mail-ed1-f45.google.com [209.85.208.45]) (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 40749197A8F; Wed, 5 Jun 2024 13:17:57 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.208.45 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717593478; cv=none; b=WSTVBylD/mIpqgtF9O9IxgAabAzxpzyalfUZ6BYLRfSeIZjBKzyOzeZLNM8x7ilzcmd6fHygZWYG+e63E3tVamBTW6MZORopCIXcs/hGcI1MnfZce3d0CsJht6gso5PzDdiAmR3gYh9xeUo6/TG6ds+DMdNgrH/H9UsA9+PdGkA= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717593478; c=relaxed/simple; bh=WDUz7fG6FfIJIZkudiSnKmkmX/Ia1bOQENtWWLof9SY=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=KS6X+SMCM0Di/YRtBFEi5ot1SCABGo2jF/Kmp/ScOZP15O7ubwh++WGt7IKkhwssZdz1KIy3wqLTtVxK7oWPmVdm1Ua7x8sjwI6bnp0DVD5oO4prKP++m4JdTwajsr9xCLSxKSipLlYDoTNVgW4IqMUZofoI1QT1I/21v+FjIeE= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org; spf=pass smtp.mailfrom=gmail.com; arc=none smtp.client-ip=209.85.208.45 Authentication-Results: smtp.subspace.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-ed1-f45.google.com with SMTP id 4fb4d7f45d1cf-57a1fe63a96so6559548a12.0; Wed, 05 Jun 2024 06:17:56 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1717593475; x=1718198275; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=lIYhLPhDACS5S3WiEv4gpp9ka+wmTQUeOJx3H2AvDpY=; b=w+SwiKz/abeX1C45N+M8aVkYaaQcg6bKclGzad12YoX7deOMtkqbO/JSJPZA4Il347 BA7jYK3nAFjxURHk+0Ic2EM42rrjuxw7NvkJAMBR6E1OC7PVNxd1Pc2GCd+oXutZF2eh SQrjVBuYyBp+kVVQdA9/MCR+2LG3kmLaX9bAH/2zkwO75M7lNe7oVflfTntpNatcBVMx 0nK+XqxoOvfxZKsIhhoYlGl/0gPGGQKJ5l2Jqh6a/x+PmhW6M7Urdff2MRbrh5Shffh9 dWYX3T13HkNMvdiZ1/z+rfL53L+8Gwb2qeKJDGelm4GZscvm3PM11yWF1i5k+o8PU+ns H6Bg== X-Forwarded-Encrypted: i=1; AJvYcCUURfm7RjXjJl+Xo83q1CNed8ZL6C/ouMge+0LE17gs8nyJVDE9eZCkzC8wvQEkLGFGLHGbhZ0TH8wbV2LgzEDZBxG4BF0zaOu0Zk6S X-Gm-Message-State: AOJu0Yw8rD2wFY+wtZQZcsHiFXF6KMDP0pAz+CKKfotynRDq82XwiHwq Tdh8uwVP+b2pIhyXBZQscVE572gMgedilPV6V8+j7m68WPLPq/pv X-Received: by 2002:a50:aac4:0:b0:57a:2417:5ef4 with SMTP id 4fb4d7f45d1cf-57a8b6aa068mr1677660a12.17.1717593475378; Wed, 05 Jun 2024 06:17:55 -0700 (PDT) Received: from [127.0.0.1] (p200300f6f7253800fa633ffffe02074c.dip0.t-ipconnect.de. [2003:f6:f725:3800:fa63:3fff:fe02:74c]) by smtp.gmail.com with ESMTPSA id 4fb4d7f45d1cf-57a31b99a3fsm9266913a12.9.2024.06.05.06.17.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 05 Jun 2024 06:17:55 -0700 (PDT) From: Johannes Thumshirn Date: Wed, 05 Jun 2024 15:17:50 +0200 Subject: [PATCH 2/4] btrfs: pass a reloc_control to relocate_file_extent_cluster Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <20240605-reloc-cleanups-v1-2-9e4a4c47e067@kernel.org> References: <20240605-reloc-cleanups-v1-0-9e4a4c47e067@kernel.org> In-Reply-To: <20240605-reloc-cleanups-v1-0-9e4a4c47e067@kernel.org> To: Chris Mason , Josef Bacik , David Sterba Cc: linux-btrfs@vger.kernel.org, linux-kernel@vger.kernel.org, Johannes Thumshirn X-Mailer: b4 0.12.4 X-Developer-Signature: v=1; a=openpgp-sha256; l=2313; i=jth@kernel.org; h=from:subject:message-id; bh=80TgFMM98ydJfyyVXKV8pIHBUC0TTeyzRxVisoduFMI=; b=owGbwMvMwCV2ad4npfVdsu8YT6slMaQlpDYYrqvLMJD/1Lqr19ncdTvPxY4CezsloUyvXR5Zh f5H/dZ2lLIwiHExyIopshwPtd0vYXqEfcqh12Ywc1iZQIYwcHEKwETSbRn+J4a/j769nenTmXud AufnrgoRFCwQcVnZf2mdvq9z5pzCSIb/8b8F3Zt+bY6/c5Wna5+LUGW+b5/EnflOezlusIpmzNP hAQA= X-Developer-Key: i=jth@kernel.org; a=openpgp; fpr=EC389CABC2C4F25D8600D0D00393969D2D760850 From: Johannes Thumshirn Instead of passing in a reloc_control's data_inode and file_extent_cluster members, pass in the whole reloc_control structure. Signed-off-by: Johannes Thumshirn --- fs/btrfs/relocation.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/fs/btrfs/relocation.c b/fs/btrfs/relocation.c index 442d3c074477..e23220bb2d53 100644 --- a/fs/btrfs/relocation.c +++ b/fs/btrfs/relocation.c @@ -3084,9 +3084,10 @@ static int relocate_one_folio(struct inode *inode, struct file_ra_state *ra, return ret; } -static int relocate_file_extent_cluster(struct inode *inode, - const struct file_extent_cluster *cluster) +static int relocate_file_extent_cluster(struct reloc_control *rc) { + struct inode *inode = rc->data_inode; + const struct file_extent_cluster *cluster = &rc->cluster; u64 offset = BTRFS_I(inode)->reloc_block_group_start; unsigned long index; unsigned long last_index; @@ -3132,7 +3133,7 @@ static noinline_for_stack int relocate_data_extent(struct reloc_control *rc, struct btrfs_root *root = BTRFS_I(inode)->root; if (cluster->nr > 0 && extent_key->objectid != cluster->end + 1) { - ret = relocate_file_extent_cluster(inode, cluster); + ret = relocate_file_extent_cluster(rc); if (ret) return ret; cluster->nr = 0; @@ -3158,7 +3159,7 @@ static noinline_for_stack int relocate_data_extent(struct reloc_control *rc, * the cluster we need to relocate. */ root->relocation_src_root = cluster->owning_root; - ret = relocate_file_extent_cluster(inode, cluster); + ret = relocate_file_extent_cluster(rc); if (ret) return ret; cluster->nr = 0; @@ -3177,7 +3178,7 @@ static noinline_for_stack int relocate_data_extent(struct reloc_control *rc, cluster->nr++; if (cluster->nr >= MAX_EXTENTS) { - ret = relocate_file_extent_cluster(inode, cluster); + ret = relocate_file_extent_cluster(rc); if (ret) return ret; cluster->nr = 0; @@ -3775,8 +3776,7 @@ static noinline_for_stack int relocate_block_group(struct reloc_control *rc) } if (!err) { - ret = relocate_file_extent_cluster(rc->data_inode, - &rc->cluster); + ret = relocate_file_extent_cluster(rc); if (ret < 0) err = ret; } -- 2.43.0