summaryrefslogtreecommitdiffstats
path: root/sys/nfsclient
diff options
context:
space:
mode:
authorbde <bde@FreeBSD.org>1998-05-16 16:20:50 +0000
committerbde <bde@FreeBSD.org>1998-05-16 16:20:50 +0000
commit3ee93801b9b818ada9bc8e3a96c3803da90c8c9f (patch)
tree7edb6a5438872bb6a87c62e55f7ec70901ded642 /sys/nfsclient
parentac772ab5bbb6f2b0e8226cda05a0770ba8d48836 (diff)
downloadFreeBSD-src-3ee93801b9b818ada9bc8e3a96c3803da90c8c9f.zip
FreeBSD-src-3ee93801b9b818ada9bc8e3a96c3803da90c8c9f.tar.gz
Get timespecs directly instead of via timevals.
Diffstat (limited to 'sys/nfsclient')
-rw-r--r--sys/nfsclient/nfs_vnops.c38
1 files changed, 11 insertions, 27 deletions
diff --git a/sys/nfsclient/nfs_vnops.c b/sys/nfsclient/nfs_vnops.c
index c403079..c8d99a9 100644
--- a/sys/nfsclient/nfs_vnops.c
+++ b/sys/nfsclient/nfs_vnops.c
@@ -34,7 +34,7 @@
* SUCH DAMAGE.
*
* @(#)nfs_vnops.c 8.16 (Berkeley) 5/27/95
- * $Id: nfs_vnops.c,v 1.86 1998/05/16 15:21:29 bde Exp $
+ * $Id: nfs_vnops.c,v 1.87 1998/05/16 16:03:10 bde Exp $
*/
@@ -3114,15 +3114,12 @@ nfsspec_read(ap)
} */ *ap;
{
register struct nfsnode *np = VTONFS(ap->a_vp);
- struct timeval tv;
/*
* Set access flag.
*/
np->n_flag |= NACC;
- getmicrotime(&tv);
- np->n_atim.tv_sec = tv.tv_sec;
- np->n_atim.tv_nsec = tv.tv_usec * 1000;
+ getnanotime(&np->n_atim);
return (VOCALL(spec_vnodeop_p, VOFFSET(vop_read), ap));
}
@@ -3139,15 +3136,12 @@ nfsspec_write(ap)
} */ *ap;
{
register struct nfsnode *np = VTONFS(ap->a_vp);
- struct timeval tv;
/*
* Set update flag.
*/
np->n_flag |= NUPD;
- getmicrotime(&tv);
- np->n_mtim.tv_sec = tv.tv_sec;
- np->n_mtim.tv_nsec = tv.tv_usec * 1000;
+ getnanotime(&np->n_mtim);
return (VOCALL(spec_vnodeop_p, VOFFSET(vop_write), ap));
}
@@ -3197,15 +3191,12 @@ nfsfifo_read(ap)
} */ *ap;
{
register struct nfsnode *np = VTONFS(ap->a_vp);
- struct timeval tv;
/*
* Set access flag.
*/
np->n_flag |= NACC;
- getmicrotime(&tv);
- np->n_atim.tv_sec = tv.tv_sec;
- np->n_atim.tv_nsec = tv.tv_usec * 1000;
+ getnanotime(&np->n_atim);
return (VOCALL(fifo_vnodeop_p, VOFFSET(vop_read), ap));
}
@@ -3222,15 +3213,12 @@ nfsfifo_write(ap)
} */ *ap;
{
register struct nfsnode *np = VTONFS(ap->a_vp);
- struct timeval tv;
/*
* Set update flag.
*/
np->n_flag |= NUPD;
- getmicrotime(&tv);
- np->n_mtim.tv_sec = tv.tv_sec;
- np->n_mtim.tv_nsec = tv.tv_usec * 1000;
+ getnanotime(&np->n_mtim);
return (VOCALL(fifo_vnodeop_p, VOFFSET(vop_write), ap));
}
@@ -3250,19 +3238,15 @@ nfsfifo_close(ap)
{
register struct vnode *vp = ap->a_vp;
register struct nfsnode *np = VTONFS(vp);
- struct timeval tv;
struct vattr vattr;
+ struct timespec ts;
if (np->n_flag & (NACC | NUPD)) {
- getmicrotime(&tv);
- if (np->n_flag & NACC) {
- np->n_atim.tv_sec = tv.tv_sec;
- np->n_atim.tv_nsec = tv.tv_usec * 1000;
- }
- if (np->n_flag & NUPD) {
- np->n_mtim.tv_sec = tv.tv_sec;
- np->n_mtim.tv_nsec = tv.tv_usec * 1000;
- }
+ getnanotime(&ts);
+ if (np->n_flag & NACC)
+ np->n_atim = ts;
+ if (np->n_flag & NUPD)
+ np->n_mtim = ts;
np->n_flag |= NCHG;
if (vp->v_usecount == 1 &&
(vp->v_mount->mnt_flag & MNT_RDONLY) == 0) {
OpenPOWER on IntegriCloud