Removed decode_rc calls that are now decoded within bdberl_drv.c

This commit is contained in:
Jon Meredith 2009-06-01 15:52:06 -06:00
parent 40393a8e62
commit 58b870d15c

View file

@ -428,7 +428,7 @@ txn_commit(Opts) ->
ok -> ok ->
receive receive
ok -> ok; ok -> ok;
{error, Reason} -> {error, decode_rc(Reason)} {error, Reason} -> {error, Reason}
end; end;
Error -> Error ->
{error, Error} {error, Error}
@ -464,7 +464,7 @@ txn_abort() ->
receive receive
ok -> ok; ok -> ok;
{error, no_txn} -> ok; {error, no_txn} -> ok;
{error, Reason} -> {error, decode_rc(Reason)} {error, Reason} -> {error, Reason}
end; end;
no_txn -> no_txn ->
@ -548,6 +548,7 @@ transaction(Fun, Retries, Opts) ->
ok -> ok ->
try Fun() of try Fun() of
abort -> abort ->
error_logger:info_msg("function requested abort"),
ok = txn_abort(), ok = txn_abort(),
{error, transaction_aborted}; {error, transaction_aborted};
@ -567,6 +568,7 @@ transaction(Fun, Retries, Opts) ->
transaction(Fun, R); transaction(Fun, R);
_ : Reason -> _ : Reason ->
error_logger:info_msg("function threw non-lock error - ~p", [Reason]),
ok = txn_abort(), ok = txn_abort(),
{error, {transaction_failed, Reason}} {error, {transaction_failed, Reason}}
end; end;
@ -867,7 +869,7 @@ get(Db, Key, Opts) ->
receive receive
{ok, _, Bin} -> {ok, binary_to_term(Bin)}; {ok, _, Bin} -> {ok, binary_to_term(Bin)};
not_found -> not_found; not_found -> not_found;
{error, Reason} -> {error, decode_rc(Reason)} {error, Reason} -> {error, Reason}
end; end;
Error -> Error ->
{error, Error} {error, Error}
@ -1051,7 +1053,7 @@ truncate(Db) ->
ok -> ok ->
receive receive
ok -> ok; ok -> ok;
{error, Reason} -> {error, decode_rc(Reason)} {error, Reason} -> {error, Reason}
end; end;
Error -> Error ->
@ -1228,7 +1230,7 @@ delete_database(Filename) ->
ok -> ok ->
receive receive
ok -> ok; ok -> ok;
{error, Reason} -> {error, decode_rc(Reason)} {error, Reason} -> {error, Reason}
end; end;
Reason -> Reason ->
{error, Reason} {error, Reason}
@ -1425,7 +1427,7 @@ stat(Db, Opts) ->
ok -> ok ->
receive receive
{error, Reason} -> {error, Reason} ->
{error, decode_rc(Reason)}; {error, Reason};
{ok, Stats} -> {ok, Stats} ->
{ok, Stats} {ok, Stats}
end; end;
@ -1540,7 +1542,7 @@ lock_stat(Opts) ->
ok -> ok ->
receive receive
{error, Reason} -> {error, Reason} ->
{error, decode_rc(Reason)}; {error, Reason};
{ok, Stats} -> {ok, Stats} ->
{ok, Stats} {ok, Stats}
end; end;
@ -1646,7 +1648,7 @@ log_stat(Opts) ->
ok -> ok ->
receive receive
{error, Reason} -> {error, Reason} ->
{error, decode_rc(Reason)}; {error, Reason};
{ok, Stats} -> {ok, Stats} ->
{ok, Stats} {ok, Stats}
end; end;
@ -1837,7 +1839,7 @@ mutex_stat(Opts) ->
ok -> ok ->
receive receive
{error, Reason} -> {error, Reason} ->
{error, decode_rc(Reason)}; {error, Reason};
{ok, Stats} -> {ok, Stats} ->
{ok, Stats} {ok, Stats}
end; end;