Home | History | Annotate | Line # | Download | only in sysvbfs
sysvbfs.h revision 1.6
      1 /*	$NetBSD: sysvbfs.h,v 1.6 2007/07/31 21:14:18 pooka 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  * 3. All advertising materials mentioning features or use of this software
     19  *    must display the following acknowledgement:
     20  *        This product includes software developed by the NetBSD
     21  *        Foundation, Inc. and its contributors.
     22  * 4. Neither the name of The NetBSD Foundation nor the names of its
     23  *    contributors may be used to endorse or promote products derived
     24  *    from this software without specific prior written permission.
     25  *
     26  * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
     27  * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
     28  * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
     29  * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
     30  * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
     31  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
     32  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
     33  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
     34  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
     35  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
     36  * POSSIBILITY OF SUCH DAMAGE.
     37  */
     38 
     39 #ifndef _FS_SYSVBFS_SYSVBFS_H_
     40 #define	_FS_SYSVBFS_SYSVBFS_H_
     41 
     42 struct sysvbfs_args {
     43 	char	*fspec;		/* blocks special holding the fs to mount */
     44 };
     45 
     46 #ifdef _KERNEL
     47 struct bfs;
     48 struct buf;
     49 
     50 #include <miscfs/genfs/genfs.h>
     51 #include <miscfs/genfs/genfs_node.h>
     52 #include <miscfs/specfs/specdev.h>
     53 
     54 struct sysvbfs_node {
     55 	struct genfs_node gnode;
     56 	struct vnode *vnode;
     57 	struct bfs_inode *inode;
     58 	struct sysvbfs_mount *bmp;
     59 	struct lockf *lockf;	/* advlock */
     60 	daddr_t data_block;
     61 	size_t size;
     62 	int update_ctime;
     63 	int update_atime;
     64 	int update_mtime;
     65 
     66 	LIST_ENTRY(sysvbfs_node) link;
     67 };
     68 
     69 struct sysvbfs_mount {
     70 	struct mount *mountp;
     71 	struct vnode *devvp;		/* block device mounted vnode */
     72 	struct bfs *bfs;
     73 	LIST_HEAD(, sysvbfs_node) bnode_head;
     74 };
     75 
     76 /* v-node ops. */
     77 int sysvbfs_lookup(void *);
     78 int sysvbfs_create(void *);
     79 int sysvbfs_open(void *);
     80 int sysvbfs_close(void *);
     81 int sysvbfs_access(void *);
     82 int sysvbfs_getattr(void *);
     83 int sysvbfs_setattr(void *);
     84 int sysvbfs_read(void *);
     85 int sysvbfs_write(void *);
     86 int sysvbfs_fsync(void *);
     87 int sysvbfs_remove(void *);
     88 int sysvbfs_rename(void *);
     89 int sysvbfs_readdir(void *);
     90 int sysvbfs_inactive(void *);
     91 int sysvbfs_reclaim(void *);
     92 int sysvbfs_bmap(void *);
     93 int sysvbfs_strategy(void *);
     94 int sysvbfs_print(void *);
     95 int sysvbfs_advlock(void *);
     96 int sysvbfs_pathconf(void *);
     97 
     98 /* vfs ops. */
     99 VFS_PROTOS(sysvbfs);
    100 
    101 extern int (**sysvbfs_vnodeop_p)(void *);
    102 
    103 /* genfs ops */
    104 int sysvbfs_gop_alloc(struct vnode *, off_t, off_t, int, kauth_cred_t);
    105 extern const struct genfs_ops sysvbfs_genfsops;
    106 
    107 /* internal service */
    108 int sysvbfs_update(struct vnode *, const struct timespec *,
    109     const struct timespec *, int);
    110 
    111 #endif /* _KERNEL */
    112 #endif /* _FS_SYSVBFS_SYSVBFS_H_ */
    113