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
@@ -236,4 +236,13 @@ typedef int (*xfs_agfl_walk_fn)(struct xfs_mount *mp, xfs_agblock_t bno,
|
||||
int xfs_agfl_walk(struct xfs_mount *mp, struct xfs_agf *agf,
|
||||
struct xfs_buf *agflbp, xfs_agfl_walk_fn walk_fn, void *priv);
|
||||
|
||||
static inline __be32 *
|
||||
xfs_buf_to_agfl_bno(
|
||||
struct xfs_buf *bp)
|
||||
{
|
||||
if (xfs_sb_version_hascrc(&bp->b_mount->m_sb))
|
||||
return bp->b_addr + sizeof(struct xfs_agfl);
|
||||
return bp->b_addr;
|
||||
}
|
||||
|
||||
#endif /* __XFS_ALLOC_H__ */
|
||||
|
Reference in New Issue
Block a user