1
0
mirror of https://git.FreeBSD.org/src.git synced 2024-12-02 08:42:48 +00:00

All unimplemented VFS ops now have entries in kern/vfs_default.c that return

reasonable defaults.

This avoids confusing and ugly casting to eopnotsupp or making dummy functions.
Bogus casting of filesystem sysctls to eopnotsupp() have been removed.

This should make *_vfsops.c more readable and reduce bloat.

Reviewed by:	msmith, eivind
Approved by:	phk
Tested by:	Jeroen Ruigrok/Asmodai <asmodai@wxs.nl>
This commit is contained in:
Alfred Perlstein 1999-09-07 22:42:38 +00:00
parent 75f462f45d
commit 5a5fccc8e7
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=51068
23 changed files with 285 additions and 906 deletions

View File

@ -230,16 +230,6 @@ coda_mount(vfsp, path, data, ndp, p)
return(error);
}
int
coda_start(vfsp, flags, p)
struct mount *vfsp;
int flags;
struct proc *p;
{
ENTRY;
return (0);
}
int
coda_unmount(vfsp, mntflags, p)
struct mount *vfsp;
@ -378,18 +368,6 @@ coda_root(vfsp, vpp)
return(error);
}
int
coda_quotactl(vfsp, cmd, uid, arg, p)
struct mount *vfsp;
int cmd;
uid_t uid;
caddr_t arg;
struct proc *p;
{
ENTRY;
return (EOPNOTSUPP);
}
/*
* Get file system statistics.
*/
@ -444,16 +422,6 @@ coda_sync(vfsp, waitfor, cred, p)
return(0);
}
int
coda_vget(vfsp, ino, vpp)
struct mount *vfsp;
ino_t ino;
struct vnode **vpp;
{
ENTRY;
return (EOPNOTSUPP);
}
/*
* fhtovp is now what vget used to be in 4.3-derived systems. For
* some silly reason, vget is now keyed by a 32 bit ino_t, rather than
@ -502,22 +470,6 @@ coda_fhtovp(vfsp, fhp, nam, vpp, exflagsp, creadanonp)
return(error);
}
int
coda_vptofh(vnp, fidp)
struct vnode *vnp;
struct fid *fidp;
{
ENTRY;
return (EOPNOTSUPP);
}
int
coda_init(struct vfsconf *vfsp)
{
ENTRY;
return 0;
}
/*
* To allow for greater ease of use, some vnodes may be orphaned when
* Venus dies. Certain operations should still be allowed to go
@ -570,18 +522,16 @@ struct mount *devtomp(dev)
struct vfsops coda_vfsops = {
coda_mount,
coda_start,
vfs_stdstart,
coda_unmount,
coda_root,
coda_quotactl,
vfs_stdquotactl,
coda_nb_statfs,
coda_sync,
coda_vget,
(int (*) (struct mount *, struct fid *, struct sockaddr *, struct vnode **,
int *, struct ucred **))
eopnotsupp,
(int (*) (struct vnode *, struct fid *)) eopnotsupp,
coda_init,
vfs_stdvget,
vfs_stdfhtovp,
vfs_stdvptofh,
vfs_stdinit
};
VFS_SET(coda_vfsops, coda, VFCF_NETWORK);

View File

@ -64,14 +64,9 @@ MALLOC_DEFINE(M_ISOFSNODE, "ISOFS node", "ISOFS vnode private part");
static int cd9660_mount __P((struct mount *,
char *, caddr_t, struct nameidata *, struct proc *));
static int cd9660_start __P((struct mount *, int, struct proc *));
static int cd9660_unmount __P((struct mount *, int, struct proc *));
static int cd9660_root __P((struct mount *, struct vnode **));
static int cd9660_quotactl __P((struct mount *, int, uid_t, caddr_t,
struct proc *));
static int cd9660_statfs __P((struct mount *, struct statfs *, struct proc *));
static int cd9660_sync __P((struct mount *, int, struct ucred *,
struct proc *));
static int cd9660_vget __P((struct mount *, ino_t, struct vnode **));
static int cd9660_fhtovp __P((struct mount *, struct fid *, struct sockaddr *,
struct vnode **, int *, struct ucred **));
@ -79,16 +74,16 @@ static int cd9660_vptofh __P((struct vnode *, struct fid *));
static struct vfsops cd9660_vfsops = {
cd9660_mount,
cd9660_start,
vfs_stdstart,
cd9660_unmount,
cd9660_root,
cd9660_quotactl,
vfs_stdquotactl,
cd9660_statfs,
cd9660_sync,
vfs_stdsync,
cd9660_vget,
cd9660_fhtovp,
cd9660_vptofh,
cd9660_init
cd9660_init,
};
VFS_SET(cd9660_vfsops, cd9660, VFCF_READONLY);
@ -523,20 +518,6 @@ iso_mountfs(devvp, mp, p, argp)
return error;
}
/*
* Make a filesystem operational.
* Nothing to do at the moment.
*/
/* ARGSUSED */
static int
cd9660_start(mp, flags, p)
struct mount *mp;
int flags;
struct proc *p;
{
return 0;
}
/*
* unmount system call
*/
@ -592,22 +573,6 @@ cd9660_root(mp, vpp)
imp->iso_ftype == ISO_FTYPE_RRIP, dp));
}
/*
* Do operations associated with quotas, not supported
*/
/* ARGSUSED */
static int
cd9660_quotactl(mp, cmd, uid, arg, p)
struct mount *mp;
int cmd;
uid_t uid;
caddr_t arg;
struct proc *p;
{
return (EOPNOTSUPP);
}
/*
* Get file system statistics.
*/
@ -636,17 +601,6 @@ cd9660_statfs(mp, sbp, p)
return 0;
}
/* ARGSUSED */
static int
cd9660_sync(mp, waitfor, cred, p)
struct mount *mp;
int waitfor;
struct ucred *cred;
struct proc *p;
{
return (0);
}
/*
* File handle to vnode
*

View File

@ -230,16 +230,6 @@ coda_mount(vfsp, path, data, ndp, p)
return(error);
}
int
coda_start(vfsp, flags, p)
struct mount *vfsp;
int flags;
struct proc *p;
{
ENTRY;
return (0);
}
int
coda_unmount(vfsp, mntflags, p)
struct mount *vfsp;
@ -378,18 +368,6 @@ coda_root(vfsp, vpp)
return(error);
}
int
coda_quotactl(vfsp, cmd, uid, arg, p)
struct mount *vfsp;
int cmd;
uid_t uid;
caddr_t arg;
struct proc *p;
{
ENTRY;
return (EOPNOTSUPP);
}
/*
* Get file system statistics.
*/
@ -444,16 +422,6 @@ coda_sync(vfsp, waitfor, cred, p)
return(0);
}
int
coda_vget(vfsp, ino, vpp)
struct mount *vfsp;
ino_t ino;
struct vnode **vpp;
{
ENTRY;
return (EOPNOTSUPP);
}
/*
* fhtovp is now what vget used to be in 4.3-derived systems. For
* some silly reason, vget is now keyed by a 32 bit ino_t, rather than
@ -502,22 +470,6 @@ coda_fhtovp(vfsp, fhp, nam, vpp, exflagsp, creadanonp)
return(error);
}
int
coda_vptofh(vnp, fidp)
struct vnode *vnp;
struct fid *fidp;
{
ENTRY;
return (EOPNOTSUPP);
}
int
coda_init(struct vfsconf *vfsp)
{
ENTRY;
return 0;
}
/*
* To allow for greater ease of use, some vnodes may be orphaned when
* Venus dies. Certain operations should still be allowed to go
@ -570,18 +522,16 @@ struct mount *devtomp(dev)
struct vfsops coda_vfsops = {
coda_mount,
coda_start,
vfs_stdstart,
coda_unmount,
coda_root,
coda_quotactl,
vfs_stdquotactl,
coda_nb_statfs,
coda_sync,
coda_vget,
(int (*) (struct mount *, struct fid *, struct sockaddr *, struct vnode **,
int *, struct ucred **))
eopnotsupp,
(int (*) (struct vnode *, struct fid *)) eopnotsupp,
coda_init,
vfs_stdvget,
vfs_stdfhtovp,
vfs_stdvptofh,
vfs_stdinit
};
VFS_SET(coda_vfsops, coda, VFCF_NETWORK);

View File

@ -57,13 +57,10 @@ static MALLOC_DEFINE(M_FDESCMNT, "FDESC mount", "FDESC mount structure");
static int fdesc_mount __P((struct mount *mp, char *path, caddr_t data,
struct nameidata *ndp, struct proc *p));
static int fdesc_start __P((struct mount *mp, int flags, struct proc *p));
static int fdesc_unmount __P((struct mount *mp, int mntflags,
struct proc *p));
static int fdesc_statfs __P((struct mount *mp, struct statfs *sbp,
struct proc *p));
static int fdesc_sync __P((struct mount *mp, int waitfor,
struct ucred *cred, struct proc *p));
/*
* Mount the per-process file descriptors (/dev/fd)
@ -109,15 +106,6 @@ fdesc_mount(mp, path, data, ndp, p)
return (0);
}
static int
fdesc_start(mp, flags, p)
struct mount *mp;
int flags;
struct proc *p;
{
return (0);
}
static int
fdesc_unmount(mp, mntflags, p)
struct mount *mp;
@ -226,38 +214,17 @@ fdesc_statfs(mp, sbp, p)
return (0);
}
static int
fdesc_sync(mp, waitfor, cred, p)
struct mount *mp;
int waitfor;
struct ucred *cred;
struct proc *p;
{
return (0);
}
#define fdesc_fhtovp ((int (*) __P((struct mount *, struct fid *, \
struct sockaddr *, struct vnode **, int *, struct ucred **)))eopnotsupp)
#define fdesc_quotactl ((int (*) __P((struct mount *, int, uid_t, caddr_t, \
struct proc *)))eopnotsupp)
#define fdesc_sysctl ((int (*) __P((int *, u_int, void *, size_t *, void *, \
size_t, struct proc *)))eopnotsupp)
#define fdesc_vget ((int (*) __P((struct mount *, ino_t, struct vnode **))) \
eopnotsupp)
#define fdesc_vptofh ((int (*) __P((struct vnode *, struct fid *)))eopnotsupp)
static struct vfsops fdesc_vfsops = {
fdesc_mount,
fdesc_start,
vfs_stdstart,
fdesc_unmount,
fdesc_root,
fdesc_quotactl,
vfs_stdquotactl,
fdesc_statfs,
fdesc_sync,
fdesc_vget,
fdesc_fhtovp,
fdesc_vptofh,
vfs_stdsync,
vfs_stdvget,
vfs_stdfhtovp,
vfs_stdvptofh,
fdesc_init,
};

View File

@ -79,17 +79,12 @@ static int msdosfs_fhtovp __P((struct mount *, struct fid *,
struct ucred **));
static int msdosfs_mount __P((struct mount *, char *, caddr_t,
struct nameidata *, struct proc *));
static int msdosfs_quotactl __P((struct mount *, int, uid_t, caddr_t,
struct proc *));
static int msdosfs_root __P((struct mount *, struct vnode **));
static int msdosfs_start __P((struct mount *, int, struct proc *));
static int msdosfs_statfs __P((struct mount *, struct statfs *,
struct proc *));
static int msdosfs_sync __P((struct mount *, int, struct ucred *,
struct proc *));
static int msdosfs_unmount __P((struct mount *, int, struct proc *));
static int msdosfs_vget __P((struct mount *mp, ino_t ino,
struct vnode **vpp));
static int msdosfs_vptofh __P((struct vnode *, struct fid *));
static int
@ -746,16 +741,6 @@ mountmsdosfs(devvp, mp, p, argp)
return (error);
}
static int
msdosfs_start(mp, flags, p)
struct mount *mp;
int flags;
struct proc *p;
{
return (0);
}
/*
* Unmount the filesystem described by mp.
*/
@ -828,17 +813,6 @@ msdosfs_root(mp, vpp)
return (0);
}
static int
msdosfs_quotactl(mp, cmds, uid, arg, p)
struct mount *mp;
int cmds;
uid_t uid;
caddr_t arg;
struct proc *p;
{
return EOPNOTSUPP;
}
static int
msdosfs_statfs(mp, sbp, p)
struct mount *mp;
@ -986,24 +960,15 @@ msdosfs_vptofh(vp, fhp)
return (0);
}
static int
msdosfs_vget(mp, ino, vpp)
struct mount *mp;
ino_t ino;
struct vnode **vpp;
{
return EOPNOTSUPP;
}
static struct vfsops msdosfs_vfsops = {
msdosfs_mount,
msdosfs_start,
vfs_stdstart,
msdosfs_unmount,
msdosfs_root,
msdosfs_quotactl,
vfs_stdquotactl,
msdosfs_statfs,
msdosfs_sync,
msdosfs_vget,
vfs_stdvget,
msdosfs_fhtovp,
msdosfs_vptofh,
msdosfs_init

View File

@ -71,26 +71,31 @@ static int ntfs_mount __P((struct mount *, char *, caddr_t,
static int ntfs_mount __P((struct mount *, const char *, void *,
struct nameidata *, struct proc *));
#endif
static int ntfs_quotactl __P((struct mount *, int, uid_t, caddr_t,
struct proc *));
static int ntfs_root __P((struct mount *, struct vnode **));
static int ntfs_start __P((struct mount *, int, struct proc *));
static int ntfs_statfs __P((struct mount *, struct statfs *,
struct proc *));
static int ntfs_sync __P((struct mount *, int, struct ucred *,
struct proc *));
static int ntfs_unmount __P((struct mount *, int, struct proc *));
static int ntfs_vget __P((struct mount *mp, ino_t ino,
struct vnode **vpp));
static int ntfs_mountfs __P((register struct vnode *, struct mount *,
struct ntfs_args *, struct proc *));
#if !defined(__FreeBSD__)
static int ntfs_quotactl __P((struct mount *, int, uid_t, caddr_t,
struct proc *));
static int ntfs_start __P((struct mount *, int, struct proc *));
static int ntfs_sync __P((struct mount *, int, struct ucred *,
struct proc *));
static int ntfs_vptofh __P((struct vnode *, struct fid *));
#endif /* !defined(__FreeBSD__) */
#if defined(__FreeBSD__)
static int ntfs_init __P((struct vfsconf *));
#if 0 /* may be implemented at a later date */
static int ntfs_fhtovp __P((struct mount *, struct fid *,
struct sockaddr *, struct vnode **,
int *, struct ucred **));
#endif
#elif defined(__NetBSD__)
static void ntfs_init __P((void));
static int ntfs_fhtovp __P((struct mount *, struct fid *,
@ -589,6 +594,7 @@ ntfs_mountfs(devvp, mp, argsp, p)
return (error);
}
#if !defined(__FreeBSD__)
static int
ntfs_start (
struct mount *mp,
@ -597,6 +603,7 @@ ntfs_start (
{
return (0);
}
#endif /* !defined(__FreeBSD__) */
static int
ntfs_unmount(
@ -676,6 +683,7 @@ ntfs_root(
return (0);
}
#if !defined(__FreeBSD__)
static int
ntfs_quotactl (
struct mount *mp,
@ -687,6 +695,7 @@ ntfs_quotactl (
printf("\nntfs_quotactl():\n");
return EOPNOTSUPP;
}
#endif /* !defined(__FreeBSD__) */
int
ntfs_calccfree(
@ -762,6 +771,7 @@ ntfs_statfs(
return (0);
}
#if !defined(__FreeBSD__)
static int
ntfs_sync (
struct mount *mp,
@ -772,7 +782,9 @@ ntfs_sync (
/*dprintf(("ntfs_sync():\n"));*/
return (0);
}
#endif /* !defined(__FreeBSD__) */
#if !defined(__FreeBSD__)
/*ARGSUSED*/
static int
ntfs_fhtovp(
@ -808,6 +820,7 @@ ntfs_vptofh(
printf("ntfs_vptofh():\n");
return EOPNOTSUPP;
}
#endif /* !defined(__FreeBSD__) */
int
ntfs_vgetex(
@ -931,15 +944,15 @@ ntfs_vget(
#if defined(__FreeBSD__)
static struct vfsops ntfs_vfsops = {
ntfs_mount,
ntfs_start,
vfs_stdstart,
ntfs_unmount,
ntfs_root,
ntfs_quotactl,
vfs_stdquotactl,
ntfs_statfs,
ntfs_sync,
vfs_stdsync,
ntfs_vget,
ntfs_fhtovp,
ntfs_vptofh,
vfs_stdfhtovp,
vfs_stdvptofh,
ntfs_init,
NULL
};

View File

@ -59,24 +59,14 @@
static MALLOC_DEFINE(M_PORTALFSMNT, "PORTAL mount", "PORTAL mount structure");
static int portal_init __P((struct vfsconf *));
static int portal_mount __P((struct mount *mp, char *path, caddr_t data,
struct nameidata *ndp, struct proc *p));
static int portal_start __P((struct mount *mp, int flags, struct proc *p));
static int portal_unmount __P((struct mount *mp, int mntflags,
struct proc *p));
static int portal_root __P((struct mount *mp, struct vnode **vpp));
static int portal_statfs __P((struct mount *mp, struct statfs *sbp,
struct proc *p));
static int
portal_init(vfsp)
struct vfsconf *vfsp;
{
return (0);
}
/*
* Mount the per-process file descriptors (/dev/fd)
*/
@ -155,16 +145,6 @@ portal_mount(mp, path, data, ndp, p)
return (0);
}
static int
portal_start(mp, flags, p)
struct mount *mp;
int flags;
struct proc *p;
{
return (0);
}
static int
portal_unmount(mp, mntflags, p)
struct mount *mp;
@ -263,30 +243,18 @@ portal_statfs(mp, sbp, p)
return (0);
}
#define portal_fhtovp ((int (*) __P((struct mount *, struct fid *, \
struct sockaddr *, struct vnode **, int *, struct ucred **)))eopnotsupp)
#define portal_quotactl ((int (*) __P((struct mount *, int, uid_t, caddr_t, \
struct proc *)))eopnotsupp)
#define portal_sync ((int (*) __P((struct mount *, int, struct ucred *, \
struct proc *)))nullop)
#define portal_sysctl ((int (*) __P((int *, u_int, void *, size_t *, void *, \
size_t, struct proc *)))eopnotsupp)
#define portal_vget ((int (*) __P((struct mount *, ino_t, struct vnode **))) \
eopnotsupp)
#define portal_vptofh ((int (*) __P((struct vnode *, struct fid *)))eopnotsupp)
static struct vfsops portal_vfsops = {
portal_mount,
portal_start,
vfs_stdstart,
portal_unmount,
portal_root,
portal_quotactl,
vfs_stdquotactl,
portal_statfs,
portal_sync,
portal_vget,
portal_fhtovp,
portal_vptofh,
portal_init,
vfs_stdsync,
vfs_stdvget,
vfs_stdfhtovp,
vfs_stdvptofh,
vfs_stdinit,
};
VFS_SET(portal_vfsops, portal, VFCF_SYNTHETIC);

