anchor.diff:          {_, NewQ} ->
               erlang:monitor(process, Pid),
               {noreply, S#state{putq = NewQ}}
  -    end;
  -
  -handle_call({get_tag_timestamp, TagName}, _From, S) ->
  +    end.
  +
  +do_get_tag_timestamp(TagName, S) ->
       case gb_trees:lookup(TagName, S#state.tags) of
           none ->
  -            {reply, notfound, S};
  +            notfound;
           {value, {_Time, _VolName} = TagNfo} ->
  -            {reply, {ok, TagNfo}, S}
  -    end;
  -
  -handle_call({get_tag_data, TagName, TagNfo}, From, S) ->
  -    spawn(fun() ->
  -        read_tag(TagName, S#state.nodename, S#state.root, TagNfo, From)
  -    end),
  -    {noreply, S};
  -
  -handle_call({put_tag_data, {Tag, Data}}, _From, S) ->
  +            {ok, TagNfo}
  +    end.
  +
  +do_get_tag_data(Tag, VolName, From, S) ->
  +    {ok, TagDir, _Url} = ddfs_util:hashdir(Tag,
  +                                           disco:host(node()),
  +                                           "tag",
  +                                           S#state.root,
  +                                           VolName),
  +    TagPath = filename:join(TagDir, binary_to_list(Tag)),
  +    case prim_file:read_file(TagPath) of
  +        {ok, Binary} ->
  +            gen_server:reply(From, {ok, Binary});
  +        {error, Reason} ->
  +            error_logger:warning_report({"Read failed", TagPath, Reason}),
  +            gen_server:reply(From, {error, read_failed})
  +    end.
  +
  +do_put_tag_data(Tag, Data, S) ->
       {_Space, VolName} = choose_vol(S#state.vols),
       {ok, Local, _} = ddfs_util:hashdir(Tag,
                                          S#state.nodename,
  
positive.code:     Dst = filename:join(Local,  TagL),
      case ddfs_util:safe_rename(Src, Dst) of
          ok ->
              {reply,
               {ok, Url},
               S#state{tags = gb_trees:enter(TagName,
                                             {Time, VolName},
                                             S#state.tags)}};
          {error, _} = E ->
              {reply, E, S}
      end.
  
  handle_cast({update_vols, NewVols}, #state{vols = Vols} = S) ->
      {noreply, S#state{vols = lists:ukeymerge(2, NewVols, Vols)}};
  
  handle_cast({update_tags, Tags}, S) ->
      {noreply, S#state{tags = Tags}}.
  
  handle_info({'DOWN', _, _, Pid, _}, #state{putq = PutQ, getq = GetQ} = S) ->
      % We don't know if Pid refers to a put or get request.
      % We can safely try to remove it both the queues: It can exist in
      % one of the queues at most.
      {_, NewPutQ} = http_queue:remove(Pid, PutQ),
      {_, NewGetQ} = http_queue:remove(Pid, GetQ),
      {noreply, S#state{putq = NewPutQ, getq = NewGetQ}}.
  
  % callback stubs
  terminate(_Reason, _State) -> {}.
  
  code_change(_OldVsn, State, _Extra) -> {ok, State}.
  
  -spec read_tag(binary(), nonempty_string(), nonempty_string(),
                 {_, nonempty_string()}, {pid(), reference()}) -> _.
  read_tag(Tag, NodeName, Root, {_, VolName}, From) ->
      {ok, D, _} = ddfs_util:hashdir(Tag, NodeName, "tag", Root, VolName),
      case prim_file:read_file(filename:join(D, binary_to_list(Tag))) of
          {ok, Bin} ->
              gen_server:reply(From, {ok, Bin});
          E ->
              error_logger:warning_report({"Read failed", Tag, D, E}),
              gen_server:reply(From, {error, read_failed})
      end.
  
  -spec init_vols(nonempty_string(), [nonempty_string(),...]) ->
  
negative.code:     case ddfs_util:ensure_dir(Local) of
          ok ->
              Filename = filename:join(Local, ["!partial.", binary_to_list(Tag)]),
              case prim_file:write_file(Filename, Data) of
                  ok ->
                      {ok, VolName};
                  {error, _} = E ->
                      E
              end;
          E ->
              E
      end.
  
  do_put_tag_commit(Tag, TagVol, S) ->
      {value, {_, VolName}} = lists:keysearch(node(), 1, TagVol),
      {ok, Local, Url} = ddfs_util:hashdir(Tag,
                                           S#state.nodename,
  