packagefs: PackageFile::DataAccessor: Avoid unnecessary locking

... in case of version 2 package files.
This commit is contained in:
Ingo Weinhold 2013-05-20 22:54:59 +02:00
parent d59e0feb59
commit b814feabd7

View File

@ -105,7 +105,8 @@ struct PackageFile::DataAccessor {
if (toRead > 0) {
IORequestOutput output(request);
MutexLocker locker(fLock);
MutexLocker locker(fLock, false, fData->Version() == 1);
// V2 readers are reentrant
status_t error = fReader->ReadDataToOutput(offset, toRead, &output);
if (error != B_OK)
RETURN_ERROR(error);