View File

@ -52,10 +52,8 @@
#include <sys/vnode.h>
#include <miscfs/procfs/procfs.h>
static int procfs_init __P((struct vfsconf *vfsp));
static int procfs_mount __P((struct mount *mp, char *path, caddr_t data,
struct nameidata *ndp, struct proc *p));
static int procfs_start __P((struct mount *mp, int flags, struct proc *p));
static int procfs_statfs __P((struct mount *mp, struct statfs *sbp,
struct proc *p));
static int procfs_unmount __P((struct mount *mp, int mntflags,
@ -135,17 +133,6 @@ procfs_root(mp, vpp)
return (procfs_allocvp(mp, vpp, 0, Proot));
}
/* ARGSUSED */
static int
procfs_start(mp, flags, p)
struct mount *mp;
int flags;
struct proc *p;
{
return (0);
}
/*
* Get file system statistics.
*/
@ -173,38 +160,18 @@ procfs_statfs(mp, sbp, p)
return (0);
}
static int
procfs_init(vfsp)
struct vfsconf *vfsp;
{
return (0);
}
#define procfs_fhtovp ((int (*) __P((struct mount *, struct fid *, \
struct sockaddr *, struct vnode **, int *, struct ucred **)))einval)
#define procfs_quotactl ((int (*) __P((struct mount *, int, uid_t, caddr_t, \
struct proc *)))eopnotsupp)
#define procfs_sync ((int (*) __P((struct mount *, int, struct ucred *, \
struct proc *)))nullop)
#define procfs_sysctl ((int (*) __P((int *, u_int, void *, size_t *, void *, \
size_t, struct proc *)))eopnotsupp)
#define procfs_vget ((int (*) __P((struct mount *, ino_t, struct vnode **))) \
eopnotsupp)
#define procfs_vptofh ((int (*) __P((struct vnode *, struct fid *)))einval)
static struct vfsops procfs_vfsops = {
procfs_mount,
procfs_start,
vfs_stdstart,
procfs_unmount,
procfs_root,
procfs_quotactl,
vfs_stdquotactl,
procfs_statfs,
procfs_sync,
procfs_vget,
procfs_fhtovp,
procfs_vptofh,
procfs_init,
vfs_stdsync,
vfs_stdvget,
vfs_stdfhtovp,
vfs_stdvptofh,
vfs_stdinit,
};
VFS_SET(procfs_vfsops, procfs, VFCF_SYNTHETIC);

