Source-Changes-HG archive

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

[src/trunk]: src/sys/nfs PR/57279: Izumi Tsutsui: Fix some {int,long} -> time...



details:   https://anonhg.NetBSD.org/src/rev/55a023c5e642
branches:  trunk
changeset: 373925:55a023c5e642
user:      christos <christos%NetBSD.org@localhost>
date:      Tue Mar 21 15:47:46 2023 +0000

description:
PR/57279: Izumi Tsutsui: Fix some {int,long} -> time_t. Still things will
break eventually because parts of the nfs protocol assume time_t will fit
in 32 bits.

diffstat:

 sys/nfs/nfs_clntsubs.c |  6 +++---
 sys/nfs/nfs_iod.c      |  7 ++++---
 sys/nfs/nfs_vfsops.c   |  8 ++++----
 3 files changed, 11 insertions(+), 10 deletions(-)

diffs (91 lines):

diff -r 4e2aacdae221 -r 55a023c5e642 sys/nfs/nfs_clntsubs.c
--- a/sys/nfs/nfs_clntsubs.c    Tue Mar 21 08:31:30 2023 +0000
+++ b/sys/nfs/nfs_clntsubs.c    Tue Mar 21 15:47:46 2023 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: nfs_clntsubs.c,v 1.6 2022/02/28 08:45:36 hannken Exp $ */
+/*     $NetBSD: nfs_clntsubs.c,v 1.7 2023/03/21 15:47:46 christos Exp $        */
 
 /*
  * Copyright (c) 1989, 1993
@@ -70,7 +70,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: nfs_clntsubs.c,v 1.6 2022/02/28 08:45:36 hannken Exp $");
+__KERNEL_RCSID(0, "$NetBSD: nfs_clntsubs.c,v 1.7 2023/03/21 15:47:46 christos Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_nfs.h"
@@ -390,7 +390,7 @@
        if (docheck) {
                struct vnode *vp = NFSTOV(np);
                struct nfsmount *nmp;
-               long now = time_second;
+               time_t now = time_second;
                const struct timespec *omtime = &np->n_vattr->va_mtime;
                const struct timespec *octime = &np->n_vattr->va_ctime;
                const char *reason = NULL; /* XXX: gcc */
diff -r 4e2aacdae221 -r 55a023c5e642 sys/nfs/nfs_iod.c
--- a/sys/nfs/nfs_iod.c Tue Mar 21 08:31:30 2023 +0000
+++ b/sys/nfs/nfs_iod.c Tue Mar 21 15:47:46 2023 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: nfs_iod.c,v 1.8 2018/09/03 16:29:36 riastradh Exp $    */
+/*     $NetBSD: nfs_iod.c,v 1.9 2023/03/21 15:47:46 christos Exp $     */
 
 /*
  * Copyright (c) 1989, 1993
@@ -35,7 +35,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: nfs_iod.c,v 1.8 2018/09/03 16:29:36 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: nfs_iod.c,v 1.9 2023/03/21 15:47:46 christos Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -409,7 +409,8 @@
        struct timeval ktvin, ktvout;
        u_int32_t nick;
        char *dpos = *dposp, *cp2;
-       int deltasec, error = 0;
+       time_t deltasec;
+       int error = 0;
 
        memset(&ktvout, 0, sizeof ktvout);       /* XXX gcc */
 
diff -r 4e2aacdae221 -r 55a023c5e642 sys/nfs/nfs_vfsops.c
--- a/sys/nfs/nfs_vfsops.c      Tue Mar 21 08:31:30 2023 +0000
+++ b/sys/nfs/nfs_vfsops.c      Tue Mar 21 15:47:46 2023 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: nfs_vfsops.c,v 1.244 2023/03/17 00:46:35 mlelstv Exp $ */
+/*     $NetBSD: nfs_vfsops.c,v 1.245 2023/03/21 15:47:46 christos Exp $        */
 
 /*
  * Copyright (c) 1989, 1993, 1995
@@ -35,7 +35,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: nfs_vfsops.c,v 1.244 2023/03/17 00:46:35 mlelstv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: nfs_vfsops.c,v 1.245 2023/03/21 15:47:46 christos Exp $");
 
 #if defined(_KERNEL_OPT)
 #include "opt_nfs.h"
@@ -323,7 +323,7 @@
        struct mount *mp;
        struct vnode *vp;
        struct lwp *l;
-       long n;
+       time_t n;
        int error;
 
        l = curlwp; /* XXX */
@@ -378,7 +378,7 @@
                panic("nfs_mountroot: getattr for root");
        n = attr.va_atime.tv_sec;
 #ifdef DEBUG
-       printf("root time: 0x%lx\n", n);
+       printf("root time: 0x%jx\n", (intmax_t)n);
 #endif
        setrootfstime(n);
 



Home | Main Index | Thread Index | Old Index