sending multiple buffers to single Irp

I have one query as follows:
I am writing one File system.
In write/Read Module, I prepare a list of runs (logical offset, length) like in FAT IORun then prepare Multiple Irp’s and send it down to storage driver. It works fine.
Runs are continuous blocks.

Here comes the problem.

Most of run has one block size difference.
Ex. If first Run is [X, L] then next Run is [X+2, L].

Because they are different runs so I have to prepare two Irp?s and send it down. And because of that it hits the performance.

Is there any way so that I can insert one block size buffer between two Mdls and prepare a single Irp and send it down?

I mean can I build an Irp with Multiple Mdl and lower driver gets continuous buffer.

I have one solution like allocate one big Buffer send and Irp with that. Then send it down.
When lower driver returns successful, copy data to waiting Irp?s user buffer. But this is not optimized solution. If somehow I can insert one buffer betweem two Mdls, It would be great help.

I know my text may not convey the problem properly, Please revert back with questions if you do not understand problem.

Unfortunately the storage stack does not support the concept of chained MDL’s like the redirector stacks do.

One thing I did not understand. Is the data contiguous on disk but not contiguous in memory or is it the other way around?

If it is contiguous on disk but not in memory you should be able to construct a single MDL that specifies the different chunks of memory that needs to be copied to the destination.

Neal Christiansen
Microsoft NTFS Development Lead
This posting is provided “AS IS” with no warranties, and confers no Rights

-----Original Message-----
From: xxxxx@lists.osr.com [mailto:xxxxx@lists.osr.com] On Behalf Of xxxxx@yahoo.com
Sent: Wednesday, October 08, 2008 6:02 AM
To: Windows File Systems Devs Interest List
Subject: [ntfsd] sending multiple buffers to single Irp

I have one query as follows:
I am writing one File system.
In write/Read Module, I prepare a list of runs (logical offset, length) like in FAT IORun then prepare Multiple Irp’s and send it down to storage driver. It works fine.
Runs are continuous blocks.

Here comes the problem.

Most of run has one block size difference.
Ex. If first Run is [X, L] then next Run is [X+2, L].

Because they are different runs so I have to prepare two Irp?s and send it down. And because of that it hits the performance.

Is there any way so that I can insert one block size buffer between two Mdls and prepare a single Irp and send it down?

I mean can I build an Irp with Multiple Mdl and lower driver gets continuous buffer.

I have one solution like allocate one big Buffer send and Irp with that. Then send it down.
When lower driver returns successful, copy data to waiting Irp?s user buffer. But this is not optimized solution. If somehow I can insert one buffer betweem two Mdls, It would be great help.

I know my text may not convey the problem properly, Please revert back with questions if you do not understand problem.


NTFSD is sponsored by OSR

For our schedule debugging and file system seminars
(including our new fs mini-filter seminar) visit:
http://www.osr.com/seminars

You are currently subscribed to ntfsd as: xxxxx@windows.microsoft.com
To unsubscribe send a blank email to xxxxx@lists.osr.com

//One thing I did not understand. Is the data contiguous on disk but not
//contiguous in memory or is it the other way around?

No it is not contiguous but there is one only block difference so I just want to insert an one block size buffer in between Irp’s User buffer so that in one call I can read full data.
For Example: There are two data runs.
DataRun1 [X,L]
DataRun[X+2.L]

To read this I have to build two Irp’s and send it down, but If I could Insert one block size fake buffer I could Read this in one Irp, so could have saved one read count ( Performance point of view).

Hope It makes you understand my problem…

Maybe the disk drive will optimize it for you. A SATA with NCQ might be
able to handle it. However if automatic sector reallocation due to a bad
sector has occurred, you will not know but the drive firmware will and can
do all the reads as it see fit. Before you optimize, see if it will gain
you anything. Storage is far more complex than as used to exist in the days
of floppies and MFM hard drives.

wrote in message news:xxxxx@ntfsd…
> //One thing I did not understand. Is the data contiguous on disk but not
> //contiguous in memory or is it the other way around?
>
> No it is not contiguous but there is one only block difference so I just
> want to insert an one block size buffer in between Irp’s User buffer so
> that in one call I can read full data.
> For Example: There are two data runs.
> DataRun1 [X,L]
> DataRun[X+2.L]
>
> To read this I have to build two Irp’s and send it down, but If I could
> Insert one block size fake buffer I could Read this in one Irp, so could
> have saved one read count ( Performance point of view).
>
> Hope It makes you understand my problem…
>