autofs: disable by default
[unleashed.git] / include / sys / objfs_impl.h
blob324a3cbef64c7df483a42a64b310e4a19e76be2e
1 /*
2 * CDDL HEADER START
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]
19 * CDDL HEADER END
22 * Copyright 2007 Sun Microsystems, Inc. All rights reserved.
23 * Use is subject to license terms.
26 #ifndef _OBJFS_IMPL_H
27 #define _OBJFS_IMPL_H
29 #pragma ident "%Z%%M% %I% %E% SMI"
31 #include <sys/modctl.h>
32 #include <sys/vfs.h>
33 #include <sys/vnode.h>
34 #include <sys/gfs.h>
35 #include <sys/objfs.h>
37 #ifdef __cplusplus
38 extern "C" {
39 #endif
42 * VFS data object
44 typedef struct objfs_vfs {
45 vnode_t *objfs_vfs_root;
46 } objfs_vfs_t;
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 *,
53 caller_context_t *);
54 extern int objfs_common_close(vnode_t *, int, int, offset_t, cred_t *,
55 caller_context_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 * ----------------------------------------
74 * | type | mod_id |
75 * ----------------------------------------
76 * 63 31 0
78 * This way, module directories will have an inode value equal to their module
79 * id.
82 #define OBJFS_INO(modid, type) \
83 (((uint64_t)(type) << 32) | (modid))
86 * Root directory
88 typedef gfs_dir_t objfs_rootnode_t;
90 #define OBJFS_INO_ROOT 0xffffffff
92 extern vnode_t *objfs_create_root(vfs_t *);
95 * Object directory
98 typedef struct objfs_odirnode {
99 gfs_dir_t objfs_odir_dir; /* gfs dir */
100 struct modctl *objfs_odir_modctl; /* modctl pointer */
101 } objfs_odirnode_t;
103 #define OBJFS_INO_ODIR(modid) OBJFS_INO(modid, 0)
105 extern vnode_t *objfs_create_odirnode(vnode_t *, struct modctl *);
108 * Data file
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 */
114 } objfs_datanode_t;
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 *);
121 #ifdef __cplusplus
123 #endif
125 #endif /* _OBJFS_IMPL_H */