Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Avoid using zero buffer when generating test files #190

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions IORequestGenerator/IORequestGenerator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1734,7 +1734,7 @@ DWORD IORequestGenerator::_CreateDirectoryPath(const char *pszPath) const
//
bool IORequestGenerator::_CreateFile(UINT64 ullFileSize, const char *pszFilename, bool fZeroBuffers, bool fVerbose) const
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fZeroBuffers is not used any more at all

{
bool fSlowWrites = false;
bool fSlowWrites = true;
Copy link
Member

@yanrez yanrez Nov 25, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why slow writes should be default mode?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Below code block setting fSlowWrites =true if SetPrivilige fails also became wrong since fSlowWrites would be true there anyway

PrintVerbose(fVerbose, "Creating file '%s' of size %I64u.\n", pszFilename, ullFileSize);

//enable SE_MANAGE_VOLUME_NAME privilege, required to set valid size of a file
Expand Down Expand Up @@ -1832,7 +1832,7 @@ bool IORequestGenerator::_CreateFile(UINT64 ullFileSize, const char *pszFilename
vector<BYTE> vBuf(ulBufSize);
for (UINT32 i=0; i<ulBufSize; ++i)
{
vBuf[i] = fZeroBuffers ? 0 : (BYTE)(i&0xFF);
vBuf[i] = (BYTE)(i&0xFF);
}

ullRemainSize = ullFileSize;
Expand Down