[prev in list] [next in list] [prev in thread] [next in thread] 

List:       haiku-commits
Subject:    [haiku-commits] [M] Change in haiku[master]: IORequest: Refactor IOOperation transferred-bytes and s
From:       Gerrit <review () review ! haiku-os ! org>
Date:       2023-04-27 21:19:48
Message-ID: dc432b629eefcb8827c55426d9747d9fd21ea8a3-HTML () review ! haiku-os ! org
[Download RAW message or body]

From waddlesplash <waddlesplash@gmail.com>:

waddlesplash has uploaded this change for review. ( \
https://review.haiku-os.org/c/haiku/+/6375 )


Change subject: IORequest: Refactor IOOperation transferred-bytes and status \
                accounting.
......................................................................

IORequest: Refactor IOOperation transferred-bytes and status accounting.

Until the introduction of the nvme_disk driver, these classes were
mostly only used directly by the IO scheduler, and then a few direct
usages of IOOperation itself in the individual disk drivers; so
API confusions were easily missed.

When writing the nvme_disk driver's IORequest support, however, it
became readily apparent that there were some pretty bad confusions
around transferred-bytes accounting in IOOperation. This commit
attempts to resolve all of those.

There are two basic changes here:

1. Move transferred-bytes accounting into IOOperation::SetStatus.

The "TransferredBytes" field of IOOperation is against the *original*
range, not the actual operation's range (which will be wider, due to
bouncing, etc.), and furthermore only applies to the actual content
of the request (and not e.g. to a read half of a bounced write.)

These two facts meant that determining what value to pass to
SetTransferredBytes was not trivial, and was easy to get wrong.
I recall messing that up when working on nvme_disk multiple times
before reading the API carefully.

2. Do not pass redundant values to IORequest::OperationFinished.

All of the values here can be derived (albeit indirectly) from the
IOOperation, and all consumers of this API basically did just that.
Rather than make them do it, make the IORequest take care of
computing all of those values itself.
---
M src/add-ons/kernel/drivers/disk/nvme/nvme_disk.cpp
M src/system/kernel/device_manager/IOCache.cpp
M src/system/kernel/device_manager/IORequest.cpp
M src/system/kernel/device_manager/IORequest.h
M src/system/kernel/device_manager/IOSchedulerSimple.cpp
5 files changed, 82 insertions(+), 37 deletions(-)



  git pull ssh://git.haiku-os.org:22/haiku refs/changes/75/6375/1

diff --git a/src/add-ons/kernel/drivers/disk/nvme/nvme_disk.cpp \
b/src/add-ons/kernel/drivers/disk/nvme/nvme_disk.cpp index dca857e..b39e0fe 100644
--- a/src/add-ons/kernel/drivers/disk/nvme/nvme_disk.cpp
+++ b/src/add-ons/kernel/drivers/disk/nvme/nvme_disk.cpp
@@ -570,7 +570,6 @@
 		if (status != B_OK)
 			break;

