Home | History | Annotate | Line # | Download | only in sysvbfs
sysvbfs.h revision 1.8
      1 /*	$NetBSD: sysvbfs.h,v 1.8 2008/09/04 12:07:30 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  *
     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_SYSVBFS_SYSVBFS_H_
     33 #define	_FS_SYSVBFS_SYSVBFS_H_
     34 
     35 struct bfs;
     36 struct buf;
     37 
     38 #include <fs/sysvbfs/sysvbfs_args.h>
     39 
     40 #include <miscfs/genfs/genfs.h>
     41 #include <miscfs/genfs/genfs_node.h>
     42 #include <miscfs/specfs/specdev.h>
     43 
     44 struct sysvbfs_node {
     45 	struct genfs_node gnode;
     46 	struct vnode *vnode;
     47 	struct bfs_inode *inode;
     48 	struct sysvbfs_mount *bmp;
     49 	struct lockf *lockf;	/* advlock */
     50 	daddr_t data_block;
     51 	size_t size;
     52 	int update_ctime;
     53 	int update_atime;
     54 	int update_mtime;
     55 
     56 	LIST_ENTRY(sysvbfs_node) link;
     57 };
     58 
     59 struct sysvbfs_mount {
     60 	struct mount *mountp;
     61 	struct vnode *devvp;		/* block device mounted vnode */
     62 	struct bfs *bfs;
     63 	LIST_HEAD(, sysvbfs_node) bnode_head;
     64 };
     65 
     66 /* v-node ops. */
     67 int sysvbfs_lookup(void *);
     68 int sysvbfs_create(void *);
     69 int sysvbfs_open(void *);
     70 int sysvbfs_close(void *);
     71 int sysvbfs_access(void *);
     72 int sysvbfs_getattr(void *);
     73 int sysvbfs_setattr(void *);
     74 int sysvbfs_read(void *);
     75 int sysvbfs_write(void *);
     76 int sysvbfs_fsync(void *);
     77 int sysvbfs_remove(void *);
     78 int sysvbfs_rename(void *);
     79 int sysvbfs_readdir(void *);
     80 int sysvbfs_inactive(void *);
     81 int sysvbfs_reclaim(void *);
     82 int sysvbfs_bmap(void *);
     83 int sysvbfs_strategy(void *);
     84 int sysvbfs_print(void *);
     85 int sysvbfs_advlock(void *);
     86 int sysvbfs_pathconf(void *);
     87 
     88 /* vfs ops. */
     89 VFS_PROTOS(sysvbfs);
     90 
     91 extern int (**sysvbfs_vnodeop_p)(void *);
     92 
     93 /* genfs ops */
     94 int sysvbfs_gop_alloc(struct vnode *, off_t, off_t, int, kauth_cred_t);
     95 extern const struct genfs_ops sysvbfs_genfsops;
     96 
     97 /* internal service */
     98 int sysvbfs_update(struct vnode *, const struct timespec *,
     99     const struct timespec *, int);
    100 
    101 #endif /* _FS_SYSVBFS_SYSVBFS_H_ */
    102