summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthew Sackman <matthew@rabbitmq.com>2011-03-14 10:48:28 +0000
committerMatthew Sackman <matthew@rabbitmq.com>2011-03-14 10:48:28 +0000
commit1d60ab309f7de265a4e8cc6ca905685e5ac04af9 (patch)
treec065e86dd5b78c900536cff10d1820fe717ebc68
parent498a61718456aeeeeac0135596658ef785d6622d (diff)
downloadrabbitmq-server-1d60ab309f7de265a4e8cc6ca905685e5ac04af9.tar.gz
Fix
-rw-r--r--src/file_handle_cache.erl16
1 files changed, 7 insertions, 9 deletions
diff --git a/src/file_handle_cache.erl b/src/file_handle_cache.erl
index b26bb988..eed62729 100644
--- a/src/file_handle_cache.erl
+++ b/src/file_handle_cache.erl
@@ -970,12 +970,13 @@ queue_fold(Fun, Init, Q) ->
filter_pending(Fun, {Count, Queue}) ->
{Delta, Queue1} =
- queue_fold(fun (Item, {DeltaN, QueueN}) ->
- case Fun(Item) of
- true -> {DeltaN, queue:in(Item, QueueN)};
- false -> {DeltaN - requested(Item), QueueN}
- end
- end, {0, queue:new()}, Queue),
+ queue_fold(
+ fun (Item = #pending { requested = Requested }, {DeltaN, QueueN}) ->
+ case Fun(Item) of
+ true -> {DeltaN, queue:in(Item, QueueN)};
+ false -> {DeltaN - Requested, QueueN}
+ end
+ end, {0, queue:new()}, Queue),
{Count + Delta, Queue1}.
pending_new() ->
@@ -1021,9 +1022,6 @@ adjust_alarm(OldState, NewState) ->
end,
NewState.
-requested({_Kind, _Pid, Requested, _From}) ->
- Requested.
-
process_pending(State = #fhc_state { limit = infinity }) ->
State;
process_pending(State) ->