--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)

iD8DBQFArimqForvXbEpPzQRAiGwAKCuE22rNNWQmv3S43rnZh qz29D/bACeNxZq
0MfLIX0WnoZY/bO4/YaLlG4=
=CrIJ
-----END PGP SIGNATURE-----

--7FBusMY41sbWuT4E--