Re: Exploring locks in darwin
site_archiver@lists.apple.com Delivered-To: darwin-kernel@lists.apple.com = Mike On Jan 15, 2005, at 5:06 AM, Yogesh P wrote: Hi Chris, Yes we are trying to add snapshot to HFS+ and for the same purpose we need to freeze the I/O's for initializing the snapshot. What do u think will be the better approach for the freezing or locking the I/O for achieving this functionality in HFS+??? Thanks, YOGESH PAHILWAN (SOFTWARE ENGINNER) S P Software Technologies (I) Pvt. Ltd. (An ISO 9001:2000 Company) Pune, Maharashtra, India - 411 004. Tel : 91-20-4006154, 4006983, 4007503. Fax : 91-20-4006153. Email : pahilwan.yogesh@spsoftindia.com Visit us at : www.spsoftindia.com from my (limited) understanding of the vfs, this is not what you're looking for. I think vn_lock acts (as the name suggests) on a single vnode, not the whole filesystem. It won't suit your purposes if you're trying to lock out all writes to the entire volume. are you trying to add snapshots to HFS+ specifically, or just in a general way to all vfs file systems? On 15/01/2005, at 1:05, Yogesh P wrote: Hi Folks, I am going through the implementation of the locking available in vfs for holding the write call for fraction of time to initialize the snapshot module. Can we directly use the vn_lock function to lock the write calls? Is there any reference document which will make me understand the functionality of simple_lock,simple_unlock,VOP_LOCK and VOP_UNLOCK under darwin kernel. _______________________________________________ Do not post admin requests to the list. They will be ignored. Darwin-kernel mailing list (Darwin-kernel@lists.apple.com) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/darwin-kernel/drivers%40mu.org This email sent to drivers@mu.org _______________________________________________ Do not post admin requests to the list. They will be ignored. Darwin-kernel mailing list (Darwin-kernel@lists.apple.com) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/darwin-kernel/site_archiver%40lists.a... You would need to 'wrap' HFS (you can do this without necessarily having to patch it). To take a snapshot, you want to quiesce the filesystem. To do this, your wrapper would block all incoming calls and wait for any calls currently in progress to complete. Once there were no more callers in HFS, you would want to sync the filesystem and then take your snapshot. Note that some things (e.g. atime/mtime updates on close) will be missed by this, and for journalled HFS you will probably want to play the journal back on the snapshot to get it as up-to-date as possible. On Fri, 2005-01-14 at 20:48, Chris Bergmann wrote: Can somebody point me about the vn_lock function which is used by lots of syscall under bsd kernel. This email sent to site_archiver@lists.apple.com
participants (1)
-
Mike Smith