Which file systems support MDL-based I/O

When rolling an IRP_MJ_WRITE, it is possible to specify that you want to
use MDL-based I/O. But apparently not all file systems support this
functionality. How does one determine which file systems support this? Or
if this is a discrete list, which ones?

Also, when calling IRP_MJ_WRITE I am getting STATUS_INVALID_USER_BUFFER
(0xc00000e8). My irp prep code is as follows:

TIA! - jb

// --------------------------------------------------
// Build the irp
// --------------------------------------------------
irp->MdlAddress = NULL;
irp->AssociatedIrp.SystemBuffer = buffer;
irp->UserEvent = &event;
irp->UserIosb = &ioStatusBlock;
irp->Tail.Overlay.Thread = PsGetCurrentThread();
irp->RequestorMode = KernelMode;
irp->Flags = IRP_BUFFERED_IO | IRP_WRITE_OPERATION;
// --------------------------------------------------
// Build the io stack location
// --------------------------------------------------
ioStackLocation = IoGetNextIrpStackLocation(irp);
ioStackLocation->MajorFunction = IRP_MJ_WRITE;
ioStackLocation->DeviceObject = pDeviceObject;
ioStackLocation->FileObject = pFileObject;
ioStackLocation->Parameters.Write.Length = (size*count);

// --------------------------------------------------
// Set the Completion Routine
// --------------------------------------------------
IoSetCompletionRoutine( irp, ScFileWriteComplete, NULL, TRUE, TRUE, TRUE
);

// --------------------------------------------------
// Call driver and if necessary, wait for event
// --------------------------------------------------
ntStatus = IoCallDriver(pDeviceObject, irp);


You are currently subscribed to ntfsd as: $subst(‘Recip.EmailAddr’)
To unsubscribe send a blank email to leave-ntfsd-$subst(‘Recip.MemberIDChar’)@lists.osr.com

Filesystems usually support neither I/O. It is specified in the
DeviceObject->Flags field.

–Mark

Mark J. Cariddi
Consulting Associate
Open Systems Resources, Inc.
http:\www.osr.com
-----Original Message-----
From: xxxxx@earthlink.net [mailto:xxxxx@earthlink.net]
Sent: Monday, January 22, 2001 7:00 PM
To: File Systems Developers
Subject: [ntfsd] Which file systems support MDL-based I/O

When rolling an IRP_MJ_WRITE, it is possible to specify that you want to
use MDL-based I/O. But apparently not all file systems support this
functionality. How does one determine which file systems support this? Or
if this is a discrete list, which ones?

Also, when calling IRP_MJ_WRITE I am getting STATUS_INVALID_USER_BUFFER
(0xc00000e8). My irp prep code is as follows:

TIA! - jb

// --------------------------------------------------
// Build the irp
// --------------------------------------------------
irp->MdlAddress = NULL;
irp->AssociatedIrp.SystemBuffer = buffer;
irp->UserEvent = &event;
irp->UserIosb = &ioStatusBlock;
irp->Tail.Overlay.Thread = PsGetCurrentThread();
irp->RequestorMode = KernelMode;
irp->Flags = IRP_BUFFERED_IO | IRP_WRITE_OPERATION;

// --------------------------------------------------
// Build the io stack location
// --------------------------------------------------
ioStackLocation = IoGetNextIrpStackLocation(irp);
ioStackLocation->MajorFunction = IRP_MJ_WRITE;
ioStackLocation->DeviceObject = pDeviceObject;
ioStackLocation->FileObject = pFileObject;
ioStackLocation->Parameters.Write.Length = (size*count);

// --------------------------------------------------
// Set the Completion Routine
// --------------------------------------------------
IoSetCompletionRoutine( irp, ScFileWriteComplete, NULL, TRUE, TRUE, TRUE
);

// --------------------------------------------------
// Call driver and if necessary, wait for event
// --------------------------------------------------
ntStatus = IoCallDriver(pDeviceObject, irp);


You are currently subscribed to ntfsd as: xxxxx@osr.com
To unsubscribe send a blank email to leave-ntfsd-$subst(‘Recip.MemberIDChar’)@lists.osr.com


You are currently subscribed to ntfsd as: $subst(‘Recip.EmailAddr’)
To unsubscribe send a blank email to leave-ntfsd-$subst(‘Recip.MemberIDChar’)@lists.osr.com

I assume you are writing a file system filter (because you are
rolling irps). You let the file system you are filtering tell you what
method to use, not the other way around. Check the device object->Flags
field before initializing (look for DO_DIRECT_IO or DO_BUFFERED_IO). Your
code assumes that the underlying fsd expects METHOD_BUFFERED io, which is
probably not true. If METHOD_DIRECT, the buffer would be described in an
MDL. Most file systems use METHOD_NEITHER, which means the user buffer will
be sent ‘as-is’, in UserBuffer. Maybe it would easier to just use
ZwWriteFile?

-----Original Message-----
From: xxxxx@earthlink.net [mailto:xxxxx@earthlink.net]
Sent: Monday, January 22, 2001 7:00 PM
To: File Systems Developers
Subject: [ntfsd] Which file systems support MDL-based I/O

When rolling an IRP_MJ_WRITE, it is possible to specify that you want to
use MDL-based I/O. But apparently not all file systems support this
functionality. How does one determine which file systems support this? Or
if this is a discrete list, which ones?

Also, when calling IRP_MJ_WRITE I am getting STATUS_INVALID_USER_BUFFER
(0xc00000e8). My irp prep code is as follows:

TIA! - jb

// --------------------------------------------------
// Build the irp
// --------------------------------------------------
irp->MdlAddress = NULL;
irp->AssociatedIrp.SystemBuffer = buffer;
irp->UserEvent = &event;
irp->UserIosb = &ioStatusBlock;
irp->Tail.Overlay.Thread = PsGetCurrentThread();
irp->RequestorMode = KernelMode;
irp->Flags = IRP_BUFFERED_IO | IRP_WRITE_OPERATION;

// --------------------------------------------------
// Build the io stack location
// --------------------------------------------------
ioStackLocation = IoGetNextIrpStackLocation(irp);
ioStackLocation->MajorFunction = IRP_MJ_WRITE;
ioStackLocation->DeviceObject = pDeviceObject;
ioStackLocation->FileObject = pFileObject;
ioStackLocation->Parameters.Write.Length = (size*count);

// --------------------------------------------------
// Set the Completion Routine
// --------------------------------------------------
IoSetCompletionRoutine( irp, ScFileWriteComplete, NULL, TRUE, TRUE, TRUE
);

// --------------------------------------------------
// Call driver and if necessary, wait for event
// --------------------------------------------------
ntStatus = IoCallDriver(pDeviceObject, irp);


You are currently subscribed to ntfsd as: xxxxx@ntpsoftware.com
To unsubscribe send a blank email to leave-ntfsd-$subst(‘Recip.MemberIDChar’)@lists.osr.com


You are currently subscribed to ntfsd as: $subst(‘Recip.EmailAddr’)
To unsubscribe send a blank email to leave-ntfsd-$subst(‘Recip.MemberIDChar’)@lists.osr.com