summaryrefslogtreecommitdiff
path: root/sys/ufs/ext2fs/ext2fs_vfsops.c
diff options
context:
space:
mode:
authorTodd C. Miller <millert@cvs.openbsd.org>1999-05-31 17:34:56 +0000
committerTodd C. Miller <millert@cvs.openbsd.org>1999-05-31 17:34:56 +0000
commitbc8362e4ef1c185f7c1d9aec69d91f269c97d4e2 (patch)
tree9194d1773b772347d76766611948ee38e1002058 /sys/ufs/ext2fs/ext2fs_vfsops.c
parent7a1b6dcd69cb5defd76dca41d6f8252a3140fb91 (diff)
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.
Diffstat (limited to 'sys/ufs/ext2fs/ext2fs_vfsops.c')
-rw-r--r--sys/ufs/ext2fs/ext2fs_vfsops.c11
1 files changed, 4 insertions, 7 deletions
diff --git a/sys/ufs/ext2fs/ext2fs_vfsops.c b/sys/ufs/ext2fs/ext2fs_vfsops.c
index da9a7612165..0f3c9ec8484 100644
--- a/sys/ufs/ext2fs/ext2fs_vfsops.c
+++ b/sys/ufs/ext2fs/ext2fs_vfsops.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ext2fs_vfsops.c,v 1.9 1998/02/08 22:41:48 tholo Exp $ */
+/* $OpenBSD: ext2fs_vfsops.c,v 1.10 1999/05/31 17:34:53 millert Exp $ */
/* $NetBSD: ext2fs_vfsops.c,v 1.1 1997/06/11 09:34:07 bouyer Exp $ */
/*
@@ -307,6 +307,7 @@ ext2fs_mount(mp, path, data, ndp, p)
ump = VFSTOUFS(mp);
fs = ump->um_e2fs;
(void) copyinstr(path, fs->e2fs_fsmnt, sizeof(fs->e2fs_fsmnt) - 1, &size);
+ bcopy(&args, &mp->mnt_stat.mount_info.ufs_args, sizeof(args));
bzero(fs->e2fs_fsmnt + size, sizeof(fs->e2fs_fsmnt) - size);
bcopy(fs->e2fs_fsmnt, mp->mnt_stat.f_mntonname, MNAMELEN);
(void) copyinstr(args.fspec, mp->mnt_stat.f_mntfromname, MNAMELEN - 1,
@@ -704,11 +705,6 @@ ext2fs_statfs(mp, sbp, p)
fs = ump->um_e2fs;
if (fs->e2fs.e2fs_magic != E2FS_MAGIC)
panic("ext2fs_statfs");
-#ifdef COMPAT_09
- sbp->f_type = 1;
-#else
- sbp->f_type = 0;
-#endif
/*
* Compute the overhead (FS structures)
@@ -730,9 +726,10 @@ ext2fs_statfs(mp, sbp, p)
sbp->f_files = fs->e2fs.e2fs_icount;
sbp->f_ffree = fs->e2fs.e2fs_ficount;
if (sbp != &mp->mnt_stat) {
- sbp->f_type = mp->mnt_vfc->vfc_typenum;
bcopy(mp->mnt_stat.f_mntonname, sbp->f_mntonname, MNAMELEN);
bcopy(mp->mnt_stat.f_mntfromname, sbp->f_mntfromname, MNAMELEN);
+ bcopy(&mp->mnt_stat.mount_info.ufs_args,
+ &sbp->mount_info.ufs_args, sizeof(struct ufs_args));
}
strncpy(sbp->f_fstypename, mp->mnt_vfc->vfc_name, MFSNAMELEN);
return (0);