* How to test the read/write flow of dm-target.
@ 2011-01-28 5:06 nishant mungse
2011-01-28 19:42 ` Malahal Naineni
0 siblings, 1 reply; 4+ messages in thread
From: nishant mungse @ 2011-01-28 5:06 UTC (permalink / raw)
To: device-mapper development
Hi,
I've created a device mapper target and I wanna test its read and
write mechanisms. I created a device using this target and tried to
write a filesystem on to the device.
My target is creating roughly two outgoing bios per incoming bio.
Which is maybe why I'm not able to get a proper log after running the
mke2fs command as while writing the filesystem, there are massive
amounts of writes performed on the device.
So, I tried to use the cat command to directly write to the device
file. The write is being performed for sure because I'm able to view
the data written to the underlying device.
But there is no output when I try to read the device file contents using cat.
Is there any other way to test the read/write workflows of a dm target
that can give out a proper log ?
Regards,
Nishant.
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: How to test the read/write flow of dm-target.
2011-01-28 5:06 How to test the read/write flow of dm-target nishant mungse
@ 2011-01-28 19:42 ` Malahal Naineni
2011-01-30 18:37 ` nishant mungse
0 siblings, 1 reply; 4+ messages in thread
From: Malahal Naineni @ 2011-01-28 19:42 UTC (permalink / raw)
To: dm-devel
nishant mungse [nishantmungse@gmail.com] wrote:
> Hi,
>
> I've created a device mapper target and I wanna test its read and
> write mechanisms. I created a device using this target and tried to
> write a filesystem on to the device.
>
> My target is creating roughly two outgoing bios per incoming bio.
> Which is maybe why I'm not able to get a proper log after running the
> mke2fs command as while writing the filesystem, there are massive
> amounts of writes performed on the device.
>
> So, I tried to use the cat command to directly write to the device
> file. The write is being performed for sure because I'm able to view
> the data written to the underlying device.
>
> But there is no output when I try to read the device file contents using cat.
>
> Is there any other way to test the read/write workflows of a dm target
> that can give out a proper log ?
I am not sure what you mean by 'proper log'. I would use 'dd' with
direct I/O to avoid cache so that every read and write directly go to the
device. I don't think you can do that with 'cat' command.
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: How to test the read/write flow of dm-target.
2011-01-28 19:42 ` Malahal Naineni
@ 2011-01-30 18:37 ` nishant mungse
2011-01-30 19:27 ` Milan Broz
0 siblings, 1 reply; 4+ messages in thread
From: nishant mungse @ 2011-01-30 18:37 UTC (permalink / raw)
To: device-mapper development
[-- Attachment #1.1: Type: text/plain, Size: 1795 bytes --]
Hi Malahal
Is there any way to find the last sector of bio.
Is this a correct way to find last sector of bio
"bio->bi_sector=bio->bi_sector + (bio->bi_size >> 9)-1"
or
bio_for_each_segment(bvec,bio,
idx)
{
bio->bi_sector=bio->bi_sector + (bvec->bv_len >> 9) -1;
}
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.
What is correct way to find/get last sector from bio?
Regards,
Nishant.
On Fri, Jan 28, 2011 at 2:42 PM, Malahal Naineni <malahal@us.ibm.com> wrote:
> nishant mungse [nishantmungse@gmail.com] wrote:
> > Hi,
> >
> > I've created a device mapper target and I wanna test its read and
> > write mechanisms. I created a device using this target and tried to
> > write a filesystem on to the device.
> >
> > My target is creating roughly two outgoing bios per incoming bio.
> > Which is maybe why I'm not able to get a proper log after running the
> > mke2fs command as while writing the filesystem, there are massive
> > amounts of writes performed on the device.
> >
> > So, I tried to use the cat command to directly write to the device
> > file. The write is being performed for sure because I'm able to view
> > the data written to the underlying device.
> >
> > But there is no output when I try to read the device file contents using
> cat.
> >
> > Is there any other way to test the read/write workflows of a dm target
> > that can give out a proper log ?
>
> I am not sure what you mean by 'proper log'. I would use 'dd' with
> direct I/O to avoid cache so that every read and write directly go to the
> device. I don't think you can do that with 'cat' command.
>
> --
> dm-devel mailing list
> dm-devel@redhat.com
> https://www.redhat.com/mailman/listinfo/dm-devel
>
[-- Attachment #1.2: Type: text/html, Size: 2641 bytes --]
[-- Attachment #2: Type: text/plain, Size: 0 bytes --]
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: How to test the read/write flow of dm-target.
2011-01-30 18:37 ` nishant mungse
@ 2011-01-30 19:27 ` Milan Broz
0 siblings, 0 replies; 4+ messages in thread
From: Milan Broz @ 2011-01-30 19:27 UTC (permalink / raw)
To: device-mapper development; +Cc: nishant mungse
On 01/30/2011 07:37 PM, nishant mungse wrote:
> Is there any way to find the last sector of bio.
Use csope to study kernel code, there is lot of examples
in existing code.
For last used sector in bio you probably want
last_used_sector = bio->bi_sector + bio_sectors(bio) - 1;
Milan
p.s.
Please do not post repeated questions in different threads
(and spam messages like chat invitations) to list, thank you.
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2011-01-30 19:27 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-01-28 5:06 How to test the read/write flow of dm-target nishant mungse
2011-01-28 19:42 ` Malahal Naineni
2011-01-30 18:37 ` nishant mungse
2011-01-30 19:27 ` Milan Broz
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox