xref: /csrg-svn/sys/miscfs/specfs/specdev.h (revision 53558)
140654Smckusick /*
240654Smckusick  * Copyright (c) 1990 The Regents of the University of California.
340654Smckusick  * All rights reserved.
440654Smckusick  *
544523Sbostic  * %sccs.include.redist.c%
640654Smckusick  *
7*53558Sheideman  *	@(#)specdev.h	7.9 (Berkeley) 05/14/92
840654Smckusick  */
940654Smckusick 
1040654Smckusick /*
1140654Smckusick  * This structure defines the information maintained about
1240654Smckusick  * special devices. It is allocated in checkalias and freed
1340654Smckusick  * in vgone.
1440654Smckusick  */
1540654Smckusick struct specinfo {
1640654Smckusick 	struct	vnode **si_hashchain;
1740654Smckusick 	struct	vnode *si_specnext;
1840654Smckusick 	long	si_flags;
1940654Smckusick 	dev_t	si_rdev;
2040654Smckusick };
2140654Smckusick /*
2240654Smckusick  * Exported shorthand
2340654Smckusick  */
2440654Smckusick #define v_rdev v_specinfo->si_rdev
2540654Smckusick #define v_hashchain v_specinfo->si_hashchain
2640654Smckusick #define v_specnext v_specinfo->si_specnext
2740654Smckusick #define v_specflags v_specinfo->si_flags
2840654Smckusick 
2940654Smckusick /*
3040654Smckusick  * Flags for specinfo
3140654Smckusick  */
3240654Smckusick #define	SI_MOUNTEDON	0x0001	/* block special device is mounted on */
3340654Smckusick 
3440654Smckusick /*
3540654Smckusick  * Special device management
3640654Smckusick  */
3740654Smckusick #define	SPECHSZ	64
3840654Smckusick #if	((SPECHSZ&(SPECHSZ-1)) == 0)
3940654Smckusick #define	SPECHASH(rdev)	(((rdev>>5)+(rdev))&(SPECHSZ-1))
4040654Smckusick #else
4140654Smckusick #define	SPECHASH(rdev)	(((unsigned)((rdev>>5)+(rdev)))%SPECHSZ)
4240654Smckusick #endif
4340654Smckusick 
4440654Smckusick struct vnode *speclisth[SPECHSZ];
4548009Smckusick 
4648009Smckusick /*
4748009Smckusick  * Prototypes for special file operations on vnodes.
4848009Smckusick  */
4948363Smckusick struct	nameidata;
5052313Sheideman struct	componentname;
5148363Smckusick struct	ucred;
5248363Smckusick struct	flock;
5348363Smckusick struct	buf;
5448363Smckusick struct	uio;
5548363Smckusick 
5648009Smckusick int	spec_badop(),
5748009Smckusick 	spec_ebadf();
5848009Smckusick 
59*53558Sheideman int	spec_lookup __P((struct vop_lookup_args *));
60*53558Sheideman #define spec_create ((int (*) __P((struct  vop_create_args *)))spec_badop)
61*53558Sheideman #define spec_mknod ((int (*) __P((struct  vop_mknod_args *)))spec_badop)
62*53558Sheideman int	spec_open __P((struct vop_open_args *));
63*53558Sheideman int	spec_close __P((struct vop_close_args *));
64*53558Sheideman #define spec_access ((int (*) __P((struct  vop_access_args *)))spec_ebadf)
65*53558Sheideman #define spec_getattr ((int (*) __P((struct  vop_getattr_args *)))spec_ebadf)
66*53558Sheideman #define spec_setattr ((int (*) __P((struct  vop_setattr_args *)))spec_ebadf)
67*53558Sheideman int	spec_read __P((struct vop_read_args *));
68*53558Sheideman int	spec_write __P((struct vop_write_args *));
69*53558Sheideman int	spec_ioctl __P((struct vop_ioctl_args *));
70*53558Sheideman int	spec_select __P((struct vop_select_args *));
71*53558Sheideman #define spec_mmap ((int (*) __P((struct  vop_mmap_args *)))spec_badop)
72*53558Sheideman #define spec_fsync ((int (*) __P((struct  vop_fsync_args *)))nullop)
73*53558Sheideman #define spec_seek ((int (*) __P((struct  vop_seek_args *)))spec_badop)
74*53558Sheideman #define spec_remove ((int (*) __P((struct  vop_remove_args *)))spec_badop)
75*53558Sheideman #define spec_link ((int (*) __P((struct  vop_link_args *)))spec_badop)
76*53558Sheideman #define spec_rename ((int (*) __P((struct  vop_rename_args *)))spec_badop)
77*53558Sheideman #define spec_mkdir ((int (*) __P((struct  vop_mkdir_args *)))spec_badop)
78*53558Sheideman #define spec_rmdir ((int (*) __P((struct  vop_rmdir_args *)))spec_badop)
79*53558Sheideman #define spec_symlink ((int (*) __P((struct  vop_symlink_args *)))spec_badop)
80*53558Sheideman #define spec_readdir ((int (*) __P((struct  vop_readdir_args *)))spec_badop)
81*53558Sheideman #define spec_readlink ((int (*) __P((struct  vop_readlink_args *)))spec_badop)
82*53558Sheideman #define spec_abortop ((int (*) __P((struct  vop_abortop_args *)))spec_badop)
83*53558Sheideman #define spec_inactive ((int (*) __P((struct  vop_inactive_args *)))nullop)
84*53558Sheideman #define spec_reclaim ((int (*) __P((struct  vop_reclaim_args *)))nullop)
85*53558Sheideman int	spec_lock __P((struct vop_lock_args *));
86*53558Sheideman int	spec_unlock __P((struct vop_unlock_args *));
87*53558Sheideman int	spec_bmap __P((struct vop_bmap_args *));
88*53558Sheideman int	spec_strategy __P((struct vop_strategy_args *));
89*53558Sheideman int	spec_print __P((struct vop_print_args *));
90*53558Sheideman #define spec_islocked ((int (*) __P((struct  vop_islocked_args *)))nullop)
91*53558Sheideman int	spec_advlock __P((struct vop_advlock_args *));
92*53558Sheideman #define spec_blkatoff ((int (*) __P((struct  vop_blkatoff_args *)))spec_badop)
93*53558Sheideman #define spec_vget ((int (*) __P((struct  vop_vget_args *)))spec_badop)
94*53558Sheideman #define spec_valloc ((int (*) __P((struct  vop_valloc_args *)))spec_badop)
95*53558Sheideman #define spec_vfree ((int (*) __P((struct  vop_vfree_args *)))spec_badop)
96*53558Sheideman #define spec_truncate ((int (*) __P((struct  vop_truncate_args *)))nullop)
97*53558Sheideman #define spec_update ((int (*) __P((struct  vop_update_args *)))nullop)
98*53558Sheideman #define spec_bwrite ((int (*) __P((struct  vop_bwrite_args *)))nullop)
99