xfs: remove the agfl_bno member from struct xfs_agfl
struct xfs_agfl is a header in front of the AGFL entries that exists for CRC enabled file systems. For not CRC enabled file systems the AGFL is simply a list of agbno. Make the CRC case similar to that by just using the list behind the new header. This indirectly solves a problem with modern gcc versions that warn about taking addresses of packed structures (and we have to pack the AGFL given that gcc rounds up structure sizes). Also replace the helper macro to get from a buffer with an inline function in xfs_alloc.h to make the code easier to read. Signed-off-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Eric Sandeen <sandeen@redhat.com> Reviewed-by: Brian Foster <bfoster@redhat.com> Reviewed-by: Darrick J. Wong <darrick.wong@oracle.com> Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
This commit is contained in:
committed by
Darrick J. Wong
parent
10a98cb16d
commit
183606d824
@ -589,6 +589,7 @@ xfs_agfl_verify(
|
||||
{
|
||||
struct xfs_mount *mp = bp->b_mount;
|
||||
struct xfs_agfl *agfl = XFS_BUF_TO_AGFL(bp);
|
||||
__be32 *agfl_bno = xfs_buf_to_agfl_bno(bp);
|
||||
int i;
|
||||
|
||||
/*
|
||||
@ -614,8 +615,8 @@ xfs_agfl_verify(
|
||||
return __this_address;
|
||||
|
||||
for (i = 0; i < xfs_agfl_size(mp); i++) {
|
||||
if (be32_to_cpu(agfl->agfl_bno[i]) != NULLAGBLOCK &&
|
||||
be32_to_cpu(agfl->agfl_bno[i]) >= mp->m_sb.sb_agblocks)
|
||||
if (be32_to_cpu(agfl_bno[i]) != NULLAGBLOCK &&
|
||||
be32_to_cpu(agfl_bno[i]) >= mp->m_sb.sb_agblocks)
|
||||
return __this_address;
|
||||
}
|
||||
|
||||
@ -2684,7 +2685,7 @@ xfs_alloc_get_freelist(
|
||||
/*
|
||||
* Get the block number and update the data structures.
|
||||
*/
|
||||
agfl_bno = XFS_BUF_TO_AGFL_BNO(mp, agflbp);
|
||||
agfl_bno = xfs_buf_to_agfl_bno(agflbp);
|
||||
bno = be32_to_cpu(agfl_bno[be32_to_cpu(agf->agf_flfirst)]);
|
||||
be32_add_cpu(&agf->agf_flfirst, 1);
|
||||
xfs_trans_brelse(tp, agflbp);
|
||||
@ -2820,7 +2821,7 @@ xfs_alloc_put_freelist(
|
||||
|
||||
ASSERT(be32_to_cpu(agf->agf_flcount) <= xfs_agfl_size(mp));
|
||||
|
||||
agfl_bno = XFS_BUF_TO_AGFL_BNO(mp, agflbp);
|
||||
agfl_bno = xfs_buf_to_agfl_bno(agflbp);
|
||||
blockp = &agfl_bno[be32_to_cpu(agf->agf_fllast)];
|
||||
*blockp = cpu_to_be32(bno);
|
||||
startoff = (char *)blockp - (char *)agflbp->b_addr;
|
||||
@ -3424,7 +3425,7 @@ xfs_agfl_walk(
|
||||
unsigned int i;
|
||||
int error;
|
||||
|
||||
agfl_bno = XFS_BUF_TO_AGFL_BNO(mp, agflbp);
|
||||
agfl_bno = xfs_buf_to_agfl_bno(agflbp);
|
||||
i = be32_to_cpu(agf->agf_flfirst);
|
||||
|
||||
/* Nothing to walk in an empty AGFL. */
|
||||
|
Reference in New Issue
Block a user