sysvbfs.h revision 1.10 1 /* $NetBSD: sysvbfs.h,v 1.10 2014/12/26 15:23:21 hannken 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
58 struct sysvbfs_mount {
59 struct mount *mountp;
60 struct vnode *devvp; /* block device mounted vnode */
61 struct bfs *bfs;
62 };
63
64 /* v-node ops. */
65 int sysvbfs_lookup(void *);
66 int sysvbfs_create(void *);
67 int sysvbfs_open(void *);
68 int sysvbfs_close(void *);
69 int sysvbfs_access(void *);
70 int sysvbfs_getattr(void *);
71 int sysvbfs_setattr(void *);
72 int sysvbfs_read(void *);
73 int sysvbfs_write(void *);
74 int sysvbfs_fsync(void *);
75 int sysvbfs_remove(void *);
76 int sysvbfs_rename(void *);
77 int sysvbfs_readdir(void *);
78 int sysvbfs_inactive(void *);
79 int sysvbfs_reclaim(void *);
80 int sysvbfs_bmap(void *);
81 int sysvbfs_strategy(void *);
82 int sysvbfs_print(void *);
83 int sysvbfs_advlock(void *);
84 int sysvbfs_pathconf(void *);
85
86 /* vfs ops. */
87 VFS_PROTOS(sysvbfs);
88
89 extern int (**sysvbfs_vnodeop_p)(void *);
90
91 /* genfs ops */
92 int sysvbfs_gop_alloc(struct vnode *, off_t, off_t, int, kauth_cred_t);
93 extern const struct genfs_ops sysvbfs_genfsops;
94
95 /* internal service */
96 int sysvbfs_update(struct vnode *, const struct timespec *,
97 const struct timespec *, int);
98
99 #endif /* _FS_SYSVBFS_SYSVBFS_H_ */
100