Source-Changes-HG archive

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

[src/netbsd-1-4]: src/sys/compat/osf1 pull up rev(s) 1.9-1.14 from trunk. (cgd)



details:   https://anonhg.NetBSD.org/src/rev/9f093ca77c1c
branches:  netbsd-1-4
changeset: 468858:9f093ca77c1c
user:      cgd <cgd%NetBSD.org@localhost>
date:      Mon Jun 21 19:27:09 1999 +0000

description:
pull up rev(s) 1.9-1.14 from trunk. (cgd)

diffstat:

 sys/compat/osf1/osf1_mount.c |  403 ++++++++++++++----------------------------
 1 files changed, 132 insertions(+), 271 deletions(-)

diffs (truncated from 507 to 300 lines):

diff -r 4947ac7d56e2 -r 9f093ca77c1c sys/compat/osf1/osf1_mount.c
--- a/sys/compat/osf1/osf1_mount.c      Mon Jun 21 19:26:58 1999 +0000
+++ b/sys/compat/osf1/osf1_mount.c      Mon Jun 21 19:27:09 1999 +0000
@@ -1,4 +1,34 @@
-/*     $NetBSD: osf1_mount.c,v 1.8 1998/08/09 20:37:54 perry Exp $     */
+/*     $NetBSD: osf1_mount.c,v 1.8.6.1 1999/06/21 19:27:09 cgd Exp $   */
+
+/*
+ * Copyright (c) 1999 Christopher G. Demetriou.  All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ * 3. All advertising materials mentioning features or use of this software
+ *    must display the following acknowledgement:
+ *      This product includes software developed by Christopher G. Demetriou
+ *     for the NetBSD Project.
+ * 4. The name of the author may not be used to endorse or promote products
+ *    derived from this software without specific prior written permission
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
 
 /*
  * Copyright (c) 1994, 1995 Carnegie-Mellon University.
@@ -39,8 +69,10 @@
 #include <sys/vnode.h>
 #include <sys/syscallargs.h>
 
+#include <compat/osf1/osf1.h>
 #include <compat/osf1/osf1_syscallargs.h>
 #include <compat/osf1/osf1_util.h>
+#include <compat/osf1/osf1_cvt.h>
 
 #include <net/if.h>
 #include <netinet/in.h>
@@ -55,23 +87,6 @@
 
 #include <machine/vmparam.h>
 
-/* File system type numbers. */
-#define        OSF1_MOUNT_NONE         0
-#define        OSF1_MOUNT_UFS          1
-#define        OSF1_MOUNT_NFS          2
-#define        OSF1_MOUNT_MFS          3
-#define        OSF1_MOUNT_PC           4
-#define        OSF1_MOUNT_S5FS         5
-#define        OSF1_MOUNT_CDFS         6
-#define        OSF1_MOUNT_DFS          7
-#define        OSF1_MOUNT_EFS          8
-#define        OSF1_MOUNT_PROCFS       9
-#define        OSF1_MOUNT_MSFS         10
-#define        OSF1_MOUNT_FFM          11
-#define        OSF1_MOUNT_FDFS         12
-#define        OSF1_MOUNT_ADDON        13
-#define        OSF1_MOUNT_MAXTYPE      OSF1_MOUNT_ADDON
-
 #define        OSF1_MNT_WAIT           0x1
 #define        OSF1_MNT_NOWAIT         0x2
 
@@ -83,157 +98,11 @@
 #define        OSF1_MOUNT_FLAGS        0xffffffff                      /* XXX */
 #define        OSF1_UNMOUNT_FLAGS      (OSF1_MNT_FORCE|OSF1_MNT_NOFORCE)
 
-struct osf1_statfs {
-       int16_t f_type;                         /*   0 */
-       int16_t f_flags;                        /*   2 */
-       int32_t f_fsize;                        /*   4 */
-       int32_t f_bsize;                        /*   8 */
-       int32_t f_blocks;                       /*  12 */
-       int32_t f_bfree;                        /*  16 */
-       int32_t f_bavail;                       /*  20 */
-       int32_t f_files;                        /*  24 */
-       int32_t f_ffree;                        /*  28 */
-       int64_t f_fsid;                         /*  32 */
-       int32_t f_spare[9];                     /*  40 (36 bytes) */
-       char    f_mntonname[90];                /*  76 (90 bytes) */
-       char    f_mntfromname[90];              /* 166 (90 bytes) */
-       char    f_xxx[80];                      /* 256 (80 bytes) XXX */
-};
 
