Filter Manager OpLock Detect

In the IRP model to detect that an OpLock was granted, I check that the
driver below me returns STATUS_PENDING otherwise the oplock was not granted.
I can’t wait for the completion (completion routine callback) because that
only happens when the OpLock is broken.

So how, using the Filter Manager, can I tell the oplock was granted by the
file system below since there is no call back to indicate the oplock was
granted.

Thanks,
Ken

Ken,

In this particular scenario what you do is take the CallbackData and perform
an asynchronous IO using it by calling FltPerformAsynchronousIo. The return
code of FltPerformAsynchronousIo will tell you if the oplock was granted on
not. Based on the return status you either complete the request by returning
FLT_PREOP_COMPLETE or FLT_PREOP_PENDING.

Thanks
Ravinder

This posting is provided “AS IS” with no warranties, and confers no rights.

“Ken Galipeau” wrote in message news:xxxxx@ntfsd…
> In the IRP model to detect that an OpLock was granted, I check that the
> driver below me returns STATUS_PENDING otherwise the oplock was not
granted.
> I can’t wait for the completion (completion routine callback) because that
> only happens when the OpLock is broken.
>
> So how, using the Filter Manager, can I tell the oplock was granted by the
> file system below since there is no call back to indicate the oplock was
> granted.
>
> Thanks,
> Ken
>

I don’t understand how I can do this in the PreOp call back when the request
has not yet been past down to the file system. Or do I do this in the Post
Op callback, but then doesn’t that only get called when the Oplock
eventually gets broken like in the Irp Model? I’m am not trying to get an
oplock,but only detect that one was granted.

If I call this routine when does its callback get called, it seems like it
would get called when the oplock was broken around the time that my callback
routine was called.

Ken

-----Original Message-----
From: Ravinder Thind [mailto:xxxxx@windows.microsoft.com]
Sent: Thursday, March 25, 2004 8:37 PM
To: Windows File Systems Devs Interest List
Subject: Re:[ntfsd] Filter Manager OpLock Detect

Ken,

In this particular scenario what you do is take the CallbackData and perform
an asynchronous IO using it by calling FltPerformAsynchronousIo. The return
code of FltPerformAsynchronousIo will tell you if the oplock was granted on
not. Based on the return status you either complete the request by returning
FLT_PREOP_COMPLETE or FLT_PREOP_PENDING.

Thanks
Ravinder

This posting is provided “AS IS” with no warranties, and confers no rights.

“Ken Galipeau” wrote in message news:xxxxx@ntfsd…
> In the IRP model to detect that an OpLock was granted, I check that
> the driver below me returns STATUS_PENDING otherwise the oplock was
> not
granted.
> I can’t wait for the completion (completion routine callback) because
> that only happens when the OpLock is broken.
>
> So how, using the Filter Manager, can I tell the oplock was granted by
> the file system below since there is no call back to indicate the
> oplock was granted.
>
> Thanks,
> Ken
>


Questions? First check the IFS FAQ at
https://www.osronline.com/article.cfm?id=17

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

Ken,

This is an interesting situation that is not currently addressed in the filter manager.

Though Ravinder’s suggestion is good in theory it is unfortunately not going to work. FltPerformAsynchronousIo does not currently allow you to call an FSCTRL with it. I will investigate why this is.

We will get back to you soon on how we will address your issue. Once decided we will get an updated filter manager on betaplace with the fix.

Neal Christiansen
Microsoft File System Filter Group Lead
This posting is provided “AS IS” with no warranties, and confers no rights.


From: xxxxx@lists.osr.com [mailto:xxxxx@lists.osr.com] On Behalf Of Ken Galipeau
Sent: Thursday, March 25, 2004 7:04 PM
To: Windows File Systems Devs Interest List
Subject: RE: [ntfsd] Filter Manager OpLock Detect

I don’t understand how I can do this in the PreOp call back when the request has not yet been past down to the file system. Or do I do this in the Post Op callback, but then doesn’t that only get called when the Oplock eventually gets broken like in the Irp Model? I’m am not trying to get an oplock,but only detect that one was granted.
If I call this routine when does its callback get called, it seems like it would get called when the oplock was broken around the time that my callback routine was called.
Ken
-----Original Message-----
From: Ravinder Thind [mailto:xxxxx@windows.microsoft.com]
Sent: Thursday, March 25, 2004 8:37 PM
To: Windows File Systems Devs Interest List
Subject: Re:[ntfsd] Filter Manager OpLock Detect
Ken,
In this particular scenario what you do is take the CallbackData and perform an asynchronous IO using it by calling FltPerformAsynchronousIo. The return code of FltPerformAsynchronousIo will tell you if the oplock was granted on not. Based on the return status you either complete the request by returning FLT_PREOP_COMPLETE or FLT_PREOP_PENDING.
Thanks
Ravinder

This posting is provided “AS IS” with no warranties, and confers no rights.
“Ken Galipeau” wrote in message news:xxxxx@ntfsd…
> In the IRP model to detect that an OpLock was granted, I check that
> the driver below me returns STATUS_PENDING otherwise the oplock was
> not
granted.
> I can’t wait for the completion (completion routine callback) because
> that only happens when the OpLock is broken.
>
> So how, using the Filter Manager, can I tell the oplock was granted by
> the file system below since there is no call back? to indicate the
> oplock was granted.
>
> Thanks,
> Ken
>


Questions? First check the IFS FAQ at https://www.osronline.com/article.cfm?id=17
You are currently subscribed to ntfsd as: xxxxx@legato.com To unsubscribe send a blank email to xxxxx@lists.osr.com

Questions? First check the IFS FAQ at https://www.osronline.com/article.cfm?id=17

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