-		size_t transferredBytes = 0;
 		do {
 			TRACE("%p: IOO offset: %" B_PRIdOFF ", length: %" B_PRIuGENADDR
 				", write: %s\n", request, operation.Offset(),
@@ -583,10 +582,9 @@
 			nvme_request.iovec_count = operation.VecCount();

 			status = do_nvme_io_request(handle->info, &nvme_request);
-			if (status == B_OK && nvme_request.write == request->IsWrite())
-				transferredBytes += operation.OriginalLength();

-			operation.SetStatus(status);
+			operation.SetStatus(status,
+				status == B_OK ? operation.Length() : 0);
 		} while (status == B_OK && !operation.Finish());

 		if (status == B_OK && operation.Status() != B_OK) {
@@ -594,9 +592,7 @@
 			status = operation.Status();
 		}

-		operation.SetTransferredBytes(transferredBytes);
-		request->OperationFinished(&operation, status, status != B_OK,
-			operation.OriginalOffset() + transferredBytes);
+		request->OperationFinished(&operation);

 		handle->info->dma_resource.RecycleBuffer(operation.Buffer());

diff --git a/src/system/kernel/device_manager/IOCache.cpp \
b/src/system/kernel/device_manager/IOCache.cpp index e62f489..fc076f6 100644
--- a/src/system/kernel/device_manager/IOCache.cpp
+++ b/src/system/kernel/device_manager/IOCache.cpp
@@ -466,8 +466,7 @@
 
 		error = _DoOperation(operation);

-		request->OperationFinished(&operation, error, false,
-			error == B_OK ? operation.OriginalLength() : 0);
+		request->OperationFinished(&operation);
 		request->SetUnfinished();
 			// Keep the request in unfinished state. ScheduleRequest() will set
 			// the final status and notify.
diff --git a/src/system/kernel/device_manager/IORequest.cpp \
b/src/system/kernel/device_manager/IORequest.cpp index eb93c1c..2c44253 100644
--- a/src/system/kernel/device_manager/IORequest.cpp
+++ b/src/system/kernel/device_manager/IORequest.cpp
@@ -291,10 +291,33 @@
 // #pragma mark -


+void
+IOOperation::SetStatus(status_t status, generic_size_t completedLength)
+{
+	IORequestChunk::SetStatus(status);
+	if (IsWrite() == fParent->IsWrite()) {
+		// Determine how many bytes we actually read or wrote,
+		// relative to the original range, not the translated range.
+		const generic_size_t partialBegin = (fOriginalOffset - fOffset);
+		generic_size_t originalTransferredBytes = completedLength;
+		if (originalTransferredBytes < partialBegin)
+			originalTransferredBytes = 0;
+		else
+			originalTransferredBytes -= partialBegin;
+
+		if (originalTransferredBytes > fOriginalLength)
+			originalTransferredBytes = fOriginalLength;
+
+		fTransferredBytes += originalTransferredBytes;
+	}
+}
+
+
 bool
 IOOperation::Finish()
 {
 	TRACE("IOOperation::Finish()\n");
+
 	if (fStatus == B_OK) {
 		if (fParent->IsWrite()) {
 			TRACE("  is write\n");
@@ -318,7 +341,7 @@
 					return false;
 				}
 
-				SetStatus(error);
+				IORequestChunk::SetStatus(error);
 			} else if (fPhase == PHASE_READ_END) {
 				TRACE("  phase read end\n");
 				// repair phase adjusted vec
@@ -338,7 +361,7 @@
 					return false;
 				}

-				SetStatus(error);
+				IORequestChunk::SetStatus(error);
 			}
 		}
 	}
@@ -402,7 +425,7 @@
 		}

 		if (error != B_OK)
-			SetStatus(error);
+			IORequestChunk::SetStatus(error);
 	}

 	return true;
@@ -1012,8 +1035,7 @@


 void
