MNT_GETARGS support

This commit is contained in:
christos 2002-09-21 18:10:34 +00:00
parent 10b6e12acc
commit 6f3945a88d
14 changed files with 137 additions and 23 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: coda_vfsops.c,v 1.18 2002/09/06 13:18:43 gehenna Exp $ */
/* $NetBSD: coda_vfsops.c,v 1.19 2002/09/21 18:10:34 christos Exp $ */
/*
*
@ -45,7 +45,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: coda_vfsops.c,v 1.18 2002/09/06 13:18:43 gehenna Exp $");
__KERNEL_RCSID(0, "$NetBSD: coda_vfsops.c,v 1.19 2002/09/21 18:10:34 christos Exp $");
#ifdef _LKM
#define NVCODA 4
@ -160,6 +160,8 @@ coda_mount(vfsp, path, data, ndp, p)
ViceFid ctlfid;
int error;
if (vfsp->mnt_flag & MNT_GETARGS)
return 0;
ENTRY;
coda_vfsopstats_init();

View File

@ -1,4 +1,4 @@
/* $NetBSD: filecore_mount.h,v 1.2 1998/08/14 18:04:05 mark Exp $ */
/* $NetBSD: filecore_mount.h,v 1.3 2002/09/21 18:11:13 christos Exp $ */
/*
* Copyright (c) 1998 Andrew McMurry
@ -53,3 +53,7 @@ struct filecore_args {
#define FILECOREMNT_OWNREAD 4 /* All files have Owner read access */
#define FILECOREMNT_USEUID 8 /* Use uid of mount process */
#define FILECOREMNT_FILETYPE 16 /* Include filetype in filename */
#define FILECOREMNT_BITS "\177\20" \
"b\00root\0b\01ownaccess\0b\02allaccess\0b\03ownread\0" \
"b\04useuid\0b\05filetype"

View File

@ -1,4 +1,4 @@
/* $NetBSD: filecore_vfsops.c,v 1.20 2002/09/06 13:18:43 gehenna Exp $ */
/* $NetBSD: filecore_vfsops.c,v 1.21 2002/09/21 18:11:13 christos Exp $ */
/*-
* Copyright (c) 1998 Andrew McMurry
@ -37,7 +37,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: filecore_vfsops.c,v 1.20 2002/09/06 13:18:43 gehenna Exp $");
__KERNEL_RCSID(0, "$NetBSD: filecore_vfsops.c,v 1.21 2002/09/21 18:11:13 christos Exp $");
#if defined(_KERNEL_OPT)
#include "opt_compat_netbsd.h"
@ -161,6 +161,17 @@ filecore_mount(mp, path, data, ndp, p)
int error;
struct filecore_mnt *fcmp = NULL;
if (mp->mnt_flag & MNT_GETARGS) {
fcmp = VFSTOFILECORE(mp);
if (fcmp == NULL)
return EIO;
args.flags = fcmp->fc_mntflags;
args.uid = fcmp->fc_uid;
args.gid = fcmp->fc_gid;
args.fspec = NULL;
args.export = fcmp->fc_export;
return copyout(&args, data, sizeof(args));
}
error = copyin(data, (caddr_t)&args, sizeof (struct filecore_args));
if (error)
return (error);

View File

@ -1,4 +1,4 @@
/* $NetBSD: smbfs_vfsops.c,v 1.3 2002/07/30 07:40:08 soren Exp $ */
/* $NetBSD: smbfs_vfsops.c,v 1.4 2002/09/21 18:11:56 christos Exp $ */
/*
* Copyright (c) 2000-2001, Boris Popov
@ -145,6 +145,12 @@ smbfs_mount(struct mount *mp, const char *path, void *data,
printf("missing data argument\n");
return EINVAL;
}
if (mp->mnt_flag & MNT_GETARGS) {
smp = VFSTOSMBFS(mp);
if (smp == NULL)
return EIO;
return copyout(&smp->sm_args, data, sizeof(smp->sm_args));
}
if (mp->mnt_flag & MNT_UPDATE) {
printf("MNT_UPDATE not implemented");
return EOPNOTSUPP;

View File

@ -1,4 +1,4 @@
/* $NetBSD: cd9660_mount.h,v 1.5 2000/07/15 21:40:44 jdolecek Exp $ */
/* $NetBSD: cd9660_mount.h,v 1.6 2002/09/21 18:12:43 christos Exp $ */
/*
* Copyright (c) 1995
* The Regents of the University of California. All rights reserved.
@ -53,3 +53,7 @@ struct iso_args {
#define ISOFSMNT_NOJOLIET 0x00000008 /* disable Joliet extensions */
#define ISOFSMNT_NOCASETRANS 0x00000010 /* do not make names lower case */
#define ISOFSMNT_RRCASEINS 0x00000020 /* case insensitive Rock Ridge */
#define ISOFSMNT_BITS "\177\20" \
"b\00norrip\0b\01gens\0b\02extatt\0b\03nojoliet\0" \
"b\04nocasetrans\0b\05rrcaseins"

