1/* $NetBSD$ */ 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 45struct 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 52struct 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. */ 70int v7fs_lookup(void *); 71int v7fs_create(void *); 72int v7fs_open(void *); 73int v7fs_close(void *); 74int v7fs_access(void *); 75int v7fs_getattr(void *); 76int v7fs_setattr(void *); 77int v7fs_read(void *); 78int v7fs_write(void *); 79int v7fs_fsync(void *); 80int v7fs_remove(void *); 81int v7fs_rename(void *); 82int v7fs_readdir(void *); 83int v7fs_inactive(void *); 84int v7fs_reclaim(void *); 85int v7fs_bmap(void *); 86int v7fs_strategy(void *); 87int v7fs_print(void *); 88int v7fs_advlock(void *); 89int v7fs_pathconf(void *); 90 91int v7fs_link(void *); 92int v7fs_symlink(void *); 93int v7fs_readlink(void *); 94 95int v7fs_mkdir(void *); 96int v7fs_rmdir(void *); 97 98int v7fs_mknod(void *); 99 100/* vfs ops. */ 101VFS_PROTOS(v7fs); 102 103int v7fs_mountroot(void); 104extern int (**v7fs_vnodeop_p)(void *); 105extern int (**v7fs_specop_p)(void *); 106extern int (**v7fs_fifoop_p)(void *); 107 108/* genfs ops */ 109int v7fs_gop_alloc(struct vnode *, off_t, off_t, int, kauth_cred_t); 110extern const struct genfs_ops v7fs_genfsops; 111 112/* internal service */ 113int v7fs_update(struct vnode *, const struct timespec *, 114 const struct timespec *, int); 115__END_DECLS 116#endif /* _FS_V7FS_EXTERN_H_ */ 117