-/* Arguments to mount() for various FS types. */
-#ifdef notyet /* XXX */
-struct osf1_ufs_args {
-       char            *fspec;
-       int32_t         exflags;
-       u_int32_t       exroot;
-};
-
-struct osf1_cdfs_args {
-       char            *fspec;
-       int32_t         exflags;
-       u_int32_t       exroot;
-       int32_t         flags;
-};
-#endif
-
-struct osf1_mfs_args {
-       char            *name;
-       caddr_t         base;
-       u_int           size;
-};
-
-struct osf1_nfs_args {
-       struct sockaddr_in      *addr;
-       void                    *fh;
-       int32_t                 flags;
-       int32_t                 wsize;
-       int32_t                 rsize;
-       int32_t                 timeo;
-       int32_t                 retrans;
-       char                    *hostname;
-       int32_t                 acregmin;
-       int32_t                 acregmax;
-       int32_t                 acdirmin;
-       int32_t                 acdirmax;
-       char                    *netname;
-       void                    *pathconf;
-};
-
-#define        OSF1_NFSMNT_SOFT        0x00001
-#define        OSF1_NFSMNT_WSIZE       0x00002
-#define        OSF1_NFSMNT_RSIZE       0x00004
-#define        OSF1_NFSMNT_TIMEO       0x00008
-#define        OSF1_NFSMNT_RETRANS     0x00010
-#define        OSF1_NFSMNT_HOSTNAME    0x00020
-#define        OSF1_NFSMNT_INT         0x00040
-#define        OSF1_NFSMNT_NOCONN      0x00080
-#define        OSF1_NFSMNT_NOAC        0x00100                 /* ??? */
-#define        OSF1_NFSMNT_ACREGMIN    0x00200                 /* ??? */
-#define        OSF1_NFSMNT_ACREGMAX    0x00400                 /* ??? */
-#define        OSF1_NFSMNT_ACDIRMIN    0x00800                 /* ??? */
-#define        OSF1_NFSMNT_ACDIRMAX    0x01000                 /* ??? */
-#define        OSF1_NFSMNT_NOCTO       0x02000                 /* ??? */
-#define        OSF1_NFSMNT_POSIX       0x04000                 /* ??? */
-#define        OSF1_NFSMNT_AUTO        0x08000                 /* ??? */
-
-#define OSF1_NFSMNT_FLAGS                                              \
-       (OSF1_NFSMNT_SOFT|OSF1_NFSMNT_WSIZE|OSF1_NFSMNT_RSIZE|          \
-       OSF1_NFSMNT_TIMEO|OSF1_NFSMNT_RETRANS|OSF1_NFSMNT_HOSTNAME|     \
-       OSF1_NFSMNT_INT|OSF1_NFSMNT_NOCONN)
-
-
-void bsd2osf_statfs __P((struct statfs *, struct osf1_statfs *));
-int osf1_mount_mfs __P((struct proc *, struct osf1_sys_mount_args *,
-                       struct sys_mount_args *));
-int osf1_mount_nfs __P((struct proc *, struct osf1_sys_mount_args *,
-                       struct sys_mount_args *));
-
-
-
-void
-bsd2osf_statfs(bsfs, osfs)
-       struct statfs *bsfs;
-       struct osf1_statfs *osfs;
-{
-
-       memset(osfs, 0, sizeof (struct osf1_statfs));
-       if (!strncmp(MOUNT_FFS, bsfs->f_fstypename, MFSNAMELEN))
-               osfs->f_type = OSF1_MOUNT_UFS;
-       else if (!strncmp(MOUNT_NFS, bsfs->f_fstypename, MFSNAMELEN))
-               osfs->f_type = OSF1_MOUNT_NFS;
-       else if (!strncmp(MOUNT_MFS, bsfs->f_fstypename, MFSNAMELEN))
-               osfs->f_type = OSF1_MOUNT_MFS;
-       else
-               /* uh oh...  XXX = PC, CDFS, PROCFS, etc. */
-               osfs->f_type = OSF1_MOUNT_ADDON;
-       osfs->f_flags = bsfs->f_flags;          /* XXX translate */
-       osfs->f_fsize = bsfs->f_bsize;
-       osfs->f_bsize = bsfs->f_iosize;
-       osfs->f_blocks = bsfs->f_blocks;
-       osfs->f_bfree = bsfs->f_bfree;
-       osfs->f_bavail = bsfs->f_bavail;
-       osfs->f_files = bsfs->f_files;
-       osfs->f_ffree = bsfs->f_ffree;
-       memcpy(&osfs->f_fsid, &bsfs->f_fsid,
-           max(sizeof bsfs->f_fsid, sizeof osfs->f_fsid));
-       /* osfs->f_spare zeroed above */
-       memcpy(osfs->f_mntonname, bsfs->f_mntonname,
-           max(sizeof bsfs->f_mntonname, sizeof osfs->f_mntonname));
-       memcpy(osfs->f_mntfromname, bsfs->f_mntfromname,
-           max(sizeof bsfs->f_mntfromname, sizeof osfs->f_mntfromname));
-       /* XXX osfs->f_xxx should be filled in... */
-}
-
-int
-osf1_sys_statfs(p, v, retval)
-       struct proc *p;
-       void *v;
-       register_t *retval;
-{
-       struct osf1_sys_statfs_args /* {
-               syscallarg(char *) path;
-               syscallarg(struct osf1_statfs *) buf;
-               syscallarg(int) len;
-       } */ *uap = v;
-       struct mount *mp;
-       struct statfs *sp;
-       struct osf1_statfs osfs;
-       int error;
-       struct nameidata nd;
-
-       NDINIT(&nd, LOOKUP, FOLLOW, UIO_USERSPACE, SCARG(uap, path), p);
-       if ((error = namei(&nd)))
-               return (error);
-       mp = nd.ni_vp->v_mount;
-       sp = &mp->mnt_stat;
-       vrele(nd.ni_vp);
-       if ((error = VFS_STATFS(mp, sp, p)))
-               return (error);
-       sp->f_flags = mp->mnt_flag & MNT_VISFLAGMASK;
-       bsd2osf_statfs(sp, &osfs);
-       return copyout(&osfs, SCARG(uap, buf), min(sizeof osfs,
-           SCARG(uap, len)));
-}
+static int     osf1_mount_mfs __P((struct proc *,
+                   struct osf1_sys_mount_args *, struct sys_mount_args *));
+static int     osf1_mount_nfs __P((struct proc *,
+                   struct osf1_sys_mount_args *, struct sys_mount_args *));
 
 int
 osf1_sys_fstatfs(p, v, retval)
