xref: /illumos-gate/usr/src/uts/common/sys/fs/swapnode.h (revision b4203d757c7c247e39c94c09a94021a3a8121062)
1 /*
2  * CDDL HEADER START
3  *
4  * The contents of this file are subject to the terms of the
5  * Common Development and Distribution License, Version 1.0 only
6  * (the "License").  You may not use this file except in compliance
7  * with the License.
8  *
9  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
10  * or http://www.opensolaris.org/os/licensing.
11  * See the License for the specific language governing permissions
12  * and limitations under the License.
13  *
14  * When distributing Covered Code, include this CDDL HEADER in each
15  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
16  * If applicable, add the following below this CDDL HEADER, with the
17  * fields enclosed by brackets "[]" replaced with your own identifying
18  * information: Portions Copyright [yyyy] [name of copyright owner]
19  *
20  * CDDL HEADER END
21  */
22 /*
23  * Copyright 2005 Sun Microsystems, Inc.  All rights reserved.
24  * Use is subject to license terms.
25  */
26 
27 /*	Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T	*/
28 /*	  All Rights Reserved	*/
29 
30 
31 #ifndef	_SYS_FS_SWAPNODE_H
32 #define	_SYS_FS_SWAPNODE_H
33 
34 #ifdef	__cplusplus
35 extern "C" {
36 #endif
37 
38 /*
39  * pointer to swapfs global data structures
40  */
41 extern pgcnt_t swapfs_minfree;		/* amount of availrmem (in pages) */
42 					/* that is unavailable to swapfs */
43 extern pgcnt_t swapfs_desfree;
44 
45 extern pgcnt_t swapfs_reserve;		/* amount of availrmem (in pages) */
46 					/* that is unavailable for swap */
47 					/* reservation to non-priv processes */
48 
49 extern struct vnodeops *swap_vnodeops;
50 extern struct vnode *swapfs_getvp(ulong_t);
51 
52 #ifdef SWAPFS_DEBUG
53 extern int swapfs_debug;
54 #define	SWAPFS_PRINT(X, S, Y1, Y2, Y3, Y4, Y5)	\
55 	if (swapfs_debug & (X)) 		\
56 		printf(S, Y1, Y2, Y3, Y4, Y5);
57 #define	SWAP_SUBR	0x01
58 #define	SWAP_VOPS	0x02
59 #define	SWAP_VFSOPS	0x04
60 #define	SWAP_PGC		0x08
61 #define	SWAP_PUTP	0x10
62 #else	/* SWAPFS_DEBUG */
63 #define	SWAPFS_PRINT(X, S, Y1, Y2, Y3, Y4, Y5)
64 #endif	/* SWAPFS_DEBUG */
65 
66 #ifdef	__cplusplus
67 }
68 #endif
69 
70 #endif	/* _SYS_FS_SWAPNODE_H */
71