diff options
author | Richard Carlsson <[email protected]> | 2016-11-15 16:53:38 +0100 |
---|---|---|
committer | Richard Carlsson <[email protected]> | 2016-11-17 21:01:48 +0100 |
commit | 6abc37b32ac6965ab780cd6fda5667585caaa711 (patch) | |
tree | e60b361e2881619cbb4fcdf4fa387f1b032fe5db /lib/kernel/src | |
parent | b653dc18fa91e68021b28bef37e942f7fa7f3809 (diff) | |
download | otp-6abc37b32ac6965ab780cd6fda5667585caaa711.tar.gz otp-6abc37b32ac6965ab780cd6fda5667585caaa711.tar.bz2 otp-6abc37b32ac6965ab780cd6fda5667585caaa711.zip |
Use iolist_size instead of local function
Diffstat (limited to 'lib/kernel/src')
-rw-r--r-- | lib/kernel/src/disk_log.erl | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/lib/kernel/src/disk_log.erl b/lib/kernel/src/disk_log.erl index d06429d629..8dd9975b23 100644 --- a/lib/kernel/src/disk_log.erl +++ b/lib/kernel/src/disk_log.erl @@ -1695,7 +1695,7 @@ do_unblock(L, S) -> do_log(L, B) when L#log.type =:= halt -> #log{format = Format, extra = Halt} = L, #halt{curB = CurSize, size = Sz} = Halt, - {Bs, BSize} = bsize(B, Format), + {Bs, BSize} = logl(B, Format), case get(is_full) of true -> {error, {error, {full, L#log.name}}, 0}; @@ -1731,17 +1731,14 @@ do_log(L, B) when L#log.format_type =:= wrap_ext -> {error, Error, Logged - Lost} end. -bsize(B, external) -> - {B, xsz(B, 0)}; -bsize(B, internal) -> +logl(B, external) -> + {B, iolist_size(B)}; +logl(B, internal) -> disk_log_1:logl(B). -xsz([B|T], Sz) -> xsz(T, byte_size(B) + Sz); -xsz([], Sz) -> Sz. - halt_write_full(L, [Bin | Bins], Format, N) -> B = [Bin], - {Bs, BSize} = bsize(B, Format), + {Bs, BSize} = logl(B, Format), Halt = L#log.extra, #halt{curB = CurSize, size = Sz} = Halt, if |