View File

@ -56,25 +56,13 @@
static MALLOC_DEFINE(M_UNIONFSMNT, "UNION mount", "UNION mount structure");
extern int union_init __P((struct vfsconf *));
extern int union_fhtovp __P((struct mount *mp, struct fid *fidp,
struct mbuf *nam, struct vnode **vpp,
int *exflagsp, struct ucred **credanonp));
static int union_mount __P((struct mount *mp, char *path, caddr_t data,
struct nameidata *ndp, struct proc *p));
extern int union_quotactl __P((struct mount *mp, int cmd, uid_t uid,
caddr_t arg, struct proc *p));
static int union_root __P((struct mount *mp, struct vnode **vpp));
static int union_start __P((struct mount *mp, int flags, struct proc *p));
static int union_statfs __P((struct mount *mp, struct statfs *sbp,
struct proc *p));
extern int union_sync __P((struct mount *mp, int waitfor,
struct ucred *cred, struct proc *p));
static int union_unmount __P((struct mount *mp, int mntflags,
struct proc *p));
extern int union_vget __P((struct mount *mp, ino_t ino,
struct vnode **vpp));
extern int union_vptofh __P((struct vnode *vp, struct fid *fhp));
/*
* Mount union filesystem
@ -288,21 +276,6 @@ union_mount(mp, path, data, ndp, p)
return (error);
}
/*
* VFS start. Nothing needed here - the start routine
* on the underlying filesystem(s) will have been called
* when that filesystem was mounted.
*/
static int
union_start(mp, flags, p)
struct mount *mp;
int flags;
struct proc *p;
{
return (0);
}
/*
* Free reference to union layer
*/
@ -521,33 +494,17 @@ union_statfs(mp, sbp, p)
return (0);
}
/*
* XXX - Assumes no data cached at union layer.
*/
#define union_sync ((int (*) __P((struct mount *, int, struct ucred *, \
struct proc *)))nullop)
#define union_fhtovp ((int (*) __P((struct mount *, struct fid *, \
struct sockaddr *, struct vnode **, int *, struct ucred **)))eopnotsupp)
#define union_quotactl ((int (*) __P((struct mount *, int, uid_t, caddr_t, \
struct proc *)))eopnotsupp)
#define union_sysctl ((int (*) __P((int *, u_int, void *, size_t *, void *, \
size_t, struct proc *)))eopnotsupp)
#define union_vget ((int (*) __P((struct mount *, ino_t, struct vnode **))) \
eopnotsupp)
#define union_vptofh ((int (*) __P((struct vnode *, struct fid *)))eopnotsupp)
static struct vfsops union_vfsops = {
union_mount,
union_start,
vfs_stdstart,
union_unmount,
union_root,
union_quotactl,
vfs_stdquotactl,
union_statfs,
union_sync,
union_vget,
union_fhtovp,
union_vptofh,
vfs_stdsync, /* XXX assumes no cached data on union level */
vfs_stdvget,
vfs_stdfhtovp,
vfs_stdvptofh,
union_init,
};