View File

@ -1,4 +1,4 @@
/* $NetBSD: cd9660_vfsops.c,v 1.63 2002/09/06 13:18:43 gehenna Exp $ */
/* $NetBSD: cd9660_vfsops.c,v 1.64 2002/09/21 18:12:43 christos Exp $ */
/*-
* Copyright (c) 1994
@ -41,7 +41,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: cd9660_vfsops.c,v 1.63 2002/09/06 13:18:43 gehenna Exp $");
__KERNEL_RCSID(0, "$NetBSD: cd9660_vfsops.c,v 1.64 2002/09/21 18:12:43 christos Exp $");
#if defined(_KERNEL_OPT)
#include "opt_compat_netbsd.h"
@ -179,6 +179,15 @@ cd9660_mount(mp, path, data, ndp, p)
int error;
struct iso_mnt *imp = NULL;
if (mp->mnt_flag & MNT_GETARGS) {
imp = VFSTOISOFS(mp);
if (imp == NULL)
return EIO;
args.fspec = NULL;
args.flags = imp->im_flags;
vfs_showexport(mp, &args.export, &imp->im_export);
return copyout(&args, data, sizeof(args));
}
error = copyin(data, (caddr_t)&args, sizeof (struct iso_args));
if (error)
return (error);

View File

@ -1,4 +1,4 @@
/* $NetBSD: msdosfs_vfsops.c,v 1.83 2002/09/06 13:18:43 gehenna Exp $ */
/* $NetBSD: msdosfs_vfsops.c,v 1.84 2002/09/21 18:13:25 christos Exp $ */
/*-
* Copyright (C) 1994, 1995, 1997 Wolfgang Solfrank.
@ -48,7 +48,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: msdosfs_vfsops.c,v 1.83 2002/09/06 13:18:43 gehenna Exp $");
__KERNEL_RCSID(0, "$NetBSD: msdosfs_vfsops.c,v 1.84 2002/09/21 18:13:25 christos Exp $");
#if defined(_KERNEL_OPT)
#include "opt_quota.h"
@ -246,6 +246,18 @@ msdosfs_mount(mp, path, data, ndp, p)
int error, flags;
mode_t accessmode;
if (mp->mnt_flag & MNT_GETARGS) {
pmp = VFSTOMSDOSFS(mp);
if (pmp == NULL)
return EIO;
args.fspec = NULL;
args.uid = pmp->pm_uid;
args.gid = pmp->pm_gid;
args.mask = pmp->pm_mask;
args.flags = pmp->pm_flags;
vfs_showexport(mp, &args.export, &pmp->pm_export);
return copyout(&args, data, sizeof(args));
}
error = copyin(data, (caddr_t)&args, sizeof(struct msdosfs_args));
if (error)
return (error);

View File

@ -1,4 +1,4 @@
/* $NetBSD: msdosfsmount.h,v 1.22 2001/09/15 16:13:01 chs Exp $ */
/* $NetBSD: msdosfsmount.h,v 1.23 2002/09/21 18:13:26 christos Exp $ */
/*-
* Copyright (C) 1994, 1995, 1997 Wolfgang Solfrank.
@ -75,6 +75,10 @@ struct msdosfs_args {
#define MSDOSFSMNT_WAITONFAT 0x40000000 /* mounted synchronous */
#define MSDOSFS_FATMIRROR 0x20000000 /* FAT is mirrored */
#define MSDOSFSMNT_BITS "\177\20" \
"b\00shortname\0b\01longname\0b\02nowin95\0bgemdosfs\0" \
"b\037ronly\0b\036waitonfat\0b\035fatmirror"
#ifdef _KERNEL
/*
* Layout of the mount control block for a msdos file system.

View File

@ -1,4 +1,4 @@
/* $NetBSD: ntfs_vfsops.c,v 1.42 2002/09/06 13:18:43 gehenna Exp $ */
/* $NetBSD: ntfs_vfsops.c,v 1.43 2002/09/21 18:13:54 christos Exp $ */
/*-
* Copyright (c) 1998, 1999 Semen Ustimenko
@ -29,7 +29,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: ntfs_vfsops.c,v 1.42 2002/09/06 13:18:43 gehenna Exp $");
__KERNEL_RCSID(0, "$NetBSD: ntfs_vfsops.c,v 1.43 2002/09/21 18:13:54 christos Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@ -286,6 +286,18 @@ ntfs_mount (
}
#endif /* FreeBSD */
if (mp->mnt_flag & MNT_GETARGS) {
struct ntfsmount *ntmp = VFSTONTFS(mp);
if (ntmp == NULL)
return EIO;
args.fspec = NULL;
args.uid = ntmp->ntm_uid;
args.gid = ntmp->ntm_gid;
args.mode = ntmp->ntm_mode;
args.flag = ntmp->ntm_flag;
vfs_showexport(mp, &args.export, &ntmp->ntm_export);
return copyout(&args, data, sizeof(args));
}
/*
***
* Mounting non-root file system or updating a file system

View File

@ -1,4 +1,4 @@
/* $NetBSD: ntfsmount.h,v 1.3 1999/07/26 14:02:32 jdolecek Exp $ */
/* $NetBSD: ntfsmount.h,v 1.4 2002/09/21 18:13:54 christos Exp $ */
/*-
* Copyright (c) 1998, 1999 Semen Ustimenko
@ -39,3 +39,6 @@ struct ntfs_args {
mode_t mode; /* mask to be applied for ntfs perms */
u_long flag; /* additional flags */
};
#define NTFS_MFLAG_BITS "\177\20" \
"b\00caseins\0b\01allnames"

