<p><br>
On Jan 6, 2014 11:34 PM, "neha naik" <<a href="mailto:nehanaik27@gmail.com">nehanaik27@gmail.com</a>> wrote:<br>
><br>
> Hi All,<br>
> I figured out the method by some trial and error and looking at the<br>
> linux source code.<br>
> We can do something like this :<br>
> Say we want to read pages of bvec in 512 chunks. Create bio with<br>
> a single page and read 512 chunk of data from wherever you want to (it<br>
> can be different disks).<br>
><br>
> dst = kmap_atomic(bvec->bv_page, KM_USER0); ---> bvec is of<br>
> original bio<br>
> src = kmap_atomic(page, KM_USER0); ---> page we read by<br>
> creating new bio<br>
> memcpy(dst+offset, src, 512);<br>
> kunmap_atomic(src, KM_USER0);<br>
> kunmap_atomic(dst, KM_USER0);<br>
><br>
How this solves the problem of data being on different disks?</p>
<p>> My difficulty was not being able to access the high memory page in<br>
> kernel. I was earlier trying to increment the offset of the bvec and<br>
> pass the page to the layer below assuming that it would read in the<br>
> data at correct offset but of course it was resulting in panic. The<br>
> above solves that. Of course, if there is some other method which<br>
> involves not creating any bio i would love to know.<br>
><br>
> Regards,<br>
> Neha<br>
><br>
><br>
> On Sat, Jan 4, 2014 at 9:32 AM, Pranay Srivastava <<a href="mailto:pranjas@gmail.com">pranjas@gmail.com</a>> wrote:<br>
> ><br>
> > On 04-Jan-2014 5:18 AM, "neha naik" <<a href="mailto:nehanaik27@gmail.com">nehanaik27@gmail.com</a>> wrote:<br>
> >><br>
> >> Hi All,<br>
> >> I am getting a request with bvec->bv_len > 512. Now, the<br>
> >> information to be read is scattered across the entire disk in 512<br>
> >> chunks. So that, information on disk can be : sector 8, sector 100,<br>
> >> sector 9.<br>
> >> Now if i get a request to read with the bvec->bv_len > 512 i need to<br>
> >> pull in the information from<br>
> >> multiple places on disk since the data is not sequentially located.<br>
> >> I tried to look at the linux source code because i think raid must be<br>
> >> doing it all the time. (eg : on disk 1 we may be storing sector 6 and<br>
> >> on disk 2 we may be storing sector 7 and so on).<br>
> ><br>
> > You are right. Perhaps you need to clone the bio and set them properly. I<br>
> > guess you ought to check dm driver's make_request function. It does clone<br>
> > bio.<br>
> ><br>
> > I don't know if you can split that request while handling it. Perhaps<br>
> > reinserting that request could work.<br>
> ><br>
> >> However, i have not really got any useful information from it. Also<br>
> >> scouring through articles on<br>
> >> google has not helped much.<br>
> >> I am hoping somebody points me in the right direction.<br>
> >><br>
> >> Thanks in advance,<br>
> >> Neha<br>
> >><br>
> >> _______________________________________________<br>
> >> Kernelnewbies mailing list<br>
> >> <a href="mailto:Kernelnewbies@kernelnewbies.org">Kernelnewbies@kernelnewbies.org</a><br>
> >> <a href="http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies">http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies</a><br>
> ><br>
> > ---P.K.S<br>
><br>
> _______________________________________________<br>
> Kernelnewbies mailing list<br>
> <a href="mailto:Kernelnewbies@kernelnewbies.org">Kernelnewbies@kernelnewbies.org</a><br>
> <a href="http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies">http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies</a></p>