View File

@ -64,14 +64,9 @@ MALLOC_DEFINE(M_ISOFSNODE, "ISOFS node", "ISOFS vnode private part");
static int cd9660_mount __P((struct mount *,
char *, caddr_t, struct nameidata *, struct proc *));
static int cd9660_start __P((struct mount *, int, struct proc *));
static int cd9660_unmount __P((struct mount *, int, struct proc *));
static int cd9660_root __P((struct mount *, struct vnode **));
static int cd9660_quotactl __P((struct mount *, int, uid_t, caddr_t,
struct proc *));
static int cd9660_statfs __P((struct mount *, struct statfs *, struct proc *));
static int cd9660_sync __P((struct mount *, int, struct ucred *,
struct proc *));
static int cd9660_vget __P((struct mount *, ino_t, struct vnode **));
static int cd9660_fhtovp __P((struct mount *, struct fid *, struct sockaddr *,
struct vnode **, int *, struct ucred **));
@ -79,16 +74,16 @@ static int cd9660_vptofh __P((struct vnode *, struct fid *));
static struct vfsops cd9660_vfsops = {
cd9660_mount,
cd9660_start,
vfs_stdstart,
cd9660_unmount,
cd9660_root,
cd9660_quotactl,
vfs_stdquotactl,
cd9660_statfs,
cd9660_sync,
vfs_stdsync,
cd9660_vget,
cd9660_fhtovp,
cd9660_vptofh,
cd9660_init
cd9660_init,
};
VFS_SET(cd9660_vfsops, cd9660, VFCF_READONLY);
@ -523,20 +518,6 @@ iso_mountfs(devvp, mp, p, argp)
return error;
}
/*
* Make a filesystem operational.
* Nothing to do at the moment.
*/
/* ARGSUSED */
static int
cd9660_start(mp, flags, p)
struct mount *mp;
int flags;
struct proc *p;
{
return 0;
}
/*
* unmount system call
*/
@ -592,22 +573,6 @@ cd9660_root(mp, vpp)
imp->iso_ftype == ISO_FTYPE_RRIP, dp));
}
/*
* Do operations associated with quotas, not supported
*/
/* ARGSUSED */
static int
cd9660_quotactl(mp, cmd, uid, arg, p)
struct mount *mp;
int cmd;
uid_t uid;
caddr_t arg;
struct proc *p;
{
return (EOPNOTSUPP);
}
/*
* Get file system statistics.
*/
@ -636,17 +601,6 @@ cd9660_statfs(mp, sbp, p)
return 0;
}
/* ARGSUSED */
static int
cd9660_sync(mp, waitfor, cred, p)
struct mount *mp;
int waitfor;
struct ucred *cred;
struct proc *p;
{
return (0);
}
/*
* File handle to vnode
*

View File

@ -45,6 +45,7 @@
#include <sys/kernel.h>
#include <sys/lock.h>
#include <sys/malloc.h>
#include <sys/mount.h>
#include <sys/unistd.h>
#include <sys/vnode.h>
#include <sys/poll.h>
@ -490,3 +491,118 @@ vop_noislocked(ap)
return (lockstatus(vp->v_vnlock));
}
/*
* vfs default ops
* used to fill the vfs fucntion table to get reasonable default return values.
*/
int
vfs_stdmount (mp, path, data, ndp, p)
struct mount *mp;
char *path;
caddr_t data;
struct nameidata *ndp;
struct proc *p;
{
return (0);
}
int
vfs_stdunmount (mp, mntflags, p)
struct mount *mp;
int mntflags;
struct proc *p;
{
return (0);
}
int
vfs_stdroot (mp, vpp)
struct mount *mp;
struct vnode **vpp;
{
return (EOPNOTSUPP);
}
int
vfs_stdstatfs (mp, sbp, p)
struct mount *mp;
struct statfs *sbp;
struct proc *p;
{
return (EOPNOTSUPP);
}
int
vfs_stdvptofh (vp, fhp)
struct vnode *vp;
struct fid *fhp;
{
return (EOPNOTSUPP);
}
int
vfs_stdstart (mp, flags, p)
struct mount *mp;
int flags;
struct proc *p;
{
return (0);
}
int
vfs_stdquotactl (mp, cmds, uid, arg, p)
struct mount *mp;
int cmds;
uid_t uid;
caddr_t arg;
struct proc *p;
{
return (EOPNOTSUPP);
}
int
vfs_stdsync (mp, waitfor, cred, p)
struct mount *mp;
int waitfor;
struct ucred *cred;
struct proc *p;
{
return (0);
}
int
vfs_stdvget (mp, ino, vpp)
struct mount *mp;
ino_t ino;
struct vnode **vpp;
{
return (EOPNOTSUPP);
}
int
vfs_stdfhtovp (mp, fhp, nam, vpp, exflagsp, credanonp)
struct mount *mp;
struct fid *fhp;
struct sockaddr *nam;
struct vnode **vpp;
int *exflagsp;
struct ucred **credanonp;
{
return (EOPNOTSUPP);
}
int
vfs_stdinit (vfsp)
struct vfsconf *vfsp;
{
return (0);
}
int
vfs_stduninit (vfsp)
struct vfsconf *vfsp;
{
return(0);
}
/* end of vfs default ops */

