[Libsysio-commit] HEAD: libsysio/include inode.h
Brought to you by:
lward
From: Lee W. <lw...@us...> - 2009-08-04 05:46:35
|
Update of /cvsroot/libsysio/libsysio/include In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv9719/include Modified Files: inode.h Log Message: Altered PB_SET_ASSOC to take a reference on each association ad drop one on disassociates. This to save the effort, everywhere it's used, of doing the same thing. Tracked down everywhere it's used and got rid of all the I_REF logic. Index: inode.h =================================================================== RCS file: /cvsroot/libsysio/libsysio/include/inode.h,v retrieving revision 1.56 retrieving revision 1.57 diff -u -w -b -B -p -r1.56 -r1.57 --- inode.h 3 Aug 2009 19:46:39 -0000 1.56 +++ inode.h 4 Aug 2009 05:46:24 -0000 1.57 @@ -411,6 +411,7 @@ struct pnode_base { assert(!(_ino)); \ _I_CHECK_LOCK((_pb)->pb_ino, 1); \ LIST_REMOVE((_pb), pb_alinks); \ + _I_RELE_NO_LOCK((_pb)->pb_ino); \ } \ (_pb)->pb_ino = (_ino); \ if ((_pb)->pb_ino) { \ @@ -418,13 +419,22 @@ struct pnode_base { LIST_INSERT_HEAD(&(_pb)->pb_ino->i_assoc, \ (_pb), \ pb_alinks); \ + _I_REF_NO_LOCK((_pb)->pb_ino); \ } \ } while (0) #else #define PB_SET_ASSOC(_pb, _ino) \ do { \ assert(!((_pb)->pb_ino && (_ino))); \ + if ((_pb)->pb_ino) { \ + _I_CHECK_LOCK((_pb)->pb_ino, 1); \ + _I_RELE_NO_LOCK((_pb)->pb_ino); \ + } \ (_pb)->pb_ino = (_ino); \ + if ((_pb)->pb_ino) { \ + _I_CHECK_LOCK((_pb)->pb_ino, 1); \ + _I_REF_NO_LOCK((_pb)->pb_ino); \ + } \ } while (0) #endif |