[Libsysio-commit] HEAD: libsysio/include inode.h
Brought to you by:
lward
From: Lee W. <lw...@us...> - 2009-08-03 19:33:17
|
Update of /cvsroot/libsysio/libsysio/include In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv27194/include Modified Files: inode.h Log Message: Added macros P_ISLOCKED, PB_ISLOCKED, I_ISLOCKED that return positive if the entity is locked or zero, if not. Index: inode.h =================================================================== RCS file: /cvsroot/libsysio/libsysio/include/inode.h,v retrieving revision 1.54 retrieving revision 1.55 diff -u -w -b -B -p -r1.54 -r1.55 --- inode.h 5 May 2009 16:34:01 -0000 1.54 +++ inode.h 3 Aug 2009 19:33:03 -0000 1.55 @@ -190,10 +190,13 @@ struct inode { _I_INIT_MORE(ino); \ } while (0) +#define I_ISLOCKED(_ino) \ + ((_ino)->i_lckcnt) + #ifdef LOCK_DEBUG #define _I_CHECK_LOCK(_ino, _test) \ - (assert(((_test) && (_ino)->i_lckcnt) || \ - !((_test) || (_ino)->i_lckcnt))) + (assert(((_test) && I_ISLOCKED(_ino)) || \ + !((_test) || I_ISLOCKED(_ino)))) #else #define _I_CHECK_LOCK(_ino, _test) #endif @@ -343,10 +346,13 @@ struct pnode_base { LIST_INIT(&(_pb)->pb_aliases); \ } while (0) +#define PB_ISLOCKED(_pb) \ + ((_pb)->pb_lckcnt) + #ifdef LOCK_DEBUG #define _PB_CHECK_LOCK(_pb, _test) \ - (assert(((_test) && (_pb)->pb_lckcnt) || \ - !((_test) || (_pb)->pb_lckcnt))) + (assert(((_test) && PB_ISLOCKED(_pb)) || \ + !((_test) || PB_ISLOCKED(_pb)))) #else #define _PB_CHECK_LOCK(_pb, _test) #endif @@ -482,10 +488,13 @@ struct pnode { (_pno)->p_cover = (_cover); \ } while (0) +#define P_ISLOCKED(_pno) \ + ((_pno)->p_lckcnt) + #ifdef LOCK_DEBUG #define _P_CHECK_LOCK(_pno, _test) \ - (assert(((_test) && (_pno)->p_lckcnt) || \ - !((_test) || (_pno)->p_lckcnt))) + (assert(((_test) && P_ISLOCKED(_pno)) || \ + !((_test) || P_ISLOCKED(_pno)))) #else #define _P_CHECK_LOCK(_pno, _test) #endif |