diff options
author | Poul-Henning Kamp <phk@FreeBSD.org> | 1997-10-16 20:32:40 +0000 |
---|---|---|
committer | Poul-Henning Kamp <phk@FreeBSD.org> | 1997-10-16 20:32:40 +0000 |
commit | 987f56967882129aef9aa431bee66fae50394ea5 (patch) | |
tree | bd4881b4840207110060b4087cc9cb78c43ac63a /sys/kern | |
parent | 2df896458d4a9759c04f59315a790f9807f4c95b (diff) | |
download | src-987f56967882129aef9aa431bee66fae50394ea5.tar.gz src-987f56967882129aef9aa431bee66fae50394ea5.zip |
Another VFS cleanup "kilo commit"
1. Remove VOP_UPDATE, it is (also) an UFS/{FFS,LFS,EXT2FS,MFS}
intereface function, and now lives in the ufsmount structure.
2. Remove VOP_SEEK, it was unused.
3. Add mode default vops:
VOP_ADVLOCK vop_einval
VOP_CLOSE vop_null
VOP_FSYNC vop_null
VOP_IOCTL vop_enotty
VOP_MMAP vop_einval
VOP_OPEN vop_null
VOP_PATHCONF vop_einval
VOP_READLINK vop_einval
VOP_REALLOCBLKS vop_eopnotsupp
And remove identical functionality from filesystems
4. Add vop_stdpathconf, which returns the canonical stuff. Use
it in the filesystems. (XXX: It's probably wrong that specfs
and fifofs sets this vop, shouldn't it come from the "host"
filesystem, for instance ufs or cd9660 ?)
5. Try to make system wide VOP functions have vop_* names.
6. Initialize the um_* vectors in LFS.
(Recompile your LKMS!!!)
Notes
Notes:
svn path=/head/; revision=30492
Diffstat (limited to 'sys/kern')
-rw-r--r-- | sys/kern/vfs_default.c | 82 | ||||
-rw-r--r-- | sys/kern/vnode_if.src | 23 |
2 files changed, 77 insertions, 28 deletions
diff --git a/sys/kern/vfs_default.c b/sys/kern/vfs_default.c index 0c1f2a6b1868..8583b55cb6d0 100644 --- a/sys/kern/vfs_default.c +++ b/sys/kern/vfs_default.c @@ -41,9 +41,9 @@ #include <sys/systm.h> #include <sys/kernel.h> #include <sys/mount.h> +#include <sys/unistd.h> #include <sys/vnode.h> -int vop_notsupp __P((struct vop_generic_args *ap)); static int vop_nostrategy __P((struct vop_strategy_args *)); /* @@ -56,11 +56,20 @@ static int vop_nostrategy __P((struct vop_strategy_args *)); vop_t **default_vnodeop_p; static struct vnodeopv_entry_desc default_vnodeop_entries[] = { - { &vop_default_desc, (vop_t *) vop_notsupp }, + { &vop_default_desc, (vop_t *) vop_eopnotsupp }, { &vop_abortop_desc, (vop_t *) nullop }, + { &vop_advlock_desc, (vop_t *) vop_einval }, { &vop_bwrite_desc, (vop_t *) vn_bwrite }, + { &vop_close_desc, (vop_t *) vop_null }, + { &vop_fsync_desc, (vop_t *) vop_null }, + { &vop_ioctl_desc, (vop_t *) vop_enotty }, { &vop_lease_desc, (vop_t *) lease_check }, + { &vop_mmap_desc, (vop_t *) vop_einval }, + { &vop_open_desc, (vop_t *) vop_null }, + { &vop_pathconf_desc, (vop_t *) vop_einval }, { &vop_poll_desc, (vop_t *) vop_nopoll }, + { &vop_readlink_desc, (vop_t *) vop_einval }, + { &vop_reallocblks_desc, (vop_t *) vop_eopnotsupp }, { &vop_revoke_desc, (vop_t *) vop_revoke }, { &vop_strategy_desc, (vop_t *) vop_nostrategy }, { NULL, NULL } @@ -72,22 +81,49 @@ static struct vnodeopv_desc default_vnodeop_opv_desc = VNODEOP_SET(default_vnodeop_opv_desc); int -vop_notsupp(struct vop_generic_args *ap) +vop_eopnotsupp(struct vop_generic_args *ap) { /* - printf("vn_notsupp[%s]\n", ap->a_desc->vdesc_name); + printf("vop_notsupp[%s]\n", ap->a_desc->vdesc_name); */ return (EOPNOTSUPP); } int -vn_defaultop(struct vop_generic_args *ap) +vop_ebadf(struct vop_generic_args *ap) { - return (VOCALL(default_vnodeop_p, ap->a_desc->vdesc_offset, ap)); + return (EBADF); +} + +int +vop_enotty(struct vop_generic_args *ap) +{ + + return (ENOTTY); +} + +int +vop_einval(struct vop_generic_args *ap) +{ + + return (EINVAL); +} + +int +vop_null(struct vop_generic_args *ap) +{ + + return (0); } +int +vop_defaultop(struct vop_generic_args *ap) +{ + + return (VOCALL(default_vnodeop_p, ap->a_desc->vdesc_offset, ap)); +} static int vop_nostrategy (struct vop_strategy_args *ap) @@ -99,3 +135,37 @@ vop_nostrategy (struct vop_strategy_args *ap) biodone(ap->a_bp); return (EOPNOTSUPP); } + +int +vop_stdpathconf(ap) + struct vop_pathconf_args /* { + struct vnode *a_vp; + int a_name; + int *a_retval; + } */ *ap; +{ + + switch (ap->a_name) { + case _PC_LINK_MAX: + *ap->a_retval = LINK_MAX; + return (0); + case _PC_MAX_CANON: + *ap->a_retval = MAX_CANON; + return (0); + case _PC_MAX_INPUT: + *ap->a_retval = MAX_INPUT; + return (0); + case _PC_PIPE_BUF: + *ap->a_retval = PIPE_BUF; + return (0); + case _PC_CHOWN_RESTRICTED: + *ap->a_retval = 1; + return (0); + case _PC_VDISABLE: + *ap->a_retval = _POSIX_VDISABLE; + return (0); + default: + return (EINVAL); + } + /* NOTREACHED */ +} diff --git a/sys/kern/vnode_if.src b/sys/kern/vnode_if.src index c91c9f34756c..bedf27422475 100644 --- a/sys/kern/vnode_if.src +++ b/sys/kern/vnode_if.src @@ -31,7 +31,7 @@ # SUCH DAMAGE. # # @(#)vnode_if.src 8.12 (Berkeley) 5/14/95 -# $Id: vnode_if.src,v 1.13 1997/09/14 02:35:25 peter Exp $ +# $Id: vnode_if.src,v 1.14 1997/10/16 10:48:00 phk Exp $ # # @@ -240,17 +240,6 @@ vop_fsync { }; # -# XXX - not used -# Needs work: Is newoff right? What's it mean? -# -vop_seek { - IN struct vnode *vp; - IN off_t oldoff; - IN off_t newoff; - IN struct ucred *cred; -}; - -# #% remove dvp L U U #% remove vp L U U # @@ -447,16 +436,6 @@ vop_reallocblks { IN struct cluster_save *buflist; }; -# -#% update vp L L L -# -vop_update { - IN struct vnode *vp; - IN struct timeval *access; - IN struct timeval *modify; - IN int waitfor; -}; - vop_getpages { IN struct vnode *vp; IN vm_page_t *m; |