fdesc_vnops.c (bea0f0be7b942a30cd23ab339491ba9277434ce8) | fdesc_vnops.c (a6aeade2c468577ef67aa9660b6a75b144cecb91) |
---|---|
1/* 2 * Copyright (c) 1992, 1993 3 * The Regents of the University of California. All rights reserved. 4 * 5 * This code is derived from software donated to Berkeley by 6 * Jan-Simon Pendry. 7 * 8 * Redistribution and use in source and binary forms, with or without --- 21 unchanged lines hidden (view full) --- 30 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 31 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 32 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 33 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 34 * SUCH DAMAGE. 35 * 36 * @(#)fdesc_vnops.c 8.9 (Berkeley) 1/21/94 37 * | 1/* 2 * Copyright (c) 1992, 1993 3 * The Regents of the University of California. All rights reserved. 4 * 5 * This code is derived from software donated to Berkeley by 6 * Jan-Simon Pendry. 7 * 8 * Redistribution and use in source and binary forms, with or without --- 21 unchanged lines hidden (view full) --- 30 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 31 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 32 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 33 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 34 * SUCH DAMAGE. 35 * 36 * @(#)fdesc_vnops.c 8.9 (Berkeley) 1/21/94 37 * |
38 * $Id: fdesc_vnops.c,v 1.24 1997/09/02 20:06:09 bde Exp $ | 38 * $Id: fdesc_vnops.c,v 1.25 1997/09/07 05:25:53 bde Exp $ |
39 */ 40 41/* 42 * /dev/fd Filesystem 43 */ 44 45#include <sys/param.h> 46#include <sys/systm.h> --- 45 unchanged lines hidden (view full) --- 92static int fdesc_lookup __P((struct vop_lookup_args *ap)); 93static int fdesc_open __P((struct vop_open_args *ap)); 94static int fdesc_pathconf __P((struct vop_pathconf_args *ap)); 95static int fdesc_print __P((struct vop_print_args *ap)); 96static int fdesc_read __P((struct vop_read_args *ap)); 97static int fdesc_readdir __P((struct vop_readdir_args *ap)); 98static int fdesc_readlink __P((struct vop_readlink_args *ap)); 99static int fdesc_reclaim __P((struct vop_reclaim_args *ap)); | 39 */ 40 41/* 42 * /dev/fd Filesystem 43 */ 44 45#include <sys/param.h> 46#include <sys/systm.h> --- 45 unchanged lines hidden (view full) --- 92static int fdesc_lookup __P((struct vop_lookup_args *ap)); 93static int fdesc_open __P((struct vop_open_args *ap)); 94static int fdesc_pathconf __P((struct vop_pathconf_args *ap)); 95static int fdesc_print __P((struct vop_print_args *ap)); 96static int fdesc_read __P((struct vop_read_args *ap)); 97static int fdesc_readdir __P((struct vop_readdir_args *ap)); 98static int fdesc_readlink __P((struct vop_readlink_args *ap)); 99static int fdesc_reclaim __P((struct vop_reclaim_args *ap)); |
100static int fdesc_select __P((struct vop_select_args *ap)); | 100static int fdesc_poll __P((struct vop_poll_args *ap)); |
101static int fdesc_setattr __P((struct vop_setattr_args *ap)); 102static int fdesc_vfree __P((struct vop_vfree_args *ap)); 103static int fdesc_write __P((struct vop_write_args *ap)); 104 105/* 106 * Initialise cache headers 107 */ 108int --- 660 unchanged lines hidden (view full) --- 769 error = EOPNOTSUPP; 770 break; 771 } 772 773 return (error); 774} 775 776static int | 101static int fdesc_setattr __P((struct vop_setattr_args *ap)); 102static int fdesc_vfree __P((struct vop_vfree_args *ap)); 103static int fdesc_write __P((struct vop_write_args *ap)); 104 105/* 106 * Initialise cache headers 107 */ 108int --- 660 unchanged lines hidden (view full) --- 769 error = EOPNOTSUPP; 770 break; 771 } 772 773 return (error); 774} 775 776static int |
777fdesc_select(ap) 778 struct vop_select_args /* { | 777fdesc_poll(ap) 778 struct vop_poll_args /* { |
779 struct vnode *a_vp; | 779 struct vnode *a_vp; |
780 int a_which; 781 int a_fflags; | 780 int a_events; |
782 struct ucred *a_cred; 783 struct proc *a_p; 784 } */ *ap; 785{ | 781 struct ucred *a_cred; 782 struct proc *a_p; 783 } */ *ap; 784{ |
786 int error = EOPNOTSUPP; | 785 int revents; |
787 788 switch (VTOFDESC(ap->a_vp)->fd_type) { 789 case Fctty: | 786 787 switch (VTOFDESC(ap->a_vp)->fd_type) { 788 case Fctty: |
790 error = (*ctty_cdevsw.d_select)(devctty, ap->a_fflags, ap->a_p); | 789 revents = (*ctty_cdevsw.d_poll)(devctty, ap->a_events, ap->a_p); |
791 break; 792 793 default: | 790 break; 791 792 default: |
794 error = EOPNOTSUPP; | 793 revents = seltrue(0, ap->a_events, ap->a_p); |
795 break; 796 } 797 | 794 break; 795 } 796 |
798 return (error); | 797 return (revents); |
799} 800 801static int 802fdesc_inactive(ap) 803 struct vop_inactive_args /* { 804 struct vnode *a_vp; 805 struct proc *a_p; 806 } */ *ap; --- 133 unchanged lines hidden (view full) --- 940#define fdesc_truncate \ 941 ((int (*) __P((struct vop_truncate_args *)))eopnotsupp) 942#define fdesc_update ((int (*) __P((struct vop_update_args *)))eopnotsupp) 943#define fdesc_bwrite ((int (*) __P((struct vop_bwrite_args *)))eopnotsupp) 944 945static struct vnodeopv_entry_desc fdesc_vnodeop_entries[] = { 946 { &vop_default_desc, (vop_t *)vn_default_error }, 947 { &vop_lookup_desc, (vop_t *)fdesc_lookup }, /* lookup */ | 798} 799 800static int 801fdesc_inactive(ap) 802 struct vop_inactive_args /* { 803 struct vnode *a_vp; 804 struct proc *a_p; 805 } */ *ap; --- 133 unchanged lines hidden (view full) --- 939#define fdesc_truncate \ 940 ((int (*) __P((struct vop_truncate_args *)))eopnotsupp) 941#define fdesc_update ((int (*) __P((struct vop_update_args *)))eopnotsupp) 942#define fdesc_bwrite ((int (*) __P((struct vop_bwrite_args *)))eopnotsupp) 943 944static struct vnodeopv_entry_desc fdesc_vnodeop_entries[] = { 945 { &vop_default_desc, (vop_t *)vn_default_error }, 946 { &vop_lookup_desc, (vop_t *)fdesc_lookup }, /* lookup */ |
947/* XXX: vop_cachedlookup */ |
|
948 { &vop_create_desc, (vop_t *)fdesc_create }, /* create */ | 948 { &vop_create_desc, (vop_t *)fdesc_create }, /* create */ |
949/* XXX: vop_whiteout */ |
|
949 { &vop_mknod_desc, (vop_t *)fdesc_mknod }, /* mknod */ 950 { &vop_open_desc, (vop_t *)fdesc_open }, /* open */ 951 { &vop_close_desc, (vop_t *)fdesc_close }, /* close */ 952 { &vop_access_desc, (vop_t *)fdesc_access }, /* access */ 953 { &vop_getattr_desc, (vop_t *)fdesc_getattr }, /* getattr */ 954 { &vop_setattr_desc, (vop_t *)fdesc_setattr }, /* setattr */ 955 { &vop_read_desc, (vop_t *)fdesc_read }, /* read */ | 950 { &vop_mknod_desc, (vop_t *)fdesc_mknod }, /* mknod */ 951 { &vop_open_desc, (vop_t *)fdesc_open }, /* open */ 952 { &vop_close_desc, (vop_t *)fdesc_close }, /* close */ 953 { &vop_access_desc, (vop_t *)fdesc_access }, /* access */ 954 { &vop_getattr_desc, (vop_t *)fdesc_getattr }, /* getattr */ 955 { &vop_setattr_desc, (vop_t *)fdesc_setattr }, /* setattr */ 956 { &vop_read_desc, (vop_t *)fdesc_read }, /* read */ |
957/* XXX: vop_lease */ |
|
956 { &vop_write_desc, (vop_t *)fdesc_write }, /* write */ 957 { &vop_ioctl_desc, (vop_t *)fdesc_ioctl }, /* ioctl */ | 958 { &vop_write_desc, (vop_t *)fdesc_write }, /* write */ 959 { &vop_ioctl_desc, (vop_t *)fdesc_ioctl }, /* ioctl */ |
958 { &vop_select_desc, (vop_t *)fdesc_select }, /* select */ | 960 { &vop_poll_desc, (vop_t *)fdesc_poll }, /* poll */ |
959 { &vop_revoke_desc, (vop_t *)fdesc_revoke }, /* revoke */ 960 { &vop_mmap_desc, (vop_t *)fdesc_mmap }, /* mmap */ 961 { &vop_fsync_desc, (vop_t *)fdesc_fsync }, /* fsync */ 962 { &vop_seek_desc, (vop_t *)fdesc_seek }, /* seek */ 963 { &vop_remove_desc, (vop_t *)fdesc_remove }, /* remove */ 964 { &vop_link_desc, (vop_t *)fdesc_link }, /* link */ 965 { &vop_rename_desc, (vop_t *)fdesc_rename }, /* rename */ 966 { &vop_mkdir_desc, (vop_t *)fdesc_mkdir }, /* mkdir */ --- 9 unchanged lines hidden (view full) --- 976 { &vop_bmap_desc, (vop_t *)fdesc_bmap }, /* bmap */ 977 { &vop_strategy_desc, (vop_t *)fdesc_strategy }, /* strategy */ 978 { &vop_print_desc, (vop_t *)fdesc_print }, /* print */ 979 { &vop_islocked_desc, (vop_t *)fdesc_islocked }, /* islocked */ 980 { &vop_pathconf_desc, (vop_t *)fdesc_pathconf }, /* pathconf */ 981 { &vop_advlock_desc, (vop_t *)fdesc_advlock }, /* advlock */ 982 { &vop_blkatoff_desc, (vop_t *)fdesc_blkatoff }, /* blkatoff */ 983 { &vop_valloc_desc, (vop_t *)fdesc_valloc }, /* valloc */ | 961 { &vop_revoke_desc, (vop_t *)fdesc_revoke }, /* revoke */ 962 { &vop_mmap_desc, (vop_t *)fdesc_mmap }, /* mmap */ 963 { &vop_fsync_desc, (vop_t *)fdesc_fsync }, /* fsync */ 964 { &vop_seek_desc, (vop_t *)fdesc_seek }, /* seek */ 965 { &vop_remove_desc, (vop_t *)fdesc_remove }, /* remove */ 966 { &vop_link_desc, (vop_t *)fdesc_link }, /* link */ 967 { &vop_rename_desc, (vop_t *)fdesc_rename }, /* rename */ 968 { &vop_mkdir_desc, (vop_t *)fdesc_mkdir }, /* mkdir */ --- 9 unchanged lines hidden (view full) --- 978 { &vop_bmap_desc, (vop_t *)fdesc_bmap }, /* bmap */ 979 { &vop_strategy_desc, (vop_t *)fdesc_strategy }, /* strategy */ 980 { &vop_print_desc, (vop_t *)fdesc_print }, /* print */ 981 { &vop_islocked_desc, (vop_t *)fdesc_islocked }, /* islocked */ 982 { &vop_pathconf_desc, (vop_t *)fdesc_pathconf }, /* pathconf */ 983 { &vop_advlock_desc, (vop_t *)fdesc_advlock }, /* advlock */ 984 { &vop_blkatoff_desc, (vop_t *)fdesc_blkatoff }, /* blkatoff */ 985 { &vop_valloc_desc, (vop_t *)fdesc_valloc }, /* valloc */ |
986/* XXX: vop_reallocblks */ |
|
984 { &vop_vfree_desc, (vop_t *)fdesc_vfree }, /* vfree */ 985 { &vop_truncate_desc, (vop_t *)fdesc_truncate }, /* truncate */ 986 { &vop_update_desc, (vop_t *)fdesc_update }, /* update */ | 987 { &vop_vfree_desc, (vop_t *)fdesc_vfree }, /* vfree */ 988 { &vop_truncate_desc, (vop_t *)fdesc_truncate }, /* truncate */ 989 { &vop_update_desc, (vop_t *)fdesc_update }, /* update */ |
990/* XXX: vop_getpages */ 991/* XXX: vop_putpages */ |
|
987 { &vop_bwrite_desc, (vop_t *)fdesc_bwrite }, /* bwrite */ 988 { NULL, NULL } 989}; 990static struct vnodeopv_desc fdesc_vnodeop_opv_desc = 991 { &fdesc_vnodeop_p, fdesc_vnodeop_entries }; 992 993VNODEOP_SET(fdesc_vnodeop_opv_desc); | 992 { &vop_bwrite_desc, (vop_t *)fdesc_bwrite }, /* bwrite */ 993 { NULL, NULL } 994}; 995static struct vnodeopv_desc fdesc_vnodeop_opv_desc = 996 { &fdesc_vnodeop_p, fdesc_vnodeop_entries }; 997 998VNODEOP_SET(fdesc_vnodeop_opv_desc); |