xfs: replace dop_low with transaction flag
The dop_low field enables the low free space allocation mode when a previous allocation has detected difficulty allocating blocks. It has historically been part of the xfs_defer_ops structure, which means if enabled, it remains enabled across a set of transactions until the deferred operations have completed and the dfops is reset. Now that the dfops is embedded in the transaction, we can save a bit more space by using a transaction flag rather than a standalone boolean. Drop the ->dop_low field and replace it with a transaction flag that is set at the same points, carried across rolling transactions and cleared on completion of deferred operations. This essentially emulates the behavior of ->dop_low and so should not change behavior. Signed-off-by: Brian Foster <bfoster@redhat.com> Reviewed-by: Darrick J. Wong <darrick.wong@oracle.com> Reviewed-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
This commit is contained in:

committed by
Darrick J. Wong

parent
ce356d6477
commit
1214f1cf66
@@ -226,7 +226,7 @@ xfs_bmbt_alloc_block(
|
||||
* block allocation here and corrupt the filesystem.
|
||||
*/
|
||||
args.minleft = args.tp->t_blk_res;
|
||||
} else if (cur->bc_tp->t_dfops->dop_low) {
|
||||
} else if (cur->bc_tp->t_flags & XFS_TRANS_LOWMODE) {
|
||||
args.type = XFS_ALLOCTYPE_START_BNO;
|
||||
} else {
|
||||
args.type = XFS_ALLOCTYPE_NEAR_BNO;
|
||||
@@ -253,7 +253,7 @@ xfs_bmbt_alloc_block(
|
||||
error = xfs_alloc_vextent(&args);
|
||||
if (error)
|
||||
goto error0;
|
||||
cur->bc_tp->t_dfops->dop_low = true;
|
||||
cur->bc_tp->t_flags |= XFS_TRANS_LOWMODE;
|
||||
}
|
||||
if (WARN_ON_ONCE(args.fsbno == NULLFSBLOCK)) {
|
||||
*stat = 0;
|
||||
|
Reference in New Issue
Block a user