Changeset 77979 in vbox for trunk/src/VBox/ValidationKit/utils
- Timestamp:
- Apr 1, 2019 1:21:04 PM (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/ValidationKit/utils/fs/FsPerf.cpp
r77969 r77979 88 88 * Defined Constants And Macros * 89 89 *********************************************************************************************************************************/ 90 /** Used for cutting the the -d parameter value short and avoid a number of buffer overflow checks. */ 91 #define FSPERF_MAX_NEEDED_PATH 224 92 /** The max path used by this code. 93 * It greatly exceeds the RTPATH_MAX so we can push the limits on windows. */ 94 #define FSPERF_MAX_PATH (_32K) 95 90 96 /** @def FSPERF_TEST_SENDFILE 91 97 * Whether to enable the sendfile() tests. */ … … 498 504 499 505 /** The test directory (absolute). This will always have a trailing slash. */ 500 static char g_szDir[ RTPATH_MAX];506 static char g_szDir[FSPERF_MAX_PATH]; 501 507 /** The test directory (absolute), 2nd copy for use with InDir2(). */ 502 static char g_szDir2[ RTPATH_MAX];508 static char g_szDir2[FSPERF_MAX_PATH]; 503 509 /** The empty test directory (absolute). This will always have a trailing slash. */ 504 static char g_szEmptyDir[ RTPATH_MAX];510 static char g_szEmptyDir[FSPERF_MAX_PATH]; 505 511 /** The deep test directory (absolute). This will always have a trailing slash. */ 506 static char g_szDeepDir[ RTPATH_MAX];512 static char g_szDeepDir[FSPERF_MAX_PATH + _1K]; 507 513 508 514 … … 741 747 RTListForEach(&g_ManyTreeHead, pCur, FSPERFNAMEENTRY, Entry) 742 748 { 743 char szPath[ RTPATH_MAX];749 char szPath[FSPERF_MAX_PATH]; 744 750 memcpy(szPath, pCur->szName, pCur->cchName); 745 751 for (uint32_t i = 0; i < g_cManyTreeFilesPerDir; i++) … … 936 942 937 943 /* Manytree: */ 938 char szPath[ RTPATH_MAX];944 char szPath[FSPERF_MAX_PATH]; 939 945 PROFILE_MANYTREE_FN(szPath, fsPerfOpenExistingOnceReadonly(szPath), 1, g_nsTestRun, "RTFileOpen/Close/manytree/readonly"); 940 946 } … … 1046 1052 1047 1053 /* Manytree: */ 1048 char szPath[ RTPATH_MAX];1054 char szPath[FSPERF_MAX_PATH]; 1049 1055 PROFILE_MANYTREE_FN(szPath, RTPathQueryInfoEx(szPath, &ObjInfo, RTFSOBJATTRADD_NOTHING, RTPATH_F_ON_LINK), 1050 1056 1, g_nsTestRun, "RTPathQueryInfoEx/manytree/NOTHING"); … … 1087 1093 1088 1094 /* Manytree: */ 1089 char szPath[ RTPATH_MAX];1095 char szPath[FSPERF_MAX_PATH]; 1090 1096 PROFILE_MANYTREE_FN(szPath, RTPathSetMode(szPath, iIteration & 1 ? fOddMode : fEvenMode), 1, g_nsTestRun, 1091 1097 "RTPathSetMode/manytree"); … … 1151 1157 1152 1158 /* Manytree: */ 1153 char szPath[ RTPATH_MAX];1159 char szPath[FSPERF_MAX_PATH]; 1154 1160 PROFILE_MANYTREE_FN(szPath, RTPathSetTimesEx(szPath, iIteration & 1 ? &Time1 : &Time2, iIteration & 1 ? &Time2 : &Time1, 1155 1161 NULL, NULL, RTPATH_F_ON_LINK), … … 1160 1166 DECL_FORCE_INLINE(int) fsPerfRenameMany(const char *pszFile, uint32_t iIteration) 1161 1167 { 1162 char szRenamed[ RTPATH_MAX];1168 char szRenamed[FSPERF_MAX_PATH]; 1163 1169 strcat(strcpy(szRenamed, pszFile), "-renamed"); 1164 1170 if (!(iIteration & 1)) … … 1171 1177 { 1172 1178 RTTestISub("rename"); 1173 char szPath[ RTPATH_MAX];1179 char szPath[FSPERF_MAX_PATH]; 1174 1180 1175 1181 /** @todo rename directories too! */ … … 1589 1595 */ 1590 1596 { 1591 char szPath[ RTPATH_MAX];1597 char szPath[FSPERF_MAX_PATH]; 1592 1598 uint64_t const nsStart = RTTimeNanoTS(); 1593 1599 DO_MANYTREE_FN(szPath, RTTESTI_CHECK_RC_RETV(RTFileDelete(szPath), VINF_SUCCESS)); … … 3776 3782 /* Create a new file, 256 KB in size, and fill it with random bytes. 3777 3783 Try uncached access if we can to force the page-in to do actual reads. */ 3778 char szFile2[ RTPATH_MAX+ 32];3784 char szFile2[FSPERF_MAX_PATH + 32]; 3779 3785 memcpy(szFile2, g_szDir, g_cchDir); 3780 3786 RTStrPrintf(&szFile2[g_cchDir], sizeof(szFile2) - g_cchDir, "mmap-%u.noh", i); … … 4284 4290 static void Usage(PRTSTREAM pStrm) 4285 4291 { 4286 char szExec[ RTPATH_MAX];4292 char szExec[FSPERF_MAX_PATH]; 4287 4293 RTStrmPrintf(pStrm, "usage: %s <-d <testdir>> [options]\n", 4288 4294 RTPathFilename(RTProcGetExecutablePath(szExec, sizeof(szExec)))); … … 4369 4375 * Default values. 4370 4376 */ 4371 rc = RTPathGetCurrent(g_szDir, sizeof(g_szDir) / 2);4377 rc = RTPathGetCurrent(g_szDir, sizeof(g_szDir) - FSPERF_MAX_NEEDED_PATH); 4372 4378 if (RT_SUCCESS(rc)) 4373 rc = RTPathAppend(g_szDir, sizeof(g_szDir) / 2, "fstestdir-");4379 rc = RTPathAppend(g_szDir, sizeof(g_szDir) - FSPERF_MAX_NEEDED_PATH, "fstestdir-"); 4374 4380 if (RT_SUCCESS(rc)) 4375 4381 { … … 4391 4397 { 4392 4398 case 'd': 4393 rc = RTPathAbs(ValueUnion.psz, g_szDir, sizeof(g_szDir) / 2);4399 rc = RTPathAbs(ValueUnion.psz, g_szDir, sizeof(g_szDir) - FSPERF_MAX_NEEDED_PATH); 4394 4400 if (RT_SUCCESS(rc)) 4395 4401 {
Note:
See TracChangeset
for help on using the changeset viewer.