summaryrefslogtreecommitdiff
path: root/indra/llvfs
diff options
context:
space:
mode:
Diffstat (limited to 'indra/llvfs')
-rwxr-xr-xindra/llvfs/CMakeLists.txt2
-rwxr-xr-xindra/llvfs/lldir.cpp62
-rwxr-xr-xindra/llvfs/lldir_linux.cpp26
-rwxr-xr-xindra/llvfs/lldir_mac.cpp4
-rwxr-xr-xindra/llvfs/lldir_solaris.cpp34
-rwxr-xr-xindra/llvfs/lldir_win32.cpp14
-rwxr-xr-xindra/llvfs/lldirguard.h2
-rwxr-xr-xindra/llvfs/lldiriterator.cpp16
-rwxr-xr-xindra/llvfs/lllfsthread.cpp20
-rwxr-xr-xindra/llvfs/llpidlock.cpp276
-rwxr-xr-xindra/llvfs/llpidlock.h59
-rwxr-xr-xindra/llvfs/llvfile.cpp49
-rwxr-xr-xindra/llvfs/llvfs.cpp200
-rwxr-xr-xindra/llvfs/llvfs.h1
-rwxr-xr-xindra/llvfs/llvfsthread.cpp26
15 files changed, 227 insertions, 564 deletions
diff --git a/indra/llvfs/CMakeLists.txt b/indra/llvfs/CMakeLists.txt
index 67dce8c073..f19fdf4890 100755
--- a/indra/llvfs/CMakeLists.txt
+++ b/indra/llvfs/CMakeLists.txt
@@ -15,7 +15,6 @@ set(llvfs_SOURCE_FILES
lldir.cpp
lldiriterator.cpp
lllfsthread.cpp
- llpidlock.cpp
llvfile.cpp
llvfs.cpp
llvfsthread.cpp
@@ -28,7 +27,6 @@ set(llvfs_HEADER_FILES
lldirguard.h
lldiriterator.h
lllfsthread.h
- llpidlock.h
llvfile.h
llvfs.h
llvfsthread.h
diff --git a/indra/llvfs/lldir.cpp b/indra/llvfs/lldir.cpp
index 6899e9a44a..1bb17eae81 100755
--- a/indra/llvfs/lldir.cpp
+++ b/indra/llvfs/lldir.cpp
@@ -110,7 +110,7 @@ S32 LLDir::deleteFilesInDir(const std::string &dirname, const std::string &mask)
// File masks starting with "/" will match nothing, so we consider them invalid.
if (LLStringUtil::startsWith(mask, getDirDelimiter()))
{
- llwarns << "Invalid file mask: " << mask << llendl;
+ LL_WARNS() << "Invalid file mask: " << mask << LL_ENDL;
llassert(!"Invalid file mask");
}
@@ -133,12 +133,12 @@ S32 LLDir::deleteFilesInDir(const std::string &dirname, const std::string &mask)
{
retry_count++;
result = errno;
- llwarns << "Problem removing " << fullpath << " - errorcode: "
- << result << " attempt " << retry_count << llendl;
+ LL_WARNS() << "Problem removing " << fullpath << " - errorcode: "
+ << result << " attempt " << retry_count << LL_ENDL;
if(retry_count >= 5)
{
- llwarns << "Failed to remove " << fullpath << llendl ;
+ LL_WARNS() << "Failed to remove " << fullpath << LL_ENDL ;
return count ;
}
@@ -148,7 +148,7 @@ S32 LLDir::deleteFilesInDir(const std::string &dirname, const std::string &mask)
{
if (retry_count)
{
- llwarns << "Successfully removed " << fullpath << llendl;
+ LL_WARNS() << "Successfully removed " << fullpath << LL_ENDL;
}
break;
}
@@ -238,7 +238,7 @@ const std::string &LLDir::getLindenUserDir() const
{
if (mLindenUserDir.empty())
{
- lldebugs << "getLindenUserDir() called early, we don't have the user name yet - returning empty string to caller" << llendl;
+ LL_DEBUGS() << "getLindenUserDir() called early, we don't have the user name yet - returning empty string to caller" << LL_ENDL;
}
return mLindenUserDir;
@@ -491,9 +491,9 @@ std::string LLDir::getExpandedFilename(ELLPath location, const std::string& subd
if (prefix.empty())
{
- llwarns << ELLPathToString(location)
+ LL_WARNS() << ELLPathToString(location)
<< ", '" << subdir1 << "', '" << subdir2 << "', '" << in_filename
- << "': prefix is empty, possible bad filename" << llendl;
+ << "': prefix is empty, possible bad filename" << LL_ENDL;
}
std::string expanded_filename = add(add(prefix, subdir1), subdir2);
@@ -802,7 +802,7 @@ void LLDir::setLindenUserDir(const std::string &username)
}
else
{
- llerrs << "NULL name for LLDir::setLindenUserDir" << llendl;
+ LL_ERRS() << "NULL name for LLDir::setLindenUserDir" << LL_ENDL;
}
dumpCurrentDirectories();
@@ -816,7 +816,7 @@ void LLDir::setChatLogsDir(const std::string &path)
}
else
{
- llwarns << "Invalid name for LLDir::setChatLogsDir" << llendl;
+ LL_WARNS() << "Invalid name for LLDir::setChatLogsDir" << LL_ENDL;
}
}
@@ -841,7 +841,7 @@ void LLDir::setPerAccountChatLogsDir(const std::string &username)
}
else
{
- llerrs << "NULL name for LLDir::setPerAccountChatLogsDir" << llendl;
+ LL_ERRS() << "NULL name for LLDir::setPerAccountChatLogsDir" << LL_ENDL;
}
}
@@ -926,22 +926,22 @@ bool LLDir::setCacheDir(const std::string &path)
void LLDir::dumpCurrentDirectories()
{
- LL_DEBUGS2("AppInit","Directories") << "Current Directories:" << LL_ENDL;
-
- LL_DEBUGS2("AppInit","Directories") << " CurPath: " << getCurPath() << LL_ENDL;
- LL_DEBUGS2("AppInit","Directories") << " AppName: " << getAppName() << LL_ENDL;
- LL_DEBUGS2("AppInit","Directories") << " ExecutableFilename: " << getExecutableFilename() << LL_ENDL;
- LL_DEBUGS2("AppInit","Directories") << " ExecutableDir: " << getExecutableDir() << LL_ENDL;
- LL_DEBUGS2("AppInit","Directories") << " ExecutablePathAndName: " << getExecutablePathAndName() << LL_ENDL;
- LL_DEBUGS2("AppInit","Directories") << " WorkingDir: " << getWorkingDir() << LL_ENDL;
- LL_DEBUGS2("AppInit","Directories") << " AppRODataDir: " << getAppRODataDir() << LL_ENDL;
- LL_DEBUGS2("AppInit","Directories") << " OSUserDir: " << getOSUserDir() << LL_ENDL;
- LL_DEBUGS2("AppInit","Directories") << " OSUserAppDir: " << getOSUserAppDir() << LL_ENDL;
- LL_DEBUGS2("AppInit","Directories") << " LindenUserDir: " << getLindenUserDir() << LL_ENDL;
- LL_DEBUGS2("AppInit","Directories") << " TempDir: " << getTempDir() << LL_ENDL;
- LL_DEBUGS2("AppInit","Directories") << " CAFile: " << getCAFile() << LL_ENDL;
- LL_DEBUGS2("AppInit","Directories") << " SkinBaseDir: " << getSkinBaseDir() << LL_ENDL;
- LL_DEBUGS2("AppInit","Directories") << " SkinDir: " << getSkinDir() << LL_ENDL;
+ LL_DEBUGS("AppInit","Directories") << "Current Directories:" << LL_ENDL;
+
+ LL_DEBUGS("AppInit","Directories") << " CurPath: " << getCurPath() << LL_ENDL;
+ LL_DEBUGS("AppInit","Directories") << " AppName: " << getAppName() << LL_ENDL;
+ LL_DEBUGS("AppInit","Directories") << " ExecutableFilename: " << getExecutableFilename() << LL_ENDL;
+ LL_DEBUGS("AppInit","Directories") << " ExecutableDir: " << getExecutableDir() << LL_ENDL;
+ LL_DEBUGS("AppInit","Directories") << " ExecutablePathAndName: " << getExecutablePathAndName() << LL_ENDL;
+ LL_DEBUGS("AppInit","Directories") << " WorkingDir: " << getWorkingDir() << LL_ENDL;
+ LL_DEBUGS("AppInit","Directories") << " AppRODataDir: " << getAppRODataDir() << LL_ENDL;
+ LL_DEBUGS("AppInit","Directories") << " OSUserDir: " << getOSUserDir() << LL_ENDL;
+ LL_DEBUGS("AppInit","Directories") << " OSUserAppDir: " << getOSUserAppDir() << LL_ENDL;
+ LL_DEBUGS("AppInit","Directories") << " LindenUserDir: " << getLindenUserDir() << LL_ENDL;
+ LL_DEBUGS("AppInit","Directories") << " TempDir: " << getTempDir() << LL_ENDL;
+ LL_DEBUGS("AppInit","Directories") << " CAFile: " << getCAFile() << LL_ENDL;
+ LL_DEBUGS("AppInit","Directories") << " SkinBaseDir: " << getSkinBaseDir() << LL_ENDL;
+ LL_DEBUGS("AppInit","Directories") << " SkinDir: " << getSkinDir() << LL_ENDL;
}
std::string LLDir::add(const std::string& path, const std::string& name) const
@@ -1011,13 +1011,13 @@ void dir_exists_or_crash(const std::string &dir_name)
{
if(0 != LLFile::mkdir(dir_name, 0700)) // octal
{
- llerrs << "Unable to create directory: " << dir_name << llendl;
+ LL_ERRS() << "Unable to create directory: " << dir_name << LL_ENDL;
}
}
else
{
- llerrs << "Unable to stat: " << dir_name << " errno = " << stat_rv
- << llendl;
+ LL_ERRS() << "Unable to stat: " << dir_name << " errno = " << stat_rv
+ << LL_ENDL;
}
}
else
@@ -1025,7 +1025,7 @@ void dir_exists_or_crash(const std::string &dir_name)
// data_dir exists, make sure it's a directory.
if(!S_ISDIR(dir_stat.st_mode))
{
- llerrs << "Data directory collision: " << dir_name << llendl;
+ LL_ERRS() << "Data directory collision: " << dir_name << LL_ENDL;
}
}
#endif
diff --git a/indra/llvfs/lldir_linux.cpp b/indra/llvfs/lldir_linux.cpp
index 4edd078640..7a4034c228 100755
--- a/indra/llvfs/lldir_linux.cpp
+++ b/indra/llvfs/lldir_linux.cpp
@@ -49,7 +49,7 @@ static std::string getCurrentUserHome(char* fallback)
}
else
{
- llinfos << "Couldn't detect home directory from passwd - trying $HOME" << llendl;
+ LL_INFOS() << "Couldn't detect home directory from passwd - trying $HOME" << LL_ENDL;
const char *const home_env = getenv("HOME"); /* Flawfinder: ignore */
if (home_env)
{
@@ -57,7 +57,7 @@ static std::string getCurrentUserHome(char* fallback)
}
else
{
- llwarns << "Couldn't detect home directory! Falling back to " << fallback << llendl;
+ LL_WARNS() << "Couldn't detect home directory! Falling back to " << fallback << LL_ENDL;
}
}
@@ -76,11 +76,11 @@ LLDir_Linux::LLDir_Linux()
if (getcwd(tmp_str, LL_MAX_PATH) == NULL)
{
strcpy(tmp_str, "/tmp");
- llwarns << "Could not get current directory; changing to "
- << tmp_str << llendl;
+ LL_WARNS() << "Could not get current directory; changing to "
+ << tmp_str << LL_ENDL;
if (chdir(tmp_str) == -1)
{
- llerrs << "Could not change directory to " << tmp_str << llendl;
+ LL_ERRS() << "Could not change directory to " << tmp_str << LL_ENDL;
}
}
@@ -98,8 +98,8 @@ LLDir_Linux::LLDir_Linux()
{
// ...we're in a dev checkout
mSkinBaseDir = mExecutableDir.substr(0, build_dir_pos) + "/indra/newview/skins";
- llinfos << "Running in dev checkout with mSkinBaseDir "
- << mSkinBaseDir << llendl;
+ LL_INFOS() << "Running in dev checkout with mSkinBaseDir "
+ << mSkinBaseDir << LL_ENDL;
}
else
{
@@ -187,8 +187,8 @@ void LLDir_Linux::initAppDirs(const std::string &app_name,
{
if (errno != EEXIST)
{
- llwarns << "Couldn't create app user dir " << mOSUserAppDir << llendl;
- llwarns << "Default to base dir" << mOSUserDir << llendl;
+ LL_WARNS() << "Couldn't create app user dir " << mOSUserAppDir << LL_ENDL;
+ LL_WARNS() << "Default to base dir" << mOSUserDir << LL_ENDL;
mOSUserAppDir = mOSUserDir;
}
}
@@ -198,7 +198,7 @@ void LLDir_Linux::initAppDirs(const std::string &app_name,
{
if (errno != EEXIST)
{
- llwarns << "Couldn't create LL_PATH_LOGS dir " << getExpandedFilename(LL_PATH_LOGS,"") << llendl;
+ LL_WARNS() << "Couldn't create LL_PATH_LOGS dir " << getExpandedFilename(LL_PATH_LOGS,"") << LL_ENDL;
}
}
@@ -207,7 +207,7 @@ void LLDir_Linux::initAppDirs(const std::string &app_name,
{
if (errno != EEXIST)
{
- llwarns << "Couldn't create LL_PATH_USER_SETTINGS dir " << getExpandedFilename(LL_PATH_USER_SETTINGS,"") << llendl;
+ LL_WARNS() << "Couldn't create LL_PATH_USER_SETTINGS dir " << getExpandedFilename(LL_PATH_USER_SETTINGS,"") << LL_ENDL;
}
}
@@ -216,7 +216,7 @@ void LLDir_Linux::initAppDirs(const std::string &app_name,
{
if (errno != EEXIST)
{
- llwarns << "Couldn't create LL_PATH_CACHE dir " << getExpandedFilename(LL_PATH_CACHE,"") << llendl;
+ LL_WARNS() << "Couldn't create LL_PATH_CACHE dir " << getExpandedFilename(LL_PATH_CACHE,"") << LL_ENDL;
}
}
@@ -247,7 +247,7 @@ std::string LLDir_Linux::getCurPath()
char tmp_str[LL_MAX_PATH]; /* Flawfinder: ignore */
if (getcwd(tmp_str, LL_MAX_PATH) == NULL)
{
- llwarns << "Could not get current directory" << llendl;
+ LL_WARNS() << "Could not get current directory" << LL_ENDL;
tmp_str[0] = '\0';
}
return tmp_str;
diff --git a/indra/llvfs/lldir_mac.cpp b/indra/llvfs/lldir_mac.cpp
index e00596cdb5..ac9ec8e8ee 100755
--- a/indra/llvfs/lldir_mac.cpp
+++ b/indra/llvfs/lldir_mac.cpp
@@ -100,8 +100,8 @@ LLDir_Mac::LLDir_Mac()
// ...we're in a dev checkout
mSkinBaseDir = mExecutableDir.substr(0, build_dir_pos)
+ "/indra/newview/skins";
- llinfos << "Running in dev checkout with mSkinBaseDir "
- << mSkinBaseDir << llendl;
+ LL_INFOS() << "Running in dev checkout with mSkinBaseDir "
+ << mSkinBaseDir << LL_ENDL;
}
else
{
diff --git a/indra/llvfs/lldir_solaris.cpp b/indra/llvfs/lldir_solaris.cpp
index a97d72d539..b43b2f27ce 100755
--- a/indra/llvfs/lldir_solaris.cpp
+++ b/indra/llvfs/lldir_solaris.cpp
@@ -52,7 +52,7 @@ static std::string getCurrentUserHome(char* fallback)
}
else
{
- llinfos << "Couldn't detect home directory from passwd - trying $HOME" << llendl;
+ LL_INFOS() << "Couldn't detect home directory from passwd - trying $HOME" << LL_ENDL;
const char *const home_env = getenv("HOME"); /* Flawfinder: ignore */
if (home_env)
{
@@ -60,7 +60,7 @@ static std::string getCurrentUserHome(char* fallback)
}
else
{
- llwarns << "Couldn't detect home directory! Falling back to " << fallback << llendl;
+ LL_WARNS() << "Couldn't detect home directory! Falling back to " << fallback << LL_ENDL;
}
}
@@ -79,11 +79,11 @@ LLDir_Solaris::LLDir_Solaris()
if (getcwd(tmp_str, LL_MAX_PATH) == NULL)
{
strcpy(tmp_str, "/tmp");
- llwarns << "Could not get current directory; changing to "
- << tmp_str << llendl;
+ LL_WARNS() << "Could not get current directory; changing to "
+ << tmp_str << LL_ENDL;
if (chdir(tmp_str) == -1)
{
- llerrs << "Could not change directory to " << tmp_str << llendl;
+ LL_ERRS() << "Could not change directory to " << tmp_str << LL_ENDL;
}
}
@@ -101,12 +101,12 @@ LLDir_Solaris::LLDir_Solaris()
sprintf(path, "/proc/%d/psinfo", (int)getpid());
int proc_fd = -1;
if((proc_fd = open(path, O_RDONLY)) == -1){
- llwarns << "unable to open " << path << llendl;
+ LL_WARNS() << "unable to open " << path << LL_ENDL;
return;
}
psinfo_t proc_psinfo;
if(read(proc_fd, &proc_psinfo, sizeof(psinfo_t)) != sizeof(psinfo_t)){
- llwarns << "Unable to read " << path << llendl;
+ LL_WARNS() << "Unable to read " << path << LL_ENDL;
close(proc_fd);
return;
}
@@ -114,13 +114,13 @@ LLDir_Solaris::LLDir_Solaris()
close(proc_fd);
mExecutableFilename = strdup(proc_psinfo.pr_fname);
- llinfos << "mExecutableFilename = [" << mExecutableFilename << "]" << llendl;
+ LL_INFOS() << "mExecutableFilename = [" << mExecutableFilename << "]" << LL_ENDL;
sprintf(path, "/proc/%d/path/a.out", (int)getpid());
char execpath[LL_MAX_PATH];
if(readlink(path, execpath, LL_MAX_PATH) == -1){
- llwarns << "Unable to read link from " << path << llendl;
+ LL_WARNS() << "Unable to read link from " << path << LL_ENDL;
return;
}
@@ -130,7 +130,7 @@ LLDir_Solaris::LLDir_Solaris()
*p = NULL;
mExecutablePathAndName = strdup(execpath);
- llinfos << "mExecutablePathAndName = [" << mExecutablePathAndName << "]" << llendl;
+ LL_INFOS() << "mExecutablePathAndName = [" << mExecutablePathAndName << "]" << LL_ENDL;
//NOTE: Why force people to cd into the package directory?
// Look for SECONDLIFE env variable and use it, if set.
@@ -151,7 +151,7 @@ LLDir_Solaris::LLDir_Solaris()
*s = (char)NULL;
mExecutableDir = strdup(execpath);
- llinfos << "mExecutableDir = [" << mExecutableDir << "]" << llendl;
+ LL_INFOS() << "mExecutableDir = [" << mExecutableDir << "]" << LL_ENDL;
}
}
@@ -205,8 +205,8 @@ void LLDir_Solaris::initAppDirs(const std::string &app_name,
{
if (errno != EEXIST)
{
- llwarns << "Couldn't create app user dir " << mOSUserAppDir << llendl;
- llwarns << "Default to base dir" << mOSUserDir << llendl;
+ LL_WARNS() << "Couldn't create app user dir " << mOSUserAppDir << LL_ENDL;
+ LL_WARNS() << "Default to base dir" << mOSUserDir << LL_ENDL;
mOSUserAppDir = mOSUserDir;
}
}
@@ -216,7 +216,7 @@ void LLDir_Solaris::initAppDirs(const std::string &app_name,
{
if (errno != EEXIST)
{
- llwarns << "Couldn't create LL_PATH_LOGS dir " << getExpandedFilename(LL_PATH_LOGS,"") << llendl;
+ LL_WARNS() << "Couldn't create LL_PATH_LOGS dir " << getExpandedFilename(LL_PATH_LOGS,"") << LL_ENDL;
}
}
@@ -225,7 +225,7 @@ void LLDir_Solaris::initAppDirs(const std::string &app_name,
{
if (errno != EEXIST)
{
- llwarns << "Couldn't create LL_PATH_USER_SETTINGS dir " << getExpandedFilename(LL_PATH_USER_SETTINGS,"") << llendl;
+ LL_WARNS() << "Couldn't create LL_PATH_USER_SETTINGS dir " << getExpandedFilename(LL_PATH_USER_SETTINGS,"") << LL_ENDL;
}
}
@@ -234,7 +234,7 @@ void LLDir_Solaris::initAppDirs(const std::string &app_name,
{
if (errno != EEXIST)
{
- llwarns << "Couldn't create LL_PATH_CACHE dir " << getExpandedFilename(LL_PATH_CACHE,"") << llendl;
+ LL_WARNS() << "Couldn't create LL_PATH_CACHE dir " << getExpandedFilename(LL_PATH_CACHE,"") << LL_ENDL;
}
}
@@ -265,7 +265,7 @@ std::string LLDir_Solaris::getCurPath()
char tmp_str[LL_MAX_PATH]; /* Flawfinder: ignore */
if (getcwd(tmp_str, LL_MAX_PATH) == NULL)
{
- llwarns << "Could not get current directory" << llendl;
+ LL_WARNS() << "Could not get current directory" << LL_ENDL;
tmp_str[0] = '\0';
}
return tmp_str;
diff --git a/indra/llvfs/lldir_win32.cpp b/indra/llvfs/lldir_win32.cpp
index 6184095957..ebc8fdca33 100755
--- a/indra/llvfs/lldir_win32.cpp
+++ b/indra/llvfs/lldir_win32.cpp
@@ -131,7 +131,7 @@ LLDir_Win32::LLDir_Win32()
mAppRODataDir = mExecutableDir;
}
-// llinfos << "mAppRODataDir = " << mAppRODataDir << llendl;
+// LL_INFOS() << "mAppRODataDir = " << mAppRODataDir << LL_ENDL;
mSkinBaseDir = mAppRODataDir + mDirDelimiter + "skins";
@@ -144,7 +144,7 @@ LLDir_Win32::LLDir_Win32()
{
if (errno != EEXIST)
{
- llwarns << "Couldn't create LL_PATH_CACHE dir " << mDefaultCacheDir << llendl;
+ LL_WARNS() << "Couldn't create LL_PATH_CACHE dir " << mDefaultCacheDir << LL_ENDL;
}
}
@@ -176,8 +176,8 @@ void LLDir_Win32::initAppDirs(const std::string &app_name,
{
if (errno != EEXIST)
{
- llwarns << "Couldn't create app user dir " << mOSUserAppDir << llendl;
- llwarns << "Default to base dir" << mOSUserDir << llendl;
+ LL_WARNS() << "Couldn't create app user dir " << mOSUserAppDir << LL_ENDL;
+ LL_WARNS() << "Default to base dir" << mOSUserDir << LL_ENDL;
mOSUserAppDir = mOSUserDir;
}
}
@@ -188,7 +188,7 @@ void LLDir_Win32::initAppDirs(const std::string &app_name,
{
if (errno != EEXIST)
{
- llwarns << "Couldn't create LL_PATH_LOGS dir " << getExpandedFilename(LL_PATH_LOGS,"") << llendl;
+ LL_WARNS() << "Couldn't create LL_PATH_LOGS dir " << getExpandedFilename(LL_PATH_LOGS,"") << LL_ENDL;
}
}
@@ -197,7 +197,7 @@ void LLDir_Win32::initAppDirs(const std::string &app_name,
{
if (errno != EEXIST)
{
- llwarns << "Couldn't create LL_PATH_USER_SETTINGS dir " << getExpandedFilename(LL_PATH_USER_SETTINGS,"") << llendl;
+ LL_WARNS() << "Couldn't create LL_PATH_USER_SETTINGS dir " << getExpandedFilename(LL_PATH_USER_SETTINGS,"") << LL_ENDL;
}
}
@@ -206,7 +206,7 @@ void LLDir_Win32::initAppDirs(const std::string &app_name,
{
if (errno != EEXIST)
{
- llwarns << "Couldn't create LL_PATH_CACHE dir " << getExpandedFilename(LL_PATH_CACHE,"") << llendl;
+ LL_WARNS() << "Couldn't create LL_PATH_CACHE dir " << getExpandedFilename(LL_PATH_CACHE,"") << LL_ENDL;
}
}
diff --git a/indra/llvfs/lldirguard.h b/indra/llvfs/lldirguard.h
index 4330095ad0..37b9e9b83e 100755
--- a/indra/llvfs/lldirguard.h
+++ b/indra/llvfs/lldirguard.h
@@ -48,7 +48,7 @@ public:
// Dir has changed
std::string mOrigDirUtf8 = utf16str_to_utf8str(llutf16string(mOrigDir));
std::string mFinalDirUtf8 = utf16str_to_utf8str(llutf16string(mFinalDir));
- llinfos << "Resetting working dir from " << mFinalDirUtf8 << " to " << mOrigDirUtf8 << llendl;
+ LL_INFOS() << "Resetting working dir from " << mFinalDirUtf8 << " to " << mOrigDirUtf8 << LL_ENDL;
SetCurrentDirectory(mOrigDir);
}
}
diff --git a/indra/llvfs/lldiriterator.cpp b/indra/llvfs/lldiriterator.cpp
index 460d2a8b4f..960212495a 100755
--- a/indra/llvfs/lldiriterator.cpp
+++ b/indra/llvfs/lldiriterator.cpp
@@ -62,13 +62,13 @@ LLDirIterator::Impl::Impl(const std::string &dirname, const std::string &mask)
}
catch (const fs::filesystem_error& e)
{
- llwarns << e.what() << llendl;
+ LL_WARNS() << e.what() << LL_ENDL;
return;
}
if (!is_dir)
{
- llwarns << "Invalid path: \"" << dir_path.string() << "\"" << llendl;
+ LL_WARNS() << "Invalid path: \"" << dir_path.string() << "\"" << LL_ENDL;
return;
}
@@ -79,7 +79,7 @@ LLDirIterator::Impl::Impl(const std::string &dirname, const std::string &mask)
}
catch (const fs::filesystem_error& e)
{
- llwarns << e.what() << llendl;
+ LL_WARNS() << e.what() << LL_ENDL;
return;
}
@@ -95,8 +95,8 @@ LLDirIterator::Impl::Impl(const std::string &dirname, const std::string &mask)
}
catch (boost::regex_error& e)
{
- llwarns << "\"" << exp << "\" is not a valid regular expression: "
- << e.what() << llendl;
+ LL_WARNS() << "\"" << exp << "\" is not a valid regular expression: "
+ << e.what() << LL_ENDL;
return;
}
@@ -113,7 +113,7 @@ bool LLDirIterator::Impl::next(std::string &fname)
if (!mIsValid)
{
- llwarns << "The iterator is not correctly initialized." << llendl;
+ LL_WARNS() << "The iterator is not correctly initialized." << LL_ENDL;
return false;
}
@@ -176,7 +176,7 @@ std::string glob_to_regex(const std::string& glob)
case '}':
if (!braces)
{
- llerrs << "glob_to_regex: Closing brace without an equivalent opening brace: " << glob << llendl;
+ LL_ERRS() << "glob_to_regex: Closing brace without an equivalent opening brace: " << glob << LL_ENDL;
}
regex+=')';
@@ -207,7 +207,7 @@ std::string glob_to_regex(const std::string& glob)
if (braces)
{
- llerrs << "glob_to_regex: Unterminated brace expression: " << glob << llendl;
+ LL_ERRS() << "glob_to_regex: Unterminated brace expression: " << glob << LL_ENDL;
}
return regex;
diff --git a/indra/llvfs/lllfsthread.cpp b/indra/llvfs/lllfsthread.cpp
index 073b1af2a1..2fd2614cce 100755
--- a/indra/llvfs/lllfsthread.cpp
+++ b/indra/llvfs/lllfsthread.cpp
@@ -97,7 +97,7 @@ LLLFSThread::handle_t LLLFSThread::read(const std::string& filename, /* Flawfind
bool res = addRequest(req);
if (!res)
{
- llerrs << "LLLFSThread::read called after LLLFSThread::cleanupClass()" << llendl;
+ LL_ERRS() << "LLLFSThread::read called after LLLFSThread::cleanupClass()" << LL_ENDL;
}
return handle;
@@ -119,7 +119,7 @@ LLLFSThread::handle_t LLLFSThread::write(const std::string& filename,
bool res = addRequest(req);
if (!res)
{
- llerrs << "LLLFSThread::read called after LLLFSThread::cleanupClass()" << llendl;
+ LL_ERRS() << "LLLFSThread::read called after LLLFSThread::cleanupClass()" << LL_ENDL;
}
return handle;
@@ -144,7 +144,7 @@ LLLFSThread::Request::Request(LLLFSThread* thread,
{
if (numbytes <= 0)
{
- llwarns << "LLLFSThread: Request with numbytes = " << numbytes << llendl;
+ LL_WARNS() << "LLLFSThread: Request with numbytes = " << numbytes << LL_ENDL;
}
}
@@ -166,7 +166,7 @@ void LLLFSThread::Request::deleteRequest()
{
if (getStatus() == STATUS_QUEUED)
{
- llerrs << "Attempt to delete a queued LLLFSThread::Request!" << llendl;
+ LL_ERRS() << "Attempt to delete a queued LLLFSThread::Request!" << LL_ENDL;
}
if (mResponder.notNull())
{
@@ -186,7 +186,7 @@ bool LLLFSThread::Request::processRequest()
infile.open(mFileName, LL_APR_RB, mThread->getLocalAPRFilePool());
if (!infile.getFileHandle())
{
- llwarns << "LLLFS: Unable to read file: " << mFileName << llendl;
+ LL_WARNS() << "LLLFS: Unable to read file: " << mFileName << LL_ENDL;
mBytesRead = 0; // fail
return true;
}
@@ -198,7 +198,7 @@ bool LLLFSThread::Request::processRequest()
llassert_always(off >= 0);
mBytesRead = infile.read(mBuffer, mBytes );
complete = true;
-// llinfos << "LLLFSThread::READ:" << mFileName << " Bytes: " << mBytesRead << llendl;
+// LL_INFOS() << "LLLFSThread::READ:" << mFileName << " Bytes: " << mBytesRead << LL_ENDL;
}
else if (mOperation == FILE_WRITE)
{
@@ -209,7 +209,7 @@ bool LLLFSThread::Request::processRequest()
outfile.open(mFileName, flags, mThread->getLocalAPRFilePool());
if (!outfile.getFileHandle())
{
- llwarns << "LLLFS: Unable to write file: " << mFileName << llendl;
+ LL_WARNS() << "LLLFS: Unable to write file: " << mFileName << LL_ENDL;
mBytesRead = 0; // fail
return true;
}
@@ -218,18 +218,18 @@ bool LLLFSThread::Request::processRequest()
S32 seek = outfile.seek(APR_SET, mOffset);
if (seek < 0)
{
- llwarns << "LLLFS: Unable to write file (seek failed): " << mFileName << llendl;
+ LL_WARNS() << "LLLFS: Unable to write file (seek failed): " << mFileName << LL_ENDL;
mBytesRead = 0; // fail
return true;
}
}
mBytesRead = outfile.write(mBuffer, mBytes );
complete = true;
-// llinfos << "LLLFSThread::WRITE:" << mFileName << " Bytes: " << mBytesRead << "/" << mBytes << " Offset:" << mOffset << llendl;
+// LL_INFOS() << "LLLFSThread::WRITE:" << mFileName << " Bytes: " << mBytesRead << "/" << mBytes << " Offset:" << mOffset << LL_ENDL;
}
else
{
- llerrs << "LLLFSThread::unknown operation: " << (S32)mOperation << llendl;
+ LL_ERRS() << "LLLFSThread::unknown operation: " << (S32)mOperation << LL_ENDL;
}
return complete;
}
diff --git a/indra/llvfs/llpidlock.cpp b/indra/llvfs/llpidlock.cpp
deleted file mode 100755
index 0424f2379e..0000000000
--- a/indra/llvfs/llpidlock.cpp
+++ /dev/null
@@ -1,276 +0,0 @@
-/**
- * @file llformat.cpp
- * @date January 2007
- * @brief string formatting utility
- *
- * $LicenseInfo:firstyear=2007&license=viewerlgpl$
- * Second Life Viewer Source Code
- * Copyright (C) 2010, Linden Research, Inc.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation;
- * version 2.1 of the License only.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- *
- * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA
- * $/LicenseInfo$
- */
-
-#include "linden_common.h"
-
-#include "llpidlock.h"
-#include "lldir.h"
-#include "llsd.h"
-#include "llsdserialize.h"
-#include "llnametable.h"
-#include "llframetimer.h"
-
-#if LL_WINDOWS //For windows platform.
-
-#include <windows.h>
-
-namespace {
- inline DWORD getpid() {
- return GetCurrentProcessId();
- }
-}
-
-bool isProcessAlive(U32 pid)
-{
- return (bool) GetProcessVersion((DWORD)pid);
-}
-
-#else //Everyone Else
-bool isProcessAlive(U32 pid)
-{
- return (bool) kill( (pid_t)pid, 0);
-}
-#endif //Everyone else.
-
-
-
-class LLPidLockFile
-{
- public:
- LLPidLockFile( ) :
- mAutosave(false),
- mSaving(false),
- mWaiting(false),
- mPID(getpid()),
- mNameTable(NULL),
- mClean(true)
- {
- mLockName = gDirUtilp->getTempDir() + gDirUtilp->getDirDelimiter() + "savelock";
- }
- bool requestLock(LLNameTable<void *> *name_table, bool autosave,
- bool force_immediate=FALSE, F32 timeout=300.0);
- bool checkLock();
- void releaseLock();
-
- private:
- void writeLockFile(LLSD pids);
- public:
- static LLPidLockFile& instance(); // return the singleton black list file
-
- bool mAutosave;
- bool mSaving;
- bool mWaiting;
- LLFrameTimer mTimer;
- U32 mPID;
- std::string mLockName;
- std::string mSaveName;
- LLSD mPIDS_sd;
- LLNameTable<void*> *mNameTable;
- bool mClean;
-};
-
-LLPidLockFile& LLPidLockFile::instance()
-{
- static LLPidLockFile the_file;
- return the_file;
-}
-
-void LLPidLockFile::writeLockFile(LLSD pids)
-{
- llofstream ofile(mLockName);
-
- if (!LLSDSerialize::toXML(pids,ofile))
- {
- llwarns << "Unable to write concurrent save lock file." << llendl;
- }
- ofile.close();
-}
-
-bool LLPidLockFile::requestLock(LLNameTable<void *> *name_table, bool autosave,
- bool force_immediate, F32 timeout)
-{
- bool readyToSave = FALSE;
-
- if (mSaving) return FALSE; //Bail out if we're currently saving. Will not queue another save.
-
- if (!mWaiting){
- mNameTable=name_table;
- mAutosave = autosave;
- }
-
- LLSD out_pids;
- out_pids.append( (LLSD::Integer)mPID );
-
- llifstream ifile(mLockName);
-
- if (ifile.is_open())
- { //If file exists, we need to decide whether or not to continue.
- if ( force_immediate
- || mTimer.hasExpired() ) //Only deserialize if we REALLY need to.
- {
-
- LLSD in_pids;
-
- LLSDSerialize::fromXML(in_pids, ifile);
-
- //Clean up any dead PIDS that might be in there.
- for (LLSD::array_iterator i=in_pids.beginArray();
- i !=in_pids.endArray();
- ++i)
- {
- U32 stored_pid=(*i).asInteger();
-
- if (isProcessAlive(stored_pid))
- {
- out_pids.append( (*i) );
- }
- }
-
- readyToSave=TRUE;
- }
- ifile.close();
- }
- else
- {
- readyToSave=TRUE;
- }
-
- if (!mWaiting) //Not presently waiting to save. Queue up.
- {
- mTimer.resetWithExpiry(timeout);
- mWaiting=TRUE;
- }
-
- if (readyToSave)
- { //Potential race condition won't kill us. Ignore it.
- writeLockFile(out_pids);
- mSaving=TRUE;
- }
-
- return readyToSave;
-}
-
-bool LLPidLockFile::checkLock()
-{
- return mWaiting;
-}
-
-void LLPidLockFile::releaseLock()
-{
- llifstream ifile(mLockName);
- LLSD in_pids;
- LLSD out_pids;
- bool write_file=FALSE;
-
- LLSDSerialize::fromXML(in_pids, ifile);
-
- //Clean up this PID and any dead ones.
- for (LLSD::array_iterator i=in_pids.beginArray();
- i !=in_pids.endArray();
- ++i)
- {
- U32 stored_pid=(*i).asInteger();
-
- if (stored_pid != mPID && isProcessAlive(stored_pid))
- {
- out_pids.append( (*i) );
- write_file=TRUE;
- }
- }
- ifile.close();
-
- if (write_file)
- {
- writeLockFile(out_pids);
- }
- else
- {
- unlink(mLockName.c_str());
- }
-
- mSaving=FALSE;
- mWaiting=FALSE;
-}
-
-//LLPidLock
-
-void LLPidLock::initClass() {
- (void) LLPidLockFile::instance();
-}
-
-bool LLPidLock::checkLock()
-{
- return LLPidLockFile::instance().checkLock();
-}
-
-bool LLPidLock::requestLock(LLNameTable<void *> *name_table, bool autosave,
- bool force_immediate, F32 timeout)
-{
- return LLPidLockFile::instance().requestLock(name_table,autosave,force_immediate,timeout);
-}
-
-void LLPidLock::releaseLock()
-{
- return LLPidLockFile::instance().releaseLock();
-}
-
-bool LLPidLock::isClean()
-{
- return LLPidLockFile::instance().mClean;
-}
-
-//getters
-LLNameTable<void *> * LLPidLock::getNameTable()
-{
- return LLPidLockFile::instance().mNameTable;
-}
-
-bool LLPidLock::getAutosave()
-{
- return LLPidLockFile::instance().mAutosave;
-}
-
-bool LLPidLock::getClean()
-{
- return LLPidLockFile::instance().mClean;
-}
-
-std::string LLPidLock::getSaveName()
-{
- return LLPidLockFile::instance().mSaveName;
-}
-
-//setters
-void LLPidLock::setClean(bool clean)
-{
- LLPidLockFile::instance().mClean=clean;
-}
-
-void LLPidLock::setSaveName(std::string savename)
-{
- LLPidLockFile::instance().mSaveName=savename;
-}
diff --git a/indra/llvfs/llpidlock.h b/indra/llvfs/llpidlock.h
deleted file mode 100755
index d3295f4911..0000000000
--- a/indra/llvfs/llpidlock.h
+++ /dev/null
@@ -1,59 +0,0 @@
-/**
- * @file llpidlock.h
- * @brief System information debugging classes.
- *
- * $LicenseInfo:firstyear=2001&license=viewerlgpl$
- * Second Life Viewer Source Code
- * Copyright (C) 2010, Linden Research, Inc.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation;
- * version 2.1 of the License only.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- *
- * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA
- * $/LicenseInfo$
- */
-
-#ifndef LL_PIDLOCK_H
-#define LL_PIDLOCK_H
-#include "llnametable.h"
-
-class LLSD;
-class LLFrameTimer;
-
-#if !LL_WINDOWS //For non-windows platforms.
-#include <signal.h>
-#endif
-
-namespace LLPidLock
-{
- void initClass(); // { (void) LLPidLockFile::instance(); }
-
- bool requestLock( LLNameTable<void *> *name_table=NULL, bool autosave=TRUE,
- bool force_immediate=FALSE, F32 timeout=300.0);
- bool checkLock();
- void releaseLock();
- bool isClean();
-
- //getters
- LLNameTable<void *> * getNameTable();
- bool getAutosave();
- bool getClean();
- std::string getSaveName();
-
- //setters
- void setClean(bool clean);
- void setSaveName(std::string savename);
-};
-
-#endif // LL_PIDLOCK_H
diff --git a/indra/llvfs/llvfile.cpp b/indra/llvfs/llvfile.cpp
index 306d7d8ec7..34b61ee0a0 100755
--- a/indra/llvfs/llvfile.cpp
+++ b/indra/llvfs/llvfile.cpp
@@ -30,16 +30,17 @@
#include "llerror.h"
#include "llthread.h"
-#include "llstat.h"
-#include "llvfs.h"
+#include "lltimer.h"
+#include "llfasttimer.h"
#include "llmemory.h"
+#include "llvfs.h"
const S32 LLVFile::READ = 0x00000001;
const S32 LLVFile::WRITE = 0x00000002;
const S32 LLVFile::READ_WRITE = 0x00000003; // LLVFile::READ & LLVFile::WRITE
const S32 LLVFile::APPEND = 0x00000006; // 0x00000004 & LLVFile::WRITE
-static LLFastTimer::DeclareTimer FTM_VFILE_WAIT("VFile Wait");
+static LLTrace::BlockTimerStatHandle FTM_VFILE_WAIT("VFile Wait");
//----------------------------------------------------------------------------
LLVFSThread* LLVFile::sVFSThread = NULL;
@@ -72,7 +73,7 @@ LLVFile::~LLVFile()
{
if (!(mMode & LLVFile::WRITE))
{
- //llwarns << "Destroying LLVFile with pending async read/write, aborting..." << llendl;
+ //LL_WARNS() << "Destroying LLVFile with pending async read/write, aborting..." << LL_ENDL;
sVFSThread->setFlags(mHandle, LLVFSThread::FLAG_AUTO_COMPLETE | LLVFSThread::FLAG_ABORT);
}
else // WRITE
@@ -88,13 +89,13 @@ BOOL LLVFile::read(U8 *buffer, S32 bytes, BOOL async, F32 priority)
{
if (! (mMode & READ))
{
- llwarns << "Attempt to read from file " << mFileID << " opened with mode " << std::hex << mMode << std::dec << llendl;
+ LL_WARNS() << "Attempt to read from file " << mFileID << " opened with mode " << std::hex << mMode << std::dec << LL_ENDL;
return FALSE;
}
if (mHandle != LLVFSThread::nullHandle())
{
- llwarns << "Attempt to read from vfile object " << mFileID << " with pending async operation" << llendl;
+ LL_WARNS() << "Attempt to read from vfile object " << mFileID << " with pending async operation" << LL_ENDL;
return FALSE;
}
mPriority = priority;
@@ -135,13 +136,13 @@ U8* LLVFile::readFile(LLVFS *vfs, const LLUUID &uuid, LLAssetType::EType type, S
data = NULL;
}
else
- {
- data = (U8*) ll_aligned_malloc_16(file_size);
+ {
+ data = (U8*) ll_aligned_malloc<16>(file_size);
file.read(data, file_size); /* Flawfinder: ignore */
if (file.getLastBytesRead() != (S32)file_size)
{
- ll_aligned_free(data);
+ ll_aligned_free<16>(data);
data = NULL;
file_size = 0;
}
@@ -198,11 +199,11 @@ BOOL LLVFile::write(const U8 *buffer, S32 bytes)
{
if (! (mMode & WRITE))
{
- llwarns << "Attempt to write to file " << mFileID << " opened with mode " << std::hex << mMode << std::dec << llendl;
+ LL_WARNS() << "Attempt to write to file " << mFileID << " opened with mode " << std::hex << mMode << std::dec << LL_ENDL;
}
if (mHandle != LLVFSThread::nullHandle())
{
- llerrs << "Attempt to write to vfile object " << mFileID << " with pending async operation" << llendl;
+ LL_ERRS() << "Attempt to write to vfile object " << mFileID << " with pending async operation" << LL_ENDL;
return FALSE;
}
BOOL success = TRUE;
@@ -232,7 +233,7 @@ BOOL LLVFile::write(const U8 *buffer, S32 bytes)
if (wrote < bytes)
{
- llwarns << "Tried to write " << bytes << " bytes, actually wrote " << wrote << llendl;
+ LL_WARNS() << "Tried to write " << bytes << " bytes, actually wrote " << wrote << LL_ENDL;
success = FALSE;
}
@@ -252,7 +253,7 @@ BOOL LLVFile::seek(S32 offset, S32 origin)
{
if (mMode == APPEND)
{
- llwarns << "Attempt to seek on append-only file" << llendl;
+ LL_WARNS() << "Attempt to seek on append-only file" << LL_ENDL;
return FALSE;
}
@@ -267,14 +268,14 @@ BOOL LLVFile::seek(S32 offset, S32 origin)
if (new_pos > size)
{
- llwarns << "Attempt to seek past end of file" << llendl;
+ LL_WARNS() << "Attempt to seek past end of file" << LL_ENDL;
mPosition = size;
return FALSE;
}
else if (new_pos < 0)
{
- llwarns << "Attempt to seek past beginning of file" << llendl;
+ LL_WARNS() << "Attempt to seek past beginning of file" << LL_ENDL;
mPosition = 0;
return FALSE;
@@ -308,20 +309,20 @@ BOOL LLVFile::setMaxSize(S32 size)
{
if (! (mMode & WRITE))
{
- llwarns << "Attempt to change size of file " << mFileID << " opened with mode " << std::hex << mMode << std::dec << llendl;
+ LL_WARNS() << "Attempt to change size of file " << mFileID << " opened with mode " << std::hex << mMode << std::dec << LL_ENDL;
return FALSE;
}
if (!mVFS->checkAvailable(size))
{
- //LLFastTimer t(FTM_VFILE_WAIT);
+ //LL_RECORD_BLOCK_TIME(FTM_VFILE_WAIT);
S32 count = 0;
while (sVFSThread->getPending() > 1000)
{
if (count % 100 == 0)
{
- llinfos << "VFS catching up... Pending: " << sVFSThread->getPending() << llendl;
+ LL_INFOS() << "VFS catching up... Pending: " << sVFSThread->getPending() << LL_ENDL;
}
if (sVFSThread->isPaused())
{
@@ -337,14 +338,14 @@ BOOL LLVFile::rename(const LLUUID &new_id, const LLAssetType::EType new_type)
{
if (! (mMode & WRITE))
{
- llwarns << "Attempt to rename file " << mFileID << " opened with mode " << std::hex << mMode << std::dec << llendl;
+ LL_WARNS() << "Attempt to rename file " << mFileID << " opened with mode " << std::hex << mMode << std::dec << LL_ENDL;
return FALSE;
}
if (mHandle != LLVFSThread::nullHandle())
{
- llwarns << "Renaming file with pending async read" << llendl;
+ LL_WARNS() << "Renaming file with pending async read" << LL_ENDL;
}
waitForLock(VFSLOCK_READ);
@@ -364,18 +365,18 @@ BOOL LLVFile::rename(const LLUUID &new_id, const LLAssetType::EType new_type)
BOOL LLVFile::remove()
{
-// llinfos << "Removing file " << mFileID << llendl;
+// LL_INFOS() << "Removing file " << mFileID << LL_ENDL;
if (! (mMode & WRITE))
{
// Leaving paranoia warning just because this should be a very infrequent
// operation.
- llwarns << "Remove file " << mFileID << " opened with mode " << std::hex << mMode << std::dec << llendl;
+ LL_WARNS() << "Remove file " << mFileID << " opened with mode " << std::hex << mMode << std::dec << LL_ENDL;
}
if (mHandle != LLVFSThread::nullHandle())
{
- llwarns << "Removing file with pending async read" << llendl;
+ LL_WARNS() << "Removing file with pending async read" << LL_ENDL;
}
// why not seek back to the beginning of the file too?
@@ -423,7 +424,7 @@ bool LLVFile::isLocked(EVFSLock lock)
void LLVFile::waitForLock(EVFSLock lock)
{
- //LLFastTimer t(FTM_VFILE_WAIT);
+ //LL_RECORD_BLOCK_TIME(FTM_VFILE_WAIT);
// spin until the lock clears
while (isLocked(lock))
{
diff --git a/indra/llvfs/llvfs.cpp b/indra/llvfs/llvfs.cpp
index 82c926620a..7b27579492 100755
--- a/indra/llvfs/llvfs.cpp
+++ b/indra/llvfs/llvfs.cpp
@@ -637,7 +637,7 @@ void LLVFS::presizeDataFile(const U32 size)
{
if (!mDataFP)
{
- llerrs << "LLVFS::presizeDataFile() with no data file open" << llendl;
+ LL_ERRS() << "LLVFS::presizeDataFile() with no data file open" << LL_ENDL;
return;
}
@@ -652,11 +652,11 @@ void LLVFS::presizeDataFile(const U32 size)
if (tmp)
{
- llinfos << "Pre-sized VFS data file to " << ftell(mDataFP) << " bytes" << llendl;
+ LL_INFOS() << "Pre-sized VFS data file to " << ftell(mDataFP) << " bytes" << LL_ENDL;
}
else
{
- llwarns << "Failed to pre-size VFS data file" << llendl;
+ LL_WARNS() << "Failed to pre-size VFS data file" << LL_ENDL;
}
}
@@ -666,7 +666,7 @@ BOOL LLVFS::getExists(const LLUUID &file_id, const LLAssetType::EType file_type)
if (!isValid())
{
- llerrs << "Attempting to use invalid VFS!" << llendl;
+ LL_ERRS() << "Attempting to use invalid VFS!" << LL_ENDL;
}
lockData();
@@ -692,7 +692,7 @@ S32 LLVFS::getSize(const LLUUID &file_id, const LLAssetType::EType file_type)
if (!isValid())
{
- llerrs << "Attempting to use invalid VFS!" << llendl;
+ LL_ERRS() << "Attempting to use invalid VFS!" << LL_ENDL;
}
@@ -719,7 +719,7 @@ S32 LLVFS::getMaxSize(const LLUUID &file_id, const LLAssetType::EType file_type
if (!isValid())
{
- llerrs << "Attempting to use invalid VFS!" << llendl;
+ LL_ERRS() << "Attempting to use invalid VFS!" << LL_ENDL;
}
lockData();
@@ -755,15 +755,15 @@ BOOL LLVFS::setMaxSize(const LLUUID &file_id, const LLAssetType::EType file_type
{
if (!isValid())
{
- llerrs << "Attempting to use invalid VFS!" << llendl;
+ LL_ERRS() << "Attempting to use invalid VFS!" << LL_ENDL;
}
if (mReadOnly)
{
- llerrs << "Attempt to write to read-only VFS" << llendl;
+ LL_ERRS() << "Attempt to write to read-only VFS" << LL_ENDL;
}
if (max_size <= 0)
{
- llwarns << "VFS: Attempt to assign size " << max_size << " to vfile " << file_id << llendl;
+ LL_WARNS() << "VFS: Attempt to assign size " << max_size << " to vfile " << file_id << LL_ENDL;
return FALSE;
}
@@ -810,7 +810,7 @@ BOOL LLVFS::setMaxSize(const LLUUID &file_id, const LLAssetType::EType file_type
if (block->mLength < block->mSize)
{
// JC: Was a warning, but Ian says it's bad.
- llerrs << "Truncating virtual file " << file_id << " to " << block->mLength << " bytes" << llendl;
+ LL_ERRS() << "Truncating virtual file " << file_id << " to " << block->mLength << " bytes" << LL_ENDL;
block->mSize = block->mLength;
}
@@ -878,10 +878,10 @@ BOOL LLVFS::setMaxSize(const LLUUID &file_id, const LLAssetType::EType file_type
fseek(mDataFP, new_data_location, SEEK_SET);
if (fwrite(&buffer[0], block->mSize, 1, mDataFP) != 1)
{
- llwarns << "Short write" << llendl;
+ LL_WARNS() << "Short write" << LL_ENDL;
}
} else {
- llwarns << "Short read" << llendl;
+ LL_WARNS() << "Short read" << LL_ENDL;
}
}
}
@@ -898,7 +898,7 @@ BOOL LLVFS::setMaxSize(const LLUUID &file_id, const LLAssetType::EType file_type
}
else
{
- llwarns << "VFS: No space (" << max_size << ") to resize existing vfile " << file_id << llendl;
+ LL_WARNS() << "VFS: No space (" << max_size << ") to resize existing vfile " << file_id << LL_ENDL;
//dumpMap();
unlockData();
dumpStatistics();
@@ -934,7 +934,7 @@ BOOL LLVFS::setMaxSize(const LLUUID &file_id, const LLAssetType::EType file_type
}
else
{
- llwarns << "VFS: No space (" << max_size << ") for new virtual file " << file_id << llendl;
+ LL_WARNS() << "VFS: No space (" << max_size << ") for new virtual file " << file_id << LL_ENDL;
//dumpMap();
unlockData();
dumpStatistics();
@@ -953,11 +953,11 @@ void LLVFS::renameFile(const LLUUID &file_id, const LLAssetType::EType file_type
{
if (!isValid())
{
- llerrs << "Attempting to use invalid VFS!" << llendl;
+ LL_ERRS() << "Attempting to use invalid VFS!" << LL_ENDL;
}
if (mReadOnly)
{
- llerrs << "Attempt to write to read-only VFS" << llendl;
+ LL_ERRS() << "Attempt to write to read-only VFS" << LL_ENDL;
}
lockData();
@@ -989,7 +989,7 @@ void LLVFS::renameFile(const LLUUID &file_id, const LLAssetType::EType file_type
{
if(dest_block->mLocks[i])
{
- llerrs << "Renaming VFS block to a locked file." << llendl;
+ LL_ERRS() << "Renaming VFS block to a locked file." << LL_ENDL;
}
dest_block->mLocks[i] = src_block->mLocks[i];
}
@@ -1009,7 +1009,7 @@ void LLVFS::renameFile(const LLUUID &file_id, const LLAssetType::EType file_type
}
else
{
- llwarns << "VFS: Attempt to rename nonexistent vfile " << file_id << ":" << file_type << llendl;
+ LL_WARNS() << "VFS: Attempt to rename nonexistent vfile " << file_id << ":" << file_type << LL_ENDL;
}
unlockData();
}
@@ -1041,11 +1041,11 @@ void LLVFS::removeFile(const LLUUID &file_id, const LLAssetType::EType file_type
{
if (!isValid())
{
- llerrs << "Attempting to use invalid VFS!" << llendl;
+ LL_ERRS() << "Attempting to use invalid VFS!" << LL_ENDL;
}
if (mReadOnly)
{
- llerrs << "Attempt to write to read-only VFS" << llendl;
+ LL_ERRS() << "Attempt to write to read-only VFS" << LL_ENDL;
}
lockData();
@@ -1059,7 +1059,7 @@ void LLVFS::removeFile(const LLUUID &file_id, const LLAssetType::EType file_type
}
else
{
- llwarns << "VFS: attempting to remove nonexistent file " << file_id << " type " << file_type << llendl;
+ LL_WARNS() << "VFS: attempting to remove nonexistent file " << file_id << " type " << file_type << LL_ENDL;
}
unlockData();
@@ -1072,7 +1072,7 @@ S32 LLVFS::getData(const LLUUID &file_id, const LLAssetType::EType file_type, U8
if (!isValid())
{
- llerrs << "Attempting to use invalid VFS!" << llendl;
+ LL_ERRS() << "Attempting to use invalid VFS!" << LL_ENDL;
}
llassert(location >= 0);
llassert(length >= 0);
@@ -1091,7 +1091,7 @@ S32 LLVFS::getData(const LLUUID &file_id, const LLAssetType::EType file_type, U8
if (location > block->mSize)
{
- llwarns << "VFS: Attempt to read location " << location << " in file " << file_id << " of length " << block->mSize << llendl;
+ LL_WARNS() << "VFS: Attempt to read location " << location << " in file " << file_id << " of length " << block->mSize << LL_ENDL;
}
else
{
@@ -1119,11 +1119,11 @@ S32 LLVFS::storeData(const LLUUID &file_id, const LLAssetType::EType file_type,
{
if (!isValid())
{
- llerrs << "Attempting to use invalid VFS!" << llendl;
+ LL_ERRS() << "Attempting to use invalid VFS!" << LL_ENDL;
}
if (mReadOnly)
{
- llerrs << "Attempt to write to read-only VFS" << llendl;
+ LL_ERRS() << "Attempt to write to read-only VFS" << LL_ENDL;
}
llassert(length > 0);
@@ -1148,22 +1148,22 @@ S32 LLVFS::storeData(const LLUUID &file_id, const LLAssetType::EType file_type,
if (block->mLength == BLOCK_LENGTH_INVALID)
{
// Block was removed, ignore write
- llwarns << "VFS: Attempt to write to invalid block"
+ LL_WARNS() << "VFS: Attempt to write to invalid block"
<< " in file " << file_id
<< " location: " << in_loc
<< " bytes: " << length
- << llendl;
+ << LL_ENDL;
unlockData();
return length;
}
else if (location > block->mLength)
{
- llwarns << "VFS: Attempt to write to location " << location
+ LL_WARNS() << "VFS: Attempt to write to location " << location
<< " in file " << file_id
<< " type " << S32(file_type)
<< " of size " << block->mSize
<< " block length " << block->mLength
- << llendl;
+ << LL_ENDL;
unlockData();
return length;
}
@@ -1171,7 +1171,7 @@ S32 LLVFS::storeData(const LLUUID &file_id, const LLAssetType::EType file_type,
{
if (length > block->mLength - location )
{
- llwarns << "VFS: Truncating write to virtual file " << file_id << " type " << S32(file_type) << llendl;
+ LL_WARNS() << "VFS: Truncating write to virtual file " << file_id << " type " << S32(file_type) << LL_ENDL;
length = block->mLength - location;
}
U32 file_location = location + block->mLocation;
@@ -1180,7 +1180,7 @@ S32 LLVFS::storeData(const LLUUID &file_id, const LLAssetType::EType file_type,
S32 write_len = (S32)fwrite(buffer, 1, length, mDataFP);
if (write_len != length)
{
- llwarns << llformat("VFS Write Error: %d != %d",write_len,length) << llendl;
+ LL_WARNS() << llformat("VFS Write Error: %d != %d",write_len,length) << LL_ENDL;
}
// fflush(mDataFP);
@@ -1243,7 +1243,7 @@ void LLVFS::decLock(const LLUUID &file_id, const LLAssetType::EType file_type, E
}
else
{
- llwarns << "VFS: Decrementing zero-value lock " << lock << llendl;
+ LL_WARNS() << "VFS: Decrementing zero-value lock " << lock << LL_ENDL;
}
mLockCounts[lock]--;
}
@@ -1295,7 +1295,7 @@ void LLVFS::eraseBlockLength(LLVFSBlock *block)
}
if(!found_block)
{
- llerrs << "eraseBlock could not find block" << llendl;
+ LL_ERRS() << "eraseBlock could not find block" << LL_ENDL;
}
}
@@ -1318,7 +1318,7 @@ void LLVFS::addFreeBlock(LLVFSBlock *block)
size_t dbgcount = mFreeBlocksByLocation.count(block->mLocation);
if(dbgcount > 0)
{
- llerrs << "addFreeBlock called with block already in list" << llendl;
+ LL_ERRS() << "addFreeBlock called with block already in list" << LL_ENDL;
}
#endif
@@ -1347,7 +1347,7 @@ void LLVFS::addFreeBlock(LLVFSBlock *block)
if (merge_prev && merge_next)
{
- // llinfos << "VFS merge BOTH" << llendl;
+ // LL_INFOS() << "VFS merge BOTH" << LL_ENDL;
// Previous block is changing length (a lot), so only need to update length map.
// Next block is going away completely. JC
eraseBlockLength(prev_block);
@@ -1361,7 +1361,7 @@ void LLVFS::addFreeBlock(LLVFSBlock *block)
}
else if (merge_prev)
{
- // llinfos << "VFS merge previous" << llendl;
+ // LL_INFOS() << "VFS merge previous" << LL_ENDL;
// Previous block is maintaining location, only changing length,
// therefore only need to update the length map. JC
eraseBlockLength(prev_block);
@@ -1372,7 +1372,7 @@ void LLVFS::addFreeBlock(LLVFSBlock *block)
}
else if (merge_next)
{
- // llinfos << "VFS merge next" << llendl;
+ // LL_INFOS() << "VFS merge next" << LL_ENDL;
// Next block is changing both location and length,
// so both free lists must update. JC
eraseBlock(next_block);
@@ -1399,7 +1399,7 @@ void LLVFS::addFreeBlock(LLVFSBlock *block)
//{
// if (!isValid())
// {
-// llerrs << "Attempting to use invalid VFS!" << llendl;
+// LL_ERRS() << "Attempting to use invalid VFS!" << LL_ENDL;
// }
// // TODO: could we optimize this with hints from the calling code?
// blocks_location_map_t::iterator iter = mFreeBlocksByLocation.begin();
@@ -1458,11 +1458,11 @@ void LLVFS::sync(LLVFSFileBlock *block, BOOL remove)
{
if (!isValid())
{
- llerrs << "Attempting to use invalid VFS!" << llendl;
+ LL_ERRS() << "Attempting to use invalid VFS!" << LL_ENDL;
}
if (mReadOnly)
{
- llwarns << "Attempt to sync read-only VFS" << llendl;
+ LL_WARNS() << "Attempt to sync read-only VFS" << LL_ENDL;
return;
}
if (block->mLength == BLOCK_LENGTH_INVALID)
@@ -1472,7 +1472,7 @@ void LLVFS::sync(LLVFSFileBlock *block, BOOL remove)
}
if (block->mLength == 0)
{
- llerrs << "VFS syncing zero-length block" << llendl;
+ LL_ERRS() << "VFS syncing zero-length block" << LL_ENDL;
}
BOOL set_index_to_end = FALSE;
@@ -1524,7 +1524,7 @@ void LLVFS::sync(LLVFSFileBlock *block, BOOL remove)
if (fwrite(buffer, LLVFSFileBlock::SERIAL_SIZE, 1, mIndexFP) != 1)
{
- llwarns << "Short write" << llendl;
+ LL_WARNS() << "Short write" << LL_ENDL;
}
// *NOTE: Why was this commented out?
@@ -1540,7 +1540,7 @@ LLVFSBlock *LLVFS::findFreeBlock(S32 size, LLVFSFileBlock *immune)
{
if (!isValid())
{
- llerrs << "Attempting to use invalid VFS!" << llendl;
+ LL_ERRS() << "Attempting to use invalid VFS!" << LL_ENDL;
}
LLVFSBlock *block = NULL;
@@ -1585,7 +1585,7 @@ LLVFSBlock *LLVFS::findFreeBlock(S32 size, LLVFSFileBlock *immune)
if (lru_list.size() == 0)
{
// No more files to delete, and still not enough room!
- llwarns << "VFS: Can't make " << size << " bytes of free space in VFS, giving up" << llendl;
+ LL_WARNS() << "VFS: Can't make " << size << " bytes of free space in VFS, giving up" << LL_ENDL;
break;
}
@@ -1596,7 +1596,7 @@ LLVFSBlock *LLVFS::findFreeBlock(S32 size, LLVFSFileBlock *immune)
{
// ditch this file and look again for a free block - should find it
// TODO: it'll be faster just to assign the free block and break
- llinfos << "LRU: Removing " << file_block->mFileID << ":" << file_block->mFileType << llendl;
+ LL_INFOS() << "LRU: Removing " << file_block->mFileID << ":" << file_block->mFileType << LL_ENDL;
lru_list.erase(it);
removeFileBlock(file_block);
file_block = NULL;
@@ -1604,7 +1604,7 @@ LLVFSBlock *LLVFS::findFreeBlock(S32 size, LLVFSFileBlock *immune)
}
- llinfos << "VFS: LRU: Aggressive: " << (S32)lru_list.size() << " files remain" << llendl;
+ LL_INFOS() << "VFS: LRU: Aggressive: " << (S32)lru_list.size() << " files remain" << LL_ENDL;
dumpLockCounts();
// Now it's time to aggressively make more space
@@ -1619,7 +1619,7 @@ LLVFSBlock *LLVFS::findFreeBlock(S32 size, LLVFSFileBlock *immune)
file_block = *it;
// TODO: it would be great to be able to batch all these sync() calls
- // llinfos << "LRU2: Removing " << file_block->mFileID << ":" << file_block->mFileType << " last accessed" << file_block->mAccessTime << llendl;
+ // LL_INFOS() << "LRU2: Removing " << file_block->mFileID << ":" << file_block->mFileType << " last accessed" << file_block->mAccessTime << LL_ENDL;
cleaned_up += file_block->mLength;
lru_list.erase(it++);
@@ -1633,7 +1633,7 @@ LLVFSBlock *LLVFS::findFreeBlock(S32 size, LLVFSFileBlock *immune)
F32 time = timer.getElapsedTimeF32();
if (time > 0.5f)
{
- llwarns << "VFS: Spent " << time << " seconds in findFreeBlock!" << llendl;
+ LL_WARNS() << "VFS: Spent " << time << " seconds in findFreeBlock!" << LL_ENDL;
}
return block;
@@ -1647,7 +1647,7 @@ void LLVFS::pokeFiles()
{
if (!isValid())
{
- llerrs << "Attempting to use invalid VFS!" << llendl;
+ LL_ERRS() << "Attempting to use invalid VFS!" << LL_ENDL;
}
U32 word;
@@ -1659,7 +1659,7 @@ void LLVFS::pokeFiles()
fseek(mDataFP, 0, SEEK_SET);
if (fwrite(&word, sizeof(word), 1, mDataFP) != 1)
{
- llwarns << "Could not write to data file" << llendl;
+ LL_WARNS() << "Could not write to data file" << LL_ENDL;
}
fflush(mDataFP);
}
@@ -1670,7 +1670,7 @@ void LLVFS::pokeFiles()
fseek(mIndexFP, 0, SEEK_SET);
if (fwrite(&word, sizeof(word), 1, mIndexFP) != 1)
{
- llwarns << "Could not write to index file" << llendl;
+ LL_WARNS() << "Could not write to index file" << LL_ENDL;
}
fflush(mIndexFP);
}
@@ -1679,20 +1679,20 @@ void LLVFS::pokeFiles()
void LLVFS::dumpMap()
{
- llinfos << "Files:" << llendl;
+ LL_INFOS() << "Files:" << LL_ENDL;
for (fileblock_map::iterator it = mFileBlocks.begin(); it != mFileBlocks.end(); ++it)
{
LLVFSFileBlock *file_block = (*it).second;
- llinfos << "Location: " << file_block->mLocation << "\tLength: " << file_block->mLength << "\t" << file_block->mFileID << "\t" << file_block->mFileType << llendl;
+ LL_INFOS() << "Location: " << file_block->mLocation << "\tLength: " << file_block->mLength << "\t" << file_block->mFileID << "\t" << file_block->mFileType << LL_ENDL;
}
- llinfos << "Free Blocks:" << llendl;
+ LL_INFOS() << "Free Blocks:" << LL_ENDL;
for (blocks_location_map_t::iterator iter = mFreeBlocksByLocation.begin(),
end = mFreeBlocksByLocation.end();
iter != end; iter++)
{
LLVFSBlock *free_block = iter->second;
- llinfos << "Location: " << free_block->mLocation << "\tLength: " << free_block->mLength << llendl;
+ LL_INFOS() << "Location: " << free_block->mLocation << "\tLength: " << free_block->mLength << LL_ENDL;
}
}
@@ -1716,7 +1716,7 @@ void LLVFS::audit()
if (fread(&buffer[0], 1, index_size, mIndexFP) != index_size)
{
- llwarns << "Index truncated" << llendl;
+ LL_WARNS() << "Index truncated" << LL_ENDL;
vfs_corrupt = TRUE;
}
@@ -1745,7 +1745,7 @@ void LLVFS::audit()
{
if (mFileBlocks.find(*block) == mFileBlocks.end())
{
- llwarns << "VFile " << block->mFileID << ":" << block->mFileType << " on disk, not in memory, loc " << block->mIndexLocation << llendl;
+ LL_WARNS() << "VFile " << block->mFileID << ":" << block->mFileType << " on disk, not in memory, loc " << block->mIndexLocation << LL_ENDL;
}
else if (found_files.find(*block) != found_files.end())
{
@@ -1757,22 +1757,22 @@ void LLVFS::audit()
mIndexFP = NULL;
unlockAndClose(mDataFP);
mDataFP = NULL;
- llwarns << "VFS: Original block index " << block->mIndexLocation
+ LL_WARNS() << "VFS: Original block index " << block->mIndexLocation
<< " location " << block->mLocation
<< " length " << block->mLength
<< " size " << block->mSize
<< " id " << block->mFileID
<< " type " << block->mFileType
- << llendl;
- llwarns << "VFS: Duplicate block index " << dupe->mIndexLocation
+ << LL_ENDL;
+ LL_WARNS() << "VFS: Duplicate block index " << dupe->mIndexLocation
<< " location " << dupe->mLocation
<< " length " << dupe->mLength
<< " size " << dupe->mSize
<< " id " << dupe->mFileID
<< " type " << dupe->mFileType
- << llendl;
- llwarns << "VFS: Index size " << index_size << llendl;
- llwarns << "VFS: INDEX CORRUPT" << llendl;
+ << LL_ENDL;
+ LL_WARNS() << "VFS: Index size " << index_size << LL_ENDL;
+ LL_WARNS() << "VFS: INDEX CORRUPT" << LL_ENDL;
vfs_corrupt = TRUE;
break;
}
@@ -1785,7 +1785,7 @@ void LLVFS::audit()
{
if (block->mLength)
{
- llwarns << "VFile " << block->mFileID << ":" << block->mFileType << " corrupt on disk" << llendl;
+ LL_WARNS() << "VFile " << block->mFileID << ":" << block->mFileType << " corrupt on disk" << LL_ENDL;
}
// else this is just a hole
}
@@ -1801,19 +1801,19 @@ void LLVFS::audit()
{
if (! found_files.count(*block))
{
- llwarns << "VFile " << block->mFileID << ":" << block->mFileType << " in memory, not on disk, loc " << block->mIndexLocation<< llendl;
+ LL_WARNS() << "VFile " << block->mFileID << ":" << block->mFileType << " in memory, not on disk, loc " << block->mIndexLocation<< LL_ENDL;
fseek(mIndexFP, block->mIndexLocation, SEEK_SET);
U8 buf[LLVFSFileBlock::SERIAL_SIZE];
if (fread(buf, LLVFSFileBlock::SERIAL_SIZE, 1, mIndexFP) != 1)
{
- llwarns << "VFile " << block->mFileID
- << " gave short read" << llendl;
+ LL_WARNS() << "VFile " << block->mFileID
+ << " gave short read" << LL_ENDL;
}
LLVFSFileBlock disk_block;
disk_block.deserialize(buf, block->mIndexLocation);
- llwarns << "Instead found " << disk_block.mFileID << ":" << block->mFileType << llendl;
+ LL_WARNS() << "Instead found " << disk_block.mFileID << ":" << block->mFileType << LL_ENDL;
}
else
{
@@ -1827,10 +1827,10 @@ void LLVFS::audit()
iter != found_files.end(); iter++)
{
LLVFSFileBlock* block = iter->second;
- llwarns << "VFile " << block->mFileID << ":" << block->mFileType << " szie:" << block->mSize << " leftover" << llendl;
+ LL_WARNS() << "VFile " << block->mFileID << ":" << block->mFileType << " szie:" << block->mSize << " leftover" << LL_ENDL;
}
- llinfos << "VFS: audit OK" << llendl;
+ LL_INFOS() << "VFS: audit OK" << LL_ENDL;
// mutex released by LLMutexLock() destructor.
}
@@ -1857,12 +1857,12 @@ void LLVFS::checkMem()
S32 index_loc = *iter;
if (index_loc == block->mIndexLocation)
{
- llwarns << "VFile block " << block->mFileID << ":" << block->mFileType << " is marked as a hole" << llendl;
+ LL_WARNS() << "VFile block " << block->mFileID << ":" << block->mFileType << " is marked as a hole" << LL_ENDL;
}
}
}
- llinfos << "VFS: mem check OK" << llendl;
+ LL_INFOS() << "VFS: mem check OK" << LL_ENDL;
unlockData();
}
@@ -1872,7 +1872,7 @@ void LLVFS::dumpLockCounts()
S32 i;
for (i = 0; i < VFSLOCK_COUNT; i++)
{
- llinfos << "LockType: " << i << ": " << mLockCounts[i] << llendl;
+ LL_INFOS() << "LockType: " << i << ": " << mLockCounts[i] << LL_ENDL;
}
}
@@ -1897,7 +1897,7 @@ void LLVFS::dumpStatistics()
}
else if (file_block->mLength <= 0)
{
- llinfos << "Bad file block at: " << file_block->mLocation << "\tLength: " << file_block->mLength << "\t" << file_block->mFileID << "\t" << file_block->mFileType << llendl;
+ LL_INFOS() << "Bad file block at: " << file_block->mLocation << "\tLength: " << file_block->mLength << "\t" << file_block->mFileID << "\t" << file_block->mFileType << LL_ENDL;
size_counts[file_block->mLength]++;
location_counts[file_block->mLocation]++;
}
@@ -1919,13 +1919,13 @@ void LLVFS::dumpStatistics()
{
S32 size = it->first;
S32 size_count = it->second;
- llinfos << "Bad files size " << size << " count " << size_count << llendl;
+ LL_INFOS() << "Bad files size " << size << " count " << size_count << LL_ENDL;
}
for (std::map<U32,S32>::iterator it = location_counts.begin(); it != location_counts.end(); ++it)
{
U32 location = it->first;
S32 location_count = it->second;
- llinfos << "Bad files location " << location << " count " << location_count << llendl;
+ LL_INFOS() << "Bad files location " << location << " count " << location_count << LL_ENDL;
}
// Investigate free list.
@@ -1939,14 +1939,14 @@ void LLVFS::dumpStatistics()
LLVFSBlock *free_block = iter->second;
if (free_block->mLength <= 0)
{
- llinfos << "Bad free block at: " << free_block->mLocation << "\tLength: " << free_block->mLength << llendl;
+ LL_INFOS() << "Bad free block at: " << free_block->mLocation << "\tLength: " << free_block->mLength << LL_ENDL;
}
else
{
- llinfos << "Block: " << free_block->mLocation
+ LL_INFOS() << "Block: " << free_block->mLocation
<< "\tLength: " << free_block->mLength
<< "\tEnd: " << free_block->mLocation + free_block->mLength
- << llendl;
+ << LL_ENDL;
total_free_size += free_block->mLength;
}
@@ -1961,38 +1961,38 @@ void LLVFS::dumpStatistics()
// Dump histogram of free block sizes
for (std::map<S32,S32>::iterator it = free_length_counts.begin(); it != free_length_counts.end(); ++it)
{
- llinfos << "Free length " << it->first << " count " << it->second << llendl;
+ LL_INFOS() << "Free length " << it->first << " count " << it->second << LL_ENDL;
}
- llinfos << "Invalid blocks: " << invalid_file_count << llendl;
- llinfos << "File blocks: " << mFileBlocks.size() << llendl;
+ LL_INFOS() << "Invalid blocks: " << invalid_file_count << LL_ENDL;
+ LL_INFOS() << "File blocks: " << mFileBlocks.size() << LL_ENDL;
S32 length_list_count = (S32)mFreeBlocksByLength.size();
S32 location_list_count = (S32)mFreeBlocksByLocation.size();
if (length_list_count == location_list_count)
{
- llinfos << "Free list lengths match, free blocks: " << location_list_count << llendl;
+ LL_INFOS() << "Free list lengths match, free blocks: " << location_list_count << LL_ENDL;
}
else
{
- llwarns << "Free list lengths do not match!" << llendl;
- llwarns << "By length: " << length_list_count << llendl;
- llwarns << "By location: " << location_list_count << llendl;
+ LL_WARNS() << "Free list lengths do not match!" << LL_ENDL;
+ LL_WARNS() << "By length: " << length_list_count << LL_ENDL;
+ LL_WARNS() << "By location: " << location_list_count << LL_ENDL;
}
- llinfos << "Max file: " << max_file_size/1024 << "K" << llendl;
- llinfos << "Max free: " << max_free_size/1024 << "K" << llendl;
- llinfos << "Total file size: " << total_file_size/1024 << "K" << llendl;
- llinfos << "Total free size: " << total_free_size/1024 << "K" << llendl;
- llinfos << "Sum: " << (total_file_size + total_free_size) << " bytes" << llendl;
- llinfos << llformat("%.0f%% full",((F32)(total_file_size)/(F32)(total_file_size+total_free_size))*100.f) << llendl;
+ LL_INFOS() << "Max file: " << max_file_size/1024 << "K" << LL_ENDL;
+ LL_INFOS() << "Max free: " << max_free_size/1024 << "K" << LL_ENDL;
+ LL_INFOS() << "Total file size: " << total_file_size/1024 << "K" << LL_ENDL;
+ LL_INFOS() << "Total free size: " << total_free_size/1024 << "K" << LL_ENDL;
+ LL_INFOS() << "Sum: " << (total_file_size + total_free_size) << " bytes" << LL_ENDL;
+ LL_INFOS() << llformat("%.0f%% full",((F32)(total_file_size)/(F32)(total_file_size+total_free_size))*100.f) << LL_ENDL;
- llinfos << " " << llendl;
+ LL_INFOS() << " " << LL_ENDL;
for (std::map<LLAssetType::EType, std::pair<S32,S32> >::iterator iter = filetype_counts.begin();
iter != filetype_counts.end(); ++iter)
{
- llinfos << "Type: " << LLAssetType::getDesc(iter->first)
+ LL_INFOS() << "Type: " << LLAssetType::getDesc(iter->first)
<< " Count: " << iter->second.first
- << " Bytes: " << (iter->second.second>>20) << " MB" << llendl;
+ << " Bytes: " << (iter->second.second>>20) << " MB" << LL_ENDL;
}
// Look for potential merges
@@ -2007,7 +2007,7 @@ void LLVFS::dumpStatistics()
LLVFSBlock *second_block = iter->second;
if (first_block->mLocation + first_block->mLength == second_block->mLocation)
{
- llinfos << "Potential merge at " << first_block->mLocation << llendl;
+ LL_INFOS() << "Potential merge at " << first_block->mLocation << LL_ENDL;
}
first_block = second_block;
}
@@ -2062,10 +2062,10 @@ void LLVFS::listFiles()
{
LLUUID id = file_spec.mFileID;
std::string extension = get_extension(file_spec.mFileType);
- llinfos << " File: " << id
+ LL_INFOS() << " File: " << id
<< " Type: " << LLAssetType::getDesc(file_spec.mFileType)
<< " Size: " << size
- << llendl;
+ << LL_ENDL;
}
}
@@ -2096,7 +2096,7 @@ void LLVFS::dumpFiles()
std::string extension = get_extension(type);
std::string filename = id.asString() + extension;
- llinfos << " Writing " << filename << llendl;
+ LL_INFOS() << " Writing " << filename << LL_ENDL;
LLAPRFile outfile;
outfile.open(filename, LL_APR_WB);
@@ -2109,7 +2109,7 @@ void LLVFS::dumpFiles()
unlockData();
- llinfos << "Extracted " << files_extracted << " files out of " << mFileBlocks.size() << llendl;
+ LL_INFOS() << "Extracted " << files_extracted << " files out of " << mFileBlocks.size() << LL_ENDL;
}
//============================================================================
diff --git a/indra/llvfs/llvfs.h b/indra/llvfs/llvfs.h
index 63f0f28933..39f31a221b 100755
--- a/indra/llvfs/llvfs.h
+++ b/indra/llvfs/llvfs.h
@@ -29,7 +29,6 @@
#include <deque>
#include "lluuid.h"
-#include "linked_lists.h"
#include "llassettype.h"
#include "llthread.h"
diff --git a/indra/llvfs/llvfsthread.cpp b/indra/llvfs/llvfsthread.cpp
index a57e2b15ab..8cd85929e2 100755
--- a/indra/llvfs/llvfsthread.cpp
+++ b/indra/llvfs/llvfsthread.cpp
@@ -88,7 +88,7 @@ LLVFSThread::handle_t LLVFSThread::read(LLVFS* vfs, const LLUUID &file_id, const
bool res = addRequest(req);
if (!res)
{
- llerrs << "LLVFSThread::read called after LLVFSThread::cleanupClass()" << llendl;
+ LL_ERRS() << "LLVFSThread::read called after LLVFSThread::cleanupClass()" << LL_ENDL;
req->deleteRequest();
handle = nullHandle();
}
@@ -107,7 +107,7 @@ S32 LLVFSThread::readImmediate(LLVFS* vfs, const LLUUID &file_id, const LLAssetT
S32 res = addRequest(req) ? 1 : 0;
if (res == 0)
{
- llerrs << "LLVFSThread::read called after LLVFSThread::cleanupClass()" << llendl;
+ LL_ERRS() << "LLVFSThread::read called after LLVFSThread::cleanupClass()" << LL_ENDL;
req->deleteRequest();
}
else
@@ -130,7 +130,7 @@ LLVFSThread::handle_t LLVFSThread::write(LLVFS* vfs, const LLUUID &file_id, cons
bool res = addRequest(req);
if (!res)
{
- llerrs << "LLVFSThread::read called after LLVFSThread::cleanupClass()" << llendl;
+ LL_ERRS() << "LLVFSThread::read called after LLVFSThread::cleanupClass()" << LL_ENDL;
req->deleteRequest();
handle = nullHandle();
}
@@ -149,7 +149,7 @@ S32 LLVFSThread::writeImmediate(LLVFS* vfs, const LLUUID &file_id, const LLAsset
S32 res = addRequest(req) ? 1 : 0;
if (res == 0)
{
- llerrs << "LLVFSThread::read called after LLVFSThread::cleanupClass()" << llendl;
+ LL_ERRS() << "LLVFSThread::read called after LLVFSThread::cleanupClass()" << LL_ENDL;
req->deleteRequest();
}
else
@@ -175,7 +175,7 @@ S32 LLVFSThread::writeImmediate(LLVFS* vfs, const LLUUID &file_id, const LLAsset
// bool res = addRequest(req);
// if (!res)
// {
-// llerrs << "LLVFSThread::read called after LLVFSThread::cleanupClass()" << llendl;
+// LL_ERRS() << "LLVFSThread::read called after LLVFSThread::cleanupClass()" << LL_ENDL;
// req->deleteRequest();
// handle = nullHandle();
// }
@@ -203,17 +203,17 @@ LLVFSThread::Request::Request(handle_t handle, U32 priority, U32 flags,
if (numbytes <= 0 && mOperation != FILE_RENAME)
{
- llwarns << "LLVFSThread: Request with numbytes = " << numbytes
+ LL_WARNS() << "LLVFSThread: Request with numbytes = " << numbytes
<< " operation = " << op
<< " offset " << offset
- << " file_type " << file_type << llendl;
+ << " file_type " << file_type << LL_ENDL;
}
if (mOperation == FILE_WRITE)
{
S32 blocksize = mVFS->getMaxSize(mFileID, mFileType);
if (blocksize < 0)
{
- llwarns << "VFS write to temporary block (shouldn't happen)" << llendl;
+ LL_WARNS() << "VFS write to temporary block (shouldn't happen)" << LL_ENDL;
}
mVFS->incLock(mFileID, mFileType, VFSLOCK_APPEND);
}
@@ -248,7 +248,7 @@ void LLVFSThread::Request::deleteRequest()
{
if (getStatus() == STATUS_QUEUED)
{
- llerrs << "Attempt to delete a queued LLVFSThread::Request!" << llendl;
+ LL_ERRS() << "Attempt to delete a queued LLVFSThread::Request!" << LL_ENDL;
}
if (mOperation == FILE_WRITE)
{
@@ -273,13 +273,13 @@ bool LLVFSThread::Request::processRequest()
llassert(mOffset >= 0);
mBytesRead = mVFS->getData(mFileID, mFileType, mBuffer, mOffset, mBytes);
complete = true;
- //llinfos << llformat("LLVFSThread::READ '%s': %d bytes arg:%d",getFilename(),mBytesRead) << llendl;
+ //LL_INFOS() << llformat("LLVFSThread::READ '%s': %d bytes arg:%d",getFilename(),mBytesRead) << LL_ENDL;
}
else if (mOperation == FILE_WRITE)
{
mBytesRead = mVFS->storeData(mFileID, mFileType, mBuffer, mOffset, mBytes);
complete = true;
- //llinfos << llformat("LLVFSThread::WRITE '%s': %d bytes arg:%d",getFilename(),mBytesRead) << llendl;
+ //LL_INFOS() << llformat("LLVFSThread::WRITE '%s': %d bytes arg:%d",getFilename(),mBytesRead) << LL_ENDL;
}
else if (mOperation == FILE_RENAME)
{
@@ -288,11 +288,11 @@ bool LLVFSThread::Request::processRequest()
mVFS->renameFile(mFileID, mFileType, *new_idp, new_type);
mFileID = *new_idp;
complete = true;
- //llinfos << llformat("LLVFSThread::RENAME '%s': %d bytes arg:%d",getFilename(),mBytesRead) << llendl;
+ //LL_INFOS() << llformat("LLVFSThread::RENAME '%s': %d bytes arg:%d",getFilename(),mBytesRead) << LL_ENDL;
}
else
{
- llerrs << llformat("LLVFSThread::unknown operation: %d", mOperation) << llendl;
+ LL_ERRS() << llformat("LLVFSThread::unknown operation: %d", mOperation) << LL_ENDL;
}
return complete;
}