-IORequest::OperationFinished(IOOperation* operation, status_t status,
-	bool partialTransfer, generic_size_t transferEndOffset)
+IORequest::OperationFinished(IOOperation* operation)
 {
 	TRACE("IORequest::OperationFinished(%p, %#" B_PRIx32 "): request: %p\n",
 		operation, status, this);
@@ -1023,6 +1045,12 @@
 	fChildren.Remove(operation);
 	operation->SetParent(NULL);

+	const status_t status = operation->Status();
+	const bool partialTransfer =
+		(operation->TransferredBytes() < operation->OriginalLength());
+	const generic_size_t transferEndOffset =
+		(operation->OriginalOffset() + operation->TransferredBytes());
+
 	if (status != B_OK || partialTransfer) {
 		if (fTransferSize > transferEndOffset)
 			fTransferSize = transferEndOffset;
diff --git a/src/system/kernel/device_manager/IORequest.h \
b/src/system/kernel/device_manager/IORequest.h index 1e754b8..8b26296 100644
--- a/src/system/kernel/device_manager/IORequest.h
+++ b/src/system/kernel/device_manager/IORequest.h
@@ -127,6 +127,9 @@
 public:
 			bool				Finish();
 									// returns true, if it can be recycled
+									// otherwise, there is more to be done
+
+			void				SetStatus(status_t status, generic_size_t completedLength);

 			status_t			Prepare(IORequest* request);
 			void				SetOriginalRange(off_t offset,
@@ -134,11 +137,9 @@
 									// also sets range
 			void				SetRange(off_t offset, generic_size_t length);

-			void				SetStatus(status_t status)
-									{ IORequestChunk::SetStatus(status); }
-
 			off_t				Offset() const;
 			generic_size_t		Length() const;
+
 			off_t				OriginalOffset() const
 									{ return fOriginalOffset; }
 			generic_size_t		OriginalLength() const
@@ -146,8 +147,6 @@

 			generic_size_t		TransferredBytes() const
 									{ return fTransferredBytes; }
-			void				SetTransferredBytes(generic_size_t bytes)
-									{ fTransferredBytes = bytes; }

 			generic_io_vec*		Vecs() const;
 			uint32				VecCount() const;
@@ -256,9 +255,7 @@
 			bool				HasCallbacks() const;
 			void				SetStatusAndNotify(status_t status);

-			void				OperationFinished(IOOperation* operation,
-									status_t status, bool partialTransfer,
-									generic_size_t transferEndOffset);
+			void				OperationFinished(IOOperation* operation);
 			void				SubRequestFinished(IORequest* request,
 									status_t status, bool partialTransfer,
 									generic_size_t transferEndOffset);
diff --git a/src/system/kernel/device_manager/IOSchedulerSimple.cpp \
b/src/system/kernel/device_manager/IOSchedulerSimple.cpp index 001bfee..c1daa0a \
                100644
--- a/src/system/kernel/device_manager/IOSchedulerSimple.cpp
+++ b/src/system/kernel/device_manager/IOSchedulerSimple.cpp
@@ -291,13 +291,7 @@
 	if (operation->Status() <= 0)
 		return;

-	operation->SetStatus(status);
-
-	// set the bytes transferred (of the net data)
-	generic_size_t partialBegin
-		= operation->OriginalOffset() - operation->Offset();
-	operation->SetTransferredBytes(
-		transferredBytes > partialBegin ? transferredBytes - partialBegin : 0);
+	operation->SetStatus(status, transferredBytes);

 	fCompletedOperations.Add(operation);
 	fFinishedOperationCondition.NotifyAll();
@@ -344,7 +338,6 @@
 		if (!operationFinished) {
 			TRACE("  operation: %p not finished yet\n", operation);
 			MutexLocker _(fLock);
-			operation->SetTransferredBytes(0);
 			operation->Parent()->Owner()->operations.Add(operation);
 			fPendingOperations--;
 			continue;
@@ -353,13 +346,7 @@
 		// notify request and remove operation
 		IORequest* request = operation->Parent();

-		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);
+		request->OperationFinished(operation);

 		// recycle the operation
 		MutexLocker _(fLock);

--
To view, visit https://review.haiku-os.org/c/haiku/+/6375
To unsubscribe, or for help writing mail filters, visit \
https://review.haiku-os.org/settings

Gerrit-Project: haiku
Gerrit-Branch: master
Gerrit-Change-Id: Ic9ae29e1100319e5b7647647c4db7e5aad4d125e
Gerrit-Change-Number: 6375
Gerrit-PatchSet: 1
Gerrit-Owner: waddlesplash <waddlesplash@gmail.com>
Gerrit-MessageType: newchange


[Attachment #3 (text/html)]

<p>waddlesplash has uploaded this change for <strong>review</strong>.</p><p><a \
href="https://review.haiku-os.org/c/haiku/+/6375">View Change</a></p><pre \
style="font-family: monospace,monospace; white-space: pre-wrap;">IORequest: Refactor \
IOOperation transferred-bytes and status accounting.<br><br>Until the introduction of \
the nvme_disk driver, these classes were<br>mostly only used directly by the IO \
scheduler, and then a few direct<br>usages of IOOperation itself in the individual \
disk drivers; so<br>API confusions were easily missed.<br><br>When writing the \
nvme_disk driver&#39;s IORequest support, however, it<br>became readily apparent that \
there were some pretty bad confusions<br>around transferred-bytes accounting in \
IOOperation. This commit<br>attempts to resolve all of those.<br><br>There are two \
basic changes here:<br><br>1. Move transferred-bytes accounting into \
IOOperation::SetStatus.<br><br>The &quot;TransferredBytes&quot; field of IOOperation \
is against the *original*<br>range, not the actual operation&#39;s range (which will \
be wider, due to<br>bouncing, etc.), and furthermore only applies to the actual \
content<br>of the request (and not e.g. to a read half of a bounced \
write.)<br><br>These two facts meant that determining what value to pass \
to<br>SetTransferredBytes was not trivial, and was easy to get wrong.<br>I recall \
messing that up when working on nvme_disk multiple times<br>before reading the API \
carefully.<br><br>2. Do not pass redundant values to \
IORequest::OperationFinished.<br><br>All of the values here can be derived (albeit \
indirectly) from the<br>IOOperation, and all consumers of this API basically did just \
that.<br>Rather than make them do it, make the IORequest take care of<br>computing \
all of those values itself.<br>---<br>M \
src/add-ons/kernel/drivers/disk/nvme/nvme_disk.cpp<br>M \
src/system/kernel/device_manager/IOCache.cpp<br>M \
src/system/kernel/device_manager/IORequest.cpp<br>M \
src/system/kernel/device_manager/IORequest.h<br>M \
src/system/kernel/device_manager/IOSchedulerSimple.cpp<br>5 files changed, 82 \
insertions(+), 37 deletions(-)<br><br></pre><pre style="font-family: \
monospace,monospace; white-space: pre-wrap;">git pull ssh://git.haiku-os.org:22/haiku \
refs/changes/75/6375/1</pre><pre style="font-family: monospace,monospace; \
white-space: pre-wrap;"><span>diff --git \
a/src/add-ons/kernel/drivers/disk/nvme/nvme_disk.cpp \
b/src/add-ons/kernel/drivers/disk/nvme/nvme_disk.cpp</span><br><span>index \
dca857e..b39e0fe 100644</span><br><span>--- \
a/src/add-ons/kernel/drivers/disk/nvme/nvme_disk.cpp</span><br><span>+++ \
b/src/add-ons/kernel/drivers/disk/nvme/nvme_disk.cpp</span><br><span>@@ -570,7 +570,6 \
@@</span><br><span> 		if (status != B_OK)</span><br><span> 			break;</span><br><span> \
</span><br><span style="color: hsl(0, 100%, 40%);">-		size_t transferredBytes = \
0;</span><br><span> 		do {</span><br><span> 			TRACE(&quot;%p: IOO offset: %&quot; \
B_PRIdOFF &quot;, length: %&quot; B_PRIuGENADDR</span><br><span> 				&quot;, write: \
%s\n&quot;, request, operation.Offset(),</span><br><span>@@ -583,10 +582,9 \
@@</span><br><span> 			nvme_request.iovec_count = \
operation.VecCount();</span><br><span> </span><br><span> 			status = \
do_nvme_io_request(handle-&gt;info, &amp;nvme_request);</span><br><span style="color: \
hsl(0, 100%, 40%);">-			if (status == B_OK &amp;&amp; nvme_request.write == \
request-&gt;IsWrite())</span><br><span style="color: hsl(0, 100%, \
40%);">-				transferredBytes += operation.OriginalLength();</span><br><span> \
</span><br><span style="color: hsl(0, 100%, \
40%);">-			operation.SetStatus(status);</span><br><span style="color: hsl(120, 100%, \
40%);">+			operation.SetStatus(status,</span><br><span style="color: hsl(120, 100%, \
40%);">+				status == B_OK ? operation.Length() : 0);</span><br><span> 		} while \
(status == B_OK &amp;&amp; !operation.Finish());</span><br><span> </span><br><span> \
if (status == B_OK &amp;&amp; operation.Status() != B_OK) {</span><br><span>@@ -594,9 \
+592,7 @@</span><br><span> 			status = operation.Status();</span><br><span> \
}</span><br><span> </span><br><span style="color: hsl(0, 100%, \
40%);">-		operation.SetTransferredBytes(transferredBytes);</span><br><span \
style="color: hsl(0, 100%, 40%);">-		request-&gt;OperationFinished(&amp;operation, \
status, status != B_OK,</span><br><span style="color: hsl(0, 100%, \
40%);">-			operation.OriginalOffset() + transferredBytes);</span><br><span \
style="color: hsl(120, 100%, \
40%);">+		request-&gt;OperationFinished(&amp;operation);</span><br><span> \
</span><br><span> 		handle-&gt;info-&gt;dma_resource.RecycleBuffer(operation.Buffer());</span><br><span> \
</span><br><span>diff --git a/src/system/kernel/device_manager/IOCache.cpp \
b/src/system/kernel/device_manager/IOCache.cpp</span><br><span>index e62f489..fc076f6 \
100644</span><br><span>--- \
a/src/system/kernel/device_manager/IOCache.cpp</span><br><span>+++ \
b/src/system/kernel/device_manager/IOCache.cpp</span><br><span>@@ -466,8 +466,7 \
@@</span><br><span> </span><br><span> 		error = \
_DoOperation(operation);</span><br><span> </span><br><span style="color: hsl(0, 100%, \
40%);">-		request-&gt;OperationFinished(&amp;operation, error, false,</span><br><span \
style="color: hsl(0, 100%, 40%);">-			error == B_OK ? operation.OriginalLength() : \
0);</span><br><span style="color: hsl(120, 100%, \
40%);">+		request-&gt;OperationFinished(&amp;operation);</span><br><span> \
request-&gt;SetUnfinished();</span><br><span> 			// Keep the request in unfinished \
state. ScheduleRequest() will set</span><br><span> 			// the final status and \
notify.</span><br><span>diff --git a/src/system/kernel/device_manager/IORequest.cpp \
b/src/system/kernel/device_manager/IORequest.cpp</span><br><span>index \
eb93c1c..2c44253 100644</span><br><span>--- \
a/src/system/kernel/device_manager/IORequest.cpp</span><br><span>+++ \
b/src/system/kernel/device_manager/IORequest.cpp</span><br><span>@@ -291,10 +291,33 \
@@</span><br><span> // #pragma mark -</span><br><span> </span><br><span> \
</span><br><span style="color: hsl(120, 100%, 40%);">+void</span><br><span \
style="color: hsl(120, 100%, 40%);">+IOOperation::SetStatus(status_t status, \
generic_size_t completedLength)</span><br><span style="color: hsl(120, 100%, \
40%);">+{</span><br><span style="color: hsl(120, 100%, \
40%);">+	IORequestChunk::SetStatus(status);</span><br><span style="color: hsl(120, \
100%, 40%);">+	if (IsWrite() == fParent-&gt;IsWrite()) {</span><br><span \
style="color: hsl(120, 100%, 40%);">+		// Determine how many bytes we actually read \
or wrote,</span><br><span style="color: hsl(120, 100%, 40%);">+		// relative to the \
original range, not the translated range.</span><br><span style="color: hsl(120, \
100%, 40%);">+		const generic_size_t partialBegin = (fOriginalOffset - \
fOffset);</span><br><span style="color: hsl(120, 100%, 40%);">+		generic_size_t \
originalTransferredBytes = completedLength;</span><br><span style="color: hsl(120, \
100%, 40%);">+		if (originalTransferredBytes &lt; partialBegin)</span><br><span \
style="color: hsl(120, 100%, 40%);">+			originalTransferredBytes = 0;</span><br><span \
style="color: hsl(120, 100%, 40%);">+		else</span><br><span style="color: hsl(120, \
100%, 40%);">+			originalTransferredBytes -= partialBegin;</span><br><span \
style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, \
40%);">+		if (originalTransferredBytes &gt; fOriginalLength)</span><br><span \
style="color: hsl(120, 100%, 40%);">+			originalTransferredBytes = \
fOriginalLength;</span><br><span style="color: hsl(120, 100%, \
40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+		fTransferredBytes += \
originalTransferredBytes;</span><br><span style="color: hsl(120, 100%, \
40%);">+	}</span><br><span style="color: hsl(120, 100%, 40%);">+}</span><br><span \
style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, \
40%);">+</span><br><span> bool</span><br><span> \
IOOperation::Finish()</span><br><span> {</span><br><span> \
TRACE(&quot;IOOperation::Finish()\n&quot;);</span><br><span style="color: hsl(120, \
100%, 40%);">+</span><br><span> 	if (fStatus == B_OK) {</span><br><span> 		if \
(fParent-&gt;IsWrite()) {</span><br><span> 			TRACE(&quot;  is \
write\n&quot;);</span><br><span>@@ -318,7 +341,7 @@</span><br><span> 					return \
false;</span><br><span> 				}</span><br><span> </span><br><span style="color: hsl(0, \
100%, 40%);">-				SetStatus(error);</span><br><span style="color: hsl(120, 100%, \
40%);">+				IORequestChunk::SetStatus(error);</span><br><span> 			} else if (fPhase \
== PHASE_READ_END) {</span><br><span> 				TRACE(&quot;  phase read \
end\n&quot;);</span><br><span> 				// repair phase adjusted vec</span><br><span>@@ \
-338,7 +361,7 @@</span><br><span> 					return false;</span><br><span> \
}</span><br><span> </span><br><span style="color: hsl(0, 100%, \
40%);">-				SetStatus(error);</span><br><span style="color: hsl(120, 100%, \
40%);">+				IORequestChunk::SetStatus(error);</span><br><span> 			}</span><br><span> \
}</span><br><span> 	}</span><br><span>@@ -402,7 +425,7 @@</span><br><span> \
}</span><br><span> </span><br><span> 		if (error != B_OK)</span><br><span \
style="color: hsl(0, 100%, 40%);">-			SetStatus(error);</span><br><span style="color: \
hsl(120, 100%, 40%);">+			IORequestChunk::SetStatus(error);</span><br><span> \
}</span><br><span> </span><br><span> 	return true;</span><br><span>@@ -1012,8 +1035,7 \
@@</span><br><span> </span><br><span> </span><br><span> void</span><br><span \
style="color: hsl(0, 100%, 40%);">-IORequest::OperationFinished(IOOperation* \
operation, status_t status,</span><br><span style="color: hsl(0, 100%, 40%);">-	bool \
partialTransfer, generic_size_t transferEndOffset)</span><br><span style="color: \
hsl(120, 100%, 40%);">+IORequest::OperationFinished(IOOperation* \
operation)</span><br><span> {</span><br><span> \
TRACE(&quot;IORequest::OperationFinished(%p, %#&quot; B_PRIx32 &quot;): request: \
%p\n&quot;,</span><br><span> 		operation, status, this);</span><br><span>@@ -1023,6 \
+1045,12 @@</span><br><span> 	fChildren.Remove(operation);</span><br><span> \
operation-&gt;SetParent(NULL);</span><br><span> </span><br><span style="color: \
hsl(120, 100%, 40%);">+	const status_t status = \
operation-&gt;Status();</span><br><span style="color: hsl(120, 100%, 40%);">+	const \
bool partialTransfer =</span><br><span style="color: hsl(120, 100%, \
40%);">+		(operation-&gt;TransferredBytes() &lt; \
operation-&gt;OriginalLength());</span><br><span style="color: hsl(120, 100%, \
40%);">+	const generic_size_t transferEndOffset =</span><br><span style="color: \
hsl(120, 100%, 40%);">+		(operation-&gt;OriginalOffset() + \
operation-&gt;TransferredBytes());</span><br><span style="color: hsl(120, 100%, \
40%);">+</span><br><span> 	if (status != B_OK || partialTransfer) {</span><br><span> \
if (fTransferSize &gt; transferEndOffset)</span><br><span> 			fTransferSize = \
transferEndOffset;</span><br><span>diff --git \
a/src/system/kernel/device_manager/IORequest.h \
b/src/system/kernel/device_manager/IORequest.h</span><br><span>index 1e754b8..8b26296 \
100644</span><br><span>--- \
a/src/system/kernel/device_manager/IORequest.h</span><br><span>+++ \
b/src/system/kernel/device_manager/IORequest.h</span><br><span>@@ -127,6 +127,9 \
@@</span><br><span> public:</span><br><span> 			bool				Finish();</span><br><span> \
// returns true, if it can be recycled</span><br><span style="color: hsl(120, 100%, \
40%);">+									// otherwise, there is more to be done</span><br><span style="color: \
hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, \
40%);">+			void				SetStatus(status_t status, generic_size_t \
completedLength);</span><br><span> </span><br><span> 			status_t			Prepare(IORequest* \
request);</span><br><span> 			void				SetOriginalRange(off_t \
offset,</span><br><span>@@ -134,11 +137,9 @@</span><br><span> 									// also sets \
range</span><br><span> 			void				SetRange(off_t offset, generic_size_t \
length);</span><br><span> </span><br><span style="color: hsl(0, 100%, \
40%);">-			void				SetStatus(status_t status)</span><br><span style="color: hsl(0, \
100%, 40%);">-									{ IORequestChunk::SetStatus(status); }</span><br><span \
style="color: hsl(0, 100%, 40%);">-</span><br><span> 			off_t				Offset() \
const;</span><br><span> 			generic_size_t		Length() const;</span><br><span \
style="color: hsl(120, 100%, 40%);">+</span><br><span> 			off_t				OriginalOffset() \
const</span><br><span> 									{ return fOriginalOffset; }</span><br><span> \
generic_size_t		OriginalLength() const</span><br><span>@@ -146,8 +147,6 \
@@</span><br><span> </span><br><span> 			generic_size_t		TransferredBytes() \
const</span><br><span> 									{ return fTransferredBytes; }</span><br><span \
style="color: hsl(0, 100%, 40%);">-			void				SetTransferredBytes(generic_size_t \
bytes)</span><br><span style="color: hsl(0, 100%, 40%);">-									{ \
fTransferredBytes = bytes; }</span><br><span> </span><br><span> \
generic_io_vec*		Vecs() const;</span><br><span> 			uint32				VecCount() \
const;</span><br><span>@@ -256,9 +255,7 @@</span><br><span> 			bool				HasCallbacks() \
const;</span><br><span> 			void				SetStatusAndNotify(status_t \
status);</span><br><span> </span><br><span style="color: hsl(0, 100%, \
40%);">-			void				OperationFinished(IOOperation* operation,</span><br><span \
style="color: hsl(0, 100%, 40%);">-									status_t status, bool \
partialTransfer,</span><br><span style="color: hsl(0, 100%, \
40%);">-									generic_size_t transferEndOffset);</span><br><span style="color: \
hsl(120, 100%, 40%);">+			void				OperationFinished(IOOperation* \
operation);</span><br><span> 			void				SubRequestFinished(IORequest* \
request,</span><br><span> 									status_t status, bool \
partialTransfer,</span><br><span> 									generic_size_t \
transferEndOffset);</span><br><span>diff --git \
a/src/system/kernel/device_manager/IOSchedulerSimple.cpp \
b/src/system/kernel/device_manager/IOSchedulerSimple.cpp</span><br><span>index \
001bfee..c1daa0a 100644</span><br><span>--- \
a/src/system/kernel/device_manager/IOSchedulerSimple.cpp</span><br><span>+++ \
b/src/system/kernel/device_manager/IOSchedulerSimple.cpp</span><br><span>@@ -291,13 \
+291,7 @@</span><br><span> 	if (operation-&gt;Status() &lt;= 0)</span><br><span> \
return;</span><br><span> </span><br><span style="color: hsl(0, 100%, \
40%);">-	operation-&gt;SetStatus(status);</span><br><span style="color: hsl(0, 100%, \
40%);">-</span><br><span style="color: hsl(0, 100%, 40%);">-	// set the bytes \
transferred (of the net data)</span><br><span style="color: hsl(0, 100%, \
40%);">-	generic_size_t partialBegin</span><br><span style="color: hsl(0, 100%, \
40%);">-		= operation-&gt;OriginalOffset() - operation-&gt;Offset();</span><br><span \
style="color: hsl(0, 100%, \
40%);">-	operation-&gt;SetTransferredBytes(</span><br><span style="color: hsl(0, \
100%, 40%);">-		transferredBytes &gt; partialBegin ? transferredBytes - partialBegin \

<div style="display:none"> Gerrit-Project: haiku </div>
<div style="display:none"> Gerrit-Branch: master </div>
<div style="display:none"> Gerrit-Change-Id: \
Ic9ae29e1100319e5b7647647c4db7e5aad4d125e </div> <div style="display:none"> \
Gerrit-Change-Number: 6375 </div> <div style="display:none"> Gerrit-PatchSet: 1 \
</div> <div style="display:none"> Gerrit-Owner: waddlesplash \
&lt;waddlesplash@gmail.com&gt; </div> <div style="display:none"> Gerrit-MessageType: \
newchange </div>



[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic