MNT_GETARGS support
This commit is contained in:
parent
2d05cb6a47
commit
6868d0a7d6
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: fdesc_vfsops.c,v 1.37 2002/07/30 07:40:09 soren Exp $ */
|
||||
/* $NetBSD: fdesc_vfsops.c,v 1.38 2002/09/21 18:09:27 christos Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1992, 1993, 1995
|
||||
@ -45,7 +45,7 @@
|
||||
*/
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
__KERNEL_RCSID(0, "$NetBSD: fdesc_vfsops.c,v 1.37 2002/07/30 07:40:09 soren Exp $");
|
||||
__KERNEL_RCSID(0, "$NetBSD: fdesc_vfsops.c,v 1.38 2002/09/21 18:09:27 christos Exp $");
|
||||
|
||||
#if defined(_KERNEL_OPT)
|
||||
#include "opt_compat_netbsd.h"
|
||||
@ -95,6 +95,8 @@ fdesc_mount(mp, path, data, ndp, p)
|
||||
struct fdescmount *fmp;
|
||||
struct vnode *rvp;
|
||||
|
||||
if (mp->mnt_flag & MNT_GETARGS)
|
||||
return 0;
|
||||
/*
|
||||
* Update is a no-op
|
||||
*/
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: kernfs_vfsops.c,v 1.45 2002/09/06 13:18:43 gehenna Exp $ */
|
||||
/* $NetBSD: kernfs_vfsops.c,v 1.46 2002/09/21 18:09:29 christos Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1992, 1993, 1995
|
||||
@ -43,7 +43,7 @@
|
||||
*/
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
__KERNEL_RCSID(0, "$NetBSD: kernfs_vfsops.c,v 1.45 2002/09/06 13:18:43 gehenna Exp $");
|
||||
__KERNEL_RCSID(0, "$NetBSD: kernfs_vfsops.c,v 1.46 2002/09/21 18:09:29 christos Exp $");
|
||||
|
||||
#if defined(_KERNEL_OPT)
|
||||
#include "opt_compat_netbsd.h"
|
||||
@ -138,6 +138,8 @@ kernfs_mount(mp, path, data, ndp, p)
|
||||
printf("kernfs_mount(mp = %p)\n", mp);
|
||||
#endif
|
||||
|
||||
if (mp->mnt_flag & MNT_GETARGS)
|
||||
return 0;
|
||||
/*
|
||||
* Update is a no-op
|
||||
*/
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: null_vfsops.c,v 1.37 2002/07/30 07:40:09 soren Exp $ */
|
||||
/* $NetBSD: null_vfsops.c,v 1.38 2002/09/21 18:09:29 christos Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1999 National Aeronautics & Space Administration
|
||||
@ -78,7 +78,7 @@
|
||||
*/
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
__KERNEL_RCSID(0, "$NetBSD: null_vfsops.c,v 1.37 2002/07/30 07:40:09 soren Exp $");
|
||||
__KERNEL_RCSID(0, "$NetBSD: null_vfsops.c,v 1.38 2002/09/21 18:09:29 christos Exp $");
|
||||
|
||||
#include <sys/param.h>
|
||||
#include <sys/systm.h>
|
||||
@ -118,6 +118,14 @@ nullfs_mount(mp, path, data, ndp, p)
|
||||
printf("nullfs_mount(mp = %p)\n", mp);
|
||||
#endif
|
||||
|
||||
if (mp->mnt_flag & MNT_GETARGS) {
|
||||
lmp = MOUNTTOLAYERMOUNT(mp);
|
||||
if (lmp == NULL)
|
||||
return EIO;
|
||||
args.la.target = NULL;
|
||||
vfs_showexport(mp, &args.la.export, &lmp->layerm_export);
|
||||
return copyout(&args, data, sizeof(args));
|
||||
}
|
||||
/*
|
||||
* Get argument
|
||||
*/
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: overlay_vfsops.c,v 1.11 2002/07/30 07:40:10 soren Exp $ */
|
||||
/* $NetBSD: overlay_vfsops.c,v 1.12 2002/09/21 18:09:29 christos Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1999, 2000 National Aeronautics & Space Administration
|
||||
@ -78,7 +78,7 @@
|
||||
*/
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
__KERNEL_RCSID(0, "$NetBSD: overlay_vfsops.c,v 1.11 2002/07/30 07:40:10 soren Exp $");
|
||||
__KERNEL_RCSID(0, "$NetBSD: overlay_vfsops.c,v 1.12 2002/09/21 18:09:29 christos Exp $");
|
||||
|
||||
#include <sys/param.h>
|
||||
#include <sys/systm.h>
|
||||
@ -119,6 +119,14 @@ ov_mount(mp, path, data, ndp, p)
|
||||
printf("ov_mount(mp = %p)\n", mp);
|
||||
#endif
|
||||
|
||||
if (mp->mnt_flag & MNT_GETARGS) {
|
||||
lmp = MOUNTTOLAYERMOUNT(mp);
|
||||
if (lmp == NULL)
|
||||
return EIO;
|
||||
args.la.target = NULL;
|
||||
vfs_showexport(mp, &args.la.export, &lmp->layerm_export);
|
||||
return copyout(&args, data, sizeof(args));
|
||||
}
|
||||
/*
|
||||
* Get argument
|
||||
*/
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: portal_vfsops.c,v 1.30 2002/07/30 07:40:10 soren Exp $ */
|
||||
/* $NetBSD: portal_vfsops.c,v 1.31 2002/09/21 18:09:30 christos Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1992, 1993, 1995
|
||||
@ -44,7 +44,7 @@
|
||||
*/
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
__KERNEL_RCSID(0, "$NetBSD: portal_vfsops.c,v 1.30 2002/07/30 07:40:10 soren Exp $");
|
||||
__KERNEL_RCSID(0, "$NetBSD: portal_vfsops.c,v 1.31 2002/09/21 18:09:30 christos Exp $");
|
||||
|
||||
#if defined(_KERNEL_OPT)
|
||||
#include "opt_compat_netbsd.h"
|
||||
@ -116,6 +116,14 @@ portal_mount(mp, path, data, ndp, p)
|
||||
size_t size;
|
||||
int error;
|
||||
|
||||
if (mp->mnt_flag & MNT_GETARGS) {
|
||||
fmp = VFSTOPORTAL(mp);
|
||||
if (fmp == NULL)
|
||||
return EIO;
|
||||
args.pa_config = NULL;
|
||||
args.pa_socket = 0; /* XXX */
|
||||
return copyout(&args, data, sizeof(args));
|
||||
}
|
||||
/*
|
||||
* Update is a no-op
|
||||
*/
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: procfs.h,v 1.37 2002/05/09 15:44:45 thorpej Exp $ */
|
||||
/* $NetBSD: procfs.h,v 1.38 2002/09/21 18:09:30 christos Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1993 Jan-Simon Pendry
|
||||
@ -93,6 +93,9 @@ struct procfs_args {
|
||||
|
||||
#define PROCFSMNT_LINUXCOMPAT 0x01
|
||||
|
||||
#define PROCFSMNT_BITS "\177\20" \
|
||||
"b\00linuxcompat"
|
||||
|
||||
/*
|
||||
* Kernel stuff follows
|
||||
*/
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: procfs_vfsops.c,v 1.42 2002/07/30 07:40:10 soren Exp $ */
|
||||
/* $NetBSD: procfs_vfsops.c,v 1.43 2002/09/21 18:09:30 christos Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1993 Jan-Simon Pendry
|
||||
@ -44,7 +44,7 @@
|
||||
*/
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
__KERNEL_RCSID(0, "$NetBSD: procfs_vfsops.c,v 1.42 2002/07/30 07:40:10 soren Exp $");
|
||||
__KERNEL_RCSID(0, "$NetBSD: procfs_vfsops.c,v 1.43 2002/09/21 18:09:30 christos Exp $");
|
||||
|
||||
#if defined(_KERNEL_OPT)
|
||||
#include "opt_compat_netbsd.h"
|
||||
@ -108,6 +108,15 @@ procfs_mount(mp, path, data, ndp, p)
|
||||
return (EINVAL);
|
||||
}
|
||||
|
||||
if (mp->mnt_flag & MNT_GETARGS) {
|
||||
pmnt = VFSTOPROC(mp);
|
||||
if (pmnt == NULL)
|
||||
return EIO;
|
||||
args.version = PROCFS_ARGSVERSION;
|
||||
args.flags = pmnt->pmnt_flags;
|
||||
return copyout(&args, data, sizeof(args));
|
||||
}
|
||||
|
||||
if (mp->mnt_flag & MNT_UPDATE)
|
||||
return (EOPNOTSUPP);
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: umap_vfsops.c,v 1.34 2002/07/30 07:40:11 soren Exp $ */
|
||||
/* $NetBSD: umap_vfsops.c,v 1.35 2002/09/21 18:09:31 christos Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1992, 1993
|
||||
@ -45,7 +45,7 @@
|
||||
*/
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
__KERNEL_RCSID(0, "$NetBSD: umap_vfsops.c,v 1.34 2002/07/30 07:40:11 soren Exp $");
|
||||
__KERNEL_RCSID(0, "$NetBSD: umap_vfsops.c,v 1.35 2002/09/21 18:09:31 christos Exp $");
|
||||
|
||||
#include <sys/param.h>
|
||||
#include <sys/systm.h>
|
||||
@ -81,6 +81,16 @@ umapfs_mount(mp, path, data, ndp, p)
|
||||
#ifdef UMAPFS_DIAGNOSTIC
|
||||
int i;
|
||||
#endif
|
||||
if (mp->mnt_flag & MNT_GETARGS) {
|
||||
amp = MOUNTTOUMAPMOUNT(mp);
|
||||
if (amp == NULL)
|
||||
return EIO;
|
||||
args.la.target = NULL;
|
||||
vfs_showexport(mp, &args.la.export, &->umapm_export);
|
||||
args.nentries = amp->info_nentries;
|
||||
args.gnentries = amp->info_gnentries;
|
||||
return copyout(&args, data, sizeof(args));
|
||||
}
|
||||
|
||||
/* only for root */
|
||||
if ((error = suser(p->p_ucred, &p->p_acflag)) != 0)
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: union.h,v 1.12 2000/03/16 18:08:27 jdolecek Exp $ */
|
||||
/* $NetBSD: union.h,v 1.13 2002/09/21 18:09:31 christos Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1994 The Regents of the University of California.
|
||||
@ -49,6 +49,9 @@ struct union_args {
|
||||
#define UNMNT_REPLACE 0x0003 /* Target replaces mount point */
|
||||
#define UNMNT_OPMASK 0x0003
|
||||
|
||||
#define UNMNT_BITS "\177\20" \
|
||||
"b\00above\0b\01below\0b\02replace"
|
||||
|
||||
struct union_mount {
|
||||
struct vnode *um_uppervp;
|
||||
struct vnode *um_lowervp;
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: union_vfsops.c,v 1.31 2002/07/30 07:40:11 soren Exp $ */
|
||||
/* $NetBSD: union_vfsops.c,v 1.32 2002/09/21 18:09:31 christos Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1994 The Regents of the University of California.
|
||||
@ -44,7 +44,7 @@
|
||||
*/
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
__KERNEL_RCSID(0, "$NetBSD: union_vfsops.c,v 1.31 2002/07/30 07:40:11 soren Exp $");
|
||||
__KERNEL_RCSID(0, "$NetBSD: union_vfsops.c,v 1.32 2002/09/21 18:09:31 christos Exp $");
|
||||
|
||||
#include <sys/param.h>
|
||||
#include <sys/systm.h>
|
||||
@ -101,6 +101,14 @@ union_mount(mp, path, data, ndp, p)
|
||||
printf("union_mount(mp = %p)\n", mp);
|
||||
#endif
|
||||
|
||||
if (mp->mnt_flag & MNT_GETARGS) {
|
||||
um = MOUNTTOUNIONMOUNT(mp);
|
||||
if (um == NULL)
|
||||
return EIO;
|
||||
args.target = NULL;
|
||||
args.mntflags = um->um_op;
|
||||
return copyout(&args, data, sizeof(args));
|
||||
}
|
||||
/*
|
||||
* Update is a no-op
|
||||
*/
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: nfs_vfsops.c,v 1.115 2002/07/30 07:40:13 soren Exp $ */
|
||||
/* $NetBSD: nfs_vfsops.c,v 1.116 2002/09/21 18:08:27 christos Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1989, 1993, 1995
|
||||
@ -39,7 +39,7 @@
|
||||
*/
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
__KERNEL_RCSID(0, "$NetBSD: nfs_vfsops.c,v 1.115 2002/07/30 07:40:13 soren Exp $");
|
||||
__KERNEL_RCSID(0, "$NetBSD: nfs_vfsops.c,v 1.116 2002/09/21 18:08:27 christos Exp $");
|
||||
|
||||
#if defined(_KERNEL_OPT)
|
||||
#include "opt_compat_netbsd.h"
|
||||
@ -564,6 +564,30 @@ nfs_mount(mp, path, data, ndp, p)
|
||||
size_t len;
|
||||
u_char *nfh;
|
||||
|
||||
if (mp->mnt_flag & MNT_GETARGS) {
|
||||
struct nfsmount *nmp = VFSTONFS(mp);
|
||||
if (nmp == NULL)
|
||||
return EIO;
|
||||
args.version = NFS_ARGSVERSION;
|
||||
args.addr = NULL;
|
||||
args.addrlen = 0;
|
||||
args.sotype = nmp->nm_sotype;
|
||||
args.proto = nmp->nm_soproto;
|
||||
args.fh = NULL;
|
||||
args.fhsize = 0;
|
||||
args.flags = nmp->nm_flag;
|
||||
args.wsize = nmp->nm_wsize;
|
||||
args.rsize = nmp->nm_rsize;
|
||||
args.readdirsize = nmp->nm_readdirsize;
|
||||
args.timeo = nmp->nm_timeo;
|
||||
args.retrans = nmp->nm_retry;
|
||||
args.maxgrouplist = nmp->nm_numgrps;
|
||||
args.readahead = nmp->nm_readahead;
|
||||
args.leaseterm = nmp->nm_leaseterm;
|
||||
args.hostname = NULL;
|
||||
return copyout(&args, data, sizeof(args));
|
||||
}
|
||||
|
||||
error = copyin(data, (caddr_t)&args, sizeof (struct nfs_args));
|
||||
if (error)
|
||||
return (error);
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: nfsmount.h,v 1.21 2001/09/15 16:13:02 chs Exp $ */
|
||||
/* $NetBSD: nfsmount.h,v 1.22 2002/09/21 18:08:27 christos Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1989, 1993
|
||||
@ -90,6 +90,13 @@ struct nfs_args {
|
||||
#define NFSMNT_READDIRSIZE 0x00020000 /* Set readdir size */
|
||||
#define NFSMNT_XLATECOOKIE 0x00040000 /* 32<->64 dir cookie xlation */
|
||||
|
||||
#define NFSMNT_BITS "\177\20" \
|
||||
"b\00soft\0b\01wsize\0b\02rsize\0b\03timeo\0" \
|
||||
"b\04retrans\0b\05maxgrps\0b\06intr\0b\07noconn\0" \
|
||||
"b\10nqnfs\0b\11nfsv3\0b\12kerb\0b\13dumbtimr\0" \
|
||||
"b\14leaseterm\0b\15readahead\0b\16deadthresh\0b\17resvport\0" \
|
||||
"b\20rdirplus\0b\21readdirsize\0b\22xlatecookie"
|
||||
|
||||
/*
|
||||
* NFS internal flags (nm_iflag) */
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user