I would say that it is entirely upto the filesystem to decide whether to cache a particular file or not. There have been several discussions regarding this on NTFSD.
Additionally, merely changing the flag to non cached wont be sufficient. The application that issued the open file request should know about it somehow. Otherwise, the application MAY not take care of the restrictions imposed on non-cached I/Os (alignment etc). For example, if u change the flag in pre-create, how will the application know that it has to now send sector aligned reads and writes?
Hey,
Don’t try to force non-cached operations on files.
Look at this link: http://www.osronline.com/showThread.cfm?link=143991
Read about forcing non-cached operations, what the offset for these
operations should be, etc. . .
How can the I/O manager do the right un-initializing in CLEANUP/CLOSE. It
should un-initialize section objects, etc. …
You could make a shadow FO when your file is opened and open it with
IRP_NOCACHE. This could affect your performance though.
If you make a filter, stick to its filter’s duties of filtering.
You could implement your own file system if you want to have full control.
With respect,
Gabriel Bercea
GaMiTech Software Development
Mobile contact: (+40)0740049634
eMail: xxxxx@gmail.com
-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of woody
Sent: Monday, January 26, 2009 5:24 PM
To: Windows File Systems Devs Interest List
Subject: [ntfsd] Open Target file with non-cached IO.
Hi,
I want to open/create some target files with non-cached IO
( change cached io non-cached ) with minifilter.
I think …
Hook IRP_MJ_CREATE as pre-op filter.
If target is a target file ,
set IRP_NOCACHE to PFLT_CALLBACK_DATA->Iopb->IrpFlags.
call FltSetCallbackDataDirty and return
FLT_PREOP_SUCCESS_WITH_CALLBACK.
Is this correct ?
Regards
Woody
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
I misunderstood about cache manager.
I will create a file based encryption/decription minifilter driver.
And my driver will encrypt/decript when read/write data from NTFS.
So it’s no problem for my driver whichever the data is
encripted/decripted ( cached or non-cached ).
Actually this is a pbem.
I do not have much experience with encryption/decryption filters but I would suggest orienting on the non-cached reads/writes.
It is really hard to actually handle the reads/write that are served using the cache manager.
Beware though that if you do this you should know that the encrypted data should also be sector aligned and if be careful for paging IO because now the encrypted data should not force extending the eof.
Good luck.
With respect,
Gabriel Bercea
GaMiTech Software Development
Mobile contact: (+40)0740049634
eMail: xxxxx@gmail.com
-----Original Message-----
From: xxxxx@lists.osr.com [mailto:xxxxx@lists.osr.com] On Behalf Of woodyring
Sent: Wednesday, January 28, 2009 4:05 PM
To: Windows File Systems Devs Interest List
Subject: Re: [ntfsd] Open Target file with non-cached IO.
Thanks Ayush and Bercea.
I misunderstood about cache manager.
I will create a file based encryption/decription minifilter driver.
And my driver will encrypt/decript when read/write data from NTFS.
So it’s no problem for my driver whichever the data is
encripted/decripted ( cached or non-cached ).
Thanks
woody
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