Skip to content

Commit 5b35d92

Browse files
author
Chandan Babu R
committed
xfs: Decouple XFS_IBULK flags from XFS_IWALK flags
A future commit will add a new XFS_IBULK flag which will not have a corresponding XFS_IWALK flag. In preparation for the change, this commit separates XFS_IBULK_* flags from XFS_IWALK_* flags. Reviewed-by: Dave Chinner <dchinner@redhat.com> Reviewed-by: Darrick J. Wong <djwong@kernel.org> Signed-off-by: Chandan Babu R <chandan.babu@oracle.com>
1 parent 4f86bb4 commit 5b35d92

3 files changed

Lines changed: 7 additions & 3 deletions

File tree

fs/xfs/xfs_itable.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -256,6 +256,7 @@ xfs_bulkstat(
256256
.breq = breq,
257257
};
258258
struct xfs_trans *tp;
259+
unsigned int iwalk_flags = 0;
259260
int error;
260261

261262
if (breq->mnt_userns != &init_user_ns) {
@@ -279,7 +280,10 @@ xfs_bulkstat(
279280
if (error)
280281
goto out;
281282

282-
error = xfs_iwalk(breq->mp, tp, breq->startino, breq->flags,
283+
if (breq->flags & XFS_IBULK_SAME_AG)
284+
iwalk_flags |= XFS_IWALK_SAME_AG;
285+
286+
error = xfs_iwalk(breq->mp, tp, breq->startino, iwalk_flags,
283287
xfs_bulkstat_iwalk, breq->icount, &bc);
284288
xfs_trans_cancel(tp);
285289
out:

fs/xfs/xfs_itable.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ struct xfs_ibulk {
1717
};
1818

1919
/* Only iterate within the same AG as startino */
20-
#define XFS_IBULK_SAME_AG (XFS_IWALK_SAME_AG)
20+
#define XFS_IBULK_SAME_AG (1U << 0)
2121

2222
/*
2323
* Advance the user buffer pointer by one record of the given size. If the

fs/xfs/xfs_iwalk.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ int xfs_iwalk_threaded(struct xfs_mount *mp, xfs_ino_t startino,
2626
unsigned int inode_records, bool poll, void *data);
2727

2828
/* Only iterate inodes within the same AG as @startino. */
29-
#define XFS_IWALK_SAME_AG (0x1)
29+
#define XFS_IWALK_SAME_AG (1U << 0)
3030

3131
#define XFS_IWALK_FLAGS_ALL (XFS_IWALK_SAME_AG)
3232

0 commit comments

Comments
 (0)