View File

@ -160,13 +160,6 @@ DBPRINT(("mount "));
}
static int
devfs_start(struct mount *mp, int flags, struct proc *p)
{
DBPRINT(("start "));
return 0;
}
/*-
* Unmount the filesystem described by mp.
*/
@ -204,14 +197,6 @@ DBPRINT(("root "));
return 0;
}
static int
devfs_quotactl(struct mount *mp, int cmds, uid_t uid, caddr_t arg,
struct proc *p)
{
DBPRINT(("quotactl "));
return EOPNOTSUPP;
}
static int
devfs_statfs( struct mount *mp, struct statfs *sbp, struct proc *p)
{
@ -308,45 +293,17 @@ DBPRINT(("sync "));
return (allerror);
}
static int
devfs_vget(struct mount *mp, ino_t ino,struct vnode **vpp)
{
DBPRINT(("vget "));
return EOPNOTSUPP;
}
/*************************************************************
* The concept of exporting a kernel generated devfs is stupid
* So don't handle filehandles
*/
static int
devfs_fhtovp (struct mount *mp, struct fid *fhp, struct sockaddr *nam,
struct vnode **vpp, int *exflagsp, struct ucred **credanonp)
{
DBPRINT(("fhtovp "));
return (EINVAL);
}
static int
devfs_vptofh (struct vnode *vp, struct fid *fhp)
{
DBPRINT(("vptofh "));
return (EINVAL);
}
static struct vfsops devfs_vfsops = {
devfs_mount,
devfs_start,
vfs_stdstart,
devfs_unmount,
devfs_root,
devfs_quotactl,
vfs_stdquotactl,
devfs_statfs,
devfs_sync,
devfs_vget,
devfs_fhtovp,
devfs_vptofh,
vfs_stdvget,
vfs_stdfhtovp,
vfs_stdvptofh,
devfs_init
};

View File

@ -57,13 +57,10 @@ static MALLOC_DEFINE(M_FDESCMNT, "FDESC mount", "FDESC mount structure");
static int fdesc_mount __P((struct mount *mp, char *path, caddr_t data,
struct nameidata *ndp, struct proc *p));
static int fdesc_start __P((struct mount *mp, int flags, struct proc *p));
static int fdesc_unmount __P((struct mount *mp, int mntflags,
struct proc *p));
static int fdesc_statfs __P((struct mount *mp, struct statfs *sbp,
struct proc *p));
static int fdesc_sync __P((struct mount *mp, int waitfor,
struct ucred *cred, struct proc *p));
/*
* Mount the per-process file descriptors (/dev/fd)
@ -109,15 +106,6 @@ fdesc_mount(mp, path, data, ndp, p)
return (0);
}
static int
fdesc_start(mp, flags, p)
struct mount *mp;
int flags;
struct proc *p;
{
return (0);
}
static int
fdesc_unmount(mp, mntflags, p)
struct mount *mp;
@ -226,38 +214,17 @@ fdesc_statfs(mp, sbp, p)
return (0);
}
static int
fdesc_sync(mp, waitfor, cred, p)
struct mount *mp;
int waitfor;
struct ucred *cred;
struct proc *p;
{
return (0);
}
#define fdesc_fhtovp ((int (*) __P((struct mount *, struct fid *, \
struct sockaddr *, struct vnode **, int *, struct ucred **)))eopnotsupp)
#define fdesc_quotactl ((int (*) __P((struct mount *, int, uid_t, caddr_t, \
struct proc *)))eopnotsupp)
#define fdesc_sysctl ((int (*) __P((int *, u_int, void *, size_t *, void *, \
size_t, struct proc *)))eopnotsupp)
#define fdesc_vget ((int (*) __P((struct mount *, ino_t, struct vnode **))) \
eopnotsupp)
#define fdesc_vptofh ((int (*) __P((struct vnode *, struct fid *)))eopnotsupp)
static struct vfsops fdesc_vfsops = {
fdesc_mount,
fdesc_start,
vfs_stdstart,
fdesc_unmount,
fdesc_root,
fdesc_quotactl,
vfs_stdquotactl,
fdesc_statfs,
fdesc_sync,
fdesc_vget,
fdesc_fhtovp,
fdesc_vptofh,
vfs_stdsync,
vfs_stdvget,
vfs_stdfhtovp,
vfs_stdvptofh,
fdesc_init,
};

View File

@ -51,17 +51,6 @@ struct kernfs_node {
#define VFSTOKERNFS(mp) ((struct kernfs_mount *)((mp)->mnt_data))
#define VTOKERN(vp) ((struct kernfs_node *)(vp)->v_data)
#define kernfs_fhtovp ((int (*) __P((struct mount *, struct fid *, \
struct sockaddr *, struct vnode **, int *, struct ucred **)))eopnotsupp)
#define kernfs_quotactl ((int (*) __P((struct mount *, int, uid_t, caddr_t, \
struct proc *)))eopnotsupp)
#define kernfs_sync ((int (*) __P((struct mount *, int, struct ucred *, \
struct proc *)))nullop)
#define kernfs_sysctl ((int (*) __P((int *, u_int, void *, size_t *, void *, \
size_t, struct proc *)))eopnotsupp)
#define kernfs_vget ((int (*) __P((struct mount *, ino_t, struct vnode **))) \
eopnotsupp)
#define kernfs_vptofh ((int (*) __P((struct vnode *, struct fid *)))eopnotsupp)
extern vop_t **kernfs_vnodeop_p;
extern dev_t rrootdev;
#endif /* KERNEL */

View File

@ -57,24 +57,14 @@ static MALLOC_DEFINE(M_KERNFSMNT, "KERNFS mount", "KERNFS mount structure");
dev_t rrootdev = NODEV;
static void kernfs_get_rrootdev __P((void));
static int kernfs_init __P((struct vfsconf *vfsp));
static int kernfs_mount __P((struct mount *mp, char *path, caddr_t data,
struct nameidata *ndp, struct proc *p));
static int kernfs_start __P((struct mount *mp, int flags, struct proc *p));
static int kernfs_unmount __P((struct mount *mp, int mntflags,
struct proc *p));
struct proc *p));
static int kernfs_root __P((struct mount *mp, struct vnode **vpp));
static int kernfs_statfs __P((struct mount *mp, struct statfs *sbp,
struct proc *p));
static int
kernfs_init(vfsp)
struct vfsconf *vfsp;
{
return (0);
}
static void
kernfs_get_rrootdev()
{
@ -153,15 +143,6 @@ kernfs_mount(mp, path, data, ndp, p)
return (0);
}
static int
kernfs_start(mp, flags, p)
struct mount *mp;
int flags;
struct proc *p;
{
return (0);
}
static int
kernfs_unmount(mp, mntflags, p)
struct mount *mp;
@ -263,16 +244,16 @@ kernfs_statfs(mp, sbp, p)
static struct vfsops kernfs_vfsops = {
kernfs_mount,
kernfs_start,
vfs_stdstart,
kernfs_unmount,
kernfs_root,
kernfs_quotactl,
vfs_stdquotactl,
kernfs_statfs,
kernfs_sync,
kernfs_vget,
kernfs_fhtovp,
kernfs_vptofh,
kernfs_init,
vfs_stdsync,
vfs_stdvget,
vfs_stdfhtovp,
vfs_stdvptofh,
vfs_stdinit,
};
VFS_SET(kernfs_vfsops, kernfs, VFCF_SYNTHETIC);