View File

@ -1,4 +1,4 @@
/* $NetBSD: ext2fs_vfsops.c,v 1.51 2002/09/06 13:18:43 gehenna Exp $ */
/* $NetBSD: ext2fs_vfsops.c,v 1.52 2002/09/21 18:14:49 christos Exp $ */
/*
* Copyright (c) 1997 Manuel Bouyer.
@ -38,7 +38,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: ext2fs_vfsops.c,v 1.51 2002/09/06 13:18:43 gehenna Exp $");
__KERNEL_RCSID(0, "$NetBSD: ext2fs_vfsops.c,v 1.52 2002/09/21 18:14:49 christos Exp $");
#if defined(_KERNEL_OPT)
#include "opt_compat_netbsd.h"
@ -225,6 +225,15 @@ ext2fs_mount(mp, path, data, ndp, p)
int error, flags;
mode_t accessmode;
if (mp->mnt_flag & MNT_GETARGS) {
ump = VFSTOUFS(mp);
if (ump == NULL)
return EIO;
args.fspec = NULL;
vfs_showexport(mp, &args.export, &ump->um_export);
return copyout(&args, data, sizeof(args));
}
error = copyin(data, (caddr_t)&args, sizeof (struct ufs_args));
if (error)
return (error);

View File

@ -1,4 +1,4 @@
/* $NetBSD: ffs_vfsops.c,v 1.101 2002/09/06 13:18:43 gehenna Exp $ */
/* $NetBSD: ffs_vfsops.c,v 1.102 2002/09/21 18:14:50 christos Exp $ */
/*
* Copyright (c) 1989, 1991, 1993, 1994
@ -36,7 +36,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: ffs_vfsops.c,v 1.101 2002/09/06 13:18:43 gehenna Exp $");
__KERNEL_RCSID(0, "$NetBSD: ffs_vfsops.c,v 1.102 2002/09/21 18:14:50 christos Exp $");
#if defined(_KERNEL_OPT)
#include "opt_ffs.h"
@ -190,6 +190,14 @@ ffs_mount(mp, path, data, ndp, p)
int error, flags, update;
mode_t accessmode;
if (mp->mnt_flag & MNT_GETARGS) {
ump = VFSTOUFS(mp);
if (ump == NULL)
return EIO;
args.fspec = NULL;
vfs_showexport(mp, &args.export, &ump->um_export);
return copyout(&args, data, sizeof(args));
}
error = copyin(data, (caddr_t)&args, sizeof (struct ufs_args));
if (error)
return (error);

View File

@ -1,4 +1,4 @@
/* $NetBSD: lfs_vfsops.c,v 1.80 2002/09/06 13:18:43 gehenna Exp $ */
/* $NetBSD: lfs_vfsops.c,v 1.81 2002/09/21 18:14:50 christos Exp $ */
/*-
* Copyright (c) 1999, 2000 The NetBSD Foundation, Inc.
@ -71,7 +71,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: lfs_vfsops.c,v 1.80 2002/09/06 13:18:43 gehenna Exp $");
__KERNEL_RCSID(0, "$NetBSD: lfs_vfsops.c,v 1.81 2002/09/21 18:14:50 christos Exp $");
#if defined(_KERNEL_OPT)
#include "opt_quota.h"
@ -243,6 +243,14 @@ lfs_mount(struct mount *mp, const char *path, void *data, struct nameidata *ndp,
int error;
mode_t accessmode;
if (mp->mnt_flag & MNT_GETARGS) {
ump = VFSTOUFS(mp);
if (ump == NULL)
return EIO;
args.fspec = NULL;
vfs_showexport(mp, &args.export, &ump->um_export);
return copyout(&args, data, sizeof(args));
}
error = copyin(data, (caddr_t)&args, sizeof (struct ufs_args));
if (error)
return (error);

View File

@ -1,4 +1,4 @@
/* $NetBSD: mfs_vfsops.c,v 1.40 2002/07/21 15:32:20 hannken Exp $ */
/* $NetBSD: mfs_vfsops.c,v 1.41 2002/09/21 18:14:51 christos Exp $ */
/*
* Copyright (c) 1989, 1990, 1993, 1994
@ -36,7 +36,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: mfs_vfsops.c,v 1.40 2002/07/21 15:32:20 hannken Exp $");
__KERNEL_RCSID(0, "$NetBSD: mfs_vfsops.c,v 1.41 2002/09/21 18:14:51 christos Exp $");
#if defined(_KERNEL_OPT)
#include "opt_compat_netbsd.h"
@ -237,6 +237,28 @@ mfs_mount(mp, path, data, ndp, p)
size_t size;
int flags, error;
if (mp->mnt_flag & MNT_GETARGS) {
struct vnode *vp;
struct mfsnode *mfsp;
ump = VFSTOUFS(mp);
if (ump == NULL)
return EIO;
vp = ump->um_devvp;
if (vp == NULL)
return EIO;
mfsp = VTOMFS(vp);
if (mfsp == NULL)
return EIO;
args.fspec = NULL;
vfs_showexport(mp, &args.export, &ump->um_export);
args.base = mfsp->mfs_baseoff;
args.size = mfsp->mfs_size;
return copyout(&args, data, sizeof(args));
}
/*
* XXX turn off async to avoid hangs when writing lots of data.
* the problem is that MFS needs to allocate pages to clean pages,