4 * The contents of this file are subject to the terms of the
5 * Common Development and Distribution License (the "License").
6 * You may not use this file except in compliance with the License.
8 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9 * or http://www.opensolaris.org/os/licensing.
10 * See the License for the specific language governing permissions
11 * and limitations under the License.
13 * When distributing Covered Code, include this CDDL HEADER in each
14 * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15 * If applicable, add the following below this CDDL HEADER, with the
16 * fields enclosed by brackets "[]" replaced with your own identifying
17 * information: Portions Copyright [yyyy] [name of copyright owner]
22 * Copyright 2007 Sun Microsystems, Inc. All rights reserved.
23 * Use is subject to license terms.
29 #pragma ident "%Z%%M% %I% %E% SMI"
31 #include <sys/modctl.h>
33 #include <sys/vnode.h>
35 #include <sys/objfs.h>
44 typedef struct objfs_vfs
{
45 vnode_t
*objfs_vfs_root
;
49 * Common vop_ entry points
51 extern int objfs_dir_open(vnode_t
**, int, cred_t
*, caller_context_t
*);
52 extern int objfs_dir_access(vnode_t
*, int, int, cred_t
*,
54 extern int objfs_common_close(vnode_t
*, int, int, offset_t
, cred_t
*,
58 * Common vop_ support functions
60 extern int objfs_common_getattr(vnode_t
*, vattr_t
*);
63 * Miscellaneous support functions
65 extern int objfs_nobjs(void);
67 #define OBJFS_NAME_MAX MAXNAMELEN
70 * The root vnode has an inode number of 0xffffffff. All other vnodes have an
71 * inode that is an OR of the module id with the type of vnode.
73 * ----------------------------------------
75 * ----------------------------------------
78 * This way, module directories will have an inode value equal to their module
82 #define OBJFS_INO(modid, type) \
83 (((uint64_t)(type) << 32) | (modid))
88 typedef gfs_dir_t objfs_rootnode_t
;
90 #define OBJFS_INO_ROOT 0xffffffff
92 extern vnode_t
*objfs_create_root(vfs_t
*);
98 typedef struct objfs_odirnode
{
99 gfs_dir_t objfs_odir_dir
; /* gfs dir */
100 struct modctl
*objfs_odir_modctl
; /* modctl pointer */
103 #define OBJFS_INO_ODIR(modid) OBJFS_INO(modid, 0)
105 extern vnode_t
*objfs_create_odirnode(vnode_t
*, struct modctl
*);
110 typedef struct objfs_datanode
{
111 gfs_file_t objfs_data_file
; /* gfs file */
112 objfs_info_t objfs_data_info
;
113 int objfs_data_gencount
; /* gen when opened */
116 #define OBJFS_INO_DATA(modid) OBJFS_INO(modid, 1)
118 extern void objfs_data_init(void);
119 extern vnode_t
*objfs_create_data(vnode_t
*);
125 #endif /* _OBJFS_IMPL_H */