OSDN Git Service

xfs: convert xfs_ialloc_next_ag() to an atomic
authorDave Chinner <dchinner@redhat.com>
Sun, 12 Feb 2023 22:14:52 +0000 (09:14 +1100)
committerDave Chinner <dchinner@redhat.com>
Sun, 12 Feb 2023 22:14:52 +0000 (09:14 +1100)
commit20a5eab49d354a2837e0af3f07f92a104de52804
treed22bcfd3a0517eea0b18a00ea9b1b8d7a7cdeac3
parentbab8b795185bf37801a4f7ee5c321eee288c2f10
xfs: convert xfs_ialloc_next_ag() to an atomic

This is currently a spinlock lock protected rotor which can be
implemented with a single atomic operation. Change it to be more
efficient and get rid of the m_agirotor_lock. Noticed while
converting the inode allocation AG selection loop to active perag
references.

Signed-off-by: Dave Chinner <dchinner@redhat.com>
Reviewed-by: Allison Henderson <allison.henderson@oracle.com>
Reviewed-by: Darrick J. Wong <djwong@kernel.org>
fs/xfs/libxfs/xfs_ialloc.c
fs/xfs/libxfs/xfs_sb.c
fs/xfs/xfs_mount.h
fs/xfs/xfs_super.c