diff options
author | phk <phk@FreeBSD.org> | 2004-12-14 21:30:45 +0000 |
---|---|---|
committer | phk <phk@FreeBSD.org> | 2004-12-14 21:30:45 +0000 |
commit | d612258e38cf241fba1d286afb4c1888dac92628 (patch) | |
tree | 895ba2ca047da1d751c74e1a7c1e0cc70dc713fc /sys/gnu | |
parent | eab55e158905b42bd76bba4164b30ab5db8d0d86 (diff) | |
download | FreeBSD-src-d612258e38cf241fba1d286afb4c1888dac92628.zip FreeBSD-src-d612258e38cf241fba1d286afb4c1888dac92628.tar.gz |
Implement simpler panics for VOP_{read,write} on fifos.
Diffstat (limited to 'sys/gnu')
-rw-r--r-- | sys/gnu/ext2fs/ext2_vnops.c | 57 | ||||
-rw-r--r-- | sys/gnu/fs/ext2fs/ext2_vnops.c | 57 |
2 files changed, 4 insertions, 110 deletions
diff --git a/sys/gnu/ext2fs/ext2_vnops.c b/sys/gnu/ext2fs/ext2_vnops.c index ebc39d0..f156f8b 100644 --- a/sys/gnu/ext2fs/ext2_vnops.c +++ b/sys/gnu/ext2fs/ext2_vnops.c @@ -108,8 +108,6 @@ static vop_symlink_t ext2_symlink; static vop_write_t ext2_write; static vop_close_t ext2fifo_close; static vop_kqfilter_t ext2fifo_kqfilter; -static vop_read_t ext2fifo_read; -static vop_write_t ext2fifo_write; static int filt_ext2read(struct knote *kn, long hint); static int filt_ext2write(struct knote *kn, long hint); static int filt_ext2vnode(struct knote *kn, long hint); @@ -159,10 +157,10 @@ struct vop_vector ext2_fifoops = { .vop_inactive = ext2_inactive, .vop_kqfilter = ext2fifo_kqfilter, .vop_print = ext2_print, - .vop_read = ext2fifo_read, + .vop_read = VOP_PANIC, .vop_reclaim = ext2_reclaim, .vop_setattr = ext2_setattr, - .vop_write = ext2fifo_write, + .vop_write = VOP_PANIC, }; #include <gnu/ext2fs/ext2_readwrite.c> @@ -1459,57 +1457,6 @@ ext2_print(ap) } /* - * Read wrapper for fifos. - */ -static int -ext2fifo_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 = fifo_specops.vop_read(ap); - ip = VTOI(ap->a_vp); - if ((ap->a_vp->v_mount->mnt_flag & MNT_NOATIME) == 0 && ip != NULL && - (uio->uio_resid != resid || (error == 0 && resid != 0))) - VTOI(ap->a_vp)->i_flag |= IN_ACCESS; - return (error); -} - -/* - * Write wrapper for fifos. - */ -static int -ext2fifo_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 = fifo_specops.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 fifos. * * Update the times on the inode then do device close. diff --git a/sys/gnu/fs/ext2fs/ext2_vnops.c b/sys/gnu/fs/ext2fs/ext2_vnops.c index ebc39d0..f156f8b 100644 --- a/sys/gnu/fs/ext2fs/ext2_vnops.c +++ b/sys/gnu/fs/ext2fs/ext2_vnops.c @@ -108,8 +108,6 @@ static vop_symlink_t ext2_symlink; static vop_write_t ext2_write; static vop_close_t ext2fifo_close; static vop_kqfilter_t ext2fifo_kqfilter; -static vop_read_t ext2fifo_read; -static vop_write_t ext2fifo_write; static int filt_ext2read(struct knote *kn, long hint); static int filt_ext2write(struct knote *kn, long hint); static int filt_ext2vnode(struct knote *kn, long hint); @@ -159,10 +157,10 @@ struct vop_vector ext2_fifoops = { .vop_inactive = ext2_inactive, .vop_kqfilter = ext2fifo_kqfilter, .vop_print = ext2_print, - .vop_read = ext2fifo_read, + .vop_read = VOP_PANIC, .vop_reclaim = ext2_reclaim, .vop_setattr = ext2_setattr, - .vop_write = ext2fifo_write, + .vop_write = VOP_PANIC, }; #include <gnu/ext2fs/ext2_readwrite.c> @@ -1459,57 +1457,6 @@ ext2_print(ap) } /* - * Read wrapper for fifos. - */ -static int -ext2fifo_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 = fifo_specops.vop_read(ap); - ip = VTOI(ap->a_vp); - if ((ap->a_vp->v_mount->mnt_flag & MNT_NOATIME) == 0 && ip != NULL && - (uio->uio_resid != resid || (error == 0 && resid != 0))) - VTOI(ap->a_vp)->i_flag |= IN_ACCESS; - return (error); -} - -/* - * Write wrapper for fifos. - */ -static int -ext2fifo_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 = fifo_specops.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 fifos. * * Update the times on the inode then do device close. |