summaryrefslogtreecommitdiff
path: root/fs/xfs/xfs_inode.c
diff options
context:
space:
mode:
authorDave Chinner <dchinner@redhat.com>2021-06-02 10:48:24 +1000
committerDave Chinner <david@fromorbit.com>2021-06-02 10:48:24 +1000
commit4268547305c91b35ae7871374078de788a822ed1 (patch)
tree9c0114fc36b1fc2ae5e42da3507c570eb3b56490 /fs/xfs/xfs_inode.c
parent50f02fe3338d3fee6b298a1b262a4c562e7d84e0 (diff)
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>
Diffstat (limited to 'fs/xfs/xfs_inode.c')
-rw-r--r--fs/xfs/xfs_inode.c3
1 files changed, 0 insertions, 3 deletions
diff --git a/fs/xfs/xfs_inode.c b/fs/xfs/xfs_inode.c
index 4d397c29ff83..743c8eeee94a 100644
--- a/fs/xfs/xfs_inode.c
+++ b/fs/xfs/xfs_inode.c
@@ -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)