Source-Changes-D archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: CVS commit: src/sys/coda



"Christos Zoulas" <christos%netbsd.org@localhost> wrote:
> Module Name:  src
> Committed By: christos
> Date:         Sat Nov 23 17:57:23 UTC 2013
> 
> Modified Files:
>       src/sys/coda: coda_vfsops.c
> 
> Log Message:
> replace open-coded scan with macro; fix locking
> 

-    /* mount structure wasn't found */
-    return(NULL);
+    mutex_exit(&mountlist_lock);
+    return mp == TAILQ_END(&mountlist) ? NULL : mp;

Although this is correct, TAILQ_END(&mountlist) *suggests* access of
mountlist.  If it would be true, it would be unlocked and buggy access.
Why not just "return mp;" ?

It seems to me that TAILQ_END() makes the code more missleading without
doing any good.  What was the rationale behind adding and using it?

-- 
Mindaugas


Home | Main Index | Thread Index | Old Index