fifo.h revision 1.28 1 1.28 riastrad /* $NetBSD: fifo.h,v 1.28 2022/10/26 23:40:20 riastradh Exp $ */
2 1.8 cgd
3 1.1 cgd /*
4 1.7 mycroft * Copyright (c) 1991, 1993
5 1.7 mycroft * The Regents of the University of California. All rights reserved.
6 1.1 cgd *
7 1.1 cgd * Redistribution and use in source and binary forms, with or without
8 1.1 cgd * modification, are permitted provided that the following conditions
9 1.1 cgd * are met:
10 1.1 cgd * 1. Redistributions of source code must retain the above copyright
11 1.1 cgd * notice, this list of conditions and the following disclaimer.
12 1.1 cgd * 2. Redistributions in binary form must reproduce the above copyright
13 1.1 cgd * notice, this list of conditions and the following disclaimer in the
14 1.1 cgd * documentation and/or other materials provided with the distribution.
15 1.20 agc * 3. Neither the name of the University nor the names of its contributors
16 1.1 cgd * may be used to endorse or promote products derived from this software
17 1.1 cgd * without specific prior written permission.
18 1.1 cgd *
19 1.1 cgd * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
20 1.1 cgd * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
21 1.1 cgd * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
22 1.1 cgd * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
23 1.1 cgd * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
24 1.1 cgd * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
25 1.1 cgd * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
26 1.1 cgd * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
27 1.1 cgd * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
28 1.1 cgd * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
29 1.1 cgd * SUCH DAMAGE.
30 1.1 cgd *
31 1.13 fvdl * @(#)fifo.h 8.6 (Berkeley) 5/21/95
32 1.1 cgd */
33 1.14 sommerfe
34 1.28 riastrad #ifndef _MISCFS_FIFOFS_FIFO_H_
35 1.28 riastrad #define _MISCFS_FIFOFS_FIFO_H_
36 1.28 riastrad
37 1.28 riastrad #include <sys/vnode.h>
38 1.28 riastrad
39 1.28 riastrad #include <miscfs/genfs/genfs.h>
40 1.28 riastrad
41 1.28 riastrad extern const struct vnodeopv_desc fifo_vnodeop_opv_desc;
42 1.28 riastrad
43 1.22 xtraeme extern int (**fifo_vnodeop_p)(void *);
44 1.27 dholland
45 1.27 dholland /*
46 1.27 dholland * This macro provides an initializer list for the fs-independent part
47 1.27 dholland * of a filesystem's fifo vnode ops descriptor table. We still need
48 1.27 dholland * such a table in every filesystem, but we can at least avoid the
49 1.27 dholland * cutpaste.
50 1.27 dholland *
51 1.27 dholland * This contains these ops:
52 1.27 dholland * parsepath lookup
53 1.27 dholland * create whiteout mknod open fallocate fdiscard ioctl poll kqfilter
54 1.27 dholland * revoke mmap seek remove link rename mkdir rmdir symlink readdir
55 1.27 dholland * readlink abortop bmap pathconf advlock getpages putpages
56 1.27 dholland *
57 1.27 dholland * The filesystem should provide these ops that need to be its own:
58 1.27 dholland * access and accessx
59 1.27 dholland * getattr
60 1.27 dholland * setattr
61 1.27 dholland * fcntl
62 1.27 dholland * inactive
63 1.27 dholland * reclaim
64 1.27 dholland * lock
65 1.27 dholland * unlock
66 1.27 dholland * strategy
67 1.27 dholland * print (should probably also call fifo_print)
68 1.27 dholland * islocked
69 1.27 dholland * bwrite (normally vn_bwrite)
70 1.27 dholland * openextattr
71 1.27 dholland * closeextattr
72 1.27 dholland * getextattr
73 1.27 dholland * setextattr
74 1.27 dholland * listextattr
75 1.27 dholland * deleteextattr
76 1.27 dholland * getacl
77 1.27 dholland * setacl
78 1.27 dholland * aclcheck
79 1.27 dholland *
80 1.27 dholland * The filesystem should also provide these ops that some filesystems
81 1.27 dholland * do their own things with:
82 1.27 dholland * close
83 1.27 dholland * read
84 1.27 dholland * write
85 1.27 dholland * fsync
86 1.27 dholland * In most cases "their own things" means adjust timestamps and call
87 1.27 dholland * fifo_foo (currently via vn_fifo_bypass). For fsync it varies.
88 1.27 dholland *
89 1.27 dholland * Note that because the op descriptor tables are unordered it does not
90 1.28 riastrad * matter where in the table this macro goes (except I think default
91 1.27 dholland * still needs to be first...)
92 1.27 dholland *
93 1.27 dholland * XXX currently all the ops are vn_fifo_bypass, which does an
94 1.27 dholland * indirect call via the fifofs ops table (externed above), which
95 1.27 dholland * someone decided was preferable to exposing the function
96 1.27 dholland * definitions. This includes (for now at least) the ones that are
97 1.27 dholland * sent to genfs by that table. This should probably be changed, but
98 1.27 dholland * not just yet.
99 1.27 dholland */
100 1.27 dholland #define GENFS_FIFOOP_ENTRIES \
101 1.27 dholland { &vop_parsepath_desc, genfs_badop }, /* parsepath */ \
102 1.27 dholland { &vop_lookup_desc, vn_fifo_bypass }, /* lookup */ \
103 1.27 dholland { &vop_create_desc, vn_fifo_bypass }, /* create */ \
104 1.27 dholland { &vop_whiteout_desc, vn_fifo_bypass }, /* whiteout */ \
105 1.27 dholland { &vop_mknod_desc, vn_fifo_bypass }, /* mknod */ \
106 1.27 dholland { &vop_open_desc, vn_fifo_bypass }, /* open */ \
107 1.27 dholland { &vop_fallocate_desc, vn_fifo_bypass }, /* fallocate */ \
108 1.27 dholland { &vop_fdiscard_desc, vn_fifo_bypass }, /* fdiscard */ \
109 1.27 dholland { &vop_ioctl_desc, vn_fifo_bypass }, /* ioctl */ \
110 1.27 dholland { &vop_poll_desc, vn_fifo_bypass }, /* poll */ \
111 1.27 dholland { &vop_kqfilter_desc, vn_fifo_bypass }, /* kqfilter */ \
112 1.27 dholland { &vop_revoke_desc, vn_fifo_bypass }, /* revoke */ \
113 1.27 dholland { &vop_mmap_desc, vn_fifo_bypass }, /* mmap */ \
114 1.27 dholland { &vop_seek_desc, vn_fifo_bypass }, /* seek */ \
115 1.27 dholland { &vop_remove_desc, vn_fifo_bypass }, /* remove */ \
116 1.27 dholland { &vop_link_desc, vn_fifo_bypass }, /* link */ \
117 1.27 dholland { &vop_rename_desc, vn_fifo_bypass }, /* rename */ \
118 1.27 dholland { &vop_mkdir_desc, vn_fifo_bypass }, /* mkdir */ \
119 1.27 dholland { &vop_rmdir_desc, vn_fifo_bypass }, /* rmdir */ \
120 1.27 dholland { &vop_symlink_desc, vn_fifo_bypass }, /* symlink */ \
121 1.27 dholland { &vop_readdir_desc, vn_fifo_bypass }, /* readdir */ \
122 1.27 dholland { &vop_readlink_desc, vn_fifo_bypass }, /* readlink */ \
123 1.27 dholland { &vop_abortop_desc, vn_fifo_bypass }, /* abortop */ \
124 1.27 dholland { &vop_bmap_desc, vn_fifo_bypass }, /* bmap */ \
125 1.27 dholland { &vop_pathconf_desc, vn_fifo_bypass }, /* pathconf */ \
126 1.27 dholland { &vop_advlock_desc, vn_fifo_bypass }, /* advlock */ \
127 1.27 dholland { &vop_getpages_desc, genfs_badop }, /* getpages */ \
128 1.27 dholland { &vop_putpages_desc, vn_fifo_bypass } /* putpages */
129 1.28 riastrad
130 1.28 riastrad #endif /* _MISCFS_FIFOFS_FIFO_H_ */
131