diff options
author | Christoph Hellwig <hch@lst.de> | 2017-03-29 00:53:35 +0300 |
---|---|---|
committer | Darrick J. Wong <darrick.wong@oracle.com> | 2017-04-04 01:18:16 +0300 |
commit | 9c4f29d39168bb9363189f0d54ee1202372e7d9b (patch) | |
tree | 4122955d6116b4622185c2ff26f9e756567f9afa /fs/xfs/libxfs/xfs_bmap.h | |
parent | 696a562072e3c14bcd13ae5acc19cdf27679e865 (diff) | |
download | linux-9c4f29d39168bb9363189f0d54ee1202372e7d9b.tar.xz |
xfs: factor out a xfs_bmap_is_real_extent helper
This checks for all the non-normal extent types, including handling both
encodings of delayed allocations.
Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Darrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Diffstat (limited to 'fs/xfs/libxfs/xfs_bmap.h')
-rw-r--r-- | fs/xfs/libxfs/xfs_bmap.h | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/fs/xfs/libxfs/xfs_bmap.h b/fs/xfs/libxfs/xfs_bmap.h index cdef87db5262..a6e612cabe15 100644 --- a/fs/xfs/libxfs/xfs_bmap.h +++ b/fs/xfs/libxfs/xfs_bmap.h @@ -172,6 +172,18 @@ static inline int xfs_bmapi_whichfork(int bmapi_flags) /* + * Return true if the extent is a real, allocated extent, or false if it is a + * delayed allocation, and unwritten extent or a hole. + */ +static inline bool xfs_bmap_is_real_extent(struct xfs_bmbt_irec *irec) +{ + return irec->br_state != XFS_EXT_UNWRITTEN && + irec->br_startblock != HOLESTARTBLOCK && + irec->br_startblock != DELAYSTARTBLOCK && + !isnullstartblock(irec->br_startblock); +} + +/* * This macro is used to determine how many extents will be shifted * in one write transaction. We could require two splits, * an extent move on the first and an extent merge on the second, |