Re: to understand the logic of raid0_make_request

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

 



2006/6/13, Neil Brown <neilb@xxxxxxx>:
On Tuesday June 13, liudows2@xxxxxxxxx wrote:
> hello,everyone.
> I am studying the code of raid0.But I find that the logic of
> raid0_make_request is a little difficult to understand.
> Who can tell me what the function of raid0_make_request will do eventually?

One of two possibilities.

Most often it will update bio->bi_dev and bio->bi_sector to refer to
the correct location on the correct underlying devices, and then
will return '1'.
The fact that it returns '1' is noticed by generic_make_request in
block/ll_rw_block.c and generic_make_request will loop around and
retry the request on the new device at the new offset.

However in the unusual case that the request cross a chunk boundary
and so needs to be sent to two different devices, raidi_make_request
will split the bio into to (using bio_split) will submit each of the
two bios directly down to the appropriate devices - and will then
return '0', so that generic make request doesn't loop around.

I hope that helps.

NeilBrown



Thanks a lot.I went through the code again following your guide.But I
still can't understand how the bio->bi_sector and bio->bi_dev are
computed.I don't know what the var 'block' stands for.
Could you explain them to me ?
Thanks!
Regards.

YangLiu
-
To unsubscribe from this list: send the line "unsubscribe linux-raid" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux RAID Wiki]     [ATA RAID]     [Linux SCSI Target Infrastructure]     [Linux Block]     [Linux IDE]     [Linux SCSI]     [Linux Hams]     [Device Mapper]     [Device Mapper Cryptographics]     [Kernel]     [Linux Admin]     [Linux Net]     [GFS]     [RPM]     [git]     [Yosemite Forum]


  Powered by Linux