Source-Changes-HG archive

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

[src/trunk]: src/sys/nfs change nctime to timespec from time_t.



details:   https://anonhg.NetBSD.org/src/rev/db2d564e7442
branches:  trunk
changeset: 552055:db2d564e7442
user:      yamt <yamt%NetBSD.org@localhost>
date:      Wed Sep 17 09:10:00 2003 +0000

description:
change nctime to timespec from time_t.
there can be too many activities in a second.

diffstat:

 sys/nfs/nfs_vnops.c |  15 ++++++++-------
 sys/nfs/nfsnode.h   |   4 ++--
 2 files changed, 10 insertions(+), 9 deletions(-)

diffs (64 lines):

diff -r c42b28810021 -r db2d564e7442 sys/nfs/nfs_vnops.c
--- a/sys/nfs/nfs_vnops.c       Wed Sep 17 07:49:11 2003 +0000
+++ b/sys/nfs/nfs_vnops.c       Wed Sep 17 09:10:00 2003 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: nfs_vnops.c,v 1.177 2003/08/07 16:33:55 agc Exp $      */
+/*     $NetBSD: nfs_vnops.c,v 1.178 2003/09/17 09:10:00 yamt Exp $     */
 
 /*
  * Copyright (c) 1989, 1993
@@ -39,7 +39,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: nfs_vnops.c,v 1.177 2003/08/07 16:33:55 agc Exp $");
+__KERNEL_RCSID(0, "$NetBSD: nfs_vnops.c,v 1.178 2003/09/17 09:10:00 yamt Exp $");
 
 #include "opt_nfs.h"
 #include "opt_uvmhist.h"
@@ -867,11 +867,11 @@
 
                if (error == ENOENT) {
                        if (!VOP_GETATTR(dvp, &vattr, cnp->cn_cred,
-                           cnp->cn_proc) && vattr.va_mtime.tv_sec ==
-                           VTONFS(dvp)->n_nctime)
+                           cnp->cn_proc) && timespeccmp(&vattr.va_mtime,
+                           &VTONFS(dvp)->n_nctime, ==))
                                return ENOENT;
                        cache_purge(dvp);
-                       np->n_nctime = 0;
+                       timespecclear(&np->n_nctime);
                        goto dorpc;
                }
 
@@ -1026,9 +1026,10 @@
                 */
                if (error == ENOENT && (cnp->cn_flags & MAKEENTRY) &&
                    cnp->cn_nameiop != CREATE) {
-                       if (VTONFS(dvp)->n_nctime == 0)
+                       if (timespecisset(&VTONFS(dvp)->n_nctime))
                                VTONFS(dvp)->n_nctime =
-                                   VTONFS(dvp)->n_vattr->va_mtime.tv_sec;
+                                   VTONFS(dvp)->n_vattr->va_mtime;
+
                        cache_enter(dvp, NULL, cnp);
                }
                if (newvp != NULLVP) {
diff -r c42b28810021 -r db2d564e7442 sys/nfs/nfsnode.h
--- a/sys/nfs/nfsnode.h Wed Sep 17 07:49:11 2003 +0000
+++ b/sys/nfs/nfsnode.h Wed Sep 17 09:10:00 2003 +0000
@@ -1,4 +1,4 @@
-/*      $NetBSD: nfsnode.h,v 1.42 2003/08/07 16:33:56 agc Exp $        */
+/*      $NetBSD: nfsnode.h,v 1.43 2003/09/17 09:10:02 yamt Exp $       */
 
 /*
  * Copyright (c) 1989, 1993
@@ -121,7 +121,7 @@
        time_t                  n_attrstamp;    /* Attr. cache timestamp */
        time_t                  n_mtime;        /* Prev modify time. */
        time_t                  n_ctime;        /* Prev create time. */
-       time_t                  n_nctime;       /* Last neg cache entry (dir) */
+       struct timespec         n_nctime;       /* Last neg cache entry (dir) */
        time_t                  n_expiry;       /* Lease expiry time */
        daddr_t                 n_dblkno;       /* To keep faked dir blkno */
        unsigned                n_dircachesize; /* Size of dir cookie cache */



Home | Main Index | Thread Index | Old Index