Source-Changes-HG archive

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

[src/netbsd-1-6]: src/sys/ufs/lfs Pull up revision 1.65 (requested by persean...



details:   https://anonhg.NetBSD.org/src/rev/ff2b62b9a671
branches:  netbsd-1-6
changeset: 528022:ff2b62b9a671
user:      lukem <lukem%NetBSD.org@localhost>
date:      Thu Jun 20 03:52:22 2002 +0000

description:
Pull up revision 1.65 (requested by perseant in ticket #325):
For synchronous writes, keep separate i/o counters for each write, so
processes don't have to wait for one another to finish (e.g., nfsd seems
to be a little happier now, though I haven't measured the difference).
Synchronous checkpoints, however, must always wait for all i/o to finish.
Take the contents of the callback functions and have them run in thread
context instead (aiodoned thread).  lfs_iocount no longer has to be
protected in splbio(), and quite a bit less of the segment construction
loop needs to be in splbio() as well.
If lfs_markv is handed a block that is not the correct size according to
the inode, refuse to process it.  (Formerly it was extended to the "correct"
size.)  This is possibly more prone to deadlock, but less prone to corruption.
lfs_segclean now outright refuses to clean segments that appear to have live
bytes in them.  Again this may be more prone to deadlock but avoids
corruption.
Replace ufsspec_close and ufsfifo_close with LFS equivalents; this means
that no UFS functions need to know about LFS_ITIMES any more.  Remove
the reference from ufs/inode.h.
Tested on i386, test-compiled on alpha.

diffstat:

 sys/ufs/lfs/lfs_vnops.c |  64 ++++++++++++++++++++++++++++++++++++++++++++----
 1 files changed, 58 insertions(+), 6 deletions(-)

diffs (107 lines):

diff -r d25a70c03e6b -r ff2b62b9a671 sys/ufs/lfs/lfs_vnops.c
--- a/sys/ufs/lfs/lfs_vnops.c   Thu Jun 20 03:52:11 2002 +0000
+++ b/sys/ufs/lfs/lfs_vnops.c   Thu Jun 20 03:52:22 2002 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: lfs_vnops.c,v 1.64 2002/05/17 21:42:38 perseant Exp $  */
+/*     $NetBSD: lfs_vnops.c,v 1.64.2.1 2002/06/20 03:52:22 lukem Exp $ */
 
 /*-
  * Copyright (c) 1999, 2000 The NetBSD Foundation, Inc.
@@ -71,7 +71,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: lfs_vnops.c,v 1.64 2002/05/17 21:42:38 perseant Exp $");
+__KERNEL_RCSID(0, "$NetBSD: lfs_vnops.c,v 1.64.2.1 2002/06/20 03:52:22 lukem Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -164,7 +164,7 @@
        { &vop_create_desc, spec_create },              /* create */
        { &vop_mknod_desc, spec_mknod },                /* mknod */
        { &vop_open_desc, spec_open },                  /* open */
-       { &vop_close_desc, ufsspec_close },             /* close */
+       { &vop_close_desc, lfsspec_close },             /* close */
        { &vop_access_desc, ufs_access },               /* access */
        { &vop_getattr_desc, lfs_getattr },             /* getattr */
        { &vop_setattr_desc, lfs_setattr },             /* setattr */
@@ -217,7 +217,7 @@
        { &vop_create_desc, fifo_create },              /* create */
        { &vop_mknod_desc, fifo_mknod },                /* mknod */
        { &vop_open_desc, fifo_open },                  /* open */
-       { &vop_close_desc, ufsfifo_close },             /* close */
+       { &vop_close_desc, lfsfifo_close },             /* close */
        { &vop_access_desc, ufs_access },               /* access */
        { &vop_getattr_desc, lfs_getattr },             /* getattr */
        { &vop_setattr_desc, lfs_setattr },             /* setattr */
@@ -864,16 +864,68 @@
        struct inode *ip = VTOI(vp);
        struct timespec ts;
 
-       simple_lock(&vp->v_interlock);
        if (vp->v_usecount > 1) {
                TIMEVAL_TO_TIMESPEC(&time, &ts);
                LFS_ITIMES(ip, &ts, &ts, &ts);
        }
-       simple_unlock(&vp->v_interlock);
        return (0);
 }
 
 /*
+ * Close wrapper for special devices.
+ *
+ * Update the times on the inode then do device close.
+ */
+int
+lfsspec_close(void *v)
+{
+       struct vop_close_args /* {
+               struct vnode    *a_vp;
+               int             a_fflag;
+               struct ucred    *a_cred;
+               struct proc     *a_p;
+       } */ *ap = v;
+       struct vnode    *vp;
+       struct inode    *ip;
+       struct timespec ts;
+
+       vp = ap->a_vp;
+       ip = VTOI(vp);
+       if (vp->v_usecount > 1) {
+               TIMEVAL_TO_TIMESPEC(&time, &ts);
+               LFS_ITIMES(ip, &ts, &ts, &ts);
+       }
+       return (VOCALL (spec_vnodeop_p, VOFFSET(vop_close), ap));
+}
+
+/*
+ * Close wrapper for fifo's.
+ *
+ * Update the times on the inode then do device close.
+ */
+int
+lfsfifo_close(void *v)
+{
+       struct vop_close_args /* {
+               struct vnode    *a_vp;
+               int             a_fflag;
+               struct ucred    *a_cred;
+               struct proc     *a_p;
+       } */ *ap = v;
+       struct vnode    *vp;
+       struct inode    *ip;
+       struct timespec ts;
+
+       vp = ap->a_vp;
+       ip = VTOI(vp);
+       if (ap->a_vp->v_usecount > 1) {
+               TIMEVAL_TO_TIMESPEC(&time, &ts);
+               LFS_ITIMES(ip, &ts, &ts, &ts);
+       }
+       return (VOCALL (fifo_vnodeop_p, VOFFSET(vop_close), ap));
+}
+
+/*
  * Reclaim an inode so that it can be used for other purposes.
  */
 int lfs_no_inactive = 0;



Home | Main Index | Thread Index | Old Index