xref: /netbsd/sys/fs/sysvbfs/sysvbfs.h (revision 6550d01e)
1 /*	$NetBSD: sysvbfs.h,v 1.9 2010/05/27 23:40:12 pooka 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 bfs;
36 struct buf;
37 
38 #include <fs/sysvbfs/sysvbfs_args.h>
39 
40 #include <miscfs/genfs/genfs.h>
41 #include <miscfs/genfs/genfs_node.h>
42 #include <miscfs/specfs/specdev.h>
43 
44 struct sysvbfs_node {
45 	struct genfs_node gnode;
46 	struct vnode *vnode;
47 	struct bfs_inode *inode;
48 	struct sysvbfs_mount *bmp;
49 	struct lockf *lockf;	/* advlock */
50 	daddr_t data_block;
51 	size_t size;
52 	int update_ctime;
53 	int update_atime;
54 	int update_mtime;
55 	int removed;
56 
57 	LIST_ENTRY(sysvbfs_node) link;
58 };
59 
60 struct sysvbfs_mount {
61 	struct mount *mountp;
62 	struct vnode *devvp;		/* block device mounted vnode */
63 	struct bfs *bfs;
64 	LIST_HEAD(, sysvbfs_node) bnode_head;
65 };
66 
67 /* v-node ops. */
68 int sysvbfs_lookup(void *);
69 int sysvbfs_create(void *);
70 int sysvbfs_open(void *);
71 int sysvbfs_close(void *);
72 int sysvbfs_access(void *);
73 int sysvbfs_getattr(void *);
74 int sysvbfs_setattr(void *);
75 int sysvbfs_read(void *);
76 int sysvbfs_write(void *);
77 int sysvbfs_fsync(void *);
78 int sysvbfs_remove(void *);
79 int sysvbfs_rename(void *);
80 int sysvbfs_readdir(void *);
81 int sysvbfs_inactive(void *);
82 int sysvbfs_reclaim(void *);
83 int sysvbfs_bmap(void *);
84 int sysvbfs_strategy(void *);
85 int sysvbfs_print(void *);
86 int sysvbfs_advlock(void *);
87 int sysvbfs_pathconf(void *);
88 
89 /* vfs ops. */
90 VFS_PROTOS(sysvbfs);
91 
92 extern int (**sysvbfs_vnodeop_p)(void *);
93 
94 /* genfs ops */
95 int sysvbfs_gop_alloc(struct vnode *, off_t, off_t, int, kauth_cred_t);
96 extern const struct genfs_ops sysvbfs_genfsops;
97 
98 /* internal service */
99 int sysvbfs_update(struct vnode *, const struct timespec *,
100     const struct timespec *, int);
101 
102 #endif /* _FS_SYSVBFS_SYSVBFS_H_ */
103