To prepare to perag initialization code move to libxfs, port the
xfs_set_inode_alloc function from the kernel and make
libxfs_initialize_perag use it. The code isn't 1:1 identical, but
AFAICT it behaves the same way. In a future kernel release we'll
move the function into xfs_ag.c and update xfsprogs.
(sandeen: Note that this is in effect simply syncing up several
kernel commits in this code which was not shared via libxfs.)
Signed-off-by: Darrick J. Wong <djwong@kernel.org> Reviewed-by: Eric Sandeen <sandeen@redhat.com> Signed-off-by: Eric Sandeen <sandeen@sandeen.net>