aboutsummaryrefslogtreecommitdiffstats
path: root/fs/xfs/xfs_bmap.c
diff options
context:
space:
mode:
authorChristoph Hellwig <hch@infradead.org>2011-09-18 16:40:42 -0400
committerAlex Elder <aelder@sgi.com>2011-10-11 22:15:03 -0400
commitb9b984d7846e37c57e5b3f8cd883ad45e8ebc2cf (patch)
tree93e383481dcbb5b5c4ded5d25e10cec1c95ac997 /fs/xfs/xfs_bmap.c
parente7455e02e5effcdd49bb28e7dfface2d3473de52 (diff)
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: Christoph Hellwig <hch@lst.de> Signed-off-by: Alex Elder <aelder@sgi.com>
Diffstat (limited to 'fs/xfs/xfs_bmap.c')
-rw-r--r--fs/xfs/xfs_bmap.c35
1 files changed, 8 insertions, 27 deletions
diff --git a/fs/xfs/xfs_bmap.c b/fs/xfs/xfs_bmap.c
index 927e5454a43c..ebcd38b14830 100644
--- a/fs/xfs/xfs_bmap.c
+++ b/fs/xfs/xfs_bmap.c
@@ -1045,34 +1045,15 @@ xfs_bmap_add_extent_delay_real(
1045 temp2 = xfs_bmap_worst_indlen(ip, temp2); 1045 temp2 = xfs_bmap_worst_indlen(ip, temp2);
1046 diff = (int)(temp + temp2 - startblockval(PREV.br_startblock) - 1046 diff = (int)(temp + temp2 - startblockval(PREV.br_startblock) -
1047 (cur ? cur->bc_private.b.allocated : 0)); 1047 (cur ? cur->bc_private.b.allocated : 0));
1048 if (diff > 0 && 1048 if (diff > 0) {
1049 xfs_icsb_modify_counters(ip->i_mount, XFS_SBS_FDBLOCKS, 1049 error = xfs_icsb_modify_counters(ip->i_mount,
1050 -((int64_t)diff), 0)) { 1050 XFS_SBS_FDBLOCKS,
1051 /* 1051 -((int64_t)diff), 0);
1052 * Ick gross gag me with a spoon. 1052 ASSERT(!error);
1053 */ 1053 if (error)
1054 ASSERT(0); /* want to see if this ever happens! */ 1054 goto done;
1055 while (diff > 0) {
1056 if (temp) {
1057 temp--;
1058 diff--;
1059 if (!diff ||
1060 !xfs_icsb_modify_counters(ip->i_mount,
1061 XFS_SBS_FDBLOCKS,
1062 -((int64_t)diff), 0))
1063 break;
1064 }
1065 if (temp2) {
1066 temp2--;
1067 diff--;
1068 if (!diff ||
1069 !xfs_icsb_modify_counters(ip->i_mount,
1070 XFS_SBS_FDBLOCKS,
1071 -((int64_t)diff), 0))
1072 break;
1073 }
1074 }
1075 } 1055 }
1056
1076 ep = xfs_iext_get_ext(ifp, *idx); 1057 ep = xfs_iext_get_ext(ifp, *idx);
1077 xfs_bmbt_set_startblock(ep, nullstartblock((int)temp)); 1058 xfs_bmbt_set_startblock(ep, nullstartblock((int)temp));
1078 trace_xfs_bmap_post_update(ip, *idx, state, _THIS_IP_); 1059 trace_xfs_bmap_post_update(ip, *idx, state, _THIS_IP_);