Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
home:Ledest:erlang:24
erlang
5997-disk_log-rotate.patch
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File 5997-disk_log-rotate.patch of Package erlang
From 41d493907bef8e2fbaa2401cc05b87bc6d5e2230 Mon Sep 17 00:00:00 2001 From: anupamasingh10 <anupamasingh31@gmail.com> Date: Tue, 28 Mar 2023 18:08:06 +0200 Subject: [PATCH 7/7] disk_log rotate --- lib/kernel/src/disk_log.erl | 9 ++++----- lib/kernel/src/disk_log_1.erl | 9 +++++---- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/lib/kernel/src/disk_log.erl b/lib/kernel/src/disk_log.erl index f89e3e7f11..721d4a3405 100644 --- a/lib/kernel/src/disk_log.erl +++ b/lib/kernel/src/disk_log.erl @@ -1285,10 +1285,9 @@ rename_file(File, NewFile, #log{type = halt}) -> end; rename_file(File, NewFile, #log{type = wrap}) -> rename_file(wrap_file_extensions(File), File, NewFile, ok); -rename_file(File, NewFile, #log{type = rotate, head = Head, extra = Handle}) -> +rename_file(File, NewFile, #log{type = rotate, extra = Handle}) -> {_MaxB, MaxF} = disk_log_1:get_rotate_size(Handle), - _Handle1 = disk_log_1:rotate_file(Handle, Head), - _ = file:delete(File), + disk_log_1:rotate_files(Handle#rotate_handle.file, MaxF), rename_file(rotate_file_extensions(File, MaxF), File, NewFile, ok). rename_file([Ext|Exts], File, NewFile0, Res) -> @@ -1496,7 +1495,7 @@ do_inc_wrap_file(L) -> %%----------------------------------------------------------------- %% -> {ok, log()} do_inc_rotate_file(#log{extra = Handle, head = Head} = L) -> - Handle2 = disk_log_1:rotate_file(Handle, Head), + Handle2 = disk_log_1:do_rotate(Handle, Head), {ok, L#log{extra = Handle2}}. %%----------------------------------------------------------------- @@ -1909,7 +1908,7 @@ do_trunc(#log{type = wrap}=L, Head) -> do_change_size(NewLog2#log{extra = NewHandle, head = OldHead}, {MaxB, MaxF}); do_trunc(#log{type = rotate, head = Head, extra = Handle}=L, none) -> - Handle1 = disk_log_1:rotate_file(Handle, Head), + Handle1 = disk_log_1:do_rotate(Handle, Head), disk_log_1:remove_files(rotate, Handle1#rotate_handle.file, 0, Handle1#rotate_handle.maxF), put(log, L#log{extra = Handle1}), ok. diff --git a/lib/kernel/src/disk_log_1.erl b/lib/kernel/src/disk_log_1.erl index c366504512..c4b00d234e 100644 --- a/lib/kernel/src/disk_log_1.erl +++ b/lib/kernel/src/disk_log_1.erl @@ -27,9 +27,10 @@ mf_ext_inc/2, mf_int_chunk/4, mf_int_chunk_step/3, mf_sync/1, mf_write_cache/1]). -export([mf_ext_open/7, mf_ext_log/3, mf_ext_close/2]). --export([open_rotate_log_file/3, rotate_file/2, +-export([open_rotate_log_file/3, do_rotate/2, rotate_ext_log/3, rotate_write_cache/1, rotate_ext_close/1, - change_size_rotate/2, get_rotate_size/1]). + change_size_rotate/2, get_rotate_size/1, + rotate_files/2]). -export([print_index_file/1]). -export([read_index_file/1]). @@ -1057,7 +1058,7 @@ maybe_update_compress(N, MaxF, FName) -> end, maybe_update_compress(N+1, MaxF, FName). -rotate_file(#rotate_handle{file = FName, maxF = MaxF, cur_fdc = FdC} = RotHandle, Head) -> +do_rotate(#rotate_handle{file = FName, maxF = MaxF, cur_fdc = FdC} = RotHandle, Head) -> #cache{fd = Fd, c = C} = FdC, {_, _C1} = write_cache(Fd, FName, C), _ = delayed_write_close(Fd), @@ -1122,7 +1123,7 @@ rotate_ext_log(Handle, Bins, Head, N0) -> ext_split_bins(CurB, MaxB, FirstPos, Bins), case FirstBins of [] -> - Handle1 = rotate_file(Handle, Head), + Handle1 = do_rotate(Handle, Head), rotate_ext_log(Handle1, Bins, Head, N0); _ -> case fwrite(CurFdC, FileName, FirstBins, NoBytes) of -- 2.35.3
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor