bug-hurd
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: gnumach/device/blkio.c (disksort) unused function


From: Miguel Figueiredo
Subject: Re: gnumach/device/blkio.c (disksort) unused function
Date: Sat, 25 May 2013 17:58:50 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130518 Icedove/17.0.5

2013-05-25 Miguel Figueiredo <elmig@debianpt.org>

* device/blkio.c (disksort): remove unused function

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;
-       }
-}
-

--
Melhores cumprimentos/Best regards,

Miguel Figueiredo



reply via email to

[Prev in Thread] Current Thread [Next in Thread]