uts: make emu10k non-verbose
[unleashed.git] / include / sys / vfs_opreg.h
blob1cf3128fbd4816f2281a267cc0509ab512615cd3
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 _SYS_VFS_OPREG_H
27 #define _SYS_VFS_OPREG_H
29 #pragma ident "%Z%%M% %I% %E% SMI"
31 #include <sys/vfs.h>
32 #include <sys/fem.h>
34 #ifdef __cplusplus
35 extern "C" {
36 #endif
38 #ifdef _KERNEL
41 * The following union allows us to use C99's "designated initializer"
42 * feature so that we can have strong typechecking for the operations
43 * used in the the fs_operation_def structures.
46 typedef union fs_func {
47 fs_generic_func_p fs_generic; /* Generic function signature */
48 int (*error)(); /* Signature of error function */
49 VFS_OPS; /* Signatures of all vfs operations (vfsops) */
50 VNODE_OPS; /* Signatures of all vnode operations (vops) */
51 FEM_OPS; /* Signatures of all FEM operations (femops) */
52 FSEM_OPS; /* Signatures of all FSEM ops (fsemops) */
53 } fs_func_p;
56 * File systems use arrays of fs_operation_def structures to form
57 * name/value pairs of operations. These arrays get passed to:
59 * - vn_make_ops() to create vnodeops
60 * - vfs_makefsops()/vfs_setfsops() to create vfsops.
62 typedef struct fs_operation_def {
63 char *name; /* name of operation (NULL at end) */
64 fs_func_p func; /* function implementing operation */
65 } fs_operation_def_t;
68 * The operation registration mechanism uses two master tables of operations:
69 * one for vnode operations (vn_ops_table[]) and one for vfs operations
70 * (vfs_ops_table[]). These tables are arrays of fs_operation_trans_def
71 * structures. They contain all of the information necessary for the system
72 * to populate an operations structure (e.g., vnodeops, vfsops).
74 * File systems call registration routines (vfs_setfsops(), vfs_makefsops(),
75 * and vn_make_ops()) and pass in their operations specification tables
76 * (arrays of fs_operation_def structures). These routines use the master
77 * table(s) of operations to build a vnodeops or vfsops structure.
79 typedef struct fs_operation_trans_def {
80 char *name; /* name of operation (NULL at end) */
81 int offset; /* byte offset within ops vector */
82 fs_generic_func_p defaultFunc; /* default function */
83 } fs_operation_trans_def_t;
85 int fs_build_vector(void *vector, int *unused_ops,
86 const fs_operation_trans_def_t *translation,
87 const fs_operation_def_t *operations);
90 * Public operations.
93 int vn_make_ops(const char *, const struct fs_operation_def *,
94 vnodeops_t **);
95 void vn_freevnodeops(vnodeops_t *);
97 int vfs_setfsops(int, const fs_operation_def_t *, vfsops_t **);
98 int vfs_makefsops(const fs_operation_def_t *, vfsops_t **);
99 void vfs_freevfsops(vfsops_t *);
100 int vfs_freevfsops_by_type(int);
102 #endif /* _KERNEL */
104 #ifdef __cplusplus
106 #endif
108 #endif /* _SYS_VFS_OPREG_H */