mirror of
https://github.com/torvalds/linux.git
synced 2025-12-07 20:06:24 +00:00
xfs: simplify xfs_dialloc_select_ag() return values
The only caller of xfs_dialloc_select_ag() will always return -ENOSPC to it's caller if the agbp returned from xfs_dialloc_select_ag() is NULL. IOWs, failure to find a candidate AGI we can allocate inodes from is always an ENOSPC condition, so move this logic up into xfs_dialloc_select_ag() so we can simplify the return logic in this function. xfs_dialloc_select_ag() now only ever returns 0 with a locked agbp, or an error with no agbp. Signed-off-by: Dave Chinner <dchinner@redhat.com> Reviewed-by: Brian Foster <bfoster@redhat.com> Reviewed-by: Darrick J. Wong <djwong@kernel.org>
This commit is contained in:
committed by
Dave Chinner
parent
50f02fe333
commit
4268547305
@@ -923,9 +923,6 @@ xfs_dir_ialloc(
|
||||
if (error)
|
||||
return error;
|
||||
|
||||
if (!agibp)
|
||||
return -ENOSPC;
|
||||
|
||||
/* Allocate an inode from the selected AG */
|
||||
error = xfs_dialloc_ag(*tpp, agibp, parent_ino, &ino);
|
||||
if (error)
|
||||
|
||||
Reference in New Issue
Block a user