Source-Changes-HG archive

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

[src/pgoyette-compat]: src/sys Add fs/puffs compat_50 to the modules



details:   https://anonhg.NetBSD.org/src/rev/fc741306c2bb
branches:  pgoyette-compat
changeset: 321090:fc741306c2bb
user:      pgoyette <pgoyette%NetBSD.org@localhost>
date:      Sat Mar 24 08:24:40 2018 +0000

description:
Add fs/puffs compat_50 to the modules

diffstat:

 sys/compat/common/Makefile.sysio |   5 ++++-
 sys/fs/puffs/files.puffs         |   4 ++--
 sys/fs/puffs/puffs_compat.c      |  31 ++++++++++++++++++++-----------
 sys/fs/puffs/puffs_msgif.c       |   7 ++++---
 sys/fs/puffs/puffs_sys.h         |  11 +++++++++--
 sys/kern/compat_stub.c           |  10 +++++++++-
 sys/modules/compat_50/Makefile   |   6 +++++-
 sys/sys/compat_stub.h            |  12 +++++++++++-
 8 files changed, 64 insertions(+), 22 deletions(-)

diffs (248 lines):

diff -r cc01f8c17ca5 -r fc741306c2bb sys/compat/common/Makefile.sysio
--- a/sys/compat/common/Makefile.sysio  Sat Mar 24 08:23:20 2018 +0000
+++ b/sys/compat/common/Makefile.sysio  Sat Mar 24 08:24:40 2018 +0000
@@ -1,4 +1,4 @@
-#      $NetBSD: Makefile.sysio,v 1.7.18.10 2018/03/24 01:59:15 pgoyette Exp $
+#      $NetBSD: Makefile.sysio,v 1.7.18.11 2018/03/24 08:24:40 pgoyette Exp $
 
 # Sources for syscall and ioctl compatibility across the versions.
 
@@ -53,3 +53,6 @@
 SRCS+= rf_compat50.c
 SRCS+= rf_compat80.c
 
+# Puffs compatability code for NetBSD 5.0
+.PATH: ${S}/fs/puffs
+SRCS+= puffs_compat.c
diff -r cc01f8c17ca5 -r fc741306c2bb sys/fs/puffs/files.puffs
--- a/sys/fs/puffs/files.puffs  Sat Mar 24 08:23:20 2018 +0000
+++ b/sys/fs/puffs/files.puffs  Sat Mar 24 08:24:40 2018 +0000
@@ -1,9 +1,9 @@
-#      $NetBSD: files.puffs,v 1.6 2014/10/11 06:42:19 uebayasi Exp $
+#      $NetBSD: files.puffs,v 1.6.18.1 2018/03/24 08:24:40 pgoyette Exp $
 
 deffs  PUFFS
 
 define puffs: vfs
-file   fs/puffs/puffs_compat.c         puffs
+file   fs/puffs/puffs_compat.c         puffs & compat_50
 file   fs/puffs/puffs_msgif.c          puffs
 file   fs/puffs/puffs_node.c           puffs
 file   fs/puffs/puffs_subr.c           puffs
diff -r cc01f8c17ca5 -r fc741306c2bb sys/fs/puffs/puffs_compat.c
--- a/sys/fs/puffs/puffs_compat.c       Sat Mar 24 08:23:20 2018 +0000
+++ b/sys/fs/puffs/puffs_compat.c       Sat Mar 24 08:24:40 2018 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: puffs_compat.c,v 1.4 2015/04/22 17:07:24 pooka Exp $   */
+/*     $NetBSD: puffs_compat.c,v 1.4.16.1 2018/03/24 08:24:40 pgoyette Exp $   */
 
 /*
  * Copyright (c) 2010 Antti Kantee.  All Rights Reserved.
@@ -32,7 +32,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: puffs_compat.c,v 1.4 2015/04/22 17:07:24 pooka Exp $");
+__KERNEL_RCSID(0, "$NetBSD: puffs_compat.c,v 1.4.16.1 2018/03/24 08:24:40 pgoyette Exp $");
 
 #include <sys/param.h>
 #include <sys/atomic.h>
@@ -44,6 +44,7 @@
 #include <sys/proc.h>
 #include <sys/vnode.h>
 #include <sys/atomic.h>
+#include <sys/compat_stub.h>
 
 #include <dev/putter/putter_sys.h>
 
@@ -157,7 +158,6 @@
  * vattr translation routines
  */
 
