anchor.diff:  -define(DEFAULT_CHUNK_SIZE, 16384). % Default size for a chunk. All clients use this.
   
   %% API
  --export([add_piece_chunks/3, select_chunks/5, store_chunk/2]).
  +-export([add_piece_chunks/3, select_chunks/5, store_chunk/5]).
   
   %%====================================================================
   %% API
  
positive.code: 	      P = mnesia:read(file_access, Pid, write),
  	      mnesia:write(file_access,
  			   P#file_access { left = P#file_access.left - 1 }),
  	      check_for_full_piece(Pid, R#chunk.piece_number),
  	      ok
        end).
  
  check_for_full_piece(Pid, PieceNumber) ->
      mnesia:transaction(
        fun () ->
  	      R = mnesia:read(file_access, Pid, read),
  	      case R#file_access.left of
  		  0 ->
  		      store_piece(Pid, PieceNumber);
  		  N when is_integer(N) ->
  		      ok
  	      end
        end).
  
  store_piece(_Pid, _PieceNumber) ->
      todo.
  
  %%====================================================================
  %% Internal functions
  %%====================================================================
  
  %%--------------------------------------------------------------------
  %% Function: chunkify(integer(), integer()) ->
  
negative.code: 			    Chunks)
        end).
  
  store_chunk(Ref, Data, StatePid, FSPid, MasterPid) ->
      mnesia:transaction(
        fun () ->
  	      R = mnesia:read(chunk, Ref, write),
  