From: Matthew Dillon Date: Fri, 30 Jan 2004 06:18:28 +0000 (+0000) Subject: This commit represents a major revamping of the clock interrupt and timebase X-Git-Tag: v2.0.1~12176 X-Git-Url: https://gitweb.dragonflybsd.org/dragonfly.git/commitdiff_plain/3a6f9faf65b88635bdd1db3db11d7b6711f5fc0c This commit represents a major revamping of the clock interrupt and timebase infrastructure in DragonFly. (missing nfs files) --- diff --git a/sys/vfs/nfs/nfs_serv.c b/sys/vfs/nfs/nfs_serv.c index 2879ac2cbb..4867450cb8 100644 --- a/sys/vfs/nfs/nfs_serv.c +++ b/sys/vfs/nfs/nfs_serv.c @@ -35,7 +35,7 @@ * * @(#)nfs_serv.c 8.8 (Berkeley) 7/31/95 * $FreeBSD: src/sys/nfs/nfs_serv.c,v 1.93.2.6 2002/12/29 18:19:53 dillon Exp $ - * $DragonFly: src/sys/vfs/nfs/nfs_serv.c,v 1.11 2003/10/09 22:27:26 dillon Exp $ + * $DragonFly: src/sys/vfs/nfs/nfs_serv.c,v 1.12 2004/01/30 06:18:28 dillon Exp $ */ /* @@ -136,7 +136,7 @@ extern struct nfsstats nfsstats; int nfsrvw_procrastinate = NFS_GATHERDELAY * 1000; int nfsrvw_procrastinate_v3 = 0; -static struct timeval nfsver = { 0 }; +static struct timespec nfsver; SYSCTL_DECL(_vfs_nfs); @@ -1196,7 +1196,7 @@ nfsrv_write(nfsd, slp, td, mrq) if (nfsver.tv_sec == 0) nfsver = boottime; *tl++ = txdr_unsigned(nfsver.tv_sec); - *tl = txdr_unsigned(nfsver.tv_usec); + *tl = txdr_unsigned(nfsver.tv_nsec / 1000); } else { nfsm_build(fp, struct nfs_fattr *, NFSX_V2FATTR); nfsm_srvfillattr(vap, fp); @@ -1484,7 +1484,7 @@ loop1: if (nfsver.tv_sec == 0) nfsver = boottime; *tl++ = txdr_unsigned(nfsver.tv_sec); - *tl = txdr_unsigned(nfsver.tv_usec); + *tl = txdr_unsigned(nfsver.tv_nsec / 1000); } else { nfsm_build(fp, struct nfs_fattr *, NFSX_V2FATTR); nfsm_srvfillattr(&va, fp); @@ -3694,7 +3694,7 @@ nfsrv_commit(nfsd, slp, td, mrq) if (nfsver.tv_sec == 0) nfsver = boottime; *tl++ = txdr_unsigned(nfsver.tv_sec); - *tl = txdr_unsigned(nfsver.tv_usec); + *tl = txdr_unsigned(nfsver.tv_nsec / 1000); } else { error = 0; } diff --git a/sys/vfs/nfs/nfs_vfsops.c b/sys/vfs/nfs/nfs_vfsops.c index 770faea690..910ae4e920 100644 --- a/sys/vfs/nfs/nfs_vfsops.c +++ b/sys/vfs/nfs/nfs_vfsops.c @@ -35,7 +35,7 @@ * * @(#)nfs_vfsops.c 8.12 (Berkeley) 5/20/95 * $FreeBSD: src/sys/nfs/nfs_vfsops.c,v 1.91.2.7 2003/01/27 20:04:08 dillon Exp $ - * $DragonFly: src/sys/vfs/nfs/nfs_vfsops.c,v 1.10 2003/11/15 21:05:44 dillon Exp $ + * $DragonFly: src/sys/vfs/nfs/nfs_vfsops.c,v 1.11 2004/01/30 06:18:28 dillon Exp $ */ #include "opt_bootp.h" @@ -409,8 +409,8 @@ nfs_mountroot(mp) * XXX time must be non-zero when we init the interface or else * the arp code will wedge... */ - while (time_second == 0) - tsleep(&time_second, 0, "arpkludge", 10); + while (mycpu->gd_time_seconds == 0) + tsleep(mycpu, 0, "arpkludge", 10); if (nfs_diskless_valid==1) nfs_convert_diskless(); diff --git a/sys/vfs/nfs/nfs_vnops.c b/sys/vfs/nfs/nfs_vnops.c index a622b4a827..1c1ecf4403 100644 --- a/sys/vfs/nfs/nfs_vnops.c +++ b/sys/vfs/nfs/nfs_vnops.c @@ -35,7 +35,7 @@ * * @(#)nfs_vnops.c 8.16 (Berkeley) 5/27/95 * $FreeBSD: src/sys/nfs/nfs_vnops.c,v 1.150.2.5 2001/12/20 19:56:28 dillon Exp $ - * $DragonFly: src/sys/vfs/nfs/nfs_vnops.c,v 1.16 2004/01/23 23:00:52 dillon Exp $ + * $DragonFly: src/sys/vfs/nfs/nfs_vnops.c,v 1.17 2004/01/30 06:18:28 dillon Exp $ */ @@ -301,7 +301,7 @@ nfs3_access_otw(struct vnode *vp, int wmode, rmode = fxdr_unsigned(u_int32_t, *tl); np->n_mode = rmode; np->n_modeuid = cred->cr_uid; - np->n_modestamp = time_second; + np->n_modestamp = mycpu->gd_time_seconds; } m_freem(mrep); nfsmout: @@ -382,7 +382,7 @@ nfs_access(ap) * Does our cached result allow us to give a definite yes to * this request? */ - if ((time_second < (np->n_modestamp + nfsaccess_cache_timeout)) && + if ((mycpu->gd_time_seconds < (np->n_modestamp + nfsaccess_cache_timeout)) && (ap->a_cred->cr_uid == np->n_modeuid) && ((np->n_mode & mode) == mode)) { nfsstats.accesscache_hits++;