-#ifdef COMPAT_50
 static void
 vattr_to_50(const struct vattr *va, struct vattr50 *va50)
 {
@@ -207,7 +207,6 @@
        va->va_filerev = va50->va_filerev;
        va->va_vaflags = va50->va_flags;
 }
-#endif /* COMPAT_50 */
 
 /*
  * XXX: cannot assert that sleeping is possible
@@ -223,12 +222,11 @@
 #define ASSIGN(field)                                                  \
        cmsg->field = omsg->field;
 
-bool
+int
 puffs_compat_outgoing(struct puffs_req *oreq,
        struct puffs_req **creqp, ssize_t *deltap)
 {
-       bool rv = false;
-#ifdef COMPAT_50
+       int rv = ENOSYS;        /* non-zero return ==> false */
        struct puffs_req *creq = NULL;
        ssize_t delta = 0;
 
@@ -331,9 +329,8 @@
        if (creq) {
                *creqp = creq;
                *deltap = delta;
-               rv = true;
+               rv = 0;
        }
-#endif
 
        return rv;
 }
@@ -350,7 +347,6 @@
 puffs_compat_incoming(struct puffs_req *preq, struct puffs_req *creq)
 {
 
-#ifdef COMPAT_50
        if (PUFFSOP_OPCLASS(preq->preq_opclass) == PUFFSOP_VFS
            && preq->preq_optype == PUFFS_VFS_FHTOVP) {
                INIT(vfsmsg_fhtonode);
@@ -438,5 +434,18 @@
                        panic("puffs compat ops come in pairs");
                }
        }
-#endif /* COMPAT_50 */
+}
+
+void puffs_50_init(void)
+{
+
+       puffs50_compat_outgoing = puffs_compat_outgoing;
+       puffs50_compat_incoming = puffs_compat_incoming;
 }
+
+void puffs_50_fini(void)
+{
+
+       puffs50_compat_outgoing = (void *)enosys;
+       puffs50_compat_incoming = (void *)voidop;
+}
diff -r cc01f8c17ca5 -r fc741306c2bb sys/fs/puffs/puffs_msgif.c
--- a/sys/fs/puffs/puffs_msgif.c        Sat Mar 24 08:23:20 2018 +0000
+++ b/sys/fs/puffs/puffs_msgif.c        Sat Mar 24 08:24:40 2018 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: puffs_msgif.c,v 1.101 2017/04/17 08:31:01 hannken Exp $        */
+/*     $NetBSD: puffs_msgif.c,v 1.101.10.1 2018/03/24 08:24:40 pgoyette Exp $  */
 
 /*
  * Copyright (c) 2005, 2006, 2007  Antti Kantee.  All Rights Reserved.
@@ -30,7 +30,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: puffs_msgif.c,v 1.101 2017/04/17 08:31:01 hannken Exp $");
+__KERNEL_RCSID(0, "$NetBSD: puffs_msgif.c,v 1.101.10.1 2018/03/24 08:24:40 pgoyette Exp $");
 
 #include <sys/param.h>
 #include <sys/kernel.h>
@@ -348,7 +348,8 @@
 
 #if 1
        /* check if we do compat adjustments */
