anchor.diff:              ok
       end.
   
  -%%--------------------------------------------------------------------
  -%% Function: select_chunks_by_piecenum(Id, PieceNum, Num, Pid) ->
  -%%     {ok, [{Offset, Len}], Remain}
  -%% Description: Select up to Num chunks from PieceNum. Will return either
  -%%  {ok, Chunks} if it got all chunks it wanted, or {partial, Chunks, Remain}
  -%%  if it got some chunks and there is still Remain chunks left to pick.
  -%%--------------------------------------------------------------------
  -select_chunks_by_piecenum(Id, Index, Max, Pid) ->
  -    R = ets:lookup(?TAB, {Id, Index, not_fetched}),
  -    %% Get up to Max chunks
  -    {Return, _Rest} = etorrent_utils:gsplit(Max, R),
  -    [_|_] = Return, %% Assert.
  -    %% Assign chunk to us
  -    Chunks = [begin
  -		  ets:delete_object(?TAB, C),
  -		  ets:insert(?TAB,
  -			     [C#chunk { idt = {Id, Index, {assigned, Pid}} }]),
  -		  C#chunk.chunk
  -	      end || C <- Return],
  -    {ok, {Index, Chunks}, length(Return)}.
  -
   %% Check the piece Idx on torrent Id for completion
   check_piece(FSPid, Id, Idx) ->
       etorrent_fs:check_piece(FSPid, Idx),
  
positive.code:     etorrent_torrent:decrease_not_fetched(Id),
      ok.
  
  %%--------------------------------------------------------------------
  %% Function: find_chunked_chunks(Id, iterator_result()) -> none | PieceNum
  %% Description: Search an iterator for a chunked piece.
  %%--------------------------------------------------------------------
  find_chunked_chunks(_Id, none, Res) -> Res;
  find_chunked_chunks(Id, {Pn, Next}, Res) ->
      case etorrent_piece_mgr:is_chunked(Id, Pn) of
  
negative.code:             case ets:lookup(?TAB, {Id, Pn, not_fetched}) of
                  [] ->
                      find_chunked_chunks(Id, gb_sets:next(Next), found_chunked);
                  Objects ->
                      Objects
              end;
          false ->
              find_chunked_chunks(Id, gb_sets:next(Next), Res)
  