Journalled UFS

Pawel Jakub Dawidek pjd at FreeBSD.org
Fri May 21 09:09:16 PDT 2004


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:
+> 
+> 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;
+> 
+>   Release Mutex;

recursed = 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=TID;
+>  else last_tid=TID-1;
+> 
+>  Dump_to last_tid;
+> 
+>  Release mutex;
+> }
+> 
+> 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.

-- 
Pawel Jakub Dawidek                       http://www.FreeBSD.org
pjd at FreeBSD.org                           http://garage.freebsd.pl
FreeBSD committer                         Am I Evil? Yes, I Am!
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 187 bytes
Desc: not available
Url : http://lists.freebsd.org/pipermail/freebsd-fs/attachments/20040521/5807acec/attachment.bin


More information about the freebsd-fs mailing list