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