From a0ea119623b8bda445f86afdb0ea7b5833c8e171 Mon Sep 17 00:00:00 2001 From: Callum Prentice Date: Tue, 6 Oct 2020 18:18:18 -0700 Subject: Replace references to static writefile with write so we end up with only a single read and a single write function --- indra/llfilesystem/llfilesystem.cpp | 13 ++++++------- indra/llfilesystem/llfilesystem.h | 2 +- 2 files changed, 7 insertions(+), 8 deletions(-) (limited to 'indra/llfilesystem') diff --git a/indra/llfilesystem/llfilesystem.cpp b/indra/llfilesystem/llfilesystem.cpp index ffc3dee12b..6d6ff3d7e1 100644 --- a/indra/llfilesystem/llfilesystem.cpp +++ b/indra/llfilesystem/llfilesystem.cpp @@ -230,6 +230,12 @@ BOOL LLFileSystem::read(U8 *buffer, S32 bytes, BOOL async, F32 priority) mReadComplete = TRUE; } + // update the last access time for the file - this is required + // even though we are reading and not writing because this is the + // way the cache works - it relies on a valid "last accessed time" for + // each file so it knows how to remove the oldest, unused files + LLFileSystem::mDiskCache->updateFileAccessTime(filename); + return success; } @@ -287,13 +293,6 @@ BOOL LLFileSystem::write(const U8 *buffer, S32 bytes) return success; } -//static -BOOL LLFileSystem::writeFile(const U8 *buffer, S32 bytes, const LLUUID &uuid, LLAssetType::EType type) -{ - LLFileSystem file(uuid, type, LLFileSystem::WRITE); - return file.write(buffer, bytes); -} - BOOL LLFileSystem::seek(S32 offset, S32 origin) { if (-1 == origin) diff --git a/indra/llfilesystem/llfilesystem.h b/indra/llfilesystem/llfilesystem.h index 789f9456c7..5d87de9bf8 100644 --- a/indra/llfilesystem/llfilesystem.h +++ b/indra/llfilesystem/llfilesystem.h @@ -1,3 +1,4 @@ +/** /** * @file filesystem.h * @brief Simulate local file system operations. @@ -46,7 +47,6 @@ public: BOOL eof(); BOOL write(const U8 *buffer, S32 bytes); - static BOOL writeFile(const U8 *buffer, S32 bytes, const LLUUID &uuid, LLAssetType::EType type); BOOL seek(S32 offset, S32 origin = -1); S32 tell() const; -- cgit v1.2.3