2 * This file and its contents are supplied under the terms of the
3 * Common Development and Distribution License ("CDDL"), version 1.0.
4 * You may only use this file in accordance with the terms of version
7 * A full copy of the text of the CDDL should have accompanied this
8 * source. A copy of the CDDL is also available via the Internet at
9 * http://www.illumos.org/license/CDDL.
13 * Copyright (c) 2014 Joyent, Inc. All rights reserved.
16 #ifndef _SYS_FS_BOOTFS_IMPL_H
17 #define _SYS_FS_BOOTFS_IMPL_H
19 #include <sys/types.h>
22 #include <sys/vnode.h>
24 #include <sys/kstat.h>
31 * The bootfs node is the file system specific version of the vnode for the
32 * bootfs file system. Because the bootfs file system is entirely a read-only
33 * file system, this structure requires no locking as the contents are
36 typedef struct bootfs_node
{
37 char *bvn_name
; /* entry name */
38 struct vnode
*bvn_vnp
; /* Corresponding vnode */
39 avl_tree_t bvn_dir
; /* directory entries, if VDIR */
40 avl_node_t bvn_link
; /* dirent link */
41 list_node_t bvn_alink
; /* link for all nodes */
42 uint64_t bvn_addr
; /* Address in pmem */
43 uint64_t bvn_size
; /* Size of the file */
44 struct bootfs_node
*bvn_parent
; /* .. */
45 vattr_t bvn_attr
; /* attributes for the node */
48 typedef struct bootfs_stat
{
49 kstat_named_t bfss_nfiles
;
50 kstat_named_t bfss_ndirs
;
51 kstat_named_t bfss_nbytes
;
52 kstat_named_t bfss_ndups
;
53 kstat_named_t bfss_ndiscards
;
56 typedef struct bootfs
{
59 bootfs_node_t
*bfs_rootvn
;
64 bootfs_stat_t bfs_stat
;
67 extern void bootfs_construct(bootfs_t
*);
68 extern void bootfs_destruct(bootfs_t
*);
69 extern int bootfs_node_constructor(void *, void *, int);
70 extern void bootfs_node_destructor(void *, void *);
72 extern const struct vnodeops bootfs_vnodeops
;
73 extern kmem_cache_t
*bootfs_node_cache
;
74 extern major_t bootfs_major
;
80 #endif /* _SYS_FS_BOOTFS_IMPL_H */