@@ -241,11 +110,7 @@
        void *v;
        register_t *retval;
 {
-       struct osf1_sys_fstatfs_args /* {
-               syscallarg(int) fd;
-               syscallarg(struct osf1_statfs *) buf;   
-               syscallarg(int) len;
-       } */ *uap = v;
+       struct osf1_sys_fstatfs_args *uap = v;
        struct file *fp;
        struct mount *mp;
        struct statfs *sp;
@@ -259,7 +124,7 @@
        if ((error = VFS_STATFS(mp, sp, p)))
                return (error);
        sp->f_flags = mp->mnt_flag & MNT_VISFLAGMASK;
-       bsd2osf_statfs(sp, &osfs);
+       osf1_cvt_statfs_from_native(sp, &osfs);
        return copyout(&osfs, SCARG(uap, buf), min(sizeof osfs,
            SCARG(uap, len)));
 }
@@ -270,11 +135,7 @@
        void *v;
        register_t *retval;
 {
-       register struct osf1_sys_getfsstat_args /* {
-               syscallarg(struct osf1_statfs *) buf;
-               syscallarg(long) bufsize;
-               syscallarg(int) flags;
-       } */ *uap = v;
+       struct osf1_sys_getfsstat_args *uap = v;
        struct mount *mp, *nmp;
        struct statfs *sp;
        struct osf1_statfs osfs;
@@ -301,7 +162,7 @@
                            (error = VFS_STATFS(mp, sp, p)))
                                continue;
                        sp->f_flags = mp->mnt_flag & MNT_VISFLAGMASK;
-                       bsd2osf_statfs(sp, &osfs);
+                       osf1_cvt_statfs_from_native(sp, &osfs);
                        if ((error = copyout(&osfs, osf_sfsp,
                            sizeof (struct osf1_statfs))))
                                return (error);
@@ -317,15 +178,73 @@
 }
 
 int
+osf1_sys_mount(p, v, retval)
+       struct proc *p;
+       void *v;
+       register_t *retval;
+{
+       struct osf1_sys_mount_args *uap = v;
+       struct sys_mount_args a;
+       int error;
+
+       SCARG(&a, path) = SCARG(uap, path);
+
+       if (SCARG(uap, flags) & ~OSF1_MOUNT_FLAGS)
+               return (EINVAL);
+       SCARG(&a, flags) = SCARG(uap, flags);           /* XXX - xlate */
+
+       switch (SCARG(uap, type)) {



Home | Main Index | Thread Index | Old Index