This patch adds two new defines XFS_DABUF_MAP_NOMAPPING and XFS_DABUF_MAP_HOLE_OK. This helps to clean up hard numbers and makes the code easier to read Signed-off-by: Allison Collins <allison.henderson@xxxxxxxxxx> --- libxfs/xfs_attr_leaf.h | 3 +++ libxfs/xfs_da_btree.c | 3 ++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/libxfs/xfs_attr_leaf.h b/libxfs/xfs_attr_leaf.h index 7b74e18..536a290 100644 --- a/libxfs/xfs_attr_leaf.h +++ b/libxfs/xfs_attr_leaf.h @@ -16,6 +16,9 @@ struct xfs_da_state_blk; struct xfs_inode; struct xfs_trans; +#define XFS_DABUF_MAP_NOMAPPING (-1) /* Caller doesn't have a mapping. */ +#define XFS_DABUF_MAP_HOLE_OK (-2) /* don't complain if we land in a hole. */ + /* * Used to keep a list of "remote value" extents when unlinking an inode. */ diff --git a/libxfs/xfs_da_btree.c b/libxfs/xfs_da_btree.c index f8e0432..0a7c601 100644 --- a/libxfs/xfs_da_btree.c +++ b/libxfs/xfs_da_btree.c @@ -2531,7 +2531,8 @@ xfs_dabuf_map( * Caller doesn't have a mapping. -2 means don't complain * if we land in a hole. */ - if (mappedbno == -1 || mappedbno == -2) { + if (mappedbno == XFS_DABUF_MAP_NOMAPPING || + mappedbno == XFS_DABUF_MAP_HOLE_OK) { /* * Optimize the one-block case. */ -- 2.7.4