From ef921adb8d7e32b181c8c0cee764ec21824f98e1 Mon Sep 17 00:00:00 2001 From: millert Date: Mon, 31 May 1999 17:34:39 +0000 Subject: New struct statfs with mount options. NOTE: this replaces statfs(2), fstatfs(2), and getfsstat(2) so you will need to build a new kernel before doing a "make build" or you will get "unimplemented syscall" errors. The new struct statfs has the following featuires: o Has a u_int32_t flags field--now softdep can have a real flag. o Uses u_int32_t instead of longs (nicer on the alpha). Note: the man page used to lie about setting invalid/unused fields to -1. SunOS does that but our code never has. o Gets rid of f_type completely. It hasn't been used since NetBSD 0.9 and having it there but always 0 is confusing. It is conceivable that this may cause some old code to not compile but that is better than silently breaking. o Adds a mount_info union that contains the FSTYPE_args struct. This means that "mount" can now tell you all the options a filesystem was mounted with. This is especially nice for NFS. Other changes: o The linux statfs emulation didn't convert between BSD fs names and linux f_type numbers. Now it does, since the BSD f_type number is useless to linux apps (and has been removed anyway) o FreeBSD's struct statfs is different from our (both old and new) and thus needs conversion. Previously, the OpenBSD syscalls were used without any real translation. o mount(8) will now show extra info when invoked with no arguments. However, to see *everything* you need to use the -v (verbose) flag. --- sys/compat/linux/linux_misc.c | 26 ++++++++++++++++++++++++-- 1 file changed, 24 insertions(+), 2 deletions(-) (limited to 'sys/compat/linux/linux_misc.c') diff --git a/sys/compat/linux/linux_misc.c b/sys/compat/linux/linux_misc.c index e6898adf982..3f0136ea255 100644 --- a/sys/compat/linux/linux_misc.c +++ b/sys/compat/linux/linux_misc.c @@ -1,4 +1,4 @@ -/* $OpenBSD: linux_misc.c,v 1.20 1999/02/10 08:01:52 deraadt Exp $ */ +/* $OpenBSD: linux_misc.c,v 1.21 1999/05/31 17:34:46 millert Exp $ */ /* $NetBSD: linux_misc.c,v 1.27 1996/05/20 01:59:21 fvdl Exp $ */ /* @@ -287,7 +287,29 @@ bsd_to_linux_statfs(bsp, lsp) struct linux_statfs *lsp; { - lsp->l_ftype = bsp->f_type; + /* + * Convert BSD filesystem names to Linux filesystem type numbers + * where possible. Linux statfs uses a value of -1 to indicate + * an unsupported field. + */ + if (!strcmp(bsp->f_fstypename, MOUNT_FFS) || + !strcmp(bsp->f_fstypename, MOUNT_MFS)) + lsp->l_ftype = 0x11954; + else if (!strcmp(bsp->f_fstypename, MOUNT_NFS)) + lsp->l_ftype = 0x6969; + else if (!strcmp(bsp->f_fstypename, MOUNT_MSDOS)) + lsp->l_ftype = 0x4d44; + else if (!strcmp(bsp->f_fstypename, MOUNT_PROCFS)) + lsp->l_ftype = 0x9fa0; + else if (!strcmp(bsp->f_fstypename, MOUNT_EXT2FS)) + lsp->l_ftype = 0xef53; + else if (!strcmp(bsp->f_fstypename, MOUNT_CD9660)) + lsp->l_ftype = 0x9660; + else if (!strcmp(bsp->f_fstypename, MOUNT_NCPFS)) + lsp->l_ftype = 0x6969; + else + lsp->l_ftype = -1; + lsp->l_fbsize = bsp->f_bsize; lsp->l_fblocks = bsp->f_blocks; lsp->l_fbfree = bsp->f_bfree; -- cgit v1.2.3-59-g8ed1b