* XDR functions for basic NFS types
  */
 static __be32 *
-encode_time3(__be32 *p, struct timespec *time)
+encode_time3(__be32 *p, struct timespec64 *time)
 {
        *p++ = htonl((u32) time->tv_sec); *p++ = htonl(time->tv_nsec);
        return p;
 }
 
 static __be32 *
-decode_time3(__be32 *p, struct timespec *time)
+decode_time3(__be32 *p, struct timespec64 *time)
 {
        time->tv_sec = ntohl(*p++);
        time->tv_nsec = ntohl(*p++);
              struct kstat *stat)
 {
        struct user_namespace *userns = nfsd_user_namespace(rqstp);
-       struct timespec ts;
        *p++ = htonl(nfs3_ftypes[(stat->mode & S_IFMT) >> 12]);
        *p++ = htonl((u32) (stat->mode & S_IALLUGO));
        *p++ = htonl((u32) stat->nlink);
        *p++ = htonl((u32) MINOR(stat->rdev));
        p = encode_fsid(p, fhp);
        p = xdr_encode_hyper(p, stat->ino);
-       ts = timespec64_to_timespec(stat->atime);
-       p = encode_time3(p, &ts);
-       ts = timespec64_to_timespec(stat->mtime);
-       p = encode_time3(p, &ts);
-       ts = timespec64_to_timespec(stat->ctime);
-       p = encode_time3(p, &ts);
+       p = encode_time3(p, &stat->atime);
+       p = encode_time3(p, &stat->mtime);
+       p = encode_time3(p, &stat->ctime);
 
        return p;
 }
                stat.size  = inode->i_size;
        }
 
-       fhp->fh_pre_mtime = timespec64_to_timespec(stat.mtime);
-       fhp->fh_pre_ctime = timespec64_to_timespec(stat.ctime);
+       fhp->fh_pre_mtime = stat.mtime;
+       fhp->fh_pre_ctime = stat.ctime;
        fhp->fh_pre_size  = stat.size;
        fhp->fh_pre_change = nfsd4_change_attribute(&stat, inode);
        fhp->fh_pre_saved = true;
        p = decode_sattr3(p, &args->attrs, nfsd_user_namespace(rqstp));
 
        if ((args->check_guard = ntohl(*p++)) != 0) { 
-               struct timespec time; 
+               struct timespec64 time;
                p = decode_time3(p, &time);
                args->guardtime = time.tv_sec;
        }
 
 
        /* Pre-op attributes saved during fh_lock */
        __u64                   fh_pre_size;    /* size before operation */
-       struct timespec         fh_pre_mtime;   /* mtime before oper */
-       struct timespec         fh_pre_ctime;   /* ctime before oper */
+       struct timespec64       fh_pre_mtime;   /* mtime before oper */
+       struct timespec64       fh_pre_ctime;   /* ctime before oper */
        /*
         * pre-op nfsv4 change attr: note must check IS_I_VERSION(inode)
         *  to find out if it is valid.