Skip to content

Commit 82efde9

Browse files
Christoph Hellwigcmaiolino
authored andcommitted
xfs: remove XFS_IBULK_SAME_AG
Add a new field to struct xfs_ibulk to directly pass XFS_IWALK* flags, and thus remove the need to indirect the SAME_AG flag through XFS_IBULK*. Signed-off-by: Christoph Hellwig <[email protected]> Reviewed-by: Darrick J. Wong <[email protected]> Signed-off-by: Carlos Maiolino <[email protected]>
1 parent d284551 commit 82efde9

File tree

3 files changed

+7
-17
lines changed

3 files changed

+7
-17
lines changed

fs/xfs/xfs_ioctl.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -219,7 +219,7 @@ xfs_bulk_ireq_setup(
219219
else if (XFS_INO_TO_AGNO(mp, breq->startino) < hdr->agno)
220220
return -EINVAL;
221221

222-
breq->flags |= XFS_IBULK_SAME_AG;
222+
breq->iwalk_flags |= XFS_IWALK_SAME_AG;
223223

224224
/* Asking for an inode past the end of the AG? We're done! */
225225
if (XFS_INO_TO_AGNO(mp, breq->startino) > hdr->agno)

fs/xfs/xfs_itable.c

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -307,7 +307,6 @@ xfs_bulkstat(
307307
.breq = breq,
308308
};
309309
struct xfs_trans *tp;
310-
unsigned int iwalk_flags = 0;
311310
int error;
312311

313312
if (breq->idmap != &nop_mnt_idmap) {
@@ -328,10 +327,7 @@ xfs_bulkstat(
328327
* locking abilities to detect cycles in the inobt without deadlocking.
329328
*/
330329
tp = xfs_trans_alloc_empty(breq->mp);
331-
if (breq->flags & XFS_IBULK_SAME_AG)
332-
iwalk_flags |= XFS_IWALK_SAME_AG;
333-
334-
error = xfs_iwalk(breq->mp, tp, breq->startino, iwalk_flags,
330+
error = xfs_iwalk(breq->mp, tp, breq->startino, breq->iwalk_flags,
335331
xfs_bulkstat_iwalk, breq->icount, &bc);
336332
xfs_trans_cancel(tp);
337333
kfree(bc.buf);
@@ -447,21 +443,17 @@ xfs_inumbers(
447443
.breq = breq,
448444
};
449445
struct xfs_trans *tp;
450-
unsigned int iwalk_flags = 0;
451446
int error = 0;
452447

453448
if (xfs_bulkstat_already_done(breq->mp, breq->startino))
454449
return 0;
455450

456-
if (breq->flags & XFS_IBULK_SAME_AG)
457-
iwalk_flags |= XFS_IWALK_SAME_AG;
458-
459451
/*
460452
* Grab an empty transaction so that we can use its recursive buffer
461453
* locking abilities to detect cycles in the inobt without deadlocking.
462454
*/
463455
tp = xfs_trans_alloc_empty(breq->mp);
464-
error = xfs_inobt_walk(breq->mp, tp, breq->startino, iwalk_flags,
456+
error = xfs_inobt_walk(breq->mp, tp, breq->startino, breq->iwalk_flags,
465457
xfs_inumbers_walk, breq->icount, &ic);
466458
xfs_trans_cancel(tp);
467459

fs/xfs/xfs_itable.h

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,17 +13,15 @@ struct xfs_ibulk {
1313
xfs_ino_t startino; /* start with this inode */
1414
unsigned int icount; /* number of elements in ubuffer */
1515
unsigned int ocount; /* number of records returned */
16-
unsigned int flags; /* see XFS_IBULK_FLAG_* */
16+
unsigned int flags; /* XFS_IBULK_FLAG_* */
17+
unsigned int iwalk_flags; /* XFS_IWALK_FLAG_* */
1718
};
1819

19-
/* Only iterate within the same AG as startino */
20-
#define XFS_IBULK_SAME_AG (1U << 0)
21-
2220
/* Fill out the bs_extents64 field if set. */
23-
#define XFS_IBULK_NREXT64 (1U << 1)
21+
#define XFS_IBULK_NREXT64 (1U << 0)
2422

2523
/* Signal that we can return metadata directories. */
26-
#define XFS_IBULK_METADIR (1U << 2)
24+
#define XFS_IBULK_METADIR (1U << 1)
2725

2826
/*
2927
* Advance the user buffer pointer by one record of the given size. If the

0 commit comments

Comments
 (0)