]> git.ipfire.org Git - thirdparty/xfsprogs-dev.git/commitdiff
libxfs: Fix a couple of sparse complaintis
authorCarlos Maiolino <cmaiolino@redhat.com>
Fri, 5 Oct 2018 02:36:09 +0000 (21:36 -0500)
committerEric Sandeen <sandeen@redhat.com>
Fri, 5 Oct 2018 02:36:09 +0000 (21:36 -0500)
Source kernel commit: 5089eafffba2ed444789e5d25c7c0dfd62595713

No significant changes, just silence a couple of sparse errors.

Using cpu_to_be32(NULLAGINO), the NULLAGINO constant will be encoded in
BE as a constant, avoiding a BE -> CPU conversion every iteraction of
the loop, if be32_to_cpu(agi->agi_unlinked[i]) was used instead.

Signed-off-by: Carlos Maiolino <cmaiolino@redhat.com>
Reviewed-by: Bill O'Donnell <billodo@redhat.com>
Reviewed-by: Darrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: Eric Sandeen <sandeen@sandeen.net>
libxfs/xfs_ag_resv.h
libxfs/xfs_ialloc.c

index 4619b554ee90381406363a1f4a7ca3924c7df748..dc953fc84b2fae2253fb15a529baf1aa614d655f 100644 (file)
@@ -28,7 +28,7 @@ xfs_ag_resv_rmapbt_alloc(
        struct xfs_mount        *mp,
        xfs_agnumber_t          agno)
 {
-       struct xfs_alloc_arg    args = {0};
+       struct xfs_alloc_arg    args = { NULL };
        struct xfs_perag        *pag;
 
        args.len = 1;
index c36171f3511d52133e10715f6394a591123e0246..c31bbdcc25c5337f9eaddd508a2f77e86b9bb7ec 100644 (file)
@@ -2531,7 +2531,7 @@ xfs_agi_verify(
                return __this_address;
 
        for (i = 0; i < XFS_AGI_UNLINKED_BUCKETS; i++) {
-               if (agi->agi_unlinked[i] == NULLAGINO)
+               if (agi->agi_unlinked[i] == cpu_to_be32(NULLAGINO))
                        continue;
                if (!xfs_verify_ino(mp, be32_to_cpu(agi->agi_unlinked[i])))
                        return __this_address;