Date: Fri, 21 May 2004 18:09:14 +0200 From: Pawel Jakub Dawidek <pjd@FreeBSD.org> To: "David E. Cross" <crossd@cs.rpi.edu> Cc: wronkm@cs.rpi.edu Subject: Re: Journalled UFS Message-ID: <20040521160914.GE845@darkness.comp.waw.pl> In-Reply-To: <1084556769.2304.20.camel@kiki.cs.rpi.edu> References: <1084556769.2304.20.camel@kiki.cs.rpi.edu>
next in thread | previous in thread | raw e-mail | index | archive | help
--7FBusMY41sbWuT4E Content-Type: text/plain; charset=iso-8859-2 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Fri, May 14, 2004 at 01:46:11PM -0400, David E. Cross wrote: +> Ok... It was brought to my attention that someone was asking for this +> again, so I figure its time to put out an update on the status. Great to hear! +> Here's what I want to do: +>=20 +> VOP/VFS entry point { +> Aquire Mutex with RECURSION; mtx_lock(your_mtx); +> If first aquire, inc transaction ID; else don't; if (!mtx_recursed(your_mtx)) /* Inc transaction ID. */; +> NORMAL VOP/VFS Dispatch; +>=20 +> Release Mutex; recursed =3D mtx_recursed(your_mtx); mtx_unlock(your_mtx); +> if last release && syn_journal Checkpoint_Routine; if (!recursed && syn_journal) Checkpoint_Routine; +> } +> Checkpoint_Routine { +> Aquire mutex with RECURSION: +> if first aquire, last_tid=3DTID; +> else last_tid=3DTID-1; +>=20 +> Dump_to last_tid; +>=20 +> Release mutex; +> } +>=20 +> I am not sure how to check if we already have a mutex, and if its +> recursion or not vs. the mutex is already aquired but its not "ours". +> suggestions? I'm not sure why you want to check if mutex is already acquired. You don't want to sleep? You can use mtx_trylock(9) or mtx_owned(9) maybe. --=20 Pawel Jakub Dawidek http://www.FreeBSD.org pjd@FreeBSD.org http://garage.freebsd.pl FreeBSD committer Am I Evil? Yes, I Am! --7FBusMY41sbWuT4E Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.4 (FreeBSD) iD8DBQFArimqForvXbEpPzQRAiGwAKCuE22rNNWQmv3S43rnZhqz29D/bACeNxZq 0MfLIX0WnoZY/bO4/YaLlG4= =CrIJ -----END PGP SIGNATURE----- --7FBusMY41sbWuT4E--
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20040521160914.GE845>