Hello,
Yes, keep a bitmask that you get on initialization of the volume to
indicate where the free sectors are on the disk. Keep this in memory for
quick access.
At the volume filter layer you are almost never called in the context of
the original calling thread/process. You are generally seeing system
threads from system modules performing flushes, etc. For this type of
context you need to be in the file system stack.
Pete
–
Kernel Drivers
Windows File System and Device Driver Consulting
www.KernelDrivers.com http:</http:>
866.263.9295
------ Original Message ------
From: xxxxx@yahoo.fr
To: “Windows File Systems Devs Interest List”
Sent: 9/1/2015 10:11:21 PM
Subject: RE:[ntfsd] How do i redirect writes and create a mapping table
of logical blocks to offsets
>First of all, I want to thank all of you for your time trying to
>provide answers to my misunderstandings, I am still a newbie to driver
>development.
>I have examined the diskperf sample and being able to understand most
>of it. My assignment consists of storing the modified blocks on the
>same volume and for that i was considering throwing them on a flat file
>while maintaining a mapping table of offset, but i think (correct me if
>i’m wrong) saving them on a file residing on the same volume won’t work
>since the protection applies to the whole partition. I am able to get
>the write’s data, able to store the write offset in an AVL structure
>though. So here are my questions.
>1) Since i expect a lot of change, how do i get the next free space on
>disk to stash the writes away? I read here that I should create a
>bitmap of the volume and consequently be able to retrieve free sectors
>numbers and write on them, if that’s the case, can you clarify what i
>need to do that?
>Also is a storage filter driver the kind i need to add exclusions so
>that certain IRPs are filtered depending on some conditions: like the
>process that is responsible of the thread writing data to disk?
>
>Thank you.
>
>—
>NTFSD is sponsored by OSR
>
>OSR is hiring!! Info at http://www.osr.com/careers
>
>For our schedule of debugging and file system seminars visit:
>http://www.osr.com/seminars
>
>To unsubscribe, visit the List Server section of OSR Online at
>http://www.osronline.com/page.cfm?name=ListServer