sysvbfs.h revision 1.6 1 1.6 pooka /* $NetBSD: sysvbfs.h,v 1.6 2007/07/31 21:14:18 pooka Exp $ */
2 1.1 tsutsui
3 1.1 tsutsui /*-
4 1.1 tsutsui * Copyright (c) 2004 The NetBSD Foundation, Inc.
5 1.1 tsutsui * All rights reserved.
6 1.1 tsutsui *
7 1.1 tsutsui * This code is derived from software contributed to The NetBSD Foundation
8 1.1 tsutsui * by UCHIYAMA Yasushi.
9 1.1 tsutsui *
10 1.1 tsutsui * Redistribution and use in source and binary forms, with or without
11 1.1 tsutsui * modification, are permitted provided that the following conditions
12 1.1 tsutsui * are met:
13 1.1 tsutsui * 1. Redistributions of source code must retain the above copyright
14 1.1 tsutsui * notice, this list of conditions and the following disclaimer.
15 1.1 tsutsui * 2. Redistributions in binary form must reproduce the above copyright
16 1.1 tsutsui * notice, this list of conditions and the following disclaimer in the
17 1.1 tsutsui * documentation and/or other materials provided with the distribution.
18 1.1 tsutsui * 3. All advertising materials mentioning features or use of this software
19 1.1 tsutsui * must display the following acknowledgement:
20 1.1 tsutsui * This product includes software developed by the NetBSD
21 1.1 tsutsui * Foundation, Inc. and its contributors.
22 1.1 tsutsui * 4. Neither the name of The NetBSD Foundation nor the names of its
23 1.1 tsutsui * contributors may be used to endorse or promote products derived
24 1.1 tsutsui * from this software without specific prior written permission.
25 1.1 tsutsui *
26 1.1 tsutsui * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
27 1.1 tsutsui * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
28 1.1 tsutsui * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
29 1.1 tsutsui * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
30 1.1 tsutsui * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
31 1.1 tsutsui * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
32 1.1 tsutsui * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
33 1.1 tsutsui * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
34 1.1 tsutsui * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
35 1.1 tsutsui * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
36 1.1 tsutsui * POSSIBILITY OF SUCH DAMAGE.
37 1.1 tsutsui */
38 1.1 tsutsui
39 1.1 tsutsui #ifndef _FS_SYSVBFS_SYSVBFS_H_
40 1.1 tsutsui #define _FS_SYSVBFS_SYSVBFS_H_
41 1.1 tsutsui
42 1.4 chs struct sysvbfs_args {
43 1.4 chs char *fspec; /* blocks special holding the fs to mount */
44 1.4 chs };
45 1.4 chs
46 1.4 chs #ifdef _KERNEL
47 1.1 tsutsui struct bfs;
48 1.1 tsutsui struct buf;
49 1.1 tsutsui
50 1.1 tsutsui #include <miscfs/genfs/genfs.h>
51 1.1 tsutsui #include <miscfs/genfs/genfs_node.h>
52 1.1 tsutsui #include <miscfs/specfs/specdev.h>
53 1.1 tsutsui
54 1.1 tsutsui struct sysvbfs_node {
55 1.1 tsutsui struct genfs_node gnode;
56 1.1 tsutsui struct vnode *vnode;
57 1.1 tsutsui struct bfs_inode *inode;
58 1.1 tsutsui struct sysvbfs_mount *bmp;
59 1.1 tsutsui struct lockf *lockf; /* advlock */
60 1.1 tsutsui daddr_t data_block;
61 1.1 tsutsui size_t size;
62 1.1 tsutsui int update_ctime;
63 1.1 tsutsui int update_atime;
64 1.1 tsutsui int update_mtime;
65 1.1 tsutsui
66 1.1 tsutsui LIST_ENTRY(sysvbfs_node) link;
67 1.1 tsutsui };
68 1.1 tsutsui
69 1.1 tsutsui struct sysvbfs_mount {
70 1.1 tsutsui struct mount *mountp;
71 1.1 tsutsui struct vnode *devvp; /* block device mounted vnode */
72 1.1 tsutsui struct bfs *bfs;
73 1.1 tsutsui LIST_HEAD(, sysvbfs_node) bnode_head;
74 1.1 tsutsui };
75 1.1 tsutsui
76 1.1 tsutsui /* v-node ops. */
77 1.1 tsutsui int sysvbfs_lookup(void *);
78 1.1 tsutsui int sysvbfs_create(void *);
79 1.1 tsutsui int sysvbfs_open(void *);
80 1.1 tsutsui int sysvbfs_close(void *);
81 1.1 tsutsui int sysvbfs_access(void *);
82 1.1 tsutsui int sysvbfs_getattr(void *);
83 1.1 tsutsui int sysvbfs_setattr(void *);
84 1.1 tsutsui int sysvbfs_read(void *);
85 1.1 tsutsui int sysvbfs_write(void *);
86 1.1 tsutsui int sysvbfs_fsync(void *);
87 1.1 tsutsui int sysvbfs_remove(void *);
88 1.1 tsutsui int sysvbfs_rename(void *);
89 1.1 tsutsui int sysvbfs_readdir(void *);
90 1.1 tsutsui int sysvbfs_inactive(void *);
91 1.1 tsutsui int sysvbfs_reclaim(void *);
92 1.1 tsutsui int sysvbfs_bmap(void *);
93 1.1 tsutsui int sysvbfs_strategy(void *);
94 1.1 tsutsui int sysvbfs_print(void *);
95 1.1 tsutsui int sysvbfs_advlock(void *);
96 1.1 tsutsui int sysvbfs_pathconf(void *);
97 1.1 tsutsui
98 1.1 tsutsui /* vfs ops. */
99 1.6 pooka VFS_PROTOS(sysvbfs);
100 1.1 tsutsui
101 1.1 tsutsui extern int (**sysvbfs_vnodeop_p)(void *);
102 1.1 tsutsui
103 1.1 tsutsui /* genfs ops */
104 1.2 elad int sysvbfs_gop_alloc(struct vnode *, off_t, off_t, int, kauth_cred_t);
105 1.1 tsutsui extern const struct genfs_ops sysvbfs_genfsops;
106 1.1 tsutsui
107 1.1 tsutsui /* internal service */
108 1.1 tsutsui int sysvbfs_update(struct vnode *, const struct timespec *,
109 1.1 tsutsui const struct timespec *, int);
110 1.1 tsutsui
111 1.1 tsutsui #endif /* _KERNEL */
112 1.1 tsutsui #endif /* _FS_SYSVBFS_SYSVBFS_H_ */
113