vegt goes away
[unix-history] / usr / src / sys / miscfs / specfs / specdev.h
CommitLineData
88859601
KM
1/*
2 * Copyright (c) 1990 The Regents of the University of California.
3 * All rights reserved.
4 *
6dc0e27a 5 * %sccs.include.redist.c%
88859601 6 *
4cf38f58 7 * @(#)specdev.h 7.11 (Berkeley) %G%
88859601
KM
8 */
9
10/*
11 * This structure defines the information maintained about
12 * special devices. It is allocated in checkalias and freed
13 * in vgone.
14 */
15struct specinfo {
16 struct vnode **si_hashchain;
17 struct vnode *si_specnext;
18 long si_flags;
19 dev_t si_rdev;
20};
21/*
22 * Exported shorthand
23 */
24#define v_rdev v_specinfo->si_rdev
25#define v_hashchain v_specinfo->si_hashchain
26#define v_specnext v_specinfo->si_specnext
27#define v_specflags v_specinfo->si_flags
28
29/*
30 * Flags for specinfo
31 */
32#define SI_MOUNTEDON 0x0001 /* block special device is mounted on */
33
34/*
35 * Special device management
36 */
37#define SPECHSZ 64
38#if ((SPECHSZ&(SPECHSZ-1)) == 0)
39#define SPECHASH(rdev) (((rdev>>5)+(rdev))&(SPECHSZ-1))
40#else
41#define SPECHASH(rdev) (((unsigned)((rdev>>5)+(rdev)))%SPECHSZ)
42#endif
43
44struct vnode *speclisth[SPECHSZ];
184ba363
KM
45
46/*
47 * Prototypes for special file operations on vnodes.
48 */
6d18c7be 49struct nameidata;
cb5e2fbb 50struct componentname;
6d18c7be
KM
51struct ucred;
52struct flock;
53struct buf;
54struct uio;
55
184ba363
KM
56int spec_badop(),
57 spec_ebadf();
58
9342689a
JH
59int spec_lookup __P((struct vop_lookup_args *));
60#define spec_create ((int (*) __P((struct vop_create_args *)))spec_badop)
61#define spec_mknod ((int (*) __P((struct vop_mknod_args *)))spec_badop)
62int spec_open __P((struct vop_open_args *));
63int spec_close __P((struct vop_close_args *));
64#define spec_access ((int (*) __P((struct vop_access_args *)))spec_ebadf)
65#define spec_getattr ((int (*) __P((struct vop_getattr_args *)))spec_ebadf)
66#define spec_setattr ((int (*) __P((struct vop_setattr_args *)))spec_ebadf)
67int spec_read __P((struct vop_read_args *));
68int spec_write __P((struct vop_write_args *));
69int spec_ioctl __P((struct vop_ioctl_args *));
70int spec_select __P((struct vop_select_args *));
71#define spec_mmap ((int (*) __P((struct vop_mmap_args *)))spec_badop)
37843f55 72int spec_fsync __P((struct vop_fsync_args *));
9342689a
JH
73#define spec_seek ((int (*) __P((struct vop_seek_args *)))spec_badop)
74#define spec_remove ((int (*) __P((struct vop_remove_args *)))spec_badop)
75#define spec_link ((int (*) __P((struct vop_link_args *)))spec_badop)
76#define spec_rename ((int (*) __P((struct vop_rename_args *)))spec_badop)
77#define spec_mkdir ((int (*) __P((struct vop_mkdir_args *)))spec_badop)
78#define spec_rmdir ((int (*) __P((struct vop_rmdir_args *)))spec_badop)
79#define spec_symlink ((int (*) __P((struct vop_symlink_args *)))spec_badop)
80#define spec_readdir ((int (*) __P((struct vop_readdir_args *)))spec_badop)
81#define spec_readlink ((int (*) __P((struct vop_readlink_args *)))spec_badop)
82#define spec_abortop ((int (*) __P((struct vop_abortop_args *)))spec_badop)
83#define spec_inactive ((int (*) __P((struct vop_inactive_args *)))nullop)
84#define spec_reclaim ((int (*) __P((struct vop_reclaim_args *)))nullop)
85int spec_lock __P((struct vop_lock_args *));
86int spec_unlock __P((struct vop_unlock_args *));
87int spec_bmap __P((struct vop_bmap_args *));
88int spec_strategy __P((struct vop_strategy_args *));
89int spec_print __P((struct vop_print_args *));
90#define spec_islocked ((int (*) __P((struct vop_islocked_args *)))nullop)
91int spec_advlock __P((struct vop_advlock_args *));
92#define spec_blkatoff ((int (*) __P((struct vop_blkatoff_args *)))spec_badop)
9342689a
JH
93#define spec_valloc ((int (*) __P((struct vop_valloc_args *)))spec_badop)
94#define spec_vfree ((int (*) __P((struct vop_vfree_args *)))spec_badop)
95#define spec_truncate ((int (*) __P((struct vop_truncate_args *)))nullop)
96#define spec_update ((int (*) __P((struct vop_update_args *)))nullop)
97#define spec_bwrite ((int (*) __P((struct vop_bwrite_args *)))nullop)