xfs: remove all *_ITER_CONTINUE values
authorDarrick J. Wong <darrick.wong@oracle.com>
Wed, 28 Aug 2019 21:39:46 +0000 (14:39 -0700)
committerDarrick J. Wong <darrick.wong@oracle.com>
Sat, 31 Aug 2019 05:43:56 +0000 (22:43 -0700)
Iterator functions already use 0 to signal "continue iterating", so get
rid of the #defines and just do it directly.

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Reviewed-by: Dave Chinner <dchinner@redhat.com>
fs/xfs/libxfs/xfs_btree.h
fs/xfs/libxfs/xfs_rmap.c
fs/xfs/libxfs/xfs_shared.h
fs/xfs/xfs_fsmap.c
fs/xfs/xfs_iwalk.h

index 326cf2a..ced1e65 100644 (file)
@@ -471,7 +471,6 @@ unsigned long long xfs_btree_calc_size(uint *limits, unsigned long long len);
  * used to stop iteration, because _query_range never generates that error
  * code on its own.
  */
-#define XFS_BTREE_QUERY_RANGE_CONTINUE (XFS_ITER_CONTINUE) /* keep iterating */
 typedef int (*xfs_btree_query_range_fn)(struct xfs_btree_cur *cur,
                union xfs_btree_rec *rec, void *priv);
 
index 09644ff..38e9414 100644 (file)
@@ -253,11 +253,11 @@ xfs_rmap_find_left_neighbor_helper(
                        rec->rm_flags);
 
        if (rec->rm_owner != info->high.rm_owner)
-               return XFS_BTREE_QUERY_RANGE_CONTINUE;
+               return 0;
        if (!XFS_RMAP_NON_INODE_OWNER(rec->rm_owner) &&
            !(rec->rm_flags & XFS_RMAP_BMBT_BLOCK) &&
            rec->rm_offset + rec->rm_blockcount - 1 != info->high.rm_offset)
-               return XFS_BTREE_QUERY_RANGE_CONTINUE;
+               return 0;
 
        *info->irec = *rec;
        *info->stat = 1;
@@ -329,12 +329,12 @@ xfs_rmap_lookup_le_range_helper(
                        rec->rm_flags);
 
        if (rec->rm_owner != info->high.rm_owner)
-               return XFS_BTREE_QUERY_RANGE_CONTINUE;
+               return 0;
        if (!XFS_RMAP_NON_INODE_OWNER(rec->rm_owner) &&
            !(rec->rm_flags & XFS_RMAP_BMBT_BLOCK) &&
            (rec->rm_offset > info->high.rm_offset ||
             rec->rm_offset + rec->rm_blockcount <= info->high.rm_offset))
-               return XFS_BTREE_QUERY_RANGE_CONTINUE;
+               return 0;
 
        *info->irec = *rec;
        *info->stat = 1;
index 2bc31c5..c45acbd 100644 (file)
@@ -177,7 +177,4 @@ struct xfs_ino_geometry {
        unsigned int    agino_log;      /* #bits for agino in inum */
 };
 
-/* Keep iterating the data structure. */
-#define XFS_ITER_CONTINUE      (0)
-
 #endif /* __XFS_SHARED_H__ */
index 8ab4ab5..d082143 100644 (file)
@@ -250,7 +250,7 @@ xfs_getfsmap_helper(
                rec_daddr += XFS_FSB_TO_BB(mp, rec->rm_blockcount);
                if (info->next_daddr < rec_daddr)
                        info->next_daddr = rec_daddr;
-               return XFS_BTREE_QUERY_RANGE_CONTINUE;
+               return 0;
        }
 
        /* Are we just counting mappings? */
@@ -259,14 +259,14 @@ xfs_getfsmap_helper(
                        info->head->fmh_entries++;
 
                if (info->last)
-                       return XFS_BTREE_QUERY_RANGE_CONTINUE;
+                       return 0;
 
                info->head->fmh_entries++;
 
                rec_daddr += XFS_FSB_TO_BB(mp, rec->rm_blockcount);
                if (info->next_daddr < rec_daddr)
                        info->next_daddr = rec_daddr;
-               return XFS_BTREE_QUERY_RANGE_CONTINUE;
+               return 0;
        }
 
        /*
@@ -328,7 +328,7 @@ out:
        rec_daddr += XFS_FSB_TO_BB(mp, rec->rm_blockcount);
        if (info->next_daddr < rec_daddr)
                info->next_daddr = rec_daddr;
-       return XFS_BTREE_QUERY_RANGE_CONTINUE;
+       return 0;
 }
 
 /* Transform a rmapbt irec into a fsmap */
index 742360d..37a795f 100644 (file)
@@ -17,8 +17,6 @@
 /* Walk all inodes in the filesystem starting from @startino. */
 typedef int (*xfs_iwalk_fn)(struct xfs_mount *mp, struct xfs_trans *tp,
                            xfs_ino_t ino, void *data);
-/* Return values for xfs_iwalk_fn. */
-#define XFS_IWALK_CONTINUE     (XFS_ITER_CONTINUE)
 
 int xfs_iwalk(struct xfs_mount *mp, struct xfs_trans *tp, xfs_ino_t startino,
                unsigned int flags, xfs_iwalk_fn iwalk_fn,