Re: [PATCH v2 3/5] mpage: split bi_end_io callback for reads and writes

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

 



>  		struct page *page = bv->bv_page;
> -		page_endio(page, bio_op(bio),
> +		page_endio(page, REQ_OP_READ,
> +			   blk_status_to_errno(bio->bi_status));

Nit: I think we can do without the page local variable here.

> +	bio_for_each_segment_all(bv, bio, iter_all) {
> +		struct page *page = bv->bv_page;
> +		page_endio(page, REQ_OP_WRITE,
>  			   blk_status_to_errno(bio->bi_status));

Same here.

>  	}
>  
> @@ -59,7 +73,11 @@ static void mpage_end_io(struct bio *bio)
>  
>  static struct bio *mpage_bio_submit(struct bio *bio)
>  {
> -	bio->bi_end_io = mpage_end_io;
> +	if (op_is_write(bio_op(bio)))
> +		bio->bi_end_io = mpage_write_end_io;
> +	else
> +		bio->bi_end_io = mpage_read_end_io;
> +

I'd also split mpage_bio_submit as all allers are clearly either
for reads or writes.




[Index of Archives]     [Linux RAID]     [Linux SCSI]     [Linux ATA RAID]     [IDE]     [Linux Wireless]     [Linux Kernel]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Device Mapper]

  Powered by Linux