block/deadline-iosched.c | 39 ++++++++++++++++++++++++--------------- block/deadline-iosched.c.orig | 0 2 files changed, 24 insertions(+), 15 deletions(-) diff -puN drivers/block/deadline-iosched.c~deadline-jiffies-wrap drivers/block/deadline-iosched.c --- 25/drivers/block/deadline-iosched.c~deadline-jiffies-wrap 2003-02-16 20:16:03.000000000 -0800 +++ 25-akpm/drivers/block/deadline-iosched.c 2003-02-16 20:19:35.000000000 -0800 @@ -44,30 +44,30 @@ struct ant_stats { /* * max time before a read is submitted. */ -static int read_expire = HZ / 10; +static unsigned long read_expire = HZ / 10; /* * ditto for writes, these limits are not hard, even * if the disk is capable of satisfying them. */ -static int write_expire = 5 * HZ; +static unsigned long write_expire = 5 * HZ; /* * read_batch_expire describes how long we will allow a stream of reads to * persist before looking to see whether it is time to switch over to writes. */ -static int read_batch_expire = HZ / 10; +static unsigned long read_batch_expire = HZ / 10; /* * write_batch_expire describes how long we will allow a stream of writes to * persist before looking to see whether it is time to switch over to reads. */ -static int write_batch_expire = HZ / 20; +static unsigned long write_batch_expire = HZ / 20; /* * max time we may wait to anticipate a read */ -static int antic_expire = HZ / 100; +static unsigned long antic_expire = HZ / 100; static const int deadline_hash_shift = 10; #define DL_HASH_BLOCK(sec) ((sec) >> 3) @@ -117,10 +117,10 @@ struct deadline_data { /* * settings that change how the i/o scheduler behaves */ - int fifo_expire[2]; - int batch_expire[2]; - int front_merges; - int antic_expire; + unsigned long fifo_expire[2]; + unsigned long batch_expire[2]; + unsigned long front_merges; + unsigned long antic_expire; }; /* @@ -150,7 +150,8 @@ struct deadline_rq { unsigned long expires; }; -static void deadline_move_request(struct deadline_data *dd, struct deadline_rq *drq); +static void +deadline_move_request(struct deadline_data *dd, struct deadline_rq *drq); /* * deadline_update_drq must be called whenever a request (drq) is added to @@ -746,7 +747,8 @@ deadline_update_drq(struct deadline_data dd->next_drq[data_dir] = deadline_choose_req(dd, drq, dd->next_drq[data_dir]); /* have we been anticipating this request? */ - if (dd->antic_status != ANTIC_OFF && data_dir == READ && deadline_antic_req(dd, drq)) { + if (dd->antic_status != ANTIC_OFF && data_dir == READ + && deadline_antic_req(dd, drq)) { long lba_offset; int neg; int log2; @@ -814,7 +816,9 @@ static int deadline_dispatch_request(str } if (dd->antic_status != ANTIC_FOUND - && (dd->antic_status == ANTIC_OFF || jiffies < dd->antic_start + dd->antic_expire) + && (dd->antic_status == ANTIC_OFF + || time_before(jiffies, dd->antic_start + + dd->antic_expire)) && (!drq || !deadline_antic_req(dd, drq)) ) { unsigned long timeout; @@ -822,9 +826,14 @@ static int deadline_dispatch_request(str ant_stats.anticipate_starts++; dd->antic_start = jiffies; } - timeout = min(dd->antic_start + dd->antic_expire, + timeout = dd->antic_start + dd->antic_expire; +#if 0 + /* FIX THIS!!! */ + timeout = min(timeout, dd->current_batch_expires); - timeout = min(timeout, dd->current_check_fifo[READ]); + timeout = min(timeout, + dd->current_check_fifo[READ]); +#endif mod_timer(&dd->antic_timer, timeout); dd->antic_status = ANTIC_WAIT; @@ -1143,7 +1152,7 @@ deadline_var_show(unsigned int var, char } static ssize_t -deadline_var_store(unsigned int *var, const char *page, size_t count) +deadline_var_store(unsigned long *var, const char *page, size_t count) { char *p = (char *) page; diff -puN drivers/block/deadline-iosched.c.orig~deadline-jiffies-wrap drivers/block/deadline-iosched.c.orig _