fifo_vnops.c (30496) | fifo_vnops.c (30743) |
---|---|
1/* 2 * Copyright (c) 1990, 1993, 1995 3 * The Regents of the University of California. All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 17 unchanged lines hidden (view full) --- 26 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 27 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 28 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 29 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 30 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 31 * SUCH DAMAGE. 32 * 33 * @(#)fifo_vnops.c 8.10 (Berkeley) 5/27/95 | 1/* 2 * Copyright (c) 1990, 1993, 1995 3 * The Regents of the University of California. All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 17 unchanged lines hidden (view full) --- 26 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 27 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 28 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 29 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 30 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 31 * SUCH DAMAGE. 32 * 33 * @(#)fifo_vnops.c 8.10 (Berkeley) 5/27/95 |
34 * $Id: fifo_vnops.c,v 1.33 1997/10/16 20:32:26 phk Exp $ | 34 * $Id: fifo_vnops.c,v 1.34 1997/10/16 22:00:12 phk Exp $ |
35 */ 36 37#include <sys/param.h> 38#include <sys/systm.h> 39#include <sys/unistd.h> 40#include <sys/kernel.h> 41#include <sys/malloc.h> 42#include <sys/vnode.h> --- 12 unchanged lines hidden (view full) --- 55 */ 56struct fifoinfo { 57 struct socket *fi_readsock; 58 struct socket *fi_writesock; 59 long fi_readers; 60 long fi_writers; 61}; 62 | 35 */ 36 37#include <sys/param.h> 38#include <sys/systm.h> 39#include <sys/unistd.h> 40#include <sys/kernel.h> 41#include <sys/malloc.h> 42#include <sys/vnode.h> --- 12 unchanged lines hidden (view full) --- 55 */ 56struct fifoinfo { 57 struct socket *fi_readsock; 58 struct socket *fi_writesock; 59 long fi_readers; 60 long fi_writers; 61}; 62 |
63static int fifo_ebadf __P((void)); | |
64static int fifo_badop __P((void)); 65static int fifo_print __P((struct vop_print_args *)); 66static int fifo_lookup __P((struct vop_lookup_args *)); 67static int fifo_open __P((struct vop_open_args *)); 68static int fifo_close __P((struct vop_close_args *)); 69static int fifo_read __P((struct vop_read_args *)); 70static int fifo_write __P((struct vop_write_args *)); 71static int fifo_ioctl __P((struct vop_ioctl_args *)); 72static int fifo_poll __P((struct vop_poll_args *)); 73static int fifo_inactive __P((struct vop_inactive_args *)); 74static int fifo_bmap __P((struct vop_bmap_args *)); 75static int fifo_advlock __P((struct vop_advlock_args *)); 76 77 78vop_t **fifo_vnodeop_p; 79static struct vnodeopv_entry_desc fifo_vnodeop_entries[] = { | 63static int fifo_badop __P((void)); 64static int fifo_print __P((struct vop_print_args *)); 65static int fifo_lookup __P((struct vop_lookup_args *)); 66static int fifo_open __P((struct vop_open_args *)); 67static int fifo_close __P((struct vop_close_args *)); 68static int fifo_read __P((struct vop_read_args *)); 69static int fifo_write __P((struct vop_write_args *)); 70static int fifo_ioctl __P((struct vop_ioctl_args *)); 71static int fifo_poll __P((struct vop_poll_args *)); 72static int fifo_inactive __P((struct vop_inactive_args *)); 73static int fifo_bmap __P((struct vop_bmap_args *)); 74static int fifo_advlock __P((struct vop_advlock_args *)); 75 76 77vop_t **fifo_vnodeop_p; 78static struct vnodeopv_entry_desc fifo_vnodeop_entries[] = { |
80 { &vop_default_desc, (vop_t *) vn_default_error }, | 79 { &vop_default_desc, (vop_t *) vop_defaultop }, |
81 { &vop_abortop_desc, (vop_t *) fifo_badop }, | 80 { &vop_abortop_desc, (vop_t *) fifo_badop }, |
82 { &vop_access_desc, (vop_t *) fifo_ebadf }, | 81 { &vop_access_desc, (vop_t *) vop_ebadf }, |
83 { &vop_advlock_desc, (vop_t *) fifo_advlock }, 84 { &vop_bmap_desc, (vop_t *) fifo_bmap }, 85 { &vop_close_desc, (vop_t *) fifo_close }, 86 { &vop_create_desc, (vop_t *) fifo_badop }, | 82 { &vop_advlock_desc, (vop_t *) fifo_advlock }, 83 { &vop_bmap_desc, (vop_t *) fifo_bmap }, 84 { &vop_close_desc, (vop_t *) fifo_close }, 85 { &vop_create_desc, (vop_t *) fifo_badop }, |
87 { &vop_getattr_desc, (vop_t *) fifo_ebadf }, | 86 { &vop_getattr_desc, (vop_t *) vop_ebadf }, |
88 { &vop_inactive_desc, (vop_t *) fifo_inactive }, 89 { &vop_ioctl_desc, (vop_t *) fifo_ioctl }, | 87 { &vop_inactive_desc, (vop_t *) fifo_inactive }, 88 { &vop_ioctl_desc, (vop_t *) fifo_ioctl }, |
90 { &vop_lease_desc, (vop_t *) nullop }, | 89 { &vop_lease_desc, (vop_t *) vop_null }, |
91 { &vop_link_desc, (vop_t *) fifo_badop }, 92 { &vop_lookup_desc, (vop_t *) fifo_lookup }, 93 { &vop_mkdir_desc, (vop_t *) fifo_badop }, 94 { &vop_mknod_desc, (vop_t *) fifo_badop }, 95 { &vop_open_desc, (vop_t *) fifo_open }, 96 { &vop_pathconf_desc, (vop_t *) vop_stdpathconf }, 97 { &vop_poll_desc, (vop_t *) fifo_poll }, 98 { &vop_print_desc, (vop_t *) fifo_print }, 99 { &vop_read_desc, (vop_t *) fifo_read }, 100 { &vop_readdir_desc, (vop_t *) fifo_badop }, 101 { &vop_readlink_desc, (vop_t *) fifo_badop }, 102 { &vop_reallocblks_desc, (vop_t *) fifo_badop }, | 90 { &vop_link_desc, (vop_t *) fifo_badop }, 91 { &vop_lookup_desc, (vop_t *) fifo_lookup }, 92 { &vop_mkdir_desc, (vop_t *) fifo_badop }, 93 { &vop_mknod_desc, (vop_t *) fifo_badop }, 94 { &vop_open_desc, (vop_t *) fifo_open }, 95 { &vop_pathconf_desc, (vop_t *) vop_stdpathconf }, 96 { &vop_poll_desc, (vop_t *) fifo_poll }, 97 { &vop_print_desc, (vop_t *) fifo_print }, 98 { &vop_read_desc, (vop_t *) fifo_read }, 99 { &vop_readdir_desc, (vop_t *) fifo_badop }, 100 { &vop_readlink_desc, (vop_t *) fifo_badop }, 101 { &vop_reallocblks_desc, (vop_t *) fifo_badop }, |
103 { &vop_reclaim_desc, (vop_t *) nullop }, | 102 { &vop_reclaim_desc, (vop_t *) vop_null }, |
104 { &vop_remove_desc, (vop_t *) fifo_badop }, 105 { &vop_rename_desc, (vop_t *) fifo_badop }, 106 { &vop_rmdir_desc, (vop_t *) fifo_badop }, | 103 { &vop_remove_desc, (vop_t *) fifo_badop }, 104 { &vop_rename_desc, (vop_t *) fifo_badop }, 105 { &vop_rmdir_desc, (vop_t *) fifo_badop }, |
107 { &vop_setattr_desc, (vop_t *) fifo_ebadf }, | 106 { &vop_setattr_desc, (vop_t *) vop_ebadf }, |
108 { &vop_symlink_desc, (vop_t *) fifo_badop }, 109 { &vop_write_desc, (vop_t *) fifo_write }, 110 { NULL, NULL } 111}; 112static struct vnodeopv_desc fifo_vnodeop_opv_desc = 113 { &fifo_vnodeop_p, fifo_vnodeop_entries }; 114 115VNODEOP_SET(fifo_vnodeop_opv_desc); --- 364 unchanged lines hidden (view full) --- 480 481 printf("tag VT_NON"); 482 fifo_printinfo(ap->a_vp); 483 printf("\n"); 484 return (0); 485} 486 487/* | 107 { &vop_symlink_desc, (vop_t *) fifo_badop }, 108 { &vop_write_desc, (vop_t *) fifo_write }, 109 { NULL, NULL } 110}; 111static struct vnodeopv_desc fifo_vnodeop_opv_desc = 112 { &fifo_vnodeop_p, fifo_vnodeop_entries }; 113 114VNODEOP_SET(fifo_vnodeop_opv_desc); --- 364 unchanged lines hidden (view full) --- 479 480 printf("tag VT_NON"); 481 fifo_printinfo(ap->a_vp); 482 printf("\n"); 483 return (0); 484} 485 486/* |
488 * Fifo failed operation 489 */ 490static int 491fifo_ebadf() 492{ 493 494 return (EBADF); 495} 496 497/* | |
498 * Fifo advisory byte-level locks. 499 */ 500/* ARGSUSED */ 501static int 502fifo_advlock(ap) 503 struct vop_advlock_args /* { 504 struct vnode *a_vp; 505 caddr_t a_id; --- 19 unchanged lines hidden --- | 487 * Fifo advisory byte-level locks. 488 */ 489/* ARGSUSED */ 490static int 491fifo_advlock(ap) 492 struct vop_advlock_args /* { 493 struct vnode *a_vp; 494 caddr_t a_id; --- 19 unchanged lines hidden --- |