Skip to content

Commit

Permalink
enforce block aligned writes
Browse files Browse the repository at this point in the history
  • Loading branch information
Cliff Moon committed May 25, 2010
1 parent 1d9ece3 commit 80de568
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion apps/luwak/src/luwak_tree.erl
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,13 @@
%%=======================================
%% Public API
%%=======================================

update(Riak, File, StartingPos, Blocks) ->
Order = luwak_obj:get_property(File, tree_order),
BlockSize = luwak_obj:get_property(File, block_size),
if
StartingPos rem BlockSize =/= 0 -> throw({error, "StartingPos must be a multiple of blocksize"});
true -> ok
end,
case luwak_obj:get_property(File, root) of
%% there is no root, therefore we create one
undefined ->
Expand Down

0 comments on commit 80de568

Please sign in to comment.