xref: /titanic_44/usr/src/uts/common/sys/fs/lofs_node.h (revision 8eea8e29cc4374d1ee24c25a07f45af132db3499)
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 1989-1991, 2003 Sun Microsystems, Inc.  All rights reserved.
24  * Use is subject to license terms.
25  */
26 
27 /*
28  * Loop-back file information structure.
29  */
30 
31 #ifndef _SYS_FS_LOFS_NODE_H
32 #define	_SYS_FS_LOFS_NODE_H
33 
34 #pragma ident	"%Z%%M%	%I%	%E% SMI"
35 
36 #include <sys/fs/lofs_info.h>
37 
38 #ifdef	__cplusplus
39 extern "C" {
40 #endif
41 
42 /*
43  * The lnode is the "inode" for loop-back files.  It contains
44  * all the information necessary to handle loop-back file on the
45  * client side.
46  */
47 typedef struct lnode {
48 	struct lnode	*lo_next;	/* link for hash chain */
49 	struct vnode	*lo_vp;		/* pointer to real vnode */
50 	uint_t		lo_looping; 	/* detect looping */
51 	struct vnode	*lo_vnode;	/* place holder vnode for file */
52 } lnode_t;
53 
54 /*
55  * Convert between vnode and lnode
56  */
57 #define	ltov(lp)	(((lp)->lo_vnode))
58 #define	vtol(vp)	((struct lnode *)((vp)->v_data))
59 #define	realvp(vp)	(vtol(vp)->lo_vp)
60 
61 #ifdef _KERNEL
62 extern vnode_t *makelonode(vnode_t *, struct loinfo *);
63 extern void freelonode(lnode_t *);
64 
65 extern struct vnode kvp;
66 #endif /* _KERNEL */
67 
68 #ifdef	__cplusplus
69 }
70 #endif
71 
72 #endif	/* _SYS_FS_LOFS_NODE_H */
73