Added a dummy lookup vop. Specfs was broken by removing its dummy

lookup vop so that it defaulted to using vop_eopnotsupp for strange
lookups like the ones for open("/dev/null/", ...) and stat("/dev/null/",
...).  This mainly caused the wrong errno to be returned by vfs syscalls
(EOPNOTSUPP is not in POSIX, and is not documented in connection with
specfs in open.2 and is not documented in stat.2 at all).  Also, lookup
vops are apparently required to set *ap->a_vpp to NULL on error, but
vop_eopnotsupp is too broken to do this.
This commit is contained in:
bde 2001-02-18 02:22:58 +00:00
parent 29bd08f30d
commit f50b2608fd

View File

@ -65,7 +65,8 @@
#include <vm/vnode_pager.h>
#include <vm/vm_zone.h>
static int vop_nostrategy __P((struct vop_strategy_args *));
static int vop_nolookup __P((struct vop_lookup_args *));
static int vop_nostrategy __P((struct vop_strategy_args *));
/*
* This vnode table stores what we want to do if the filesystem doesn't
@ -90,6 +91,7 @@ static struct vnodeopv_entry_desc default_vnodeop_entries[] = {
{ &vop_islocked_desc, (vop_t *) vop_noislocked },
{ &vop_lease_desc, (vop_t *) vop_null },
{ &vop_lock_desc, (vop_t *) vop_nolock },
{ &vop_lookup_desc, (vop_t *) vop_nolookup },
{ &vop_open_desc, (vop_t *) vop_null },
{ &vop_pathconf_desc, (vop_t *) vop_einval },
{ &vop_poll_desc, (vop_t *) vop_nopoll },
@ -154,9 +156,20 @@ int
vop_panic(struct vop_generic_args *ap)
{
printf("vop_panic[%s]\n", ap->a_desc->vdesc_name);
panic("Filesystem goof");
return (0);
panic("filesystem goof: vop_panic[%s]", ap->a_desc->vdesc_name);
}
static int
vop_nolookup(ap)
struct vop_lookup_args /* {
struct vnode *a_dvp;
struct vnode **a_vpp;
struct componentname *a_cnp;
} */ *ap;
{
*ap->a_vpp = NULL;
return (ENOTDIR);
}
/*