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.19->1.20 (fvdl): fix file creation wit...



details:   https://anonhg.NetBSD.org/src/rev/c6cf10f8c077
branches:  netbsd-1-4
changeset: 468893:c6cf10f8c077
user:      perry <perry%NetBSD.org@localhost>
date:      Tue Jun 22 17:09:27 1999 +0000

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

diffstat:

 sys/nfs/nfsm_subs.h |  73 +++++++++++++++++++++++++++++++++++++++++++++-------
 1 files changed, 62 insertions(+), 11 deletions(-)

diffs (88 lines):

diff -r 9978428bd75a -r c6cf10f8c077 sys/nfs/nfsm_subs.h
--- a/sys/nfs/nfsm_subs.h       Tue Jun 22 17:07:29 1999 +0000
+++ b/sys/nfs/nfsm_subs.h       Tue Jun 22 17:09:27 1999 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: nfsm_subs.h,v 1.19 1999/03/06 05:34:41 fair Exp $      */
+/*     $NetBSD: nfsm_subs.h,v 1.19.2.1 1999/06/22 17:09:27 perry Exp $ */
 
 /*
  * Copyright (c) 1989, 1993
@@ -229,17 +229,68 @@
                        (f) = ttattrf; \
                } }
 
-#define nfsm_v3sattr(s, a) \
-               { (s)->sa_modetrue = nfs_true; \
-               (s)->sa_mode = vtonfsv3_mode((a)->va_mode); \
-               (s)->sa_uidfalse = nfs_false; \
-               (s)->sa_gidfalse = nfs_false; \
-               (s)->sa_sizefalse = nfs_false; \
-               (s)->sa_atimetype = txdr_unsigned(NFSV3SATTRTIME_TOCLIENT); \
-               txdr_nfsv3time(&(a)->va_atime, &(s)->sa_atime); \
-               (s)->sa_mtimetype = txdr_unsigned(NFSV3SATTRTIME_TOCLIENT); \
-               txdr_nfsv3time(&(a)->va_mtime, &(s)->sa_mtime); \
+/* If full is true, set all fields, otherwise just set mode and time fields */
+#define nfsm_v3attrbuild(a, full)                                              \
+               { if ((a)->va_mode != (mode_t)VNOVAL) {                         \
+                       nfsm_build(tl, u_int32_t *, 2 * NFSX_UNSIGNED);         \
+                       *tl++ = nfs_true;                                       \
+                       *tl = txdr_unsigned((a)->va_mode);                      \
+               } else {                                                        \
+                       nfsm_build(tl, u_int32_t *, NFSX_UNSIGNED);             \
+                       *tl = nfs_false;                                        \
+               }                                                               \
+               if ((full) && (a)->va_uid != (uid_t)VNOVAL) {                   \
+                       nfsm_build(tl, u_int32_t *, 2 * NFSX_UNSIGNED);         \
+                       *tl++ = nfs_true;                                       \
+                       *tl = txdr_unsigned((a)->va_uid);                       \
+               } else {                                                        \
+                       nfsm_build(tl, u_int32_t *, NFSX_UNSIGNED);             \
+                       *tl = nfs_false;                                        \
+               }                                                               \
+               if ((full) && (a)->va_gid != (gid_t)VNOVAL) {                   \
+                       nfsm_build(tl, u_int32_t *, 2 * NFSX_UNSIGNED);         \
+                       *tl++ = nfs_true;                                       \
+                       *tl = txdr_unsigned((a)->va_gid);                       \
+               } else {                                                        \
+                       nfsm_build(tl, u_int32_t *, NFSX_UNSIGNED);             \
+                       *tl = nfs_false;                                        \
+               }                                                               \
+               if ((full) && (a)->va_size != VNOVAL) {                         \
+                       nfsm_build(tl, u_int32_t *, 3 * NFSX_UNSIGNED);         \
+                       *tl++ = nfs_true;                                       \
+                       txdr_hyper((a)->va_size, tl);                           \
+               } else {                                                        \
+                       nfsm_build(tl, u_int32_t *, NFSX_UNSIGNED);             \
+                       *tl = nfs_false;                                        \
+               }                                                               \
+               if ((a)->va_atime.tv_sec != VNOVAL) {                           \
+                       if ((a)->va_atime.tv_sec != time.tv_sec) {              \
+                               nfsm_build(tl, u_int32_t *, 3 * NFSX_UNSIGNED); \
+                               *tl++ = txdr_unsigned(NFSV3SATTRTIME_TOCLIENT); \
+                               txdr_nfsv3time(&(a)->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 ((a)->va_mtime.tv_sec != VNOVAL) {                           \
+                       if ((a)->va_mtime.tv_sec != time.tv_sec) {              \
+                               nfsm_build(tl, u_int32_t *, 3 * NFSX_UNSIGNED); \
+                               *tl++ = txdr_unsigned(NFSV3SATTRTIME_TOCLIENT); \
+                               txdr_nfsv3time(&(a)->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);         \
+               }                                                               \
                }
+                               
 
 #define        nfsm_strsiz(s,m) \
                { nfsm_dissect(tl,u_int32_t *,NFSX_UNSIGNED); \



Home | Main Index | Thread Index | Old Index