Since you don’t mention if this is a filter or a file system in which
you are performing it, you make the conversation a bit more difficult.
In either case, you have the initial problem that cached read operations
do not have the same restrictions that non-cached read operations have.
Thus, you cannot just “convert” a six-byte cached read into a six-byte
non-cached read. The non-cached read must be done in properly aligned
buffers on sector-sized boundaries in sector sized units. Thus, in the
worst case, you need to allocate an aligned buffer, retrieve the
existing data, update the appropriate bytes and then write the existing
data, ensuring that you don’t allow any other access to that region of
the file while you are doing so.
If you are a file system, the easiest thing to do is to never allow
caching in the first place - don’t create a section object pointers
structure region and it will “just work”. Caching will never be
established, memory mapping will never be allowed.
If you are a filter driver, you are out of luck. You can try persuasive
techniques (Cc and Mm functions that try to make the section go away)
but they are not guaranteed to fail.
And of course there is the bottom line issue that disabling caching in
this fashion is going to be a horrible drain on performance. Thus, you
might achieve a mixture of techniques here you find acceptable from a
technical perspective but the overall project will fail because it makes
the user’s machines so hideously slow that they find it unusable.
Disabling caching is, in my experience, something that developers
believe will simplify their development but ultimately makes it fragile
and complex and horribly performing.
Regards,
Tony
Tony Mason
Consulting Partner
OSR Open Systems Resources, Inc.
http://www.osr.com
Looking forward to seeing you at the next OSR File Systems class in Los
Angeles, CA October 24-27, 2005.
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Raghwendra Kshatriya
Sent: Friday, October 07, 2005 5:08 AM
To: ntfsd redirect
Subject: [ntfsd] How to redirect cache read to page read
Hi All
I want to redirect any read call coming for cache, to the read of file
on disk. So the read call, instead of getting data from cache, should
get it from the file on disk.
And also after any IO operation I want to clean my cache completely.
Thanks in Advance.
Regards,
Raghwendra
Questions? First check the IFS FAQ at
https://www.osronline.com/article.cfm?id=17
You are currently subscribed to ntfsd as: unknown lmsubst tag argument:
‘’
To unsubscribe send a blank email to xxxxx@lists.osr.com
*********************************************************
Disclaimer:
The contents of this E-mail (including the contents of the enclosure(s)
or attachment(s) if any) are privileged and confidential material of MBT
and should not be disclosed to, used by or copied in any manner by
anyone other than the intended addressee(s). In case you are not the
desired addressee, you should delete this message and/or re-direct it to
the sender. The views expressed in this E-mail message (including the
enclosure(s) or attachment(s) if any) are those of the individual
sender, except where the sender expressly, and with authority, states
them to be the views of MBT.
This e-mail message including attachment/(s), if any, is believed to be
free of any virus. However, it is the responsibility of the recipient to
ensure that it is virus free and MBT is not responsible for any loss or
damage arising in any way from its use
********************************************************