lkml.org 
[lkml]   [2007]   [Aug]   [1]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 008 of 35] Introduce bi_iocnt to count requests sharing the one bio.
Hello,

On Tue, Jul 31, 2007 at 12:16:29PM +1000, NeilBrown wrote:
> static int ordered_bio_endio(struct request *rq, struct bio *bio,
> int error)
> {
> struct request_queue *q = rq->q;
> - bio_end_io_t *endio;
> - void *private;
>
> if (&q->bar_rq != rq)
> return 0;
>
> /*
> * Okay, this is the barrier request in progress, dry finish it.
> + *
> + * We'll finish this request again with the original
> + * bi_end_io after an error occurs or post flush is complete.
> */
> +
> if (error && !q->orderr)
> q->orderr = error;
>
> - endio = bio->bi_end_io;
> - private = bio->bi_private;
> - bio->bi_end_io = flush_dry_bio_endio;
> - bio->bi_private = q;
> -
> - bio_endio(bio, error);
> -
> - bio->bi_end_io = endio;
> - bio->bi_private = private;
> + set_bit(BIO_UPTODATE, &bio->bi_flags);
>
> return 1;
> }

The only reason bio_endio() was called from ordered_bio_endio() was to
get the same side effect (bio update) as real io completions, which
should be reversed by flush_dry_bio_endio() to re-finish it later.
This was done this way under the assumption that somebody might depend
on bio updates after partial bio completion.

Now that it's guaranteed that there's no partial bio completion, none
of the dancing is needed. Setting BIO_UPTODATE can be removed too.

Nice clean up. Thanks.

--
tejun
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2007-08-01 17:51    [W:0.738 / U:2.048 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site