xref: /netbsd-src/sys/fs/v7fs/v7fs_extern.h (revision 6a493d6bc668897c91594964a732d38505b70cbb)
1 /*	$NetBSD: v7fs_extern.h,v 1.1 2011/06/27 11:52:24 uch Exp $	*/
2 
3 /*-
4  * Copyright (c) 2004, 2011 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_V7FS_EXTERN_H_
33 #define	_FS_V7FS_EXTERN_H_
34 
35 #include <fs/v7fs/v7fs_args.h>
36 
37 #include <miscfs/genfs/genfs.h>
38 #include <miscfs/genfs/genfs_node.h>
39 #include <miscfs/specfs/specdev.h>
40 
41 #include "v7fs.h"
42 #include "v7fs_impl.h"
43 #include "v7fs_inode.h"
44 
45 struct v7fs_mount {
46 	struct mount *mountp;
47 	struct vnode *devvp;		/* block device mounted vnode */
48 	struct v7fs_self *core;		/* filesystem dependent implementation*/
49 	LIST_HEAD(, v7fs_node) v7fs_node_head;
50 };
51 
52 struct v7fs_node {
53 	struct genfs_node gnode;
54 	struct v7fs_inode inode; /* filesystem dependent implementation */
55 	struct vnode *vnode;		/* back-link */
56 	struct v7fs_mount *v7fsmount;	/* our filesystem */
57 	struct lockf *lockf;		/* advlock */
58 
59 	int update_ctime;
60 	int update_atime;
61 	int update_mtime;
62 
63 	LIST_ENTRY(v7fs_node) link;
64 };
65 
66 #define	VFSTOV7FS(mp)	((struct v7fs_mount *)((mp)->mnt_data))
67 
68 __BEGIN_DECLS
69 /* v-node ops. */
70 int v7fs_lookup(void *);
71 int v7fs_create(void *);
72 int v7fs_open(void *);
73 int v7fs_close(void *);
74 int v7fs_access(void *);
75 int v7fs_getattr(void *);
76 int v7fs_setattr(void *);
77 int v7fs_read(void *);
78 int v7fs_write(void *);
79 int v7fs_fsync(void *);
80 int v7fs_remove(void *);
81 int v7fs_rename(void *);
82 int v7fs_readdir(void *);
83 int v7fs_inactive(void *);
84 int v7fs_reclaim(void *);
85 int v7fs_bmap(void *);
86 int v7fs_strategy(void *);
87 int v7fs_print(void *);
88 int v7fs_advlock(void *);
89 int v7fs_pathconf(void *);
90 
91 int v7fs_link(void *);
92 int v7fs_symlink(void *);
93 int v7fs_readlink(void *);
94 
95 int v7fs_mkdir(void *);
96 int v7fs_rmdir(void *);
97 
98 int v7fs_mknod(void *);
99 
100 /* vfs ops. */
101 VFS_PROTOS(v7fs);
102 
103 int v7fs_mountroot(void);
104 extern int (**v7fs_vnodeop_p)(void *);
105 extern int (**v7fs_specop_p)(void *);
106 extern int (**v7fs_fifoop_p)(void *);
107 
108 /* genfs ops */
109 int v7fs_gop_alloc(struct vnode *, off_t, off_t, int, kauth_cred_t);
110 extern const struct genfs_ops v7fs_genfsops;
111 
112 /* internal service */
113 int v7fs_update(struct vnode *, const struct timespec *,
114     const struct timespec *, int);
115 __END_DECLS
116 #endif /* _FS_V7FS_EXTERN_H_ */
117