This renames a couple of functions if you don't mind. The second hunk in the patch makes it stop trying to break anticipation while writing... a bit of an ugly fix but I'll think up something. drivers/block/as-iosched.c | 17 +++++++++-------- drivers/block/as-iosched.c.orig | 0 2 files changed, 9 insertions(+), 8 deletions(-) diff -puN drivers/block/as-iosched.c~as-cleanup drivers/block/as-iosched.c --- 25/drivers/block/as-iosched.c~as-cleanup 2003-02-24 23:36:24.000000000 -0800 +++ 25-akpm/drivers/block/as-iosched.c 2003-02-24 23:36:24.000000000 -0800 @@ -746,14 +746,15 @@ elevator_wrap: } /* - * as_break_anticipation returns true if we have been anticipating this request. + * as_can_break_anticipation returns true if we have been anticipating this + * request. * * It also returns true if the process against which we are anticipating * submits a write - that's presumably an fsync, O_SYNC write, etc. We want to * dispatch it ASAP, because we know that application will not be submitting * any new reads. */ -static int as_break_anticipation(struct as_data *ad, struct as_rq *arq) +static int as_can_break_anticipation(struct as_data *ad, struct as_rq *arq) { if (rq_data_dir(arq->request) == READ && as_close_req(ad, arq)) { ant_stats.close_requests++; @@ -790,8 +791,8 @@ static void as_update_arq(struct as_data * or does it come from the same process as the one we are anticipating * for? */ - if (ad->antic_status != ANTIC_FINISHED - && as_break_anticipation(ad, arq)) { + if (ad->batch_data_dir == READ && ad->antic_status != ANTIC_FINISHED + && as_can_break_anticipation(ad, arq)) { sector_t last = ad->last_sector[data_dir]; sector_t this = arq->request->sector; unsigned long delay = jiffies - ad->antic_start; @@ -829,10 +830,10 @@ static void as_update_arq(struct as_data } /* - * can_start_anticipation indicates weather we should either run arq + * as_can_anticipate indicates weather we should either run arq * or keep anticipating a better request. */ -static int can_start_anticipation(struct as_data *ad, struct as_rq *arq) +static int as_can_anticipate(struct as_data *ad, struct as_rq *arq) { if (ad->antic_status == ANTIC_FINISHED) /* @@ -852,7 +853,7 @@ static int can_start_anticipation(struct return 0; } - if (arq && as_break_anticipation(ad, arq)) + if (arq && as_can_break_anticipation(ad, arq)) /* * This request is a good candidate. Don't keep anticipating, * run it. @@ -903,7 +904,7 @@ static int as_dispatch_request(struct as if (as_fifo_expired(ad, READ)) goto fifo_expired; - if (can_start_anticipation(ad, arq)) { + if (as_can_anticipate(ad, arq)) { unsigned long timeout; if (ad->antic_status == ANTIC_OFF) { diff -puN drivers/block/as-iosched.c.orig~as-cleanup drivers/block/as-iosched.c.orig _