Re: [PATCH 008 of 35] Introduce bi_iocnt to count requests sharing the one bio.

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

 



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 [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[Index of Archives]     [Kernel Newbies]     [Netfilter]     [Bugtraq]     [Photo]     [Stuff]     [Gimp]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Video 4 Linux]     [Linux for the blind]     [Linux Resources]
  Powered by Linux