Update of /cvsroot/libsysio/libsysio/src
In directory sc8-pr-cvs1:/tmp/cvs-serv19555/src
Modified Files:
Tag: cplant
inode.c
Log Message:
Add capability of checking inode generation numbers,
if a field for it exists in the stat struct.
Bug fix for unlink/creat failure:
Changes allow re-use of an inode which is no longer in use, but
still exists in the inode cache. If the stat info for the new use
matches cached info, the inode is re-used. If not, the old inode is
marked 'zombie' and removed from the inode cache to make way for
the new inode.
Index: inode.c
===================================================================
RCS file: /cvsroot/libsysio/libsysio/src/inode.c,v
retrieving revision 1.5.2.1
retrieving revision 1.5.2.2
diff -u -w -b -B -p -r1.5.2.1 -r1.5.2.2
--- inode.c 28 Apr 2003 20:55:56 -0000 1.5.2.1
+++ inode.c 24 Jul 2003 22:52:57 -0000 1.5.2.2
@@ -265,6 +265,7 @@ _sysio_i_gone(struct inode *ino)
if (ino->i_ref)
abort();
+ if (!ino->i_zombie)
LIST_REMOVE(ino, i_link);
TAILQ_REMOVE(&_sysio_inodes, ino, i_nodes);
(*ino->i_ops.inop_gone)(ino);
@@ -272,6 +273,17 @@ _sysio_i_gone(struct inode *ino)
assert(n_inodes);
n_inodes--;
+}
+
+/*
+ * Stale inode, zombie it and move it out of the way
+ */
+void
+_sysio_i_undead(struct inode *ino)
+{
+
+ LIST_REMOVE(ino, i_link);
+ ino->i_zombie = 1;
}
/*
|