-       if (pmp->pmp_docompat && puffs_compat_outgoing(preq, &creq, &delta)) {
+       if (pmp->pmp_docompat &&
+           puffs_compat_outgoing(preq, &creq, &delta) == 0) {
                park->park_creq = park->park_preq;
                park->park_creqlen = park->park_maxlen;
 
diff -r cc01f8c17ca5 -r fc741306c2bb sys/fs/puffs/puffs_sys.h
--- a/sys/fs/puffs/puffs_sys.h  Sat Mar 24 08:23:20 2018 +0000
+++ b/sys/fs/puffs/puffs_sys.h  Sat Mar 24 08:24:40 2018 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: puffs_sys.h,v 1.90 2016/07/07 06:55:42 msaitoh Exp $   */
+/*     $NetBSD: puffs_sys.h,v 1.90.16.1 2018/03/24 08:24:40 pgoyette Exp $     */
 
 /*
  * Copyright (c) 2005, 2006  Antti Kantee.  All Rights Reserved.
@@ -290,7 +290,7 @@
 void   puffs_senderr(struct puffs_mount *, int, int, const char *,
                      puffs_cookie_t);
 
-bool   puffs_compat_outgoing(struct puffs_req *, struct puffs_req**, ssize_t*);
+int    puffs_compat_outgoing(struct puffs_req *, struct puffs_req**, ssize_t*);
 void   puffs_compat_incoming(struct puffs_req *, struct puffs_req *);
 
 void   puffs_updatenode(struct puffs_node *, int, voff_t);
@@ -359,4 +359,11 @@
        var = puffs_msg_wait2(pmp, park, vp1, vp2);                     \
 } while (/*CONSTCOND*/0)
 
+/*
+ * compat50 init/fini 
+ */
+
+void puffs_50_init(void);
+void puffs_50_fini(void);
+
 #endif /* _PUFFS_SYS_H_ */
diff -r cc01f8c17ca5 -r fc741306c2bb sys/kern/compat_stub.c
--- a/sys/kern/compat_stub.c    Sat Mar 24 08:23:20 2018 +0000
+++ b/sys/kern/compat_stub.c    Sat Mar 24 08:24:40 2018 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: compat_stub.c,v 1.1.2.5 2018/03/24 01:59:15 pgoyette Exp $ */
+/* $NetBSD: compat_stub.c,v 1.1.2.6 2018/03/24 08:24:40 pgoyette Exp $ */
 
 /*-
  * Copyright (c) 2018 The NetBSD Foundation, Inc.
@@ -79,3 +79,11 @@
     struct RF_Config_s **) = (void *)enosys;
 int (*raidframe80_ioctl)(int, int, struct RF_Raid_s *, int, void *,
     struct RF_Config_s **) = (void *)enosys;
+
+/*
+ * puffs compatability
+ */
+int (*puffs50_compat_outgoing)(struct puffs_req *, struct puffs_req **,
+    ssize_t *) = (void *)enosys;
+void (*puffs50_compat_incoming)(struct puffs_req *, struct puffs_req *) =
+    (void *)voidop;
diff -r cc01f8c17ca5 -r fc741306c2bb sys/modules/compat_50/Makefile
--- a/sys/modules/compat_50/Makefile    Sat Mar 24 08:23:20 2018 +0000
+++ b/sys/modules/compat_50/Makefile    Sat Mar 24 08:24:40 2018 +0000
@@ -1,4 +1,4 @@
-#      $NetBSD: Makefile,v 1.1.2.5 2018/03/24 01:59:16 pgoyette Exp $
+#      $NetBSD: Makefile,v 1.1.2.6 2018/03/24 08:24:40 pgoyette Exp $
 
 .include "../Makefile.inc"
 
@@ -22,4 +22,8 @@
 
 SRCS+= rf_compat50.c
 
+.PATH: ${S}/fs/puffs
+
+SRCS+= puffs_compat.c
+
 .include <bsd.kmodule.mk>
diff -r cc01f8c17ca5 -r fc741306c2bb sys/sys/compat_stub.h
--- a/sys/sys/compat_stub.h     Sat Mar 24 08:23:20 2018 +0000
+++ b/sys/sys/compat_stub.h     Sat Mar 24 08:24:40 2018 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: compat_stub.h,v 1.1.2.5 2018/03/24 01:59:16 pgoyette Exp $ */
+/* $NetBSD: compat_stub.h,v 1.1.2.6 2018/03/24 08:24:40 pgoyette Exp $ */
 
 /*-
  * Copyright (c) 2018 The NetBSD Foundation, Inc.
@@ -80,4 +80,14 @@
 extern int (*raidframe80_ioctl)(int, int, struct RF_Raid_s *, int, void *,
     struct RF_Config_s **);
 
+/*
+ * puffs compatability
+ */
+
+struct puffs_req;
+
+extern int (*puffs50_compat_outgoing)(struct puffs_req *, struct puffs_req **,
+    ssize_t *);
+extern void (*puffs50_compat_incoming)(struct puffs_req *, struct puffs_req *);
+
 #endif /* _SYS_COMPAT_STUB_H */



Home | Main Index | Thread Index | Old Index