Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/netbsd-6]: src/sys/compat/netbsd32 Pull up following revision(s) (reques...
details: https://anonhg.NetBSD.org/src/rev/6b1dc4787575
branches: netbsd-6
changeset: 775570:6b1dc4787575
user: riz <riz%NetBSD.org@localhost>
date: Thu Dec 13 23:47:57 2012 +0000
description:
Pull up following revision(s) (requested by bouyer in ticket #742):
sys/compat/netbsd32/netbsd32.h: revision 1.94
sys/compat/netbsd32/netbsd32_fs.c: revision 1.63
allow mounting ext2fs and msdosfs
while there also enable lfs but that's untested
diffstat:
sys/compat/netbsd32/netbsd32.h | 15 +++++++++++++-
sys/compat/netbsd32/netbsd32_fs.c | 42 ++++++++++++++++++++++++++++++++++++--
2 files changed, 53 insertions(+), 4 deletions(-)
diffs (119 lines):
diff -r e7e2a7c3a970 -r 6b1dc4787575 sys/compat/netbsd32/netbsd32.h
--- a/sys/compat/netbsd32/netbsd32.h Thu Dec 13 23:41:57 2012 +0000
+++ b/sys/compat/netbsd32/netbsd32.h Thu Dec 13 23:47:57 2012 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: netbsd32.h,v 1.92.2.1 2012/04/12 17:05:37 riz Exp $ */
+/* $NetBSD: netbsd32.h,v 1.92.2.2 2012/12/13 23:47:57 riz Exp $ */
/*
* Copyright (c) 1998, 2001, 2008 Matthew R. Green
@@ -938,6 +938,19 @@
int32_t deadthresh; /* Retrans threshold */
netbsd32_charp hostname; /* server's name */
};
+struct netbsd32_msdosfs_args {
+ netbsd32_charp fspec; /* blocks special holding the fs to mount */
+ struct netbsd32_export_args30 _pad1; /* compat with old userland tools */
+ uid_t uid; /* uid that owns msdosfs files */
+ gid_t gid; /* gid that owns msdosfs files */
+ mode_t mask; /* mask to be applied for msdosfs perms */
+ int flags; /* see below */
+
+ /* Following items added after versioning support */
+ int version; /* version of the struct */
+ mode_t dirmask; /* v2: mask to be applied for msdosfs perms */
+ int gmtoff; /* v3: offset from UTC in seconds */
+};
struct netbsd32_posix_spawn_file_actions_entry {
enum { FAE32_OPEN, FAE32_DUP2, FAE32_CLOSE } fae_action;
diff -r e7e2a7c3a970 -r 6b1dc4787575 sys/compat/netbsd32/netbsd32_fs.c
--- a/sys/compat/netbsd32/netbsd32_fs.c Thu Dec 13 23:41:57 2012 +0000
+++ b/sys/compat/netbsd32/netbsd32_fs.c Thu Dec 13 23:47:57 2012 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: netbsd32_fs.c,v 1.62 2012/01/25 14:06:07 christos Exp $ */
+/* $NetBSD: netbsd32_fs.c,v 1.62.2.1 2012/12/13 23:47:57 riz Exp $ */
/*
* Copyright (c) 1998, 2001 Matthew R. Green
@@ -27,7 +27,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: netbsd32_fs.c,v 1.62 2012/01/25 14:06:07 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: netbsd32_fs.c,v 1.62.2.1 2012/12/13 23:47:57 riz Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -50,6 +50,8 @@
#include <sys/vfs_syscalls.h>
#include <fs/cd9660/cd9660_mount.h>
+#include <fs/msdosfs/bpb.h>
+#include <fs/msdosfs/msdosfsmount.h>
#include <ufs/ufs/ufsmount.h>
#define NFS_ARGS_ONLY
@@ -774,12 +776,14 @@
struct netbsd32_mfs_args mfs_args;
struct netbsd32_iso_args iso_args;
struct netbsd32_nfs_args nfs_args;
+ struct netbsd32_msdosfs_args msdosfs_args;
} fs_args32;
union {
struct ufs_args ufs_args;
struct mfs_args mfs_args;
struct iso_args iso_args;
struct nfs_args nfs_args;
+ struct msdosfs_args msdosfs_args;
} fs_args;
const char *type = SCARG_P32(uap, type);
const char *path = SCARG_P32(uap, path);
@@ -812,7 +816,9 @@
data_seg = UIO_SYSSPACE;
data = &fs_args.mfs_args;
data_len = sizeof(fs_args.mfs_args);
- } else if (strcmp(mtype, MOUNT_UFS) == 0) {
+ } else if ((strcmp(mtype, MOUNT_UFS) == 0) ||
+ (strcmp(mtype, MOUNT_EXT2FS) == 0) ||
+ (strcmp(mtype, MOUNT_LFS) == 0)) {
if (data_len > sizeof(fs_args32.ufs_args))
return EINVAL;
if ((flags & MNT_GETARGS) == 0) {
@@ -843,6 +849,36 @@
data_seg = UIO_SYSSPACE;
data = &fs_args.iso_args;
data_len = sizeof(fs_args.iso_args);
+ } else if (strcmp(mtype, MOUNT_MSDOS) == 0) {
+ if (data_len != sizeof(fs_args32.msdosfs_args))
+ return EINVAL;
+ if ((flags & MNT_GETARGS) == 0) {
+ error = copyin(data, &fs_args32.msdosfs_args,
+ sizeof(fs_args32.msdosfs_args));
+ if (error)
+ return error;
+ fs_args.msdosfs_args.fspec =
+ NETBSD32PTR64(fs_args32.msdosfs_args.fspec);
+ memset(&fs_args.msdosfs_args._pad1, 0,
+ sizeof(fs_args.msdosfs_args._pad1));
+ fs_args.msdosfs_args.uid =
+ fs_args32.msdosfs_args.uid;
+ fs_args.msdosfs_args.gid =
+ fs_args32.msdosfs_args.gid;
+ fs_args.msdosfs_args.mask =
+ fs_args32.msdosfs_args.mask;
+ fs_args.msdosfs_args.flags =
+ fs_args32.msdosfs_args.flags;
+ fs_args.msdosfs_args.version =
+ fs_args32.msdosfs_args.version;
+ fs_args.msdosfs_args.dirmask =
+ fs_args32.msdosfs_args.dirmask;
+ fs_args.msdosfs_args.gmtoff =
+ fs_args32.msdosfs_args.gmtoff;
+ }
+ data_seg = UIO_SYSSPACE;
+ data = &fs_args.msdosfs_args;
+ data_len = sizeof(fs_args.msdosfs_args);
} else if (strcmp(mtype, MOUNT_NFS) == 0) {
if (data_len != sizeof(fs_args32.nfs_args))
return EINVAL;
Home |
Main Index |
Thread Index |
Old Index