On Oct 26, 2005, at 5:37 AM, mekhala wrote:
Hi Folks,
Actually we are writing filter scheme driver for implementing copy-on-write dependent Snapshot on Mac OSX. For this we have to enhance write routine in the filter scheme driver.
In this case, the snapshot volume (the target of your write) should have been matched by your driver (as otherwise it would have been mounted by the system as a separate copy of the volume).
Since you control the code at either end, it then becomes a simple matter of arranging a rendezvous between the two pieces of your own code.
If we write some data on Original partition(Part1) then the drivers write routine for Part1 media object gets called. Now before writing the new buffer at specified byteStart on Part1 we have to read the data from the same byteStart and write the read data on Snapshot partition(Part2) and finally write the new buffer on Part1.
The probelem is when we write someting on Part1 then in write routine we get the IOMedia object only for Part1 so we dont have any problem in reading data frfom original disk. But for writing the same data on Part2 we also need IOMedia object for Part2 in the same write routine. which we have got using the below mentioned code snippet.But as soon as we load the driver with this patch the system gets crashed.
Correct. As I note above, you must own the Part2 IOMedia; if it is owned by the system and mounted, you are guaranteed corruption. At the time that you decide that Part1 is going to be supported by Part2; most likely during matching for one or the other, you must notify the Part1 filter of the existence of your driver attached to Part2. Then it becomes a simple matter of passing a reference to the Part2 IOMedia to the Part1 filter driver.
= Mike