Received: by 2002:ab2:620c:0:b0:1ef:ffd0:ce49 with SMTP id o12csp593381lqt; Mon, 18 Mar 2024 18:36:52 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWR9tUuWIpJDWOQFQGqfr+TNJWUbebDURIxyinMrE17ux5HOUixNlNTcaXeImNaBR8i5YunUAeab2orxrHW9kIZHOEFELDC75FvpdEd1w== X-Google-Smtp-Source: AGHT+IF+7yJ5R3hxrd3uzG1Pib0qcOrawmU8nHhv8o8xg9RCfYdBo/xiNX6Yn27Uc502EGYQLQ4d X-Received: by 2002:ac2:4c37:0:b0:513:5c10:309c with SMTP id u23-20020ac24c37000000b005135c10309cmr834994lfq.3.1710812212805; Mon, 18 Mar 2024 18:36:52 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1710812212; cv=pass; d=google.com; s=arc-20160816; b=phwdHtwkgOdWK8//pKnUjdznEPTRoeImo6oCoNyBUhQo0YbYPePtQAQvJ6Pc4/LZRZ XYf3S5Xp1GocHCB8TnG13XGrFx0LS3XLFbH0X1TsowgahudOeiaJVUtk5BKXNuMHAjPK HpQoRvsOkKFPiRxUDXj0ewBhE2Ykx+622/ai9kyP/cmEegFiek2t2d2ooE9qlnm2iaFH x8GnkTAFJ2A6wERCXJn+i5RQnQv+T2EQuCFvoKdCWaE5ELTB4DvQ4xGly7d30Uhe44WN VEuH81Uu/FDhq2q7BrDWAIm2Z2f5XuBEt618tqnPiuqbnaAdvvFHFmq39pdXyhAFmDLQ pCSA== 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=SwLAHrDlvDrYDo7Fh3+llSljc9+tcSUNzkl80CLe9gE=; fh=5dB93T9RUScPXiJBPgMY9ddAKXpKWIKqxrLOkZR5g5k=; b=g43EtnmUXbXf5yYUt6XNeU8RZWMFI+5fDJhcyE4bRcQl0aqWt1uu+0qYhVPnQ4kOI4 z3ATuW1irfZpb+G88PabRNtiQe5OS3CEA1aFqworMH5U1hyEgNfDmuU8xh9EHrLR9PNi unXfQuwnbVf52kAb7jgRgyTGYaVvt5ccAMhprdAk9Dl3plVm9/mIR0SnJnUpIr8tFmvT 64sfgZRVTW/HL/KBcNG5aMFPRSNbW31ZkXc5SD6X3Li6dFYMTMVfS+NXOXWPd/v7cSsW UYhGpeanSnLmIuJQFiSDJFN9W7FF8cZgTJfCMP+bNrh6GYrUUPdZbbmLkoX/MmYMZR65 8wLQ==; 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-106888-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-106888-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id a9-20020a1709064a4900b00a45acb1955csi4810393ejv.736.2024.03.18.18.36.52 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 18 Mar 2024 18:36:52 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-106888-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; arc=pass (i=1 spf=pass spfdomain=huaweicloud.com); spf=pass (google.com: domain of linux-kernel+bounces-106888-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-106888-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 2048D1F20628 for ; Tue, 19 Mar 2024 01:36:51 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 41400657B0; Tue, 19 Mar 2024 01:36:20 +0000 (UTC) Received: from dggsgout11.his.huawei.com (unknown [45.249.212.51]) (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 AD555627F8; Tue, 19 Mar 2024 01:36:17 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=45.249.212.51 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710812179; cv=none; b=JJWCdq60WYkhCmbV3rEEsLmXr24nV2UXoF72TgDvLqtp/ML/nPH+ABr0xDdnLIcjInz5XajYN7qVa5ZtWleD3JHkXghY1vQGGoBrxBYyA8dzZtsdgrBo7PZFGwfVB1nzEDcXun5xuchSx0KlqEctnV5qgmLJ2/3bc/Irwjp7TUM= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710812179; c=relaxed/simple; bh=HsCNfrBJCmBes5k19aRX+ww2bJfpG010GSZURLUeilU=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=DM9y5IKs2IkUdj43XsPHtfXtapmjivGrmFRph2gV/HhJeJ8dzGKSsqvxq3mSGJSRETYuOu3yg+M2gZuSidRa7RS2zN9vcWcGePYEOtIx7hh8pzA1jWClz+qlai0m4SdGT6syc3HE7iVxmK03E2Qx73nEpqZJSiNvqlc9fEEZZgg= 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.51 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 dggsgout11.his.huawei.com (SkyGuard) with ESMTP id 4TzDPd28cqz4f3kJx; Tue, 19 Mar 2024 09:18:29 +0800 (CST) Received: from mail02.huawei.com (unknown [10.116.40.112]) by mail.maildlp.com (Postfix) with ESMTP id 24B3A1A019F; Tue, 19 Mar 2024 09:18:33 +0800 (CST) Received: from huaweicloud.com (unknown [10.175.104.67]) by APP1 (Coremail) with SMTP id cCh0CgAn9g7O5_hlUIGNHQ--.34497S6; Tue, 19 Mar 2024 09:18:32 +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, tytso@mit.edu, jack@suse.cz, yi.zhang@huawei.com, yi.zhang@huaweicloud.com, chengzhihao1@huawei.com, yukuai3@huawei.com Subject: [PATCH v3 2/9] xfs: make the seq argument to xfs_bmapi_convert_delalloc() optional Date: Tue, 19 Mar 2024 09:10:55 +0800 Message-Id: <20240319011102.2929635-3-yi.zhang@huaweicloud.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240319011102.2929635-1-yi.zhang@huaweicloud.com> References: <20240319011102.2929635-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:cCh0CgAn9g7O5_hlUIGNHQ--.34497S6 X-Coremail-Antispam: 1UD129KBjvJXoW7GF4fKr4xtFy5Jr13JF47Arb_yoW8Jr45pF s7G34UGFZ3Xw4avF4kJF15Wa1fJ3Z2ka40yFs7Zwn3ZanrAr4aqr1rKFyYqw1UAw4FqF18 WF13Cr17Xw45Aa7anT9S1TB71UUUUUUqnTZGkaVYY2UrUUUUjbIjqfuFe4nvWSU5nxnvy2 9KBjDU0xBIdaVrnRJUUUBE14x267AKxVWrJVCq3wAFc2x0x2IEx4CE42xK8VAvwI8IcIk0 rVWrJVCq3wAFIxvE14AKwVWUJVWUGwA2048vs2IY020E87I2jVAFwI0_Jryl82xGYIkIc2 x26xkF7I0E14v26ryj6s0DM28lY4IEw2IIxxk0rwA2F7IY1VAKz4vEj48ve4kI8wA2z4x0 Y4vE2Ix0cI8IcVAFwI0_tr0E3s1l84ACjcxK6xIIjxv20xvEc7CjxVAFwI0_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 --- 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 f362345467fa..07dc35de8ce5 100644 --- a/fs/xfs/libxfs/xfs_bmap.c +++ b/fs/xfs/libxfs/xfs_bmap.c @@ -4574,7 +4574,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; } @@ -4623,7 +4624,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