Fix dialyzer warnings

This commit is contained in:
Scott Lystig Fritchie 2016-02-15 17:51:08 +09:00
parent 9d4483ae68
commit 67dad7fb8a
2 changed files with 4 additions and 9 deletions

View file

@ -725,8 +725,9 @@ read_repair2(ap_mode=ConsistencyMode,
{ok, {Chunks, _Trimmed}, GotItFrom} when is_list(Chunks) -> {ok, {Chunks, _Trimmed}, GotItFrom} when is_list(Chunks) ->
%% TODO: Repair trimmed chunks %% TODO: Repair trimmed chunks
ToRepair = mutation_flus(P) -- [GotItFrom], ToRepair = mutation_flus(P) -- [GotItFrom],
{reply, Reply, S1} = do_repair_chunks(Chunks, ToRepair, ReturnMode, [GotItFrom], Reply = {ok, {Chunks, []}},
NSInfo, File, Depth, STime, S, {ok, Chunks}), {Reply, S1} = do_repair_chunks(Chunks, ToRepair, ReturnMode, [GotItFrom],
NSInfo, File, Depth, STime, S, Reply),
{reply, Reply, S1}; {reply, Reply, S1};
{error, bad_checksum}=BadCS -> {error, bad_checksum}=BadCS ->
%% TODO: alternate strategy? %% TODO: alternate strategy?
@ -753,7 +754,7 @@ do_repair_chunks([{_, Offset, Chunk, CSum}|T],
Size = iolist_size(Chunk), Size = iolist_size(Chunk),
case do_repair_chunk(ToRepair, ReturnMode, Chunk, CSum, [GotItFrom], NSInfo, File, Offset, case do_repair_chunk(ToRepair, ReturnMode, Chunk, CSum, [GotItFrom], NSInfo, File, Offset,
Size, Depth, STime, S) of Size, Depth, STime, S) of
{ok, Chunk, S1} -> {reply, {ok, _}, S1} ->
do_repair_chunks(T, ToRepair, ReturnMode, [GotItFrom], NSInfo, File, Depth, STime, S1, Reply); do_repair_chunks(T, ToRepair, ReturnMode, [GotItFrom], NSInfo, File, Depth, STime, S1, Reply);
Error -> Error ->
Error Error

View file

@ -191,12 +191,6 @@ generate_uuid_v4_str() ->
io_lib:format("~8.16.0b-~4.16.0b-4~3.16.0b-~4.16.0b-~12.16.0b", io_lib:format("~8.16.0b-~4.16.0b-4~3.16.0b-~4.16.0b-~12.16.0b",
[A, B, C band 16#0fff, D band 16#3fff bor 16#8000, E]). [A, B, C band 16#0fff, D band 16#3fff bor 16#8000, E]).
find_file(DataDir, #ns_info{name=NS, locator=NSLocator}=_NSInfo, Prefix, N) ->
{_Filename, Path} = machi_util:make_data_filename(DataDir,
NS, NSLocator,
Prefix, "*", N),
filelib:wildcard(Path).
list_files(DataDir, Prefix) -> list_files(DataDir, Prefix) ->
{F_bin, Path} = machi_util:make_data_filename(DataDir, "*^" ++ Prefix ++ "^*"), {F_bin, Path} = machi_util:make_data_filename(DataDir, "*^" ++ Prefix ++ "^*"),
filelib:wildcard(binary_to_list(F_bin), filename:dirname(Path)). filelib:wildcard(binary_to_list(F_bin), filename:dirname(Path)).