summaryrefslogtreecommitdiff
path: root/device
diff options
context:
space:
mode:
authorMiguel Figueiredo <elmig@debianpt.org>2013-05-27 01:03:41 +0200
committerSamuel Thibault <samuel.thibault@ens-lyon.org>2013-05-27 01:03:41 +0200
commit0bd4a8ed0ea5295bd00de63d33253ad05548d71f (patch)
tree244b13fb0d2adb1bdb7d9be1ef3fb0d619e6b402 /device
parentbc99a4f4a85d1803430d1b4c0d6619d1fba8d9c7 (diff)
Remove old elevator algorithm function
* device/blkio.c (disksort): remove unused function
Diffstat (limited to 'device')
-rw-r--r--device/blkio.c129
1 files changed, 0 insertions, 129 deletions
diff --git a/device/blkio.c b/device/blkio.c
index 26d4a75..27fec0e 100644
--- a/device/blkio.c
+++ b/device/blkio.c
@@ -107,132 +107,3 @@ vm_offset_t block_io_mmap()
return (0);
}
-/*
- * Disk sort routine.
- *
- * We order the disk request chain so that the disk head will sweep
- * back and forth across the disk. The chain is divided into two
- * pieces, with requests ordered in opposite directions. Assume that
- * the first part of the chain holds increasing cylinder numbers.
- * If a new request has a higher cylinder number than the head of
- * the chain, the disk head has not yet reached it; the new request
- * can go in the first part of the chain. If the new request has
- * a lower cylinder number, the disk head has already passed it and
- * must catch it on the way back; so the new request goes in the
- * second (descending) part of the chain.
- * When all of the requests in the ascending portion are filled,
- * the descending chain becomes the first chain, and requests above
- * the first now go in the second part of the chain (ascending).
- */
-
-#define io_cylinder io_residual
- /* Disk drivers put cylinder here */
-#define h_head io_next
-#define h_tail io_prev
- /* IORs are chained here */
-
-void disksort(head, ior)
- io_req_t head; /* (sort of) */
- io_req_t ior;
-{
- register int cylinder = ior->io_cylinder;
- register io_req_t next, prev;
-
- next = head->h_head;
- if (next == 0) {
- head->h_head = ior;
- head->h_tail = ior;
- ior->io_next = 0;
- return;
- }
-
- do {
- prev = next;
- next = prev->io_next;
- } while (next != 0 && prev->io_cylinder == next->io_cylinder);
-
- if (next == 0) {
- prev->io_next = ior;
- head->h_tail = ior;
- ior->io_next = 0;
- return;
- }
-
- if (prev->io_cylinder < next->io_cylinder) {
- /*
- * Ascending list first.
- */
- if (prev->io_cylinder <= cylinder) {
- /*
- * Insert in ascending list.
- */
- while (next != 0 &&
- next->io_cylinder <= cylinder &&
- prev->io_cylinder <= next->io_cylinder)
- {
- prev = next;
- next = prev->io_next;
- }
- }
- else {
- /*
- * Insert in descending list
- */
- do {
- prev = next;
- next = prev->io_next;
- } while (next != 0 &&
- prev->io_cylinder <= next->io_cylinder);
-
- while (next != 0 &&
- next->io_cylinder >= cylinder)
- {
- prev = next;
- next = prev->io_next;
- }
- }
- }
- else {
- /*
- * Descending first.
- */
- if (prev->io_cylinder >= cylinder) {
- /*
- * Insert in descending list.
- */
- while (next != 0 &&
- next->io_cylinder >= cylinder &&
- prev->io_cylinder >= next->io_cylinder)
- {
- prev = next;
- next = prev->io_next;
- }
- }
- else {
- /*
- * Insert in ascending list
- */
- do {
- prev = next;
- next = prev->io_next;
- } while (next != 0 &&
- prev->io_cylinder >= next->io_cylinder);
- while (next != 0 &&
- next->io_cylinder <= cylinder)
- {
- prev = next;
- next = prev->io_next;
- }
- }
- }
- /*
- * Insert between prev and next.
- */
- prev->io_next = ior;
- ior->io_next = next;
- if (next == 0) {
- /* At tail of list. */
- head->h_tail = ior;
- }
-}
-