anchor.diff:      ErrorGeneral :: atom(),
       ErrorDetail :: term().
   %% ====================================================================
  -write({uuid, Uuid}, Offset, Buf, EventPolicy) -> % todo alow only FullFilePath for better performance
  +write({uuid, Uuid}, Offset, Buf, EventPolicy) ->
       ct:print("write/4 ~p",[{uuid, Uuid}]),
  -    case logical_files_manager:get_file_full_name_by_uuid(Uuid) of
  +    case get_file_path_from_cache({uuid, Uuid}) of
           {ok, FullFilePath} -> write(FullFilePath, Offset, Buf, EventPolicy);
           Error -> Error
       end;
  -write(File, Offset, Buf, EventPolicy) ->
  -    ct:print("write/4 ~p",[File]),
  +write(FilePath, Offset, Buf, EventPolicy) ->
  +    ct:print("write/4 ~p",[FilePath]),
       case write_enabled(fslogic_context:get_user_dn()) of
           true ->
  -            {Response, Response2} = getfilelocation(File),
  -            case Response of
  -                ok ->
  -                    {Storage_helper_info, FileId} = Response2,
  +            case getfilelocation(FilePath) of
  +                {ok, {Storage_helper_info, FileId}} ->
                       Res = storage_files_manager:write(Storage_helper_info, FileId, Offset, Buf),
   
  -                    %% TODO - check if asynchronous processing needed
                       case {is_integer(Res), event_production_enabled("write_event"), EventPolicy} of
                           {true, true, generate_events} ->
  -
  -                            Ctx = fslogic_context:get_user_context(),
  -                            spawn(fun() ->
  -                                fslogic_context:set_user_context(Ctx),
  -                                {ok, FullFileName} = fslogic_path:get_full_file_name(File), %todo cache somehow
  -                                WriteEvent = [{"type", "write_event"}, {"user_dn", fslogic_context:get_user_dn()},
  -                                    {"count", Res}, {"blocks", [{Offset, Res}]}, {"filePath", FullFileName}],
  -                                gen_server:call(?Dispatcher_Name, {cluster_rengine, 1, {event_arrived, WriteEvent}}),
  -                                WriteEventStats = [{"type", "write_for_stats"}, {"user_dn", fslogic_context:get_user_dn()},
  -                                    {"bytes", Res}, {"blocks", [{Offset, Res}]}, {"filePath", FullFileName}],
  -                                gen_server:call(?Dispatcher_Name, {cluster_rengine, 1, {event_arrived, WriteEventStats}}),
  -                                WriteEventAvailableBlocks = [{"type", "write_for_available_blocks"}, {"user_dn", fslogic_context:get_user_dn()},
  -                                    {"bytes", Res}, {"blocks", [{Offset, Res}]}, {"filePath", FullFileName}],
  -                                gen_server:call(?Dispatcher_Name, {cluster_rengine, 1, {event_arrived, WriteEventAvailableBlocks}})
  -                            end);
  +                            {ok, FullFileName} = get_file_path_from_cache(FilePath),
  +                            WriteEvent = [{"type", "write_event"}, {"user_dn", fslogic_context:get_user_dn()},
  +                                {"count", Res}, {"blocks", [{Offset, Res}]}, {"filePath", FullFileName}],
  +                            gen_server:call(?Dispatcher_Name, {cluster_rengine, 1, {event_arrived, WriteEvent}}),
  +                            WriteEventStats = [{"type", "write_for_stats"}, {"user_dn", fslogic_context:get_user_dn()},
  +                                {"bytes", Res}, {"blocks", [{Offset, Res}]}, {"filePath", FullFileName}],
  +                            gen_server:call(?Dispatcher_Name, {cluster_rengine, 1, {event_arrived, WriteEventStats}}),
  +                            WriteEventAvailableBlocks = [{"type", "write_for_available_blocks"}, {"user_dn", fslogic_context:get_user_dn()},
  +                                {"bytes", Res}, {"blocks", [{Offset, Res}]}, {"filePath", FullFileName}],
  +                            gen_server:call(?Dispatcher_Name, {cluster_rengine, 1, {event_arrived, WriteEventAvailableBlocks}});
                           _ ->
                               ok
                       end,
                       Res;
  -                _ -> {Response, Response2}
  +                Err -> Err
               end;
           _ ->
               {error, quota_exceeded}
  
positive.code:             ok;
          Error -> Error
      end.
  
negative.code:     ErrorGeneral :: atom(),
      ErrorDetail :: term().
  %% ====================================================================
  write({uuid, Uuid}, Buf) ->
      ct:print("write/2 ~p",[{uuid, Uuid}]),
      case get_file_path_from_cache({uuid, Uuid}) of
          {ok, FullFilePath} -> write(FullFilePath, Buf);
          Error -> Error
      end;
  write(FilePath, Buf) ->
      ct:print("write/2 ~p",[FilePath]),
      case write_enabled(fslogic_context:get_user_dn()) of
          true ->
              case getfilelocation(FilePath) of
                  {ok, {Storage_helper_info, FileId}} ->
                      Res = storage_files_manager:write(Storage_helper_info, FileId, Buf),
                      case {is_integer(Res), event_production_enabled("write_event")} of
                          {true, true} ->
  