xref: /minix3/sys/fs/v7fs/v7fs_extern.h (revision 0a6a1f1d05b60e214de2f05a7310ddd1f0e590e7)
1*0a6a1f1dSLionel Sambuc /*	$NetBSD: v7fs_extern.h,v 1.2 2014/12/29 15:29:38 hannken Exp $	*/
29f988b79SJean-Baptiste Boric 
39f988b79SJean-Baptiste Boric /*-
49f988b79SJean-Baptiste Boric  * Copyright (c) 2004, 2011 The NetBSD Foundation, Inc.
59f988b79SJean-Baptiste Boric  * All rights reserved.
69f988b79SJean-Baptiste Boric  *
79f988b79SJean-Baptiste Boric  * This code is derived from software contributed to The NetBSD Foundation
89f988b79SJean-Baptiste Boric  * by UCHIYAMA Yasushi.
99f988b79SJean-Baptiste Boric  *
109f988b79SJean-Baptiste Boric  * Redistribution and use in source and binary forms, with or without
119f988b79SJean-Baptiste Boric  * modification, are permitted provided that the following conditions
129f988b79SJean-Baptiste Boric  * are met:
139f988b79SJean-Baptiste Boric  * 1. Redistributions of source code must retain the above copyright
149f988b79SJean-Baptiste Boric  *    notice, this list of conditions and the following disclaimer.
159f988b79SJean-Baptiste Boric  * 2. Redistributions in binary form must reproduce the above copyright
169f988b79SJean-Baptiste Boric  *    notice, this list of conditions and the following disclaimer in the
179f988b79SJean-Baptiste Boric  *    documentation and/or other materials provided with the distribution.
189f988b79SJean-Baptiste Boric  *
199f988b79SJean-Baptiste Boric  * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
209f988b79SJean-Baptiste Boric  * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
219f988b79SJean-Baptiste Boric  * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
229f988b79SJean-Baptiste Boric  * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
239f988b79SJean-Baptiste Boric  * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
249f988b79SJean-Baptiste Boric  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
259f988b79SJean-Baptiste Boric  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
269f988b79SJean-Baptiste Boric  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
279f988b79SJean-Baptiste Boric  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
289f988b79SJean-Baptiste Boric  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
299f988b79SJean-Baptiste Boric  * POSSIBILITY OF SUCH DAMAGE.
309f988b79SJean-Baptiste Boric  */
319f988b79SJean-Baptiste Boric 
329f988b79SJean-Baptiste Boric #ifndef _FS_V7FS_EXTERN_H_
339f988b79SJean-Baptiste Boric #define	_FS_V7FS_EXTERN_H_
349f988b79SJean-Baptiste Boric 
359f988b79SJean-Baptiste Boric #include <fs/v7fs/v7fs_args.h>
369f988b79SJean-Baptiste Boric 
379f988b79SJean-Baptiste Boric #include <miscfs/genfs/genfs.h>
389f988b79SJean-Baptiste Boric #include <miscfs/genfs/genfs_node.h>
399f988b79SJean-Baptiste Boric #include <miscfs/specfs/specdev.h>
409f988b79SJean-Baptiste Boric 
419f988b79SJean-Baptiste Boric #include "v7fs.h"
429f988b79SJean-Baptiste Boric #include "v7fs_impl.h"
439f988b79SJean-Baptiste Boric #include "v7fs_inode.h"
449f988b79SJean-Baptiste Boric 
459f988b79SJean-Baptiste Boric struct v7fs_mount {
469f988b79SJean-Baptiste Boric 	struct mount *mountp;
479f988b79SJean-Baptiste Boric 	struct vnode *devvp;		/* block device mounted vnode */
489f988b79SJean-Baptiste Boric 	struct v7fs_self *core;		/* filesystem dependent implementation*/
499f988b79SJean-Baptiste Boric };
509f988b79SJean-Baptiste Boric 
519f988b79SJean-Baptiste Boric struct v7fs_node {
529f988b79SJean-Baptiste Boric 	struct genfs_node gnode;
539f988b79SJean-Baptiste Boric 	struct v7fs_inode inode; /* filesystem dependent implementation */
549f988b79SJean-Baptiste Boric 	struct vnode *vnode;		/* back-link */
559f988b79SJean-Baptiste Boric 	struct v7fs_mount *v7fsmount;	/* our filesystem */
569f988b79SJean-Baptiste Boric 	struct lockf *lockf;		/* advlock */
579f988b79SJean-Baptiste Boric 
589f988b79SJean-Baptiste Boric 	int update_ctime;
599f988b79SJean-Baptiste Boric 	int update_atime;
609f988b79SJean-Baptiste Boric 	int update_mtime;
619f988b79SJean-Baptiste Boric };
629f988b79SJean-Baptiste Boric 
639f988b79SJean-Baptiste Boric #define	VFSTOV7FS(mp)	((struct v7fs_mount *)((mp)->mnt_data))
649f988b79SJean-Baptiste Boric 
659f988b79SJean-Baptiste Boric __BEGIN_DECLS
669f988b79SJean-Baptiste Boric /* v-node ops. */
679f988b79SJean-Baptiste Boric int v7fs_lookup(void *);
689f988b79SJean-Baptiste Boric int v7fs_create(void *);
699f988b79SJean-Baptiste Boric int v7fs_open(void *);
709f988b79SJean-Baptiste Boric int v7fs_close(void *);
719f988b79SJean-Baptiste Boric int v7fs_access(void *);
729f988b79SJean-Baptiste Boric int v7fs_getattr(void *);
739f988b79SJean-Baptiste Boric int v7fs_setattr(void *);
749f988b79SJean-Baptiste Boric int v7fs_read(void *);
759f988b79SJean-Baptiste Boric int v7fs_write(void *);
769f988b79SJean-Baptiste Boric int v7fs_fsync(void *);
779f988b79SJean-Baptiste Boric int v7fs_remove(void *);
789f988b79SJean-Baptiste Boric int v7fs_rename(void *);
799f988b79SJean-Baptiste Boric int v7fs_readdir(void *);
809f988b79SJean-Baptiste Boric int v7fs_inactive(void *);
819f988b79SJean-Baptiste Boric int v7fs_reclaim(void *);
829f988b79SJean-Baptiste Boric int v7fs_bmap(void *);
839f988b79SJean-Baptiste Boric int v7fs_strategy(void *);
849f988b79SJean-Baptiste Boric int v7fs_print(void *);
859f988b79SJean-Baptiste Boric int v7fs_advlock(void *);
869f988b79SJean-Baptiste Boric int v7fs_pathconf(void *);
879f988b79SJean-Baptiste Boric 
889f988b79SJean-Baptiste Boric int v7fs_link(void *);
899f988b79SJean-Baptiste Boric int v7fs_symlink(void *);
909f988b79SJean-Baptiste Boric int v7fs_readlink(void *);
919f988b79SJean-Baptiste Boric 
929f988b79SJean-Baptiste Boric int v7fs_mkdir(void *);
939f988b79SJean-Baptiste Boric int v7fs_rmdir(void *);
949f988b79SJean-Baptiste Boric 
959f988b79SJean-Baptiste Boric int v7fs_mknod(void *);
969f988b79SJean-Baptiste Boric 
979f988b79SJean-Baptiste Boric /* vfs ops. */
989f988b79SJean-Baptiste Boric VFS_PROTOS(v7fs);
999f988b79SJean-Baptiste Boric 
1009f988b79SJean-Baptiste Boric int v7fs_mountroot(void);
1019f988b79SJean-Baptiste Boric extern int (**v7fs_vnodeop_p)(void *);
1029f988b79SJean-Baptiste Boric extern int (**v7fs_specop_p)(void *);
1039f988b79SJean-Baptiste Boric extern int (**v7fs_fifoop_p)(void *);
1049f988b79SJean-Baptiste Boric 
1059f988b79SJean-Baptiste Boric /* genfs ops */
1069f988b79SJean-Baptiste Boric int v7fs_gop_alloc(struct vnode *, off_t, off_t, int, kauth_cred_t);
1079f988b79SJean-Baptiste Boric extern const struct genfs_ops v7fs_genfsops;
1089f988b79SJean-Baptiste Boric 
1099f988b79SJean-Baptiste Boric /* internal service */
1109f988b79SJean-Baptiste Boric int v7fs_update(struct vnode *, const struct timespec *,
1119f988b79SJean-Baptiste Boric     const struct timespec *, int);
1129f988b79SJean-Baptiste Boric __END_DECLS
1139f988b79SJean-Baptiste Boric #endif /* _FS_V7FS_EXTERN_H_ */
114