View File

@ -59,24 +59,14 @@
static MALLOC_DEFINE(M_PORTALFSMNT, "PORTAL mount", "PORTAL mount structure");
static int portal_init __P((struct vfsconf *));
static int portal_mount __P((struct mount *mp, char *path, caddr_t data,
struct nameidata *ndp, struct proc *p));
static int portal_start __P((struct mount *mp, int flags, struct proc *p));
static int portal_unmount __P((struct mount *mp, int mntflags,
struct proc *p));
static int portal_root __P((struct mount *mp, struct vnode **vpp));
static int portal_statfs __P((struct mount *mp, struct statfs *sbp,
struct proc *p));
static int
portal_init(vfsp)
struct vfsconf *vfsp;
{
return (0);
}
/*
* Mount the per-process file descriptors (/dev/fd)
*/
@ -155,16 +145,6 @@ portal_mount(mp, path, data, ndp, p)
return (0);
}
static int
portal_start(mp, flags, p)
struct mount *mp;
int flags;
struct proc *p;
{
return (0);
}
static int
portal_unmount(mp, mntflags, p)
struct mount *mp;
@ -263,30 +243,18 @@ portal_statfs(mp, sbp, p)
return (0);
}
#define portal_fhtovp ((int (*) __P((struct mount *, struct fid *, \
struct sockaddr *, struct vnode **, int *, struct ucred **)))eopnotsupp)
#define portal_quotactl ((int (*) __P((struct mount *, int, uid_t, caddr_t, \
struct proc *)))eopnotsupp)
#define portal_sync ((int (*) __P((struct mount *, int, struct ucred *, \
struct proc *)))nullop)
#define portal_sysctl ((int (*) __P((int *, u_int, void *, size_t *, void *, \
size_t, struct proc *)))eopnotsupp)
#define portal_vget ((int (*) __P((struct mount *, ino_t, struct vnode **))) \
eopnotsupp)
#define portal_vptofh ((int (*) __P((struct vnode *, struct fid *)))eopnotsupp)
static struct vfsops portal_vfsops = {
portal_mount,
portal_start,
vfs_stdstart,
portal_unmount,
portal_root,
portal_quotactl,
vfs_stdquotactl,
portal_statfs,
portal_sync,
portal_vget,
portal_fhtovp,
portal_vptofh,
portal_init,
vfs_stdsync,
vfs_stdvget,
vfs_stdfhtovp,
vfs_stdvptofh,
vfs_stdinit,
};
VFS_SET(portal_vfsops, portal, VFCF_SYNTHETIC);

View File

@ -52,10 +52,8 @@
#include <sys/vnode.h>
#include <miscfs/procfs/procfs.h>
static int procfs_init __P((struct vfsconf *vfsp));
static int procfs_mount __P((struct mount *mp, char *path, caddr_t data,
struct nameidata *ndp, struct proc *p));
static int procfs_start __P((struct mount *mp, int flags, struct proc *p));
static int procfs_statfs __P((struct mount *mp, struct statfs *sbp,
struct proc *p));
static int procfs_unmount __P((struct mount *mp, int mntflags,
@ -135,17 +133,6 @@ procfs_root(mp, vpp)
return (procfs_allocvp(mp, vpp, 0, Proot));
}
/* ARGSUSED */
static int
procfs_start(mp, flags, p)
struct mount *mp;
int flags;
struct proc *p;
{
return (0);
}
/*
* Get file system statistics.
*/
@ -173,38 +160,18 @@ procfs_statfs(mp, sbp, p)
return (0);
}
static int
procfs_init(vfsp)
struct vfsconf *vfsp;
{
return (0);
}
#define procfs_fhtovp ((int (*) __P((struct mount *, struct fid *, \
struct sockaddr *, struct vnode **, int *, struct ucred **)))einval)
#define procfs_quotactl ((int (*) __P((struct mount *, int, uid_t, caddr_t, \
struct proc *)))eopnotsupp)
#define procfs_sync ((int (*) __P((struct mount *, int, struct ucred *, \
struct proc *)))nullop)
#define procfs_sysctl ((int (*) __P((int *, u_int, void *, size_t *, void *, \
size_t, struct proc *)))eopnotsupp)
#define procfs_vget ((int (*) __P((struct mount *, ino_t, struct vnode **))) \
eopnotsupp)
#define procfs_vptofh ((int (*) __P((struct vnode *, struct fid *)))einval)
static struct vfsops procfs_vfsops = {
procfs_mount,
procfs_start,
vfs_stdstart,
procfs_unmount,
procfs_root,
procfs_quotactl,
vfs_stdquotactl,
procfs_statfs,
procfs_sync,
procfs_vget,
procfs_fhtovp,
procfs_vptofh,
procfs_init,
vfs_stdsync,
vfs_stdvget,
vfs_stdfhtovp,
vfs_stdvptofh,
vfs_stdinit,
};
VFS_SET(procfs_vfsops, procfs, VFCF_SYNTHETIC);

View File

@ -56,25 +56,13 @@
static MALLOC_DEFINE(M_UNIONFSMNT, "UNION mount", "UNION mount structure");
extern int union_init __P((struct vfsconf *));
extern int union_fhtovp __P((struct mount *mp, struct fid *fidp,
struct mbuf *nam, struct vnode **vpp,
int *exflagsp, struct ucred **credanonp));
static int union_mount __P((struct mount *mp, char *path, caddr_t data,
struct nameidata *ndp, struct proc *p));
extern int union_quotactl __P((struct mount *mp, int cmd, uid_t uid,
caddr_t arg, struct proc *p));
static int union_root __P((struct mount *mp, struct vnode **vpp));
static int union_start __P((struct mount *mp, int flags, struct proc *p));
static int union_statfs __P((struct mount *mp, struct statfs *sbp,
struct proc *p));
extern int union_sync __P((struct mount *mp, int waitfor,
struct ucred *cred, struct proc *p));
static int union_unmount __P((struct mount *mp, int mntflags,
struct proc *p));
extern int union_vget __P((struct mount *mp, ino_t ino,
struct vnode **vpp));
extern int union_vptofh __P((struct vnode *vp, struct fid *fhp));
/*
* Mount union filesystem
@ -288,21 +276,6 @@ union_mount(mp, path, data, ndp, p)
return (error);
}
/*
* VFS start. Nothing needed here - the start routine
* on the underlying filesystem(s) will have been called
* when that filesystem was mounted.
*/
static int
union_start(mp, flags, p)
struct mount *mp;
int flags;
struct proc *p;
{
return (0);
}
/*
* Free reference to union layer
*/
@ -521,33 +494,17 @@ union_statfs(mp, sbp, p)
return (0);
}
/*
* XXX - Assumes no data cached at union layer.
*/
#define union_sync ((int (*) __P((struct mount *, int, struct ucred *, \
struct proc *)))nullop)
#define union_fhtovp ((int (*) __P((struct mount *, struct fid *, \
struct sockaddr *, struct vnode **, int *, struct ucred **)))eopnotsupp)
#define union_quotactl ((int (*) __P((struct mount *, int, uid_t, caddr_t, \
struct proc *)))eopnotsupp)
#define union_sysctl ((int (*) __P((int *, u_int, void *, size_t *, void *, \
size_t, struct proc *)))eopnotsupp)
#define union_vget ((int (*) __P((struct mount *, ino_t, struct vnode **))) \
eopnotsupp)
#define union_vptofh ((int (*) __P((struct vnode *, struct fid *)))eopnotsupp)
static struct vfsops union_vfsops = {
union_mount,
union_start,
vfs_stdstart,
union_unmount,
union_root,
union_quotactl,
vfs_stdquotactl,
union_statfs,
union_sync,
union_vget,
union_fhtovp,
union_vptofh,
vfs_stdsync, /* XXX assumes no cached data on union level */
vfs_stdvget,
vfs_stdfhtovp,
vfs_stdvptofh,
union_init,
};

