Source-Changes-HG archive

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

[src/netbsd-1-4]: src/sys/nfs pullup 1.100->1.101 (fvdl): fix file creation w...



details:   https://anonhg.NetBSD.org/src/rev/def1ce976b2b
branches:  netbsd-1-4
changeset: 468894:def1ce976b2b
user:      perry <perry%NetBSD.org@localhost>
date:      Tue Jun 22 17:10:39 1999 +0000

description:
pullup 1.100->1.101 (fvdl): fix file creation with a Solaris 7 server

diffstat:

 sys/nfs/nfs_vnops.c |  99 ++++++++--------------------------------------------
 1 files changed, 16 insertions(+), 83 deletions(-)

diffs (171 lines):

diff -r c6cf10f8c077 -r def1ce976b2b sys/nfs/nfs_vnops.c
--- a/sys/nfs/nfs_vnops.c       Tue Jun 22 17:09:27 1999 +0000
+++ b/sys/nfs/nfs_vnops.c       Tue Jun 22 17:10:39 1999 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: nfs_vnops.c,v 1.100 1999/03/24 05:51:29 mrg Exp $      */
+/*     $NetBSD: nfs_vnops.c,v 1.100.2.1 1999/06/22 17:10:39 perry Exp $        */
 
 /*
  * Copyright (c) 1989, 1993
@@ -675,64 +675,7 @@
        nfsm_reqhead(vp, NFSPROC_SETATTR, NFSX_FH(v3) + NFSX_SATTR(v3));
        nfsm_fhtom(vp, v3);
        if (v3) {
-               if (vap->va_mode != (mode_t)VNOVAL) {
-                       nfsm_build(tl, u_int32_t *, 2 * NFSX_UNSIGNED);
-                       *tl++ = nfs_true;
-                       *tl = txdr_unsigned(vap->va_mode);
-               } else {
-                       nfsm_build(tl, u_int32_t *, NFSX_UNSIGNED);
-                       *tl = nfs_false;
-               }
-               if (vap->va_uid != (uid_t)VNOVAL) {
-                       nfsm_build(tl, u_int32_t *, 2 * NFSX_UNSIGNED);
-                       *tl++ = nfs_true;
-                       *tl = txdr_unsigned(vap->va_uid);
-               } else {
-                       nfsm_build(tl, u_int32_t *, NFSX_UNSIGNED);
-                       *tl = nfs_false;
-               }
-               if (vap->va_gid != (gid_t)VNOVAL) {
-                       nfsm_build(tl, u_int32_t *, 2 * NFSX_UNSIGNED);
-                       *tl++ = nfs_true;
-                       *tl = txdr_unsigned(vap->va_gid);
-               } else {
-                       nfsm_build(tl, u_int32_t *, NFSX_UNSIGNED);
-                       *tl = nfs_false;
-               }
-               if (vap->va_size != VNOVAL) {
-                       nfsm_build(tl, u_int32_t *, 3 * NFSX_UNSIGNED);
-                       *tl++ = nfs_true;
-                       txdr_hyper(vap->va_size, tl);
-               } else {
-                       nfsm_build(tl, u_int32_t *, NFSX_UNSIGNED);
-                       *tl = nfs_false;
-               }
-               if (vap->va_atime.tv_sec != VNOVAL) {
-                       if (vap->va_atime.tv_sec != time.tv_sec) {
-                               nfsm_build(tl, u_int32_t *, 3 * NFSX_UNSIGNED);
-                               *tl++ = txdr_unsigned(NFSV3SATTRTIME_TOCLIENT);
-                               txdr_nfsv3time(&vap->va_atime, tl);
-                       } else {
-                               nfsm_build(tl, u_int32_t *, NFSX_UNSIGNED);
-                               *tl = txdr_unsigned(NFSV3SATTRTIME_TOSERVER);
-                       }
-               } else {
-                       nfsm_build(tl, u_int32_t *, NFSX_UNSIGNED);
-                       *tl = txdr_unsigned(NFSV3SATTRTIME_DONTCHANGE);
-               }
-               if (vap->va_mtime.tv_sec != VNOVAL) {
-                       if (vap->va_mtime.tv_sec != time.tv_sec) {
-                               nfsm_build(tl, u_int32_t *, 3 * NFSX_UNSIGNED);
-                               *tl++ = txdr_unsigned(NFSV3SATTRTIME_TOCLIENT);
-                               txdr_nfsv3time(&vap->va_mtime, tl);
-                       } else {
-                               nfsm_build(tl, u_int32_t *, NFSX_UNSIGNED);
-                               *tl = txdr_unsigned(NFSV3SATTRTIME_TOSERVER);
-                       }
-               } else {
-                       nfsm_build(tl, u_int32_t *, NFSX_UNSIGNED);
-                       *tl = txdr_unsigned(NFSV3SATTRTIME_DONTCHANGE);
-               }
+               nfsm_v3attrbuild(vap, TRUE);
                nfsm_build(tl, u_int32_t *, NFSX_UNSIGNED);
                *tl = nfs_false;
        } else {
@@ -1199,7 +1142,6 @@
        register struct vattr *vap;
 {
        register struct nfsv2_sattr *sp;
-       register struct nfsv3_sattr *sp3;
        register u_int32_t *tl;
        register caddr_t cp;
        register int32_t t1, t2;
@@ -1227,10 +1169,9 @@
        nfsm_fhtom(dvp, v3);
        nfsm_strtom(cnp->cn_nameptr, cnp->cn_namelen, NFS_MAXNAMLEN);
        if (v3) {
-               nfsm_build(tl, u_int32_t *, NFSX_UNSIGNED + NFSX_V3SRVSATTR);
+               nfsm_build(tl, u_int32_t *, NFSX_UNSIGNED);
                *tl++ = vtonfsv3_type(vap->va_type);
-               sp3 = (struct nfsv3_sattr *)tl;
-               nfsm_v3sattr(sp3, vap);
+               nfsm_v3attrbuild(vap, FALSE);
                if (vap->va_type == VCHR || vap->va_type == VBLK) {
                        nfsm_build(tl, u_int32_t *, 2 * NFSX_UNSIGNED);
                        *tl++ = txdr_unsigned(major(vap->va_rdev));
@@ -1320,7 +1261,6 @@
        register struct vattr *vap = ap->a_vap;
        register struct componentname *cnp = ap->a_cnp;
        register struct nfsv2_sattr *sp;
-       register struct nfsv3_sattr *sp3;
        register u_int32_t *tl;
        register caddr_t cp;
        register int32_t t1, t2;
@@ -1350,18 +1290,16 @@
        if (v3) {
                nfsm_build(tl, u_int32_t *, NFSX_UNSIGNED);
                if (fmode & O_EXCL) {
-                   *tl = txdr_unsigned(NFSV3CREATE_EXCLUSIVE);
-                   nfsm_build(tl, u_int32_t *, NFSX_V3CREATEVERF);
-                   if (in_ifaddr.tqh_first)
-                       *tl++ = in_ifaddr.tqh_first->ia_addr.sin_addr.s_addr;
-                   else
-                       *tl++ = create_verf;
-                   *tl = ++create_verf;
+                       *tl = txdr_unsigned(NFSV3CREATE_EXCLUSIVE);
+                       nfsm_build(tl, u_int32_t *, NFSX_V3CREATEVERF);
+                       if (in_ifaddr.tqh_first)
+                               *tl++ = in_ifaddr.tqh_first->ia_addr.sin_addr.s_addr;
+                       else
+                               *tl++ = create_verf;
+                       *tl = ++create_verf;
                } else {
-                   *tl = txdr_unsigned(NFSV3CREATE_UNCHECKED);
-                   nfsm_build(tl, u_int32_t *, NFSX_V3SRVSATTR);
-                   sp3 = (struct nfsv3_sattr *)tl;
-                   nfsm_v3sattr(sp3, vap);
+                       *tl = txdr_unsigned(NFSV3CREATE_UNCHECKED);
+                       nfsm_v3attrbuild(vap, FALSE);
                }
        } else {
                nfsm_build(sp, struct nfsv2_sattr *, NFSX_V2SATTR);
@@ -1741,7 +1679,6 @@
        register struct vattr *vap = ap->a_vap;
        register struct componentname *cnp = ap->a_cnp;
        register struct nfsv2_sattr *sp;
-       register struct nfsv3_sattr *sp3;
        register u_int32_t *tl;
        register caddr_t cp;
        register int32_t t1, t2;
@@ -1757,10 +1694,8 @@
            nfsm_rndup(cnp->cn_namelen) + nfsm_rndup(slen) + NFSX_SATTR(v3));
        nfsm_fhtom(dvp, v3);
        nfsm_strtom(cnp->cn_nameptr, cnp->cn_namelen, NFS_MAXNAMLEN);
-       if (v3) {
-               nfsm_build(sp3, struct nfsv3_sattr *, NFSX_V3SRVSATTR);
-               nfsm_v3sattr(sp3, vap);
-       }
+       if (v3)
+               nfsm_v3attrbuild(vap, FALSE);
        nfsm_strtom(ap->a_target, slen, NFS_MAXPATHLEN);
        if (!v3) {
                nfsm_build(sp, struct nfsv2_sattr *, NFSX_V2SATTR);
@@ -1810,7 +1745,6 @@
        register struct vattr *vap = ap->a_vap;
        register struct componentname *cnp = ap->a_cnp;
        register struct nfsv2_sattr *sp;
-       register struct nfsv3_sattr *sp3;
        register u_int32_t *tl;
        register caddr_t cp;
        register int32_t t1, t2;
@@ -1830,8 +1764,7 @@
        nfsm_fhtom(dvp, v3);
        nfsm_strtom(cnp->cn_nameptr, len, NFS_MAXNAMLEN);
        if (v3) {
-               nfsm_build(sp3, struct nfsv3_sattr *, NFSX_V3SRVSATTR);
-               nfsm_v3sattr(sp3, vap);
+               nfsm_v3attrbuild(vap, FALSE);
        } else {
                nfsm_build(sp, struct nfsv2_sattr *, NFSX_V2SATTR);
                sp->sa_mode = vtonfsv2_mode(VDIR, vap->va_mode);



Home | Main Index | Thread Index | Old Index