aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorRichard Carlsson <[email protected]>2016-11-25 21:26:19 +0100
committerRichard Carlsson <[email protected]>2016-11-29 10:31:43 +0100
commit93ac8d2b4b2937b9b7651b5e043c31929f3b2c7c (patch)
tree4f9b7171e2cc631394707f339a4f9a7a9d02139e /lib
parenteda5c4859f561fae7d3a3b74f19dd8596c212966 (diff)
downloadotp-93ac8d2b4b2937b9b7651b5e043c31929f3b2c7c.tar.gz
otp-93ac8d2b4b2937b9b7651b5e043c31929f3b2c7c.tar.bz2
otp-93ac8d2b4b2937b9b7651b5e043c31929f3b2c7c.zip
Pass log format through from handle()
Diffstat (limited to 'lib')
-rw-r--r--lib/kernel/src/disk_log.erl15
1 files changed, 6 insertions, 9 deletions
diff --git a/lib/kernel/src/disk_log.erl b/lib/kernel/src/disk_log.erl
index 69c65c9c43..2ade7fd77a 100644
--- a/lib/kernel/src/disk_log.erl
+++ b/lib/kernel/src/disk_log.erl
@@ -689,8 +689,8 @@ handle({From, {log, Format, B}}=Message, S) ->
reply(From, {error, {read_only_mode, L#log.name}}, S);
#log{status = ok, format=external}=L when Format =:= internal ->
reply(From, {error, {format_external, L#log.name}}, S);
- #log{status = ok} ->
- log_loop(S, From, [B], []);
+ #log{status = ok, format=LogFormat} ->
+ log_loop(S, From, [B], [], iolist_size(B), LogFormat);
#log{status = {blocked, false}}=L ->
reply(From, {error, {blocked_log, L#log.name}}, S);
#log{blocked_by = From}=L ->
@@ -706,8 +706,8 @@ handle({alog, Format, B}=Message, S) ->
#log{status = ok, format = external} when Format =:= internal ->
notify_owners({format_external, B}),
loop(S);
- #log{status = ok} ->
- log_loop(S, [], [B], []);
+ #log{status = ok, format=LogFormat} ->
+ log_loop(S, [], [B], [], iolist_size(B), LogFormat);
#log{status = {blocked, false}} ->
notify_owners({blocked_log, B}),
loop(S);
@@ -740,8 +740,8 @@ handle({From, sync}=Message, S) ->
case get(log) of
#log{mode = read_only}=L ->
reply(From, {error, {read_only_mode, L#log.name}}, S);
- #log{status = ok} ->
- log_loop(S, [], [], [From]);
+ #log{status = ok, format=LogFormat} ->
+ log_loop(S, [], [], [From], 0, LogFormat);
#log{status = {blocked, false}}=L ->
reply(From, {error, {blocked_log, L#log.name}}, S);
#log{blocked_by = From}=L ->
@@ -1006,9 +1006,6 @@ enqueue(Message, #state{queue = Queue}=S) ->
-define(MAX_LOOK_AHEAD, 64*1024).
-log_loop(S, Pids, Bins, Sync) ->
- log_loop(S, Pids, Bins, Sync, iolist_size(Bins), (get(log))#log.format).
-
%% Inlined.
log_loop(#state{cache_error = CE}=S, Pids, _Bins, _Sync, _Sz, _F) when CE =/= ok ->
loop(cache_error(S, Pids));