Skip to content

Commit 8d242e9

Browse files
Christoph Hellwigdjwong
authored andcommitted
xfs: remove XFS_ALLOCTYPE_ANY_AG and XFS_ALLOCTYPE_START_AG
XFS_ALLOCTYPE_ANY_AG was only used for the RT allocator and is unused now, and XFS_ALLOCTYPE_START_AG has been unused for a while. Signed-off-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Darrick J. Wong <darrick.wong@oracle.com> Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
1 parent 089ec2f commit 8d242e9

File tree

2 files changed

+2
-18
lines changed

2 files changed

+2
-18
lines changed

fs/xfs/libxfs/xfs_alloc.c

Lines changed: 2 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -2664,21 +2664,11 @@ xfs_alloc_vextent(
26642664
args->agbno = XFS_FSB_TO_AGBNO(mp, args->fsbno);
26652665
args->type = XFS_ALLOCTYPE_NEAR_BNO;
26662666
/* FALLTHROUGH */
2667-
case XFS_ALLOCTYPE_ANY_AG:
2668-
case XFS_ALLOCTYPE_START_AG:
26692667
case XFS_ALLOCTYPE_FIRST_AG:
26702668
/*
26712669
* Rotate through the allocation groups looking for a winner.
26722670
*/
2673-
if (type == XFS_ALLOCTYPE_ANY_AG) {
2674-
/*
2675-
* Start with the last place we left off.
2676-
*/
2677-
args->agno = sagno = (mp->m_agfrotor / rotorstep) %
2678-
mp->m_sb.sb_agcount;
2679-
args->type = XFS_ALLOCTYPE_THIS_AG;
2680-
flags = XFS_ALLOC_FLAG_TRYLOCK;
2681-
} else if (type == XFS_ALLOCTYPE_FIRST_AG) {
2671+
if (type == XFS_ALLOCTYPE_FIRST_AG) {
26822672
/*
26832673
* Start with allocation group given by bno.
26842674
*/
@@ -2687,8 +2677,6 @@ xfs_alloc_vextent(
26872677
sagno = 0;
26882678
flags = 0;
26892679
} else {
2690-
if (type == XFS_ALLOCTYPE_START_AG)
2691-
args->type = XFS_ALLOCTYPE_THIS_AG;
26922680
/*
26932681
* Start with the given allocation group.
26942682
*/
@@ -2756,7 +2744,7 @@ xfs_alloc_vextent(
27562744
}
27572745
xfs_perag_put(args->pag);
27582746
}
2759-
if (bump_rotor || (type == XFS_ALLOCTYPE_ANY_AG)) {
2747+
if (bump_rotor) {
27602748
if (args->agno == sagno)
27612749
mp->m_agfrotor = (mp->m_agfrotor + 1) %
27622750
(mp->m_sb.sb_agcount * rotorstep);

fs/xfs/libxfs/xfs_alloc.h

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,7 @@ extern struct workqueue_struct *xfs_alloc_wq;
2929
/*
3030
* Freespace allocation types. Argument to xfs_alloc_[v]extent.
3131
*/
32-
#define XFS_ALLOCTYPE_ANY_AG 0x01 /* allocate anywhere, use rotor */
3332
#define XFS_ALLOCTYPE_FIRST_AG 0x02 /* ... start at ag 0 */
34-
#define XFS_ALLOCTYPE_START_AG 0x04 /* anywhere, start in this a.g. */
3533
#define XFS_ALLOCTYPE_THIS_AG 0x08 /* anywhere in this a.g. */
3634
#define XFS_ALLOCTYPE_START_BNO 0x10 /* near this block else anywhere */
3735
#define XFS_ALLOCTYPE_NEAR_BNO 0x20 /* in this a.g. and near this block */
@@ -41,9 +39,7 @@ extern struct workqueue_struct *xfs_alloc_wq;
4139
typedef unsigned int xfs_alloctype_t;
4240

4341
#define XFS_ALLOC_TYPES \
44-
{ XFS_ALLOCTYPE_ANY_AG, "ANY_AG" }, \
4542
{ XFS_ALLOCTYPE_FIRST_AG, "FIRST_AG" }, \
46-
{ XFS_ALLOCTYPE_START_AG, "START_AG" }, \
4743
{ XFS_ALLOCTYPE_THIS_AG, "THIS_AG" }, \
4844
{ XFS_ALLOCTYPE_START_BNO, "START_BNO" }, \
4945
{ XFS_ALLOCTYPE_NEAR_BNO, "NEAR_BNO" }, \

0 commit comments

Comments
 (0)