Re: flushing disk buffer cache
From: Don Lewis (truckman_at_FreeBSD.org)
Date: 10/29/04
- Previous message: Siddharth Aggarwal: "Re: flushing disk buffer cache"
- In reply to: Siddharth Aggarwal: "Re: flushing disk buffer cache"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Fri, 29 Oct 2004 12:56:08 -0700 (PDT) To: saggarwa@cs.utah.edu
On 29 Oct, Siddharth Aggarwal wrote:
>
> Thanks for your reply.
>
> Hmm. At the moment, the user can send an ioctl to define a checkpoint. But
> I would guess that this could happen between 2 strategy() function calls
> corresponding to the same filesystem operation?
Yes.
> So if there a way to block
> filesystem operations while a snapshot is taken? I can't unmount an active
> filesystem before the snapshot and remount it after. Any suggestions?
Yes, this is done by the following code in ffs_snapshot():
/*
* Suspend operation on filesystem.
*/
for (;;) {
vn_finished_write(wrtmp);
if ((error = vfs_write_suspend(vp->v_mount)) != 0) {
vn_start_write(NULL, &wrtmp, V_WAIT);
vn_lock(vp, LK_EXCLUSIVE | LK_RETRY, td);
goto out;
}
if (mp->mnt_kern_flag & MNTK_SUSPENDED)
break;
vn_start_write(NULL, &wrtmp, V_WAIT);
}
I think the snapshot code works at a higher level than what you are
implementing, so I believe that the snapshot code doesn't need to sync
all the files to create a consistent snapshot. You may run into
problems with syncing unwritten data while writing is suspended, but I'm
not sure because don't understand the code all that well.
_______________________________________________
freebsd-hackers@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to "freebsd-hackers-unsubscribe@freebsd.org"
- Previous message: Siddharth Aggarwal: "Re: flushing disk buffer cache"
- In reply to: Siddharth Aggarwal: "Re: flushing disk buffer cache"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|
|