View File

@ -79,17 +79,12 @@ static int msdosfs_fhtovp __P((struct mount *, struct fid *,
struct ucred **));
static int msdosfs_mount __P((struct mount *, char *, caddr_t,
struct nameidata *, struct proc *));
static int msdosfs_quotactl __P((struct mount *, int, uid_t, caddr_t,
struct proc *));
static int msdosfs_root __P((struct mount *, struct vnode **));
static int msdosfs_start __P((struct mount *, int, struct proc *));
static int msdosfs_statfs __P((struct mount *, struct statfs *,
struct proc *));
static int msdosfs_sync __P((struct mount *, int, struct ucred *,
struct proc *));
static int msdosfs_unmount __P((struct mount *, int, struct proc *));
static int msdosfs_vget __P((struct mount *mp, ino_t ino,
struct vnode **vpp));
static int msdosfs_vptofh __P((struct vnode *, struct fid *));
static int
@ -746,16 +741,6 @@ mountmsdosfs(devvp, mp, p, argp)
return (error);
}
static int
msdosfs_start(mp, flags, p)
struct mount *mp;
int flags;
struct proc *p;
{
return (0);
}
/*
* Unmount the filesystem described by mp.
*/
@ -828,17 +813,6 @@ msdosfs_root(mp, vpp)
return (0);
}
static int
msdosfs_quotactl(mp, cmds, uid, arg, p)
struct mount *mp;
int cmds;
uid_t uid;
caddr_t arg;
struct proc *p;
{
return EOPNOTSUPP;
}
static int
msdosfs_statfs(mp, sbp, p)
struct mount *mp;
@ -986,24 +960,15 @@ msdosfs_vptofh(vp, fhp)
return (0);
}
static int
msdosfs_vget(mp, ino, vpp)
struct mount *mp;
ino_t ino;
struct vnode **vpp;
{
return EOPNOTSUPP;
}
static struct vfsops msdosfs_vfsops = {
msdosfs_mount,
msdosfs_start,
vfs_stdstart,
msdosfs_unmount,
msdosfs_root,
msdosfs_quotactl,
vfs_stdquotactl,
msdosfs_statfs,
msdosfs_sync,
msdosfs_vget,
vfs_stdvget,
msdosfs_fhtovp,
msdosfs_vptofh,
msdosfs_init

View File

@ -99,38 +99,28 @@ static int mountnfs __P((struct nfs_args *,struct mount *,
struct sockaddr *,char *,char *,struct vnode **));
static int nfs_mount __P(( struct mount *mp, char *path, caddr_t data,
struct nameidata *ndp, struct proc *p));
static int nfs_start __P(( struct mount *mp, int flags,
struct proc *p));
static int nfs_unmount __P(( struct mount *mp, int mntflags,
struct proc *p));
static int nfs_root __P(( struct mount *mp, struct vnode **vpp));
static int nfs_quotactl __P(( struct mount *mp, int cmds, uid_t uid,
caddr_t arg, struct proc *p));
static int nfs_statfs __P(( struct mount *mp, struct statfs *sbp,
struct proc *p));
static int nfs_sync __P(( struct mount *mp, int waitfor,
struct ucred *cred, struct proc *p));
static int nfs_vptofh __P(( struct vnode *vp, struct fid *fhp));
static int nfs_fhtovp __P((struct mount *mp, struct fid *fhp,
struct sockaddr *nam, struct vnode **vpp,
int *exflagsp, struct ucred **credanonp));
static int nfs_vget __P((struct mount *, ino_t, struct vnode **));
/*
* nfs vfs operations.
*/
static struct vfsops nfs_vfsops = {
nfs_mount,
nfs_start,
vfs_stdstart,
nfs_unmount,
nfs_root,
nfs_quotactl,
vfs_stdquotactl,
nfs_statfs,
nfs_sync,
nfs_vget,
nfs_fhtovp,
nfs_vptofh,
vfs_stdvget,
vfs_stdfhtovp, /* shouldn't happen */
vfs_stdvptofh, /* shouldn't happen */
nfs_init,
nfs_uninit,
};
@ -1078,77 +1068,3 @@ nfs_sync(mp, waitfor, cred, p)
return (allerror);
}
/*
* NFS flat namespace lookup.
* Currently unsupported.
*/
/* ARGSUSED */
static int
nfs_vget(mp, ino, vpp)
struct mount *mp;
ino_t ino;
struct vnode **vpp;
{
return (EOPNOTSUPP);
}
/*
* At this point, this should never happen
*/
/* ARGSUSED */
static int
nfs_fhtovp(mp, fhp, nam, vpp, exflagsp, credanonp)
register struct mount *mp;
struct fid *fhp;
struct sockaddr *nam;
struct vnode **vpp;
int *exflagsp;
struct ucred **credanonp;
{
return (EINVAL);
}
/*
* Vnode pointer to File handle, should never happen either
*/
/* ARGSUSED */
static int
nfs_vptofh(vp, fhp)
struct vnode *vp;
struct fid *fhp;
{
return (EINVAL);
}
/*
* Vfs start routine, a no-op.
*/
/* ARGSUSED */
static int
nfs_start(mp, flags, p)
struct mount *mp;
int flags;
struct proc *p;
{
return (0);
}
/*
* Do operations associated with quotas, not supported
*/
/* ARGSUSED */
static int
nfs_quotactl(mp, cmd, uid, arg, p)
struct mount *mp;
int cmd;
uid_t uid;
caddr_t arg;
struct proc *p;
{
return (EOPNOTSUPP);
}

View File

