1 /* $NetBSD: v7fs_extern.h,v 1.2 2014/12/29 15:29:38 hannken 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 }; 50 51 struct v7fs_node { 52 struct genfs_node gnode; 53 struct v7fs_inode inode; /* filesystem dependent implementation */ 54 struct vnode *vnode; /* back-link */ 55 struct v7fs_mount *v7fsmount; /* our filesystem */ 56 struct lockf *lockf; /* advlock */ 57 58 int update_ctime; 59 int update_atime; 60 int update_mtime; 61 }; 62 63 #define VFSTOV7FS(mp) ((struct v7fs_mount *)((mp)->mnt_data)) 64 65 __BEGIN_DECLS 66 /* v-node ops. */ 67 int v7fs_lookup(void *); 68 int v7fs_create(void *); 69 int v7fs_open(void *); 70 int v7fs_close(void *); 71 int v7fs_access(void *); 72 int v7fs_getattr(void *); 73 int v7fs_setattr(void *); 74 int v7fs_read(void *); 75 int v7fs_write(void *); 76 int v7fs_fsync(void *); 77 int v7fs_remove(void *); 78 int v7fs_rename(void *); 79 int v7fs_readdir(void *); 80 int v7fs_inactive(void *); 81 int v7fs_reclaim(void *); 82 int v7fs_bmap(void *); 83 int v7fs_strategy(void *); 84 int v7fs_print(void *); 85 int v7fs_advlock(void *); 86 int v7fs_pathconf(void *); 87 88 int v7fs_link(void *); 89 int v7fs_symlink(void *); 90 int v7fs_readlink(void *); 91 92 int v7fs_mkdir(void *); 93 int v7fs_rmdir(void *); 94 95 int v7fs_mknod(void *); 96 97 /* vfs ops. */ 98 VFS_PROTOS(v7fs); 99 100 int v7fs_mountroot(void); 101 extern int (**v7fs_vnodeop_p)(void *); 102 extern int (**v7fs_specop_p)(void *); 103 extern int (**v7fs_fifoop_p)(void *); 104 105 /* genfs ops */ 106 int v7fs_gop_alloc(struct vnode *, off_t, off_t, int, kauth_cred_t); 107 extern const struct genfs_ops v7fs_genfsops; 108 109 /* internal service */ 110 int v7fs_update(struct vnode *, const struct timespec *, 111 const struct timespec *, int); 112 __END_DECLS 113 #endif /* _FS_V7FS_EXTERN_H_ */ 114