Hi Malahal<br>
<br>
Is there any way to find the last sector of bio. <br>
Is this a correct way to find last sector of bio <br><br>"bio->bi_sector=bio->bi_sector + (bio->bi_size >> 9)-1"<br>
<br>or<br>
<br>bio_for_each_segment(bvec,bio,<div id=":1ae">idx)<br>
{<br>
 bio->bi_sector=bio->bi_sector + (bvec->bv_len >> 9) -1;<br>
}<br>
Actually what i think both are same thing but in different way. Will this bio->bi_sector point to last sector of bio if bio->bi_vcnt is greater than 1.<br>
What is correct way to find/get last sector from bio?<br>
Regards,<br><font color="#888888">
Nishant.</font></div><br><br><div class="gmail_quote">On Fri, Jan 28, 2011 at 2:42 PM, Malahal Naineni <span dir="ltr"><<a href="mailto:malahal@us.ibm.com">malahal@us.ibm.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div><div></div><div class="h5">nishant mungse [<a href="mailto:nishantmungse@gmail.com">nishantmungse@gmail.com</a>] wrote:<br>
> Hi,<br>
><br>
> I've created a device mapper target and I wanna test its read and<br>
> write mechanisms. I created a device using this target and tried to<br>
> write a filesystem on to the device.<br>
><br>
> My target is creating roughly two outgoing bios per incoming bio.<br>
> Which is maybe why I'm not able to get a proper log after running the<br>
> mke2fs command as while writing the filesystem, there are massive<br>
> amounts of writes performed on the device.<br>
><br>
> So, I tried to use the cat command to directly write to the device<br>
> file. The write is being performed for sure because I'm able to view<br>
> the data written to the underlying device.<br>
><br>
> But there is no output when I try to read the device file contents using cat.<br>
><br>
> Is there any other way to test the read/write workflows of a dm target<br>
> that can give out a proper log ?<br>
<br>
</div></div>I am not sure what you mean by 'proper log'. I would use 'dd' with<br>
direct I/O to avoid cache so that every read and write directly go to the<br>
device. I don't think you can do that with 'cat' command.<br>
<font color="#888888"><br>
--<br>
dm-devel mailing list<br>
<a href="mailto:dm-devel@redhat.com">dm-devel@redhat.com</a><br>
<a href="https://www.redhat.com/mailman/listinfo/dm-devel" target="_blank">https://www.redhat.com/mailman/listinfo/dm-devel</a><br>
</font></blockquote></div><br>