xfs: make the seq argument to xfs_bmapi_convert_delalloc() optional
authorZhang Yi <yi.zhang@huawei.com>
Thu, 25 Apr 2024 13:13:28 +0000 (21:13 +0800)
committerChandan Babu R <chandanbabu@kernel.org>
Mon, 29 Apr 2024 11:53:11 +0000 (17:23 +0530)
Allow callers to pass a NULLL seq argument if they don't care about
the fork sequence number.

Signed-off-by: Zhang Yi <yi.zhang@huawei.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: "Darrick J. Wong" <djwong@kernel.org>
Signed-off-by: Chandan Babu R <chandanbabu@kernel.org>
fs/xfs/libxfs/xfs_bmap.c

index 6053f5e5c71eec7c45b1f1413bde2aa17780ed7d..c9b1dfe639444ae7f5aafe432dc0b366ecaec2f6 100644 (file)
@@ -4648,7 +4648,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;
        }
 
@@ -4699,7 +4700,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);