]> git.apps.os.sepia.ceph.com Git - xfsprogs-dev.git/commitdiff
xfs: make the seq argument to xfs_bmapi_convert_delalloc() optional
authorZhang Yi <yi.zhang@huawei.com>
Mon, 29 Jul 2024 23:22:54 +0000 (16:22 -0700)
committerDarrick J. Wong <djwong@kernel.org>
Tue, 30 Jul 2024 00:01:04 +0000 (17:01 -0700)
Source kernel commit: fc8d0ba0ff5fe4700fa02008b7751ec6b84b7677

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>
libxfs/xfs_bmap.c

index def73fd50742c234aec197861da584eeab19f28f..33d0764a0a8418957b97d50fb51237ff1ba0cf6a 100644 (file)
@@ -4642,7 +4642,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;
        }
 
@@ -4693,7 +4694,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);