Re: Freezing of live volumes
Re: Freezing of live volumes
- Subject: Re: Freezing of live volumes
- From: Dean Reece <email@hidden>
- Date: Tue, 21 Dec 2004 02:19:19 -0800
On Dec 21, 2004, at 1:46 AM, Yogesh P wrote:
We are not trying to freeze the filesystem,but we want to freeze the
live volume at block level by writing our own kext module which kept
all the I/O write request in queue so that we copy all the meta-data
to the other location.After copying of all the meta-data we will
release the queue.
So if we want to freeze the live volume at block level is it feasible
at generic block level???
Thanks & Regards,
YOGESH PAHILWAN
(SOFTWARE ENGINNER)
This is certainly possible, though a bit scary from a performance
perspective. Consider how freezing a volume will effect real-time
operations like A/V capture and playback. You'll want to design your
code to keep drives frozen for the absolute minimum time necessary.
Ideally, you would allow reads to proceed and only freeze writes. If
you can have all the logic that decides which metadata blocks need to
be copied from within the kext itself, you'll have a lot easier time of
it. If you have to communicate with a user-space process/daemon while
a volume is frozen, then deadlocks will be much harder to avoid.
Have a look at the IOMedia filter documentation at
http://developer.apple.com/documentation/DeviceDrivers/Conceptual/
MassStorage/04_Matching/chapter_4_section_5.html. Also, have a look at
the partition scheme classes in the IOStorageFamily project
(IOFDiskPartitionScheme & IOApplePartitionScheme).
This will give you some idea of how to insert code into the I/O stack
such that you can intercept all I/Os going to any/all disks (this is
called an IOMedia Filter in IOKit). Making a 'null' filter scheme is
fairly straight forward. I would recommend matching on the IOMedia
"leaf" nodes, since that is where the filesystems will be mounted.
You'll get one instance of your driver created for each partition of
every disk; you should be able to refine the match using
kIOMediaContentHintKey so that you only stack onto partitions with
filesystems you care about.
The actual freezing part will be much trickier due to potential for
deadlocks. In particular, you need to be careful if you freeze I/Os to
any disk being used for swap space - if you need to do anything that
blocks or allocates memory while the disk is frozen, you can deadlock.
Hope this helps,
- Dean
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Darwin-kernel mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden