anchor.diff:  %% @end
   %%--------------------------------------------------------------------
   -spec request_to_file_entry_or_provider(fslogic_worker:ctx(), #fuse_request{}
  -    | #file_request{} | #provider_request{} | #proxyio_request{}) ->
  +| #file_request{} | #provider_request{} | #proxyio_request{}) ->
       {file, file_meta:entry() | {guid, fslogic_worker:file_guid()}} | {provider, oneprovider:id()} | {space, SpaceId :: binary()}.
   request_to_file_entry_or_provider(Ctx, #fuse_request{fuse_request = #resolve_guid{path = Path}}) ->
       {ok, Tokens} = fslogic_path:verify_file_path(Path),
  
positive.code:     #event{object = #write_event{size = Size, blocks = Blocks,
          file_uuid = FileGUID, file_size = FileSize}, counter = Counter} = Event,
  
          {FileUUID, SpaceId} = fslogic_uuid:unpack_guid(FileGUID),
          {ok, #document{value = #session{identity = #user_identity{
              user_id = UserId}}}} = session:get(SessId),
          monitoring_event:emit_write_statistics(SpaceId, UserId, Size, Counter),
  
          UpdatedBlocks = lists:map(fun(#file_block{file_id = FileId, storage_id = StorageId} = Block) ->
              {ValidFileId, ValidStorageId} = file_location:validate_block_data(FileUUID, FileId, StorageId),
              Block#file_block{file_id = ValidFileId, storage_id = ValidStorageId}
          end, Blocks),
  
          case replica_updater:update(FileUUID, UpdatedBlocks, FileSize, true, undefined) of
              {ok, size_changed} ->
                  {ok, #document{value = #session{identity = #user_identity{
                      user_id = UserId}}}} = session:get(SessId),
                  fslogic_times:update_mtime_ctime({uuid, FileUUID}, UserId),
                  fslogic_event:emit_file_attr_update({uuid, FileUUID}, [SessId]),
                  fslogic_event:emit_file_location_update({uuid, FileUUID}, [SessId]);
              {ok, size_not_changed} ->
                  {ok, #document{value = #session{identity = #user_identity{
                      user_id = UserId}}}} = session:get(SessId),
                  fslogic_times:update_mtime_ctime({uuid, FileUUID}, UserId),
                  fslogic_event:emit_file_location_update({uuid, FileUUID}, [SessId]);
              {error, Reason} ->
                  ?error("Unable to update blocks for file ~p due to: ~p.", [FileUUID, Reason]),
                  {error, Reason}
          end.
  
  
  %%--------------------------------------------------------------------
  
negative.code:     end, Evts),
  
      case Ctx of
          #{notify := NotifyFun} ->
              NotifyFun(#server_message{message_body = #status{code = ?OK}});
          _ -> ok
      end,
  
  