Eliminate null_open() and use instead null_bypass().

Null_open() was only here to handle MNT_NODEV, but since that does
not affect any filesystems anymore, it could only have any effect
if you nullfs mounted a devfs but didn't want devices to show up.

If you need that, there are easier ways.
This commit is contained in:
Poul-Henning Kamp 2004-11-26 07:18:28 +00:00
parent f0775d7c7a
commit c96c1bebe3

View file

@ -201,7 +201,6 @@ static int null_inactive(struct vop_inactive_args *ap);
static int null_islocked(struct vop_islocked_args *ap);
static int null_lock(struct vop_lock_args *ap);
static int null_lookup(struct vop_lookup_args *ap);
static int null_open(struct vop_open_args *ap);
static int null_print(struct vop_print_args *ap);
static int null_reclaim(struct vop_reclaim_args *ap);
static int null_rename(struct vop_rename_args *ap);
@ -510,28 +509,6 @@ null_access(ap)
return (null_bypass((struct vop_generic_args *)ap));
}
/*
* We must handle open to be able to catch MNT_NODEV and friends.
*/
static int
null_open(ap)
struct vop_open_args /* {
struct vnode *a_vp;
int a_mode;
struct ucred *a_cred;
struct thread *a_td;
} */ *ap;
{
struct vnode *vp = ap->a_vp;
struct vnode *lvp = NULLVPTOLOWERVP(ap->a_vp);
if ((vp->v_mount->mnt_flag & MNT_NODEV) &&
(lvp->v_type == VBLK || lvp->v_type == VCHR))
return ENXIO;
return (null_bypass((struct vop_generic_args *)ap));
}
/*
* We handle this to eliminate null FS to lower FS
* file moving. Don't know why we don't allow this,
@ -895,7 +872,6 @@ static struct vnodeopv_entry_desc null_vnodeop_entries[] = {
{ &vop_islocked_desc, (vop_t *) null_islocked },
{ &vop_lock_desc, (vop_t *) null_lock },
{ &vop_lookup_desc, (vop_t *) null_lookup },
{ &vop_open_desc, (vop_t *) null_open },
{ &vop_print_desc, (vop_t *) null_print },
{ &vop_reclaim_desc, (vop_t *) null_reclaim },
{ &vop_rename_desc, (vop_t *) null_rename },