]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
xfs: use XFS_BUF_DADDR_NULL for daddrs in getfsmap code
authorDarrick J. Wong <djwong@kernel.org>
Wed, 11 Jun 2025 21:01:25 +0000 (14:01 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 27 Jun 2025 10:07:20 +0000 (11:07 +0100)
[ Upstream commit 6b35cc8d9239569700cc7cc737c8ed40b8b9cfdb ]

Use XFS_BUF_DADDR_NULL (instead of a magic sentinel value) to mean "this
field is null" like the rest of xfs.

Cc: wozizhi@huawei.com
Fixes: e89c041338ed6 ("xfs: implement the GETFSMAP ioctl")
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Darrick J. Wong <djwong@kernel.org>
Signed-off-by: Chandan Babu R <chandanbabu@kernel.org>
Signed-off-by: Leah Rumancik <leah.rumancik@gmail.com>
Acked-by: "Darrick J. Wong" <djwong@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
fs/xfs/xfs_fsmap.c

index 1efd18437ca4c4dc82a24ed4388c831b42010141..a0668a1ef1006cb6e2a0a4af44acf09e66f6e5af 100644 (file)
@@ -252,7 +252,7 @@ xfs_getfsmap_rec_before_start(
        const struct xfs_rmap_irec      *rec,
        xfs_daddr_t                     rec_daddr)
 {
-       if (info->low_daddr != -1ULL)
+       if (info->low_daddr != XFS_BUF_DADDR_NULL)
                return rec_daddr < info->low_daddr;
        if (info->low.rm_blockcount)
                return xfs_rmap_compare(rec, &info->low) < 0;
@@ -986,7 +986,7 @@ xfs_getfsmap(
                info.dev = handlers[i].dev;
                info.last = false;
                info.pag = NULL;
-               info.low_daddr = -1ULL;
+               info.low_daddr = XFS_BUF_DADDR_NULL;
                info.low.rm_blockcount = 0;
                error = handlers[i].fn(tp, dkeys, &info);
                if (error)