anchor.diff:              );
           MaxBlockSize ->
               write_req_body_to_file_in_blocks(
  -                FileHandle, Offset, Req, <<>>, MaxBlockSize,
  +                FileHandle, Offset, Req, MaxBlockSize,
                   ReadReqBodyFun, ReadReqBodyOpts
               )
       end.
  
positive.code: 
  %% API
  -export([get_preferable_write_block_size/1, upload_file/5]).
  %% Exported for tests- TODO rm after switching to use onenv and real storages in tests
  -export([get_storage_preferable_write_block_size/1]).
  
  
  -type read_req_body_fun() :: fun((cowboy_req:req(), cowboy_req:read_body_opts()) ->
      {ok, binary(), cowboy_req:req()} | {more, binary(), cowboy_req:req()}
  
negative.code: 
              case DataToWriteSize >= MaxBlockSize of
                  true ->
                      ChunkSize = case BlockMultiplesPolicy of
                          allow_block_multiples ->
                              MaxBlockSize * (DataToWriteSize div MaxBlockSize);
                          disallow_block_multiples ->
                              MaxBlockSize
                      end,
                      <<Chunk:ChunkSize/binary, ExcessBytes/binary>> = DataToWrite,
  
                      {ok, NewHandle, ChunkSize} = ?check(lfm:write(
                          FileHandle, Offset, Chunk
                      )),
                      {more, NewHandle, Offset + ChunkSize, Req1, ExcessBytes};
                  false ->
                      write_next_block_to_file(
                          FileHandle, Offset, Req1, DataToWrite, MaxBlockSize,
                          BlockMultiplesPolicy, ReadReqBodyFun, ReadReqBodyOpts
                      )
              end
      end.
  