fifo.h revision 1.27 1 1.27 dholland /* $NetBSD: fifo.h,v 1.27 2021/07/18 23:56:13 dholland 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.22 xtraeme extern int (**fifo_vnodeop_p)(void *);
35 1.27 dholland
36 1.27 dholland /*
37 1.27 dholland * This macro provides an initializer list for the fs-independent part
38 1.27 dholland * of a filesystem's fifo vnode ops descriptor table. We still need
39 1.27 dholland * such a table in every filesystem, but we can at least avoid the
40 1.27 dholland * cutpaste.
41 1.27 dholland *
42 1.27 dholland * This contains these ops:
43 1.27 dholland * parsepath lookup
44 1.27 dholland * create whiteout mknod open fallocate fdiscard ioctl poll kqfilter
45 1.27 dholland * revoke mmap seek remove link rename mkdir rmdir symlink readdir
46 1.27 dholland * readlink abortop bmap pathconf advlock getpages putpages
47 1.27 dholland *
48 1.27 dholland * The filesystem should provide these ops that need to be its own:
49 1.27 dholland * access and accessx
50 1.27 dholland * getattr
51 1.27 dholland * setattr
52 1.27 dholland * fcntl
53 1.27 dholland * inactive
54 1.27 dholland * reclaim
55 1.27 dholland * lock
56 1.27 dholland * unlock
57 1.27 dholland * strategy
58 1.27 dholland * print (should probably also call fifo_print)
59 1.27 dholland * islocked
60 1.27 dholland * bwrite (normally vn_bwrite)
61 1.27 dholland * openextattr
62 1.27 dholland * closeextattr
63 1.27 dholland * getextattr
64 1.27 dholland * setextattr
65 1.27 dholland * listextattr
66 1.27 dholland * deleteextattr
67 1.27 dholland * getacl
68 1.27 dholland * setacl
69 1.27 dholland * aclcheck
70 1.27 dholland *
71 1.27 dholland * The filesystem should also provide these ops that some filesystems
72 1.27 dholland * do their own things with:
73 1.27 dholland * close
74 1.27 dholland * read
75 1.27 dholland * write
76 1.27 dholland * fsync
77 1.27 dholland * In most cases "their own things" means adjust timestamps and call
78 1.27 dholland * fifo_foo (currently via vn_fifo_bypass). For fsync it varies.
79 1.27 dholland *
80 1.27 dholland * Note that because the op descriptor tables are unordered it does not
81 1.27 dholland * matter where in the table this macro goes (except I think default
82 1.27 dholland * still needs to be first...)
83 1.27 dholland *
84 1.27 dholland * XXX currently all the ops are vn_fifo_bypass, which does an
85 1.27 dholland * indirect call via the fifofs ops table (externed above), which
86 1.27 dholland * someone decided was preferable to exposing the function
87 1.27 dholland * definitions. This includes (for now at least) the ones that are
88 1.27 dholland * sent to genfs by that table. This should probably be changed, but
89 1.27 dholland * not just yet.
90 1.27 dholland */
91 1.27 dholland #define GENFS_FIFOOP_ENTRIES \
92 1.27 dholland { &vop_parsepath_desc, genfs_badop }, /* parsepath */ \
93 1.27 dholland { &vop_lookup_desc, vn_fifo_bypass }, /* lookup */ \
94 1.27 dholland { &vop_create_desc, vn_fifo_bypass }, /* create */ \
95 1.27 dholland { &vop_whiteout_desc, vn_fifo_bypass }, /* whiteout */ \
96 1.27 dholland { &vop_mknod_desc, vn_fifo_bypass }, /* mknod */ \
97 1.27 dholland { &vop_open_desc, vn_fifo_bypass }, /* open */ \
98 1.27 dholland { &vop_fallocate_desc, vn_fifo_bypass }, /* fallocate */ \
99 1.27 dholland { &vop_fdiscard_desc, vn_fifo_bypass }, /* fdiscard */ \
100 1.27 dholland { &vop_ioctl_desc, vn_fifo_bypass }, /* ioctl */ \
101 1.27 dholland { &vop_poll_desc, vn_fifo_bypass }, /* poll */ \
102 1.27 dholland { &vop_kqfilter_desc, vn_fifo_bypass }, /* kqfilter */ \
103 1.27 dholland { &vop_revoke_desc, vn_fifo_bypass }, /* revoke */ \
104 1.27 dholland { &vop_mmap_desc, vn_fifo_bypass }, /* mmap */ \
105 1.27 dholland { &vop_seek_desc, vn_fifo_bypass }, /* seek */ \
106 1.27 dholland { &vop_remove_desc, vn_fifo_bypass }, /* remove */ \
107 1.27 dholland { &vop_link_desc, vn_fifo_bypass }, /* link */ \
108 1.27 dholland { &vop_rename_desc, vn_fifo_bypass }, /* rename */ \
109 1.27 dholland { &vop_mkdir_desc, vn_fifo_bypass }, /* mkdir */ \
110 1.27 dholland { &vop_rmdir_desc, vn_fifo_bypass }, /* rmdir */ \
111 1.27 dholland { &vop_symlink_desc, vn_fifo_bypass }, /* symlink */ \
112 1.27 dholland { &vop_readdir_desc, vn_fifo_bypass }, /* readdir */ \
113 1.27 dholland { &vop_readlink_desc, vn_fifo_bypass }, /* readlink */ \
114 1.27 dholland { &vop_abortop_desc, vn_fifo_bypass }, /* abortop */ \
115 1.27 dholland { &vop_bmap_desc, vn_fifo_bypass }, /* bmap */ \
116 1.27 dholland { &vop_pathconf_desc, vn_fifo_bypass }, /* pathconf */ \
117 1.27 dholland { &vop_advlock_desc, vn_fifo_bypass }, /* advlock */ \
118 1.27 dholland { &vop_getpages_desc, genfs_badop }, /* getpages */ \
119 1.27 dholland { &vop_putpages_desc, vn_fifo_bypass } /* putpages */
120