Re: Regarding RAID0 Code
From: Neil Brown <hidden>
Date: 2005-01-03 05:49:34
On Saturday January 1, poonamsbox@yahoo.com wrote:
Respected Sir,
I am a student from India. I am studying the RAID 0 code
in the linux kernel 2.4.20. I got some problems in
understanding the code, especially in the
raid0_make_request function. I didnt understand the
following statements.. like why the anding is done, and
what is sect_in_chunk. Please if you could tell me the
details, it would be a very great help for me. Please
sir, hoping for some help.
258 sect_in_chunk = bh->b_rsector & ((chunk_size<<1) -1);
259 chunk = (block - zone->zone_offset) / (zone->nb_dev << chunksize_bits);
260 tmp_dev = zone->dev[(block >> chunksize_bits) % zone->nb_dev];
261 rsect = (((chunk << chunksize_bits) + zone->dev_offset)<<1)
262 + sect_in_chunk;"sect_in_chunk" is the number of the target sector within it's chunk. i.e. the remainder when the target sector is divided by the chunk size. If it still doesn't make sense, try writing the code for mapping an array sector number to a (device number + device sector number). Then ask specifically about differences. NeilBrown
Thanking you in anticipation.
With Regards,
Poonam Dalya,
PICT,Pune,
INDIA.