@@ -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.
*/
@@ -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.
*/
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@oracle.com> --- libxfs/xfs_attr_leaf.h | 3 +++ libxfs/xfs_da_btree.c | 3 ++- 2 files changed, 5 insertions(+), 1 deletion(-)