Received: by 2002:a89:48b:0:b0:1f5:f2ab:c469 with SMTP id a11csp1108572lqd; Thu, 25 Apr 2024 06:23:54 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCUxj3wKUrJe1ldE+PJSwn+gjN3wFh+PGE+lb8uVdEjLS/SMQTjrVtbSwpN4EDDKCeJAJ6hy743LTwKvpw+Rzs0lWIeeoE21bO/DBZbnwA== X-Google-Smtp-Source: AGHT+IEOOkbK4URUbIxL0IK1UMNb68cdJsmY6YOLm4N1bbo++vbfd4DSz6aJOIcBHacf030RNiib X-Received: by 2002:a17:907:e94:b0:a58:8613:13a6 with SMTP id ho20-20020a1709070e9400b00a58861313a6mr5379647ejc.0.1714051434700; Thu, 25 Apr 2024 06:23:54 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1714051434; cv=pass; d=google.com; s=arc-20160816; b=bljys9+DdA349SqZirsJXoeDkJgLUWU1Y8EBwBxAUCENwSvX2YSfBiFmXo5PaXqwCG tZMwGQ4VW+XPa1qdjMVQaE2ku68VSuwd0PTWQ5eNc5QSz5KxQ8xrwHTCyBMTcSkIsS5S Y3otzqCuYYSOTqW9CzNJiJqgbz5IymivRGDt6RXTg6tyET2epQBxJnzjihXxzkG+GG4i FnI1yLlSuA+7mB+FYZnz/AAKiD1a8d26isM6EKgg8VjB/a1DEOOPiXRGM3RqHJ0kH85F YhRJo0owGKuaidpE+whc4naAFC/EE8NCQ5bV8fiS+28ZTjJryoUnt8LzE8TuZHoyL5CY GqLQ== 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:references:in-reply-to:message-id :date:subject:cc:to:from; bh=XW6iblOsqSAoW7dX3SyEhw+sJOuGdUpv+i8D40ucesI=; fh=gVqSn+gMOZkzbuzl7fujuMh2YVkiKU3c6mFoNhCnODI=; b=hzu9fJM382ivQGCQHF30RLsKEkNrEyUGdYYFnwoohcgFZcMBnUMhACkFqE5zVyv5AM pmsKXtXvt7l+Cs4RRZ9YspaLl9thoH8eOa15KWoQgpWjRpzfEP9kUhzyTBc/m6SZ8AAD 2qFmuShhkCFq2KVW5/N/yXdHUgHvuS5YdnHmx2F9tBGYVxzoDIRhcGAQqoIbx8vIEWjv L2TJoSNLSwuhWbwsrWleMVprByTxSOlLp3HWPEFrwkE4zDl1g8vpD5ttzbYN/A2rTv2y 9d0Wq4PuQiAhzT6ZL9xziWtYCPebnw3XPJzPbpsvmuIG0N8WXnjwyASSZEQitUaAgIvS nehQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1 spf=pass spfdomain=huaweicloud.com); spf=pass (google.com: domain of linux-kernel+bounces-158586-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-158586-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id y25-20020a1709063a9900b00a4e6bfb0a89si9743850ejd.312.2024.04.25.06.23.54 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 25 Apr 2024 06:23:54 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-158586-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; arc=pass (i=1 spf=pass spfdomain=huaweicloud.com); spf=pass (google.com: domain of linux-kernel+bounces-158586-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-158586-linux.lists.archive=gmail.com@vger.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 am.mirrors.kernel.org (Postfix) with ESMTPS id 6E8CF1F278C9 for ; Thu, 25 Apr 2024 13:23:54 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 7D5B314A09A; Thu, 25 Apr 2024 13:23:09 +0000 (UTC) Received: from dggsgout12.his.huawei.com (unknown [45.249.212.56]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 96681149C78; Thu, 25 Apr 2024 13:23:07 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=45.249.212.56 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714051388; cv=none; b=CiOfcMDwE635nO9T4Maa903nFNQvq0vPUIP7Y5k2mkYYTJVOjIvDkbqHfWmev/xJx52Cutqfrd0P+UYDsEIvue9iwEFpzzF2luAqtfarR9j4J/o2wRpsdMHfy0xS4Vv55zHegSjxjB3CBGpUgDcLAMjknt/M18hFr0yZGc3gSrM= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714051388; c=relaxed/simple; bh=YYgJYc9k7nSPDrt0nETOz+OlbA353EOqoTJA7r013QY=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=tlfz/5Ky0s7rOjDEB2quP/l4xCm5XGnJ6gQ/n9dfJaw1U1qTOqIGE3T5aA17yxPGnVTTQRZbWjacCwFiVgvAz7J+dVOxRFeEW79dPGVlx1HxsqpflZwU5H2c35dMOEZs4Yx5cGkLfgA+zFXWfHj4Tx/Em2ufpAv0F/z7w+BOuzs= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=huaweicloud.com; spf=pass smtp.mailfrom=huaweicloud.com; arc=none smtp.client-ip=45.249.212.56 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=huaweicloud.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=huaweicloud.com Received: from mail.maildlp.com (unknown [172.19.163.216]) by dggsgout12.his.huawei.com (SkyGuard) with ESMTP id 4VQGkS50CCz4f3khg; Thu, 25 Apr 2024 21:22:56 +0800 (CST) Received: from mail02.huawei.com (unknown [10.116.40.112]) by mail.maildlp.com (Postfix) with ESMTP id 4D9E11A111D; Thu, 25 Apr 2024 21:23:04 +0800 (CST) Received: from huaweicloud.com (unknown [10.175.104.67]) by APP1 (Coremail) with SMTP id cCh0CgCXaBEqWSpmHu+2Kw--.61462S6; Thu, 25 Apr 2024 21:23:04 +0800 (CST) From: Zhang Yi To: linux-xfs@vger.kernel.org, linux-fsdevel@vger.kernel.org Cc: linux-kernel@vger.kernel.org, djwong@kernel.org, hch@infradead.org, brauner@kernel.org, david@fromorbit.com, chandanbabu@kernel.org, tytso@mit.edu, jack@suse.cz, yi.zhang@huawei.com, yi.zhang@huaweicloud.com, chengzhihao1@huawei.com, yukuai3@huawei.com Subject: [PATCH v5 2/9] xfs: make the seq argument to xfs_bmapi_convert_delalloc() optional Date: Thu, 25 Apr 2024 21:13:28 +0800 Message-Id: <20240425131335.878454-3-yi.zhang@huaweicloud.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240425131335.878454-1-yi.zhang@huaweicloud.com> References: <20240425131335.878454-1-yi.zhang@huaweicloud.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-CM-TRANSID:cCh0CgCXaBEqWSpmHu+2Kw--.61462S6 X-Coremail-Antispam: 1UD129KBjvJXoW7Ww45uFy8Ww4DtF43CFWrAFb_yoW8JF43pF s7G34UWFZ3Zw4SvF4kJF15Wa1ft3Z2ka48AFs7Zwn3ZanrAr1aqr4rKFyFqw1UAw4FqF18 WF13Cr1UW3y5Aa7anT9S1TB71UUUUUUqnTZGkaVYY2UrUUUUjbIjqfuFe4nvWSU5nxnvy2 9KBjDU0xBIdaVrnRJUUUBE14x267AKxVWrJVCq3wAFc2x0x2IEx4CE42xK8VAvwI8IcIk0 rVWrJVCq3wAFIxvE14AKwVWUJVWUGwA2048vs2IY020E87I2jVAFwI0_Jryl82xGYIkIc2 x26xkF7I0E14v26ryj6s0DM28lY4IEw2IIxxk0rwA2F7IY1VAKz4vEj48ve4kI8wA2z4x0 Y4vE2Ix0cI8IcVAFwI0_Ar0_tr1l84ACjcxK6xIIjxv20xvEc7CjxVAFwI0_Gr1j6F4UJw A2z4x0Y4vEx4A2jsIE14v26rxl6s0DM28EF7xvwVC2z280aVCY1x0267AKxVW0oVCq3wAS 0I0E0xvYzxvE52x082IY62kv0487Mc02F40EFcxC0VAKzVAqx4xG6I80ewAv7VC0I7IYx2 IY67AKxVWUJVWUGwAv7VC2z280aVAFwI0_Jr0_Gr1lOx8S6xCaFVCjc4AY6r1j6r4UM4x0 Y48IcxkI7VAKI48JM4x0x7Aq67IIx4CEVc8vx2IErcIFxwACI402YVCY1x02628vn2kIc2 xKxwCF04k20xvY0x0EwIxGrwCFx2IqxVCFs4IE7xkEbVWUJVW8JwC20s026c02F40E14v2 6r1j6r18MI8I3I0E7480Y4vE14v26r106r1rMI8E67AF67kF1VAFwI0_Jw0_GFylIxkGc2 Ij64vIr41lIxAIcVC0I7IYx2IY67AKxVWUJVWUCwCI42IY6xIIjxv20xvEc7CjxVAFwI0_ Gr0_Cr1lIxAIcVCF04k26cxKx2IYs7xG6r1j6r1xMIIF0xvEx4A2jsIE14v26r1j6r4UMI IF0xvEx4A2jsIEc7CjxVAFwI0_Gr0_Gr1UYxBIdaVFxhVjvjDU0xZFpf9x0JUHbyAUUUUU = X-CM-SenderInfo: d1lo6xhdqjqx5xdzvxpfor3voofrz/ From: Zhang Yi Allow callers to pass a NULLL seq argument if they don't care about the fork sequence number. Signed-off-by: Zhang Yi Reviewed-by: Christoph Hellwig Reviewed-by: Darrick J. Wong --- fs/xfs/libxfs/xfs_bmap.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/fs/xfs/libxfs/xfs_bmap.c b/fs/xfs/libxfs/xfs_bmap.c index 656c95a22f2e..9783ddb337d2 100644 --- a/fs/xfs/libxfs/xfs_bmap.c +++ b/fs/xfs/libxfs/xfs_bmap.c @@ -4657,7 +4657,8 @@ xfs_bmapi_convert_delalloc( if (!isnullstartblock(bma.got.br_startblock)) { xfs_bmbt_to_iomap(ip, iomap, &bma.got, 0, flags, xfs_iomap_inode_sequence(ip, flags)); - *seq = READ_ONCE(ifp->if_seq); + if (seq) + *seq = READ_ONCE(ifp->if_seq); goto out_trans_cancel; } @@ -4708,7 +4709,8 @@ xfs_bmapi_convert_delalloc( ASSERT(!isnullstartblock(bma.got.br_startblock)); xfs_bmbt_to_iomap(ip, iomap, &bma.got, 0, flags, xfs_iomap_inode_sequence(ip, flags)); - *seq = READ_ONCE(ifp->if_seq); + if (seq) + *seq = READ_ONCE(ifp->if_seq); if (whichfork == XFS_COW_FORK) xfs_refcount_alloc_cow_extent(tp, bma.blkno, bma.length); -- 2.39.2