Commit b9b984d7 authored by Christoph Hellwig's avatar Christoph Hellwig Committed by Alex Elder

xfs: remove impossible to read code in xfs_bmap_add_extent_delay_real

We already have the worst case blocks reserved, so xfs_icsb_modify_counters
won't fail in xfs_bmap_add_extent_delay_real.  In fact we've had an assert
to catch this case since day and it never triggered.  So remove the code
to try smaller reservations, and just return the error for that case in
addition to keeping the assert.
Signed-off-by: default avatarChristoph Hellwig <hch@lst.de>
Signed-off-by: default avatarAlex Elder <aelder@sgi.com>
parent e7455e02
...@@ -1045,34 +1045,15 @@ xfs_bmap_add_extent_delay_real( ...@@ -1045,34 +1045,15 @@ xfs_bmap_add_extent_delay_real(
temp2 = xfs_bmap_worst_indlen(ip, temp2); temp2 = xfs_bmap_worst_indlen(ip, temp2);
diff = (int)(temp + temp2 - startblockval(PREV.br_startblock) - diff = (int)(temp + temp2 - startblockval(PREV.br_startblock) -
(cur ? cur->bc_private.b.allocated : 0)); (cur ? cur->bc_private.b.allocated : 0));
if (diff > 0 && if (diff > 0) {
xfs_icsb_modify_counters(ip->i_mount, XFS_SBS_FDBLOCKS, error = xfs_icsb_modify_counters(ip->i_mount,
-((int64_t)diff), 0)) { XFS_SBS_FDBLOCKS,
/* -((int64_t)diff), 0);
* Ick gross gag me with a spoon. ASSERT(!error);
*/ if (error)
ASSERT(0); /* want to see if this ever happens! */ goto done;
while (diff > 0) {
if (temp) {
temp--;
diff--;
if (!diff ||
!xfs_icsb_modify_counters(ip->i_mount,
XFS_SBS_FDBLOCKS,
-((int64_t)diff), 0))
break;
}
if (temp2) {
temp2--;
diff--;
if (!diff ||
!xfs_icsb_modify_counters(ip->i_mount,
XFS_SBS_FDBLOCKS,
-((int64_t)diff), 0))
break;
}
}
} }
ep = xfs_iext_get_ext(ifp, *idx); ep = xfs_iext_get_ext(ifp, *idx);
xfs_bmbt_set_startblock(ep, nullstartblock((int)temp)); xfs_bmbt_set_startblock(ep, nullstartblock((int)temp));
trace_xfs_bmap_post_update(ip, *idx, state, _THIS_IP_); trace_xfs_bmap_post_update(ip, *idx, state, _THIS_IP_);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment