Please tell us more about what you’re trying to do. I’m going to infer
that what you want to do is something like this:
FilterPagingIoWrite()
{
Perform some preprocessing on the request (maybe)
Send the write down to the filesystem, maybe in pieces
Perform some postprocessing on the request (maybe)
}
And you want to somehow guarantee that the file size (that you take out
of FsContext->FileSize - just accessing this field should not cause you
to deadlock) won’t change around this function.
Well, this isn’t really possible on a generic basis. If you KNOW you’re
working with a FastFat volume, you know that the file size will not
shrink during this call because the appropriate locks are already held,
but it may very well increase. Other filesystems may not even give you
this limited guarantee.
If you want to enforce synchronization of this code with file size
changes, you need to use your own locks to protect the file size on
files that your filter is interested in. Note that this is something
very dangerous for a filter to do, because you’re layering on top of an
existing locking mechanism that is already very complex. I suggest you
design your filter in such a way that you don’t have to take any locks
of your own during paging read/write operations - otherwise, deadlocks
are just too difficult to avoid no matter what filesystem you are
filtering.
-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Zm Chen
Sent: Tuesday, March 25, 2003 6:41 PM
To: File Systems Developers
Subject: [ntfsd] RE: How to determine valid data length in paging IO
Sorry, I have not describe my question clearly.
My problem is about the valid data length in the last page to
be paged.
So, ValidDataLength is not what I want.
Another question, the system hangs if I try to acquire
PagingIOResource. But, if I access the FsContext without
acquiring PagingIOResource, it hangs soon also.
Thanks!
Chen Zemao
You are currently subscribed to ntfsd as: xxxxx@nryan.com
To unsubscribe send a blank email to xxxxx@lists.osr.com