Posted by Anonymous Tue 27th Mar 2007 18:19 - Syntax is Java - 58 views
Download | New Post | Modify | Hide line numbers
Download | New Post | Modify | Hide line numbers
-
protected synchronized void completedRequest ()//{{{
-
{
-
int cylPosition = 0;
-
if (rq_count > 0)
-
{
-
/* have more requests pending, so dispatch one immediately */
-
DSRequest req = request_queue[0];
-
int[] cylNo = ddev.getCHS(req.blk);
-
int firstCyl = cylNo[0];
-
-
int optimumDistance = (firstCyl - last_cyl);
-
-
for (int reqPos = 1; reqPos < request_queue.length; reqPos++)
-
{
-
DSRequest req2 = request_queue[reqPos];
-
int[] nextCylNo = ddev.getCHS(req2.blk);
-
int nextCyl = nextCylNo[0];
-
-
int currentDistance = (nextCyl - last_cyl);
-
-
if (optimumDistance < currentDistance)
-
{
-
req = req2;
-
firstCyl = nextCyl;
-
cylPosition = reqPos;
-
}
-
-
}
-
rq_count--;
-
if (rq_count > 0) {
-
if (cylPosition < (rq_count))
-
{
-
.arraycopy (request_queue, cylPosition+1, request_queue, cylPosition, rq_count-cylPosition);
-
}
-
else
-
{
-
.arraycopy (request_queue, 0, request_queue, 0, rq_count);
-
}
-
}
-
-
scheduleRequestNow(req);
-
}
-
else
-
{
-
/* else that's one less pending request */
-
ddev_pending--;
-
}
-
-
ddev.setDSchedStr("" + ddev_pending + " pending, RQ " + rq_count + "/" + QUEUESIZE);
-
}
PermaLink to this entry https://pastebin.co.uk/12292
Posted by Anonymous Tue 27th Mar 2007 18:19 - Syntax is Java - 58 views
Download | New Post | Modify | Hide line numbers
Download | New Post | Modify | Hide line numbers
Comments: 0