summaryrefslogtreecommitdiffstats
path: root/sys
diff options
context:
space:
mode:
authorphk <phk@FreeBSD.org>2004-09-28 13:30:58 +0000
committerphk <phk@FreeBSD.org>2004-09-28 13:30:58 +0000
commitfb7e95019ce55e624f1b131f920257870df56f22 (patch)
treea03cecc06c9d33b30646a2d23e70ebd8c98982ca /sys
parentdd7446483c6623723f0f5a0cf4954a72efe3acb5 (diff)
downloadFreeBSD-src-fb7e95019ce55e624f1b131f920257870df56f22.zip
FreeBSD-src-fb7e95019ce55e624f1b131f920257870df56f22.tar.gz
Remove support for accessing device nodes in UFS/FFS.
Device nodes can still be created and exported with NFS.
Diffstat (limited to 'sys')
-rw-r--r--sys/ufs/ffs/ffs_extern.h1
-rw-r--r--sys/ufs/ffs/ffs_vfsops.c2
-rw-r--r--sys/ufs/ffs/ffs_vnops.c20
-rw-r--r--sys/ufs/ufs/ufs_extern.h3
-rw-r--r--sys/ufs/ufs/ufs_vnops.c132
5 files changed, 7 insertions, 151 deletions
diff --git a/sys/ufs/ffs/ffs_extern.h b/sys/ufs/ffs/ffs_extern.h
index 556ad5d..336a264 100644
--- a/sys/ufs/ffs/ffs_extern.h
+++ b/sys/ufs/ffs/ffs_extern.h
@@ -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;
/*
diff --git a/sys/ufs/ffs/ffs_vfsops.c b/sys/ufs/ffs/ffs_vfsops.c
index a8a5937..224dba4 100644
--- a/sys/ufs/ffs/ffs_vfsops.c
+++ b/sys/ufs/ffs/ffs_vfsops.c
@@ -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;
diff --git a/sys/ufs/ffs/ffs_vnops.c b/sys/ufs/ffs/ffs_vnops.c
index 616f9e8..64b2c37 100644
--- a/sys/ufs/ffs/ffs_vnops.c
+++ b/sys/ufs/ffs/ffs_vnops.c
@@ -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");
}
/*
diff --git a/sys/ufs/ufs/ufs_extern.h b/sys/ufs/ufs/ufs_extern.h
index 56b48f2..9ada834 100644
--- a/sys/ufs/ufs/ufs_extern.h
+++ b/sys/ufs/ufs/ufs_extern.h
@@ -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.
diff --git a/sys/ufs/ufs/ufs_vnops.c b/sys/ufs/ufs/ufs_vnops.c
index b09f957..4406999 100644
--- a/sys/ufs/ufs/ufs_vnops.c
+++ b/sys/ufs/ufs/ufs_vnops.c
@@ -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.
*/
@@ -2003,83 +2003,6 @@ ufs_print(ap)
}
/*
- * 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.
*/
static int
@@ -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));
-}
OpenPOWER on IntegriCloud