diff options
author | alfred <alfred@FreeBSD.org> | 1999-09-07 22:42:38 +0000 |
---|---|---|
committer | alfred <alfred@FreeBSD.org> | 1999-09-07 22:42:38 +0000 |
commit | e16a3900a7835b58a16e19a58511db912f1081f8 (patch) | |
tree | f6801d0b7edc902d94f170cf5d4a357c90e1fdb6 /sys/fs | |
parent | 16f9b4552c757be79df4ea6fa44b8be88902894b (diff) | |
download | FreeBSD-src-e16a3900a7835b58a16e19a58511db912f1081f8.zip FreeBSD-src-e16a3900a7835b58a16e19a58511db912f1081f8.tar.gz |
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>
Diffstat (limited to 'sys/fs')
-rw-r--r-- | sys/fs/cd9660/cd9660_vfsops.c | 54 | ||||
-rw-r--r-- | sys/fs/coda/coda_vfsops.c | 62 | ||||
-rw-r--r-- | sys/fs/fdescfs/fdesc_vfsops.c | 45 | ||||
-rw-r--r-- | sys/fs/msdosfs/msdosfs_vfsops.c | 41 | ||||
-rw-r--r-- | sys/fs/ntfs/ntfs_vfsops.c | 33 | ||||
-rw-r--r-- | sys/fs/portalfs/portal_vfsops.c | 46 | ||||
-rw-r--r-- | sys/fs/procfs/procfs_vfsops.c | 47 | ||||
-rw-r--r-- | sys/fs/unionfs/union_vfsops.c | 55 |
8 files changed, 62 insertions, 321 deletions
diff --git a/sys/fs/cd9660/cd9660_vfsops.c b/sys/fs/cd9660/cd9660_vfsops.c index 05615c3..f81cb14 100644 --- a/sys/fs/cd9660/cd9660_vfsops.c +++ b/sys/fs/cd9660/cd9660_vfsops.c @@ -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); @@ -524,20 +519,6 @@ out: } /* - * 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 */ static int @@ -593,22 +574,6 @@ cd9660_root(mp, vpp) } /* - * 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. */ int @@ -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 * diff --git a/sys/fs/coda/coda_vfsops.c b/sys/fs/coda/coda_vfsops.c index 35959df..489ce06 100644 --- a/sys/fs/coda/coda_vfsops.c +++ b/sys/fs/coda/coda_vfsops.c @@ -231,16 +231,6 @@ coda_mount(vfsp, path, data, ndp, p) } 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; int mntflags; @@ -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); diff --git a/sys/fs/fdescfs/fdesc_vfsops.c b/sys/fs/fdescfs/fdesc_vfsops.c index 157454c..97231a4 100644 --- a/sys/fs/fdescfs/fdesc_vfsops.c +++ b/sys/fs/fdescfs/fdesc_vfsops.c @@ -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) @@ -110,15 +107,6 @@ fdesc_mount(mp, path, data, ndp, p) } 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; int mntflags; @@ -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, }; diff --git a/sys/fs/msdosfs/msdosfs_vfsops.c b/sys/fs/msdosfs/msdosfs_vfsops.c index 92f0084..e8695b8 100644 --- a/sys/fs/msdosfs/msdosfs_vfsops.c +++ b/sys/fs/msdosfs/msdosfs_vfsops.c @@ -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 @@ error_exit: 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. */ @@ -829,17 +814,6 @@ msdosfs_root(mp, vpp) } 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; struct statfs *sbp; @@ -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 diff --git a/sys/fs/ntfs/ntfs_vfsops.c b/sys/fs/ntfs/ntfs_vfsops.c index 207cd77..4106fc3 100644 --- a/sys/fs/ntfs/ntfs_vfsops.c +++ b/sys/fs/ntfs/ntfs_vfsops.c @@ -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 @@ out: 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 }; diff --git a/sys/fs/portalfs/portal_vfsops.c b/sys/fs/portalfs/portal_vfsops.c index d447664..bdb172b 100644 --- a/sys/fs/portalfs/portal_vfsops.c +++ b/sys/fs/portalfs/portal_vfsops.c @@ -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) */ @@ -156,16 +146,6 @@ portal_mount(mp, path, data, ndp, p) } 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; int mntflags; @@ -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); diff --git a/sys/fs/procfs/procfs_vfsops.c b/sys/fs/procfs/procfs_vfsops.c index 0478e38..92245b8 100644 --- a/sys/fs/procfs/procfs_vfsops.c +++ b/sys/fs/procfs/procfs_vfsops.c @@ -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); diff --git a/sys/fs/unionfs/union_vfsops.c b/sys/fs/unionfs/union_vfsops.c index 888ad30..def8416 100644 --- a/sys/fs/unionfs/union_vfsops.c +++ b/sys/fs/unionfs/union_vfsops.c @@ -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 @@ -289,21 +277,6 @@ bad: } /* - * 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 */ static int @@ -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, }; |