libxfs: Fix a couple of sparse complaintis
PATCH v2 1/1 libxfs: Fix a couple of sparse complaintis
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.
---
V2:
Convert NULLAGINO to BE32 instead of converting agi_unlinked[i] to cpu
fs/xfs/libxfs/xfs_ag_resv.h | 2 +- fs/xfs/libxfs/xfs_ialloc.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)
fs/xfs/libxfs/xfs_ag_resv.h +1 -1
@@ -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 ;
fs/xfs/libxfs/xfs_ialloc.c +1 -1
@@ -2539,7 +2539,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;
Signature · 1 line
2.14.3
Quoted 7 lines · Carlos Maiolino
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, ifbe32_to_cpu(agi->agi_unlinked[i])was used instead.Signed-off-by Carlos Maiolino <[email protected]>
Looks ok, will test...
--D
Quoted 42 lines
---
V2:
Convert NULLAGINO to BE32 instead of converting agi_unlinked[i] to cpufs/xfs/libxfs/xfs_ag_resv.h | 2 +- fs/xfs/libxfs/xfs_ialloc.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)fs/xfs/libxfs/xfs_ag_resv.h +1
-1@@ -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 ;fs/xfs/libxfs/xfs_ialloc.c +1
-1@@ -2539,7 +2539,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;Signature · 6 lines
2.14.3 -- To unsubscribe from this list: send the line "unsubscribe linux-xfs" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
Quoted 8 lines · Carlos Maiolino
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, ifbe32_to_cpu(agi->agi_unlinked[i])was used instead.Signed-off-by Carlos Maiolino <[email protected]>---
looks fine.
Quoted 41 lines
V2:
Convert NULLAGINO to BE32 instead of converting agi_unlinked[i] to cpufs/xfs/libxfs/xfs_ag_resv.h | 2 +- fs/xfs/libxfs/xfs_ialloc.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)fs/xfs/libxfs/xfs_ag_resv.h +1
-1@@ -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 ;fs/xfs/libxfs/xfs_ialloc.c +1
-1@@ -2539,7 +2539,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;Signature · 6 lines
2.14.3 -- To unsubscribe from this list: send the line "unsubscribe linux-xfs" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html