xfs: factor free block index lookup from xfs_dir2_node_addname_int()
authorDave Chinner <dchinner@redhat.com>
Thu, 29 Aug 2019 16:04:07 +0000 (09:04 -0700)
committerDarrick J. Wong <darrick.wong@oracle.com>
Sat, 31 Aug 2019 05:43:57 +0000 (22:43 -0700)
commit0e822255f95db400e56e19773e04755d79b50bda
tree4bf283a5959b9ce864a25d9725ca8fc7593a13e5
parenta07258a695281109422011182db069a0e6f8855e
xfs: factor free block index lookup from xfs_dir2_node_addname_int()

Simplify the logic in xfs_dir2_node_addname_int() by factoring out
the free block index lookup code that finds a block with enough free
space for the entry to be added. The code that is moved gets a major
cleanup at the same time, but there is no algorithm change here.

Signed-off-by: Dave Chinner <dchinner@redhat.com>
Reviewed-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>
fs/xfs/libxfs/xfs_dir2_node.c