* The parent of an IOOperation cannot be NULL for completed operations.

* This fixes CID 1507.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@38458 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Axel Dörfler
2010-08-30 19:41:08 +00:00
parent 2bd0cd6cb8
commit 9910e4f1bf
@@ -1,6 +1,6 @@
/*
* Copyright 2008-2010, Ingo Weinhold, [email protected].
* Copyright 2004-2009, Axel Dörfler, [email protected].
* Copyright 2004-2010, Axel Dörfler, [email protected].
* Distributed under the terms of the MIT License.
*/
@@ -353,15 +353,14 @@ IOSchedulerSimple::_Finisher()
// notify request and remove operation
IORequest* request = operation->Parent();
if (request != NULL) {
generic_size_t operationOffset = operation->OriginalOffset()
- request->Offset();
request->OperationFinished(operation, operation->Status(),
operation->TransferredBytes() < operation->OriginalLength(),
operation->Status() == B_OK
? operationOffset + operation->OriginalLength()
: operationOffset);
}
generic_size_t operationOffset
= operation->OriginalOffset() - request->Offset();
request->OperationFinished(operation, operation->Status(),
operation->TransferredBytes() < operation->OriginalLength(),
operation->Status() == B_OK
? operationOffset + operation->OriginalLength()
: operationOffset);
// recycle the operation
MutexLocker _(fLock);