xref: /netbsd-src/sys/ufs/mfs/mfsnode.h (revision 4171507047618037486097a1f3c1745570c5c293)
1*41715070Sdholland /*	$NetBSD: mfsnode.h,v 1.22 2021/07/18 23:57:15 dholland Exp $	*/
2fccfa11aScgd 
3264b874cSmycroft /*
4264b874cSmycroft  * Copyright (c) 1989, 1993
5264b874cSmycroft  *	The Regents of the University of California.  All rights reserved.
6264b874cSmycroft  *
7264b874cSmycroft  * Redistribution and use in source and binary forms, with or without
8264b874cSmycroft  * modification, are permitted provided that the following conditions
9264b874cSmycroft  * are met:
10264b874cSmycroft  * 1. Redistributions of source code must retain the above copyright
11264b874cSmycroft  *    notice, this list of conditions and the following disclaimer.
12264b874cSmycroft  * 2. Redistributions in binary form must reproduce the above copyright
13264b874cSmycroft  *    notice, this list of conditions and the following disclaimer in the
14264b874cSmycroft  *    documentation and/or other materials provided with the distribution.
15aad01611Sagc  * 3. Neither the name of the University nor the names of its contributors
16264b874cSmycroft  *    may be used to endorse or promote products derived from this software
17264b874cSmycroft  *    without specific prior written permission.
18264b874cSmycroft  *
19264b874cSmycroft  * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
20264b874cSmycroft  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
21264b874cSmycroft  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
22264b874cSmycroft  * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
23264b874cSmycroft  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
24264b874cSmycroft  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
25264b874cSmycroft  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
26264b874cSmycroft  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
27264b874cSmycroft  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
28264b874cSmycroft  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
29264b874cSmycroft  * SUCH DAMAGE.
30264b874cSmycroft  *
31e5bc90f4Sfvdl  *	@(#)mfsnode.h	8.3 (Berkeley) 5/19/95
32264b874cSmycroft  */
33264b874cSmycroft 
3460db16d1Smatt #ifndef _UFS_MFS_MFSNODE_H_
3560db16d1Smatt #define _UFS_MFS_MFSNODE_H_
3660db16d1Smatt 
37264b874cSmycroft /*
38264b874cSmycroft  * This structure defines the control data for the memory based file system.
39264b874cSmycroft  */
40264b874cSmycroft 
41264b874cSmycroft struct mfsnode {
42264b874cSmycroft 	struct vnode *mfs_vnode;	/* vnode associated with this mfsnode */
4353524e44Schristos 	void 	*mfs_baseoff;		/* base of file system in memory */
44264b874cSmycroft 	long	mfs_size;		/* size of memory file system */
456d7f14dcSthorpej 	struct proc *mfs_proc;		/* supporting process */
46d4c062b4Shannken 	int	mfs_shutdown;		/* shutdown this mfsnode */
473bc2a579Syamt #if defined(_KERNEL)
48110d5cc2Sad 	kcondvar_t mfs_cv;		/* notifier */
49021b86ddSad 	int	mfs_refcnt;		/* number of references */
50aec75b1cSyamt 	struct	bufq_state *mfs_buflist;/* list of I/O requests */
513bc2a579Syamt #endif /* defined(_KERNEL) */
52264b874cSmycroft };
53264b874cSmycroft 
543bc2a579Syamt #if defined(_KERNEL)
55264b874cSmycroft /*
56264b874cSmycroft  * Convert between mfsnode pointers and vnode pointers
57264b874cSmycroft  */
58264b874cSmycroft #define VTOMFS(vp)	((struct mfsnode *)(vp)->v_data)
59264b874cSmycroft #define MFSTOV(mfsp)	((mfsp)->mfs_vnode)
60264b874cSmycroft 
613bc2a579Syamt #endif /* defined(_KERNEL) */
623bc2a579Syamt 
6360db16d1Smatt #endif /* !_UFS_MFS_MFSNODE_H_ */
64