@ -99,38 +99,28 @@ static int mountnfs __P((struct nfs_args *,struct mount *,
struct sockaddr *,char *,char *,struct vnode **));
static int nfs_mount __P(( struct mount *mp, char *path, caddr_t data,
struct nameidata *ndp, struct proc *p));
static int nfs_start __P(( struct mount *mp, int flags,
struct proc *p));
static int nfs_unmount __P(( struct mount *mp, int mntflags,
struct proc *p));
static int nfs_root __P(( struct mount *mp, struct vnode **vpp));
static int nfs_quotactl __P(( struct mount *mp, int cmds, uid_t uid,
caddr_t arg, struct proc *p));
static int nfs_statfs __P(( struct mount *mp, struct statfs *sbp,
struct proc *p));
static int nfs_sync __P(( struct mount *mp, int waitfor,
struct ucred *cred, struct proc *p));
static int nfs_vptofh __P(( struct vnode *vp, struct fid *fhp));
static int nfs_fhtovp __P((struct mount *mp, struct fid *fhp,
struct sockaddr *nam, struct vnode **vpp,
int *exflagsp, struct ucred **credanonp));
static int nfs_vget __P((struct mount *, ino_t, struct vnode **));
/*
* nfs vfs operations.
*/
static struct vfsops nfs_vfsops = {
nfs_mount,
nfs_start,
vfs_stdstart,
nfs_unmount,
nfs_root,
nfs_quotactl,
vfs_stdquotactl,
nfs_statfs,
nfs_sync,
nfs_vget,
nfs_fhtovp,
nfs_vptofh,
vfs_stdvget,
vfs_stdfhtovp, /* shouldn't happen */
vfs_stdvptofh, /* shouldn't happen */
nfs_init,
nfs_uninit,
};
@ -1078,77 +1068,3 @@ nfs_sync(mp, waitfor, cred, p)
return (allerror);
}
/*
* NFS flat namespace lookup.
* Currently unsupported.
*/
/* ARGSUSED */
static int
nfs_vget(mp, ino, vpp)
struct mount *mp;
ino_t ino;
struct vnode **vpp;
{
return (EOPNOTSUPP);
}
/*
* At this point, this should never happen
*/
/* ARGSUSED */
static int
nfs_fhtovp(mp, fhp, nam, vpp, exflagsp, credanonp)
register struct mount *mp;
struct fid *fhp;
struct sockaddr *nam;
struct vnode **vpp;
int *exflagsp;
struct ucred **credanonp;
{
return (EINVAL);
}
/*
* Vnode pointer to File handle, should never happen either
*/
/* ARGSUSED */
static int
nfs_vptofh(vp, fhp)
struct vnode *vp;
struct fid *fhp;
{
return (EINVAL);
}
/*
* Vfs start routine, a no-op.
*/
/* ARGSUSED */
static int
nfs_start(mp, flags, p)
struct mount *mp;
int flags;
struct proc *p;
{
return (0);
}
/*
* Do operations associated with quotas, not supported
*/
/* ARGSUSED */
static int
nfs_quotactl(mp, cmd, uid, arg, p)
struct mount *mp;
int cmd;
uid_t uid;
caddr_t arg;
struct proc *p;
{
return (EOPNOTSUPP);
}

View File

@ -71,26 +71,31 @@ static int ntfs_mount __P((struct mount *, char *, caddr_t,
static int ntfs_mount __P((struct mount *, const char *, void *,
struct nameidata *, struct proc *));
#endif
static int ntfs_quotactl __P((struct mount *, int, uid_t, caddr_t,
struct proc *));
static int ntfs_root __P((struct mount *, struct vnode **));
static int ntfs_start __P((struct mount *, int, struct proc *));
static int ntfs_statfs __P((struct mount *, struct statfs *,
struct proc *));
static int ntfs_sync __P((struct mount *, int, struct ucred *,
struct proc *));
static int ntfs_unmount __P((struct mount *, int, struct proc *));
static int ntfs_vget __P((struct mount *mp, ino_t ino,
struct vnode **vpp));
static int ntfs_mountfs __P((register struct vnode *, struct mount *,
struct ntfs_args *, struct proc *));
#if !defined(__FreeBSD__)
static int ntfs_quotactl __P((struct mount *, int, uid_t, caddr_t,
struct proc *));
static int ntfs_start __P((struct mount *, int, struct proc *));
static int ntfs_sync __P((struct mount *, int, struct ucred *,
struct proc *));
static int ntfs_vptofh __P((struct vnode *, struct fid *));
#endif /* !defined(__FreeBSD__) */
#if defined(__FreeBSD__)
static int ntfs_init __P((struct vfsconf *));
#if 0 /* may be implemented at a later date */
static int ntfs_fhtovp __P((struct mount *, struct fid *,
struct sockaddr *, struct vnode **,
int *, struct ucred **));
#endif
#elif defined(__NetBSD__)
static void ntfs_init __P((void));
static int ntfs_fhtovp __P((struct mount *, struct fid *,
@ -589,6 +594,7 @@ ntfs_mountfs(devvp, mp, argsp, p)
return (error);
}
#if !defined(__FreeBSD__)
static int
ntfs_start (
struct mount *mp,
@ -597,6 +603,7 @@ ntfs_start (
{
return (0);
}
#endif /* !defined(__FreeBSD__) */
static int
ntfs_unmount(
@ -676,6 +683,7 @@ ntfs_root(
return (0);
}
#if !defined(__FreeBSD__)
static int
ntfs_quotactl (
struct mount *mp,
@ -687,6 +695,7 @@ ntfs_quotactl (
printf("\nntfs_quotactl():\n");
return EOPNOTSUPP;
}
#endif /* !defined(__FreeBSD__) */
int
ntfs_calccfree(
@ -762,6 +771,7 @@ ntfs_statfs(
return (0);
}
#if !defined(__FreeBSD__)
static int
ntfs_sync (
struct mount *mp,
@ -772,7 +782,9 @@ ntfs_sync (
/*dprintf(("ntfs_sync():\n"));*/
return (0);
}
#endif /* !defined(__FreeBSD__) */
#if !defined(__FreeBSD__)
/*ARGSUSED*/
static int
ntfs_fhtovp(
@ -808,6 +820,7 @@ ntfs_vptofh(
printf("ntfs_vptofh():\n");
return EOPNOTSUPP;
}
#endif /* !defined(__FreeBSD__) */
int
ntfs_vgetex(
@ -931,15 +944,15 @@ ntfs_vget(
#if defined(__FreeBSD__)
static struct vfsops ntfs_vfsops = {
ntfs_mount,
ntfs_start,
vfs_stdstart,
ntfs_unmount,
ntfs_root,
ntfs_quotactl,
vfs_stdquotactl,
ntfs_statfs,
ntfs_sync,
vfs_stdsync,
ntfs_vget,
ntfs_fhtovp,
ntfs_vptofh,
vfs_stdfhtovp,
vfs_stdvptofh,
ntfs_init,
NULL
};

View File

@ -393,6 +393,28 @@ extern CIRCLEQ_HEAD(mntlist, mount) mountlist; /* mounted filesystem list */
extern struct simplelock mountlist_slock;
extern struct nfs_public nfs_pub;
/*
* Declarations for these vfs default operations are located in
* kern/vfs_default.c, they should be used instead of making "dummy"
* functions or casting entries in the VFS op table to "enopnotsupp()".
*/
int vfs_stdmount __P((struct mount *mp, char *path, caddr_t data,
struct nameidata *ndp, struct proc *p));
int vfs_stdstart __P((struct mount *mp, int flags, struct proc *p));
int vfs_stdunmount __P((struct mount *mp, int mntflags, struct proc *p));
int vfs_stdroot __P((struct mount *mp, struct vnode **vpp));
int vfs_stdquotactl __P((struct mount *mp, int cmds, uid_t uid,
caddr_t arg, struct proc *p));
int vfs_stdstatfs __P((struct mount *mp, struct statfs *sbp, struct proc *p));
int vfs_stdsync __P((struct mount *mp, int waitfor, struct ucred *cred,
struct proc *p));
int vfs_stdvget __P((struct mount *mp, ino_t ino, struct vnode **vpp));
int vfs_stdfhtovp __P((struct mount *mp, struct fid *fhp, struct sockaddr *nam,
struct vnode **vpp, int *exflagsp, struct ucred **credanonp));
int vfs_stdvptofh __P((struct vnode *vp, struct fid *fhp));
int vfs_stdinit __P((struct vfsconf *));
int vfs_stduninit __P((struct vfsconf *));
#else /* !KERNEL */
#include <sys/cdefs.h>