mirror of
https://git.FreeBSD.org/src.git
synced 2024-12-14 10:09:48 +00:00
Remove support for accessing device nodes in UFS/FFS.
Device nodes can still be created and exported with NFS.
This commit is contained in:
parent
19fa21aa50
commit
4f116178ba
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=135877
@ -90,7 +90,6 @@ vfs_vget_t ffs_vget;
|
||||
vfs_vptofh_t ffs_vptofh;
|
||||
|
||||
extern vop_t **ffs_vnodeop_p;
|
||||
extern vop_t **ffs_specop_p;
|
||||
extern vop_t **ffs_fifoop_p;
|
||||
|
||||
/*
|
||||
|
@ -1304,7 +1304,7 @@ ffs_vget(mp, ino, flags, vpp)
|
||||
* Initialize the vnode from the inode, check for aliases.
|
||||
* Note that the underlying vnode may have changed.
|
||||
*/
|
||||
error = ufs_vinit(mp, ffs_specop_p, ffs_fifoop_p, &vp);
|
||||
error = ufs_vinit(mp, ffs_fifoop_p, &vp);
|
||||
if (error) {
|
||||
vput(vp);
|
||||
*vpp = NULL;
|
||||
|
@ -116,23 +116,6 @@ static struct vnodeopv_entry_desc ffs_vnodeop_entries[] = {
|
||||
static struct vnodeopv_desc ffs_vnodeop_opv_desc =
|
||||
{ &ffs_vnodeop_p, ffs_vnodeop_entries };
|
||||
|
||||
vop_t **ffs_specop_p;
|
||||
static struct vnodeopv_entry_desc ffs_specop_entries[] = {
|
||||
{ &vop_default_desc, (vop_t *) ufs_vnoperatespec },
|
||||
{ &vop_fsync_desc, (vop_t *) ffs_fsync },
|
||||
{ &vop_reallocblks_desc, (vop_t *) ffs_reallocblks },
|
||||
{ &vop_strategy_desc, (vop_t *) ffsext_strategy },
|
||||
{ &vop_closeextattr_desc, (vop_t *) ffs_closeextattr },
|
||||
{ &vop_deleteextattr_desc, (vop_t *) ffs_deleteextattr },
|
||||
{ &vop_getextattr_desc, (vop_t *) ffs_getextattr },
|
||||
{ &vop_listextattr_desc, (vop_t *) ffs_listextattr },
|
||||
{ &vop_openextattr_desc, (vop_t *) ffs_openextattr },
|
||||
{ &vop_setextattr_desc, (vop_t *) ffs_setextattr },
|
||||
{ NULL, NULL }
|
||||
};
|
||||
static struct vnodeopv_desc ffs_specop_opv_desc =
|
||||
{ &ffs_specop_p, ffs_specop_entries };
|
||||
|
||||
vop_t **ffs_fifoop_p;
|
||||
static struct vnodeopv_entry_desc ffs_fifoop_entries[] = {
|
||||
{ &vop_default_desc, (vop_t *) ufs_vnoperatefifo },
|
||||
@ -151,7 +134,6 @@ static struct vnodeopv_desc ffs_fifoop_opv_desc =
|
||||
{ &ffs_fifoop_p, ffs_fifoop_entries };
|
||||
|
||||
VNODEOP_SET(ffs_vnodeop_opv_desc);
|
||||
VNODEOP_SET(ffs_specop_opv_desc);
|
||||
VNODEOP_SET(ffs_fifoop_opv_desc);
|
||||
|
||||
/*
|
||||
@ -1241,7 +1223,7 @@ struct vop_strategy_args {
|
||||
return (ufs_vnoperate((struct vop_generic_args *)ap));
|
||||
if (vp->v_type == VFIFO)
|
||||
return (ufs_vnoperatefifo((struct vop_generic_args *)ap));
|
||||
return (ufs_vnoperatespec((struct vop_generic_args *)ap));
|
||||
panic("spec nodes went here");
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -53,7 +53,6 @@ struct vop_reclaim_args;
|
||||
|
||||
int ufs_vnoperate(struct vop_generic_args *);
|
||||
int ufs_vnoperatefifo(struct vop_generic_args *);
|
||||
int ufs_vnoperatespec(struct vop_generic_args *);
|
||||
|
||||
int ufs_bmap(struct vop_bmap_args *);
|
||||
int ufs_bmaparray(struct vnode *, ufs2_daddr_t, ufs2_daddr_t *,
|
||||
@ -89,7 +88,7 @@ void ffs_snapgone(struct inode *);
|
||||
vfs_root_t ufs_root;
|
||||
vfs_start_t ufs_start;
|
||||
int ufs_uninit(struct vfsconf *);
|
||||
int ufs_vinit(struct mount *, vop_t **, vop_t **, struct vnode **);
|
||||
int ufs_vinit(struct mount *, vop_t **, struct vnode **);
|
||||
|
||||
/*
|
||||
* Soft update function prototypes.
|
||||
|
@ -108,9 +108,6 @@ static int ufsfifo_close(struct vop_close_args *);
|
||||
static int ufsfifo_kqfilter(struct vop_kqfilter_args *);
|
||||
static int ufsfifo_read(struct vop_read_args *);
|
||||
static int ufsfifo_write(struct vop_write_args *);
|
||||
static int ufsspec_close(struct vop_close_args *);
|
||||
static int ufsspec_read(struct vop_read_args *);
|
||||
static int ufsspec_write(struct vop_write_args *);
|
||||
static int filt_ufsread(struct knote *kn, long hint);
|
||||
static int filt_ufswrite(struct knote *kn, long hint);
|
||||
static int filt_ufsvnode(struct knote *kn, long hint);
|
||||
@ -251,6 +248,9 @@ ufs_open(ap)
|
||||
} */ *ap;
|
||||
{
|
||||
|
||||
if (ap->a_vp->v_type == VCHR || ap->a_vp->v_type == VBLK)
|
||||
return (EOPNOTSUPP);
|
||||
|
||||
/*
|
||||
* Files marked append-only must be opened for appending.
|
||||
*/
|
||||
@ -2002,83 +2002,6 @@ ufs_print(ap)
|
||||
return (0);
|
||||
}
|
||||
|
||||
/*
|
||||
* Read wrapper for special devices.
|
||||
*/
|
||||
static int
|
||||
ufsspec_read(ap)
|
||||
struct vop_read_args /* {
|
||||
struct vnode *a_vp;
|
||||
struct uio *a_uio;
|
||||
int a_ioflag;
|
||||
struct ucred *a_cred;
|
||||
} */ *ap;
|
||||
{
|
||||
int error, resid;
|
||||
struct inode *ip;
|
||||
struct uio *uio;
|
||||
|
||||
uio = ap->a_uio;
|
||||
resid = uio->uio_resid;
|
||||
error = VOCALL(spec_vnodeop_p, VOFFSET(vop_read), ap);
|
||||
/*
|
||||
* The inode may have been revoked during the call, so it must not
|
||||
* be accessed blindly here or in the other wrapper functions.
|
||||
*/
|
||||
ip = VTOI(ap->a_vp);
|
||||
if (ip != NULL && (uio->uio_resid != resid || (error == 0 && resid != 0)))
|
||||
ip->i_flag |= IN_ACCESS;
|
||||
return (error);
|
||||
}
|
||||
|
||||
/*
|
||||
* Write wrapper for special devices.
|
||||
*/
|
||||
static int
|
||||
ufsspec_write(ap)
|
||||
struct vop_write_args /* {
|
||||
struct vnode *a_vp;
|
||||
struct uio *a_uio;
|
||||
int a_ioflag;
|
||||
struct ucred *a_cred;
|
||||
} */ *ap;
|
||||
{
|
||||
int error, resid;
|
||||
struct inode *ip;
|
||||
struct uio *uio;
|
||||
|
||||
uio = ap->a_uio;
|
||||
resid = uio->uio_resid;
|
||||
error = VOCALL(spec_vnodeop_p, VOFFSET(vop_write), ap);
|
||||
ip = VTOI(ap->a_vp);
|
||||
if (ip != NULL && (uio->uio_resid != resid || (error == 0 && resid != 0)))
|
||||
VTOI(ap->a_vp)->i_flag |= IN_CHANGE | IN_UPDATE;
|
||||
return (error);
|
||||
}
|
||||
|
||||
/*
|
||||
* Close wrapper for special devices.
|
||||
*
|
||||
* Update the times on the inode then do device close.
|
||||
*/
|
||||
static int
|
||||
ufsspec_close(ap)
|
||||
struct vop_close_args /* {
|
||||
struct vnode *a_vp;
|
||||
int a_fflag;
|
||||
struct ucred *a_cred;
|
||||
struct thread *a_td;
|
||||
} */ *ap;
|
||||
{
|
||||
struct vnode *vp = ap->a_vp;
|
||||
|
||||
VI_LOCK(vp);
|
||||
if (vp->v_usecount > 1)
|
||||
ufs_itimes(vp);
|
||||
VI_UNLOCK(vp);
|
||||
return (VOCALL(spec_vnodeop_p, VOFFSET(vop_close), ap));
|
||||
}
|
||||
|
||||
/*
|
||||
* Read wrapper for fifos.
|
||||
*/
|
||||
@ -2296,9 +2219,8 @@ ufs_advlock(ap)
|
||||
* vnodes.
|
||||
*/
|
||||
int
|
||||
ufs_vinit(mntp, specops, fifoops, vpp)
|
||||
ufs_vinit(mntp, fifoops, vpp)
|
||||
struct mount *mntp;
|
||||
vop_t **specops;
|
||||
vop_t **fifoops;
|
||||
struct vnode **vpp;
|
||||
{
|
||||
@ -2308,11 +2230,6 @@ ufs_vinit(mntp, specops, fifoops, vpp)
|
||||
vp = *vpp;
|
||||
ip = VTOI(vp);
|
||||
switch(vp->v_type = IFTOVT(ip->i_mode)) {
|
||||
case VCHR:
|
||||
case VBLK:
|
||||
vp->v_op = specops;
|
||||
vp = addaliasu(vp, DIP(ip, i_rdev));
|
||||
ip->i_vnode = vp;
|
||||
break;
|
||||
case VFIFO:
|
||||
vp->v_op = fifoops;
|
||||
@ -2717,37 +2634,6 @@ static struct vnodeopv_entry_desc ufs_vnodeop_entries[] = {
|
||||
static struct vnodeopv_desc ufs_vnodeop_opv_desc =
|
||||
{ &ufs_vnodeop_p, ufs_vnodeop_entries };
|
||||
|
||||
static vop_t **ufs_specop_p;
|
||||
static struct vnodeopv_entry_desc ufs_specop_entries[] = {
|
||||
{ &vop_default_desc, (vop_t *) spec_vnoperate },
|
||||
{ &vop_fsync_desc, (vop_t *) vop_panic },
|
||||
{ &vop_access_desc, (vop_t *) ufs_access },
|
||||
{ &vop_close_desc, (vop_t *) ufsspec_close },
|
||||
{ &vop_getattr_desc, (vop_t *) ufs_getattr },
|
||||
{ &vop_inactive_desc, (vop_t *) ufs_inactive },
|
||||
{ &vop_print_desc, (vop_t *) ufs_print },
|
||||
{ &vop_read_desc, (vop_t *) ufsspec_read },
|
||||
{ &vop_reclaim_desc, (vop_t *) ufs_reclaim },
|
||||
{ &vop_setattr_desc, (vop_t *) ufs_setattr },
|
||||
#ifdef MAC
|
||||
{ &vop_setlabel_desc, (vop_t *) vop_stdsetlabel_ea },
|
||||
#endif
|
||||
{ &vop_write_desc, (vop_t *) ufsspec_write },
|
||||
#ifdef UFS_EXTATTR
|
||||
{ &vop_getextattr_desc, (vop_t *) ufs_getextattr },
|
||||
{ &vop_deleteextattr_desc, (vop_t *) ufs_deleteextattr },
|
||||
{ &vop_setextattr_desc, (vop_t *) ufs_setextattr },
|
||||
#endif
|
||||
#ifdef UFS_ACL
|
||||
{ &vop_getacl_desc, (vop_t *) ufs_getacl },
|
||||
{ &vop_setacl_desc, (vop_t *) ufs_setacl },
|
||||
{ &vop_aclcheck_desc, (vop_t *) ufs_aclcheck },
|
||||
#endif
|
||||
{NULL, NULL}
|
||||
};
|
||||
static struct vnodeopv_desc ufs_specop_opv_desc =
|
||||
{ &ufs_specop_p, ufs_specop_entries };
|
||||
|
||||
static vop_t **ufs_fifoop_p;
|
||||
static struct vnodeopv_entry_desc ufs_fifoop_entries[] = {
|
||||
{ &vop_default_desc, (vop_t *) fifo_vnoperate },
|
||||
@ -2781,7 +2667,6 @@ static struct vnodeopv_desc ufs_fifoop_opv_desc =
|
||||
{ &ufs_fifoop_p, ufs_fifoop_entries };
|
||||
|
||||
VNODEOP_SET(ufs_vnodeop_opv_desc);
|
||||
VNODEOP_SET(ufs_specop_opv_desc);
|
||||
VNODEOP_SET(ufs_fifoop_opv_desc);
|
||||
|
||||
int
|
||||
@ -2801,12 +2686,3 @@ ufs_vnoperatefifo(ap)
|
||||
{
|
||||
return (VOCALL(ufs_fifoop_p, ap->a_desc->vdesc_offset, ap));
|
||||
}
|
||||
|
||||
int
|
||||
ufs_vnoperatespec(ap)
|
||||
struct vop_generic_args /* {
|
||||
struct vnodeop_desc *a_desc;
|
||||
} */ *ap;
|
||||
{
|
||||
return (VOCALL(ufs_specop_p, ap->a_desc->vdesc_offset, ap));
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user