From owner-freebsd-fs@FreeBSD.ORG Fri May 21 09:09:16 2004 Return-Path: Delivered-To: freebsd-fs@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 414B216A4CE for ; Fri, 21 May 2004 09:09:16 -0700 (PDT) Received: from darkness.comp.waw.pl (darkness.comp.waw.pl [195.117.238.236]) by mx1.FreeBSD.org (Postfix) with ESMTP id D3F0843D1D for ; Fri, 21 May 2004 09:09:15 -0700 (PDT) (envelope-from pjd@darkness.comp.waw.pl) Received: by darkness.comp.waw.pl (Postfix, from userid 1009) id 36EE9ACBD6; Fri, 21 May 2004 18:09:14 +0200 (CEST) Date: Fri, 21 May 2004 18:09:14 +0200 From: Pawel Jakub Dawidek To: "David E. Cross" Message-ID: <20040521160914.GE845@darkness.comp.waw.pl> References: <1084556769.2304.20.camel@kiki.cs.rpi.edu> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="7FBusMY41sbWuT4E" Content-Disposition: inline In-Reply-To: <1084556769.2304.20.camel@kiki.cs.rpi.edu> User-Agent: Mutt/1.4.2i X-PGP-Key-URL: http://people.freebsd.org/~pjd/pjd.asc X-OS: FreeBSD 5.2.1-RC2 i386 cc: freebsd-fs@freebsd.org cc: moorthy@cs.rpi.edu cc: wronkm@cs.rpi.edu Subject: Re: Journalled UFS X-BeenThere: freebsd-fs@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Filesystems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 21 May 2004 16:09:16 -0000 --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--