Thread: [Libsysio-commit] HEAD: libsysio/src inode.c (Page 2)
Brought to you by:
lward
From: Lee W. <lw...@us...> - 2009-01-22 18:06:57
|
Update of /cvsroot/libsysio/libsysio/src In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv12343 Modified Files: inode.c Log Message: Can't call p_reclaim_debug unless PB_DEBUG is defined. Fixed. Index: inode.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/src/inode.c,v retrieving revision 1.51 retrieving revision 1.52 diff -u -w -b -B -p -r1.51 -r1.52 --- inode.c 5 Jan 2009 19:19:29 -0000 1.51 +++ inode.c 22 Jan 2009 18:06:44 -0000 1.52 @@ -401,6 +401,10 @@ p_reclaim(unsigned limit) else PB_UNLOCK(pb); } while ((!limit || limit-- > 1) && next); + +#ifdef PB_DEBUG + p_reclaim_debug(); +#endif } static int |
From: Lee W. <lw...@us...> - 2009-01-22 19:07:51
|
Update of /cvsroot/libsysio/libsysio/src In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv15278/src Modified Files: inode.c Log Message: With I_ASSOCIATIONS defined, inodes keep a list of all path-base nodes that are currently associated. Always, association of a path-base node with an i-node is now done via the macro PB_SET_ASSOC(). This, new, macro will not allow an already associated path-base node to gain a new association; This to enforce the emerging policy of "once set, immutable" for these nodes. You can set the association of an unassociated path-base node or clear it, only. Index: inode.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/src/inode.c,v retrieving revision 1.52 retrieving revision 1.53 diff -u -w -b -B -p -r1.52 -r1.53 --- inode.c 22 Jan 2009 18:06:44 -0000 1.52 +++ inode.c 22 Jan 2009 19:07:42 -0000 1.53 @@ -304,6 +304,9 @@ _sysio_i_gone(struct inode *ino) if (ino->i_ref) abort(); +#ifdef I_ASSOCIATIIONS + assert(!I_ISASSOC(ino)); +#endif if (!ino->i_zombie) icache_delete(ino); TAILQ_REMOVE(&_sysio_inodes, ino, i_nodes); @@ -508,7 +511,8 @@ _sysio_pb_new(struct qstr *name, struct if (!name) name = &noname; - PB_INIT(pb, name, parent, ino); + PB_INIT(pb, name, parent); + PB_SET_ASSOC(pb, ino); if (ino) I_REF(ino); PB_LOCK(pb); @@ -587,14 +591,14 @@ _sysio_pb_gone(struct pnode_base *pb) ino = pb->pb_ino; if (ino) I_LOCK(ino); - pb->pb_ino = NULL; + PB_SET_ASSOC(pb, NULL); PB_UNLOCK(pb); mutex_destroy(&pb->pb_mutex); free(pb); if (ino) { I_RELE(ino); - if (!(ino->i_ref || ino->i_immune)) + if (!(ino->i_ref || ino->i_immune || I_ISASSOC(ino))) _sysio_i_gone(ino); else I_UNLOCK(ino); @@ -893,12 +897,17 @@ _sysio_p_validate(struct pnode *pno, str /* * Make valid. */ - pno->p_base->pb_ino = ino; + PB_SET_ASSOC(pno->p_base, ino); I_REF(pno->p_base->pb_ino); } else if (pno->p_base->pb_ino != ino) { /* * Path resolves to a different inode, now. The * currently attached inode, then, is stale. + * + * Don't want to disconnect it. If caller + * is handles based, we want to keep returning + * stale. Other users should know better than to + * keep retrying; It'll never become valid. */ err = -ESTALE; I_PUT(ino); @@ -1280,7 +1289,7 @@ _sysio_p_link(struct pnode *old, struct err = PNOP_LINK(old, new); if (err) return err; - new->p_base->pb_ino = old->p_base->pb_ino; + PB_SET_ASSOC(new->p_base, old->p_base->pb_ino); I_REF(new->p_base->pb_ino); return 0; } |
From: Lee W. <lw...@us...> - 2009-01-22 19:12:30
|
Update of /cvsroot/libsysio/libsysio/src In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv16097/src Modified Files: inode.c Log Message: Updated copyright. Sorry, should have done this with last check-in. Index: inode.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/src/inode.c,v retrieving revision 1.53 retrieving revision 1.54 diff -u -w -b -B -p -r1.53 -r1.54 --- inode.c 22 Jan 2009 19:07:42 -0000 1.53 +++ inode.c 22 Jan 2009 19:12:19 -0000 1.54 @@ -9,7 +9,7 @@ * terms of the GNU Lesser General Public License * (see cit/LGPL or http://www.gnu.org/licenses/lgpl.html) * - * Cplant(TM) Copyright 1998-2006 Sandia Corporation. + * Cplant(TM) Copyright 1998-2009 Sandia Corporation. * Under the terms of Contract DE-AC04-94AL85000, there is a non-exclusive * license for use of this work by or on behalf of the US Government. * Export of this program may require a license from the United States @@ -36,7 +36,7 @@ * Lee Ward * Sandia National Laboratories, New Mexico * P.O. Box 5800 - * Albuquerque, NM 87185-1110 + * Albuquerque, NM 87185-1319 * * le...@sa... */ |
From: Lee W. <lw...@us...> - 2009-08-04 05:46:33
|
Update of /cvsroot/libsysio/libsysio/src In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv9719/src Modified Files: inode.c 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.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/src/inode.c,v retrieving revision 1.55 retrieving revision 1.56 diff -u -w -b -B -p -r1.55 -r1.56 --- inode.c 28 Jan 2009 16:13:19 -0000 1.55 +++ inode.c 4 Aug 2009 05:46:24 -0000 1.56 @@ -513,8 +513,6 @@ _sysio_pb_new(struct qstr *name, struct name = &noname; PB_INIT(pb, name, parent); PB_SET_ASSOC(pb, ino); - if (ino) - I_REF(ino); PB_LOCK(pb); if (pb->pb_key.pbk_parent) { @@ -597,7 +595,6 @@ _sysio_pb_gone(struct pnode_base *pb) free(pb); if (ino) { - I_RELE(ino); if (!(ino->i_ref || ino->i_immune || I_ISASSOC(ino))) _sysio_i_gone(ino); else @@ -898,7 +895,6 @@ _sysio_p_validate(struct pnode *pno, str * Make valid. */ PB_SET_ASSOC(pno->p_base, ino); - I_REF(pno->p_base->pb_ino); } else if (pno->p_base->pb_ino != ino) { /* * Path resolves to a different inode, now. The |
From: Lee W. <lw...@us...> - 2009-08-17 23:00:33
|
Update of /cvsroot/libsysio/libsysio/src In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv31563 Modified Files: inode.c Log Message: Two changes to _sysio_pb_gone 1) Use I_GONE instead of _sysio_i_gone directly. 2) BUGFIX! If the associated i-node is a zombie it was being released once by the PB_SET_ASSOC(..., NULL) and then again, later, when we are trying to force the i-node to go away. Added a special check to remove the latter, forced, gone if ref == 1 and zombie. Index: inode.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/src/inode.c,v retrieving revision 1.56 retrieving revision 1.57 diff -u -w -b -B -p -r1.56 -r1.57 --- inode.c 4 Aug 2009 05:46:24 -0000 1.56 +++ inode.c 17 Aug 2009 23:00:20 -0000 1.57 @@ -587,8 +587,18 @@ _sysio_pb_gone(struct pnode_base *pb) TAILQ_REMOVE(&pb_leaf_nodes, pb, pb_links); #endif ino = pb->pb_ino; - if (ino) + if (ino) { I_LOCK(ino); + if (ino->i_ref == 1 && ino->i_zombie) { + /* + * The PB_UNLOCK, below, will kill it before + * we have a chance to force the issue. Avoid + * the double gone by resetting the pointer + * to NULL. + */ + ino = NULL; + } + } PB_SET_ASSOC(pb, NULL); PB_UNLOCK(pb); mutex_destroy(&pb->pb_mutex); @@ -596,7 +606,7 @@ _sysio_pb_gone(struct pnode_base *pb) if (ino) { if (!(ino->i_ref || ino->i_immune || I_ISASSOC(ino))) - _sysio_i_gone(ino); + I_GONE(ino); else I_UNLOCK(ino); } |
From: Lee W. <lw...@us...> - 2009-08-31 21:46:19
|
Update of /cvsroot/libsysio/libsysio/src In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv28646/src Modified Files: inode.c Log Message: Had left the old pb_prune routine, the recursive list-based implementation, but ifdef'd out. It's just gone, now. Index: inode.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/src/inode.c,v retrieving revision 1.58 retrieving revision 1.59 diff -u -w -b -B -p -r1.58 -r1.59 --- inode.c 31 Aug 2009 21:38:29 -0000 1.58 +++ inode.c 31 Aug 2009 21:46:09 -0000 1.59 @@ -1082,34 +1082,6 @@ p_remove_aliases(struct mount *mnt, stru return count; } -#if 0 -static size_t -pb_prune(struct mount *mnt, struct pnode_base *pb) -{ - size_t count; - struct pnode_base *nxt, *child; - - PB_LOCK(pb); - count = 0; - nxt = pb->pb_children.lh_first; - while ((child = nxt)) { - nxt = child->pb_sibs.le_next; - count += pb_prune(mnt, child); - } - - if (!count) { - count += p_remove_aliases(mnt, pb); - if (!(pb->pb_aliases.lh_first || pb->pb_children.lh_first)) { - _sysio_pb_gone(pb); - pb = NULL; - } - } - if (pb) - PB_UNLOCK(pb); - return count; -} -#endif - static size_t pb_prune(struct mount *mnt, struct pnode_base *pb) { |
From: Ruth K. <rk...@us...> - 2009-09-18 20:23:27
|
Update of /cvsroot/libsysio/libsysio/src In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv28263 Modified Files: inode.c Log Message: fix obsolete reference to lh_first in PB_DEBUG code block Index: inode.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/src/inode.c,v retrieving revision 1.59 retrieving revision 1.60 diff -u -w -b -B -p -r1.59 -r1.60 --- inode.c 31 Aug 2009 21:46:09 -0000 1.59 +++ inode.c 18 Sep 2009 20:23:16 -0000 1.60 @@ -533,7 +533,7 @@ _sysio_pb_new(struct qstr *name, struct if (pb->pb_key.pbk_parent) { #if defined(PB_DEBUG) - if (!parent->pb_children.lh_first) { + if (!parent->pb_children) { /* * The parent is no longer a leaf. We * need to remove it from that list. |
From: Lee W. <lw...@us...> - 2009-09-22 22:32:11
|
Update of /cvsroot/libsysio/libsysio/src In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv25491/src Modified Files: inode.c Log Message: There was an ifdef dependent on I_ASSOCIATIIONS. Notice anything funny about that? Fixed the typo and it builds with the to-be-included code now. Index: inode.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/src/inode.c,v retrieving revision 1.60 retrieving revision 1.61 diff -u -w -b -B -p -r1.60 -r1.61 --- inode.c 18 Sep 2009 20:23:16 -0000 1.60 +++ inode.c 22 Sep 2009 22:31:54 -0000 1.61 @@ -304,7 +304,7 @@ _sysio_i_gone(struct inode *ino) if (ino->i_ref) abort(); -#ifdef I_ASSOCIATIIONS +#ifdef I_ASSOCIATIONS assert(!I_ISASSOC(ino)); #endif if (!ino->i_zombie) |