dv_node.h revision aac43a5f8f51bcc570ff0ae9fad0380daf839ad9
/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License (the "License").
* You may not use this file except in compliance with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
* See the License for the specific language governing permissions
* and limitations under the License.
*
* When distributing Covered Code, include this CDDL HEADER in each
* file and include the License file at usr/src/OPENSOLARIS.LICENSE.
* If applicable, add the following below this CDDL HEADER, with the
* fields enclosed by brackets "[]" replaced with your own identifying
* information: Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
*/
/*
* Copyright 2008 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
#ifndef _SYS_DV_NODE_H
#define _SYS_DV_NODE_H
#pragma ident "%Z%%M% %I% %E% SMI"
/*
* dv_nodes are the file-system specific part of the
* vnodes for the device filesystem.
*
* The device filesystem exports two node types:
*
* VDIR nodes to represent nexus drivers
* VCHR & VBLK nodes to represent devices
*/
#include <sys/ddi_impldefs.h>
#include <sys/devpolicy.h>
#ifdef __cplusplus
extern "C" {
#endif
#ifdef _KERNEL
/*
* Here's the focal point of this filesystem
*/
typedef struct dv_node {
char *dv_name; /* pointer to name */
/*
* The dv_contents lock should be held (read) before looking at
* any of the fields below, and held (write) before modifying them.
*/
/* has ndi_devi_hold on device */
int dv_flags; /* state bits and stuff */
} dvnode_t;
#define DV_UID_DEFAULT 0 /* default uid for devs and dirs */
/* flags for devfs_clean() */
struct devfs_data {
struct dv_node *devfs_root;
struct vfs *devfs_vfsp;
};
/* dv_fid overlays the fid structure (for VFS_VGET) */
struct dv_fid {
};
/*
* Compare a vattr's and mperm_t's minor permissions (uid, gid & mode)
*/
/*
* Merge an mperm_t's minor permissions into a vattr
*/
/*
* dv_shadow_node flags
*/
/*
* Directory tree traversal
*/
extern const char dvnm[]; /* share some space.. */
extern void dv_node_cache_init(void);
extern void dv_node_cache_fini(void);
extern void dv_filldir(struct dv_node *);
void (*f)(struct dv_node *, void *), void *);
extern int devfs_walk(char *, void (*f)(struct dv_node *, void *), void *);
extern int devfs_reset_perm(uint_t);
extern int devfs_remdrv_cleanup(const char *, const char *);
extern struct vnodeops *dv_vnodeops;
extern const struct fs_operation_def dv_vnodeops_template[];
#ifdef DEBUG
extern int devfs_debug;
#define DV_DEBUG 0x01
#define DV_DEBUG2 0x02
#define DV_DEBUG3 0x04
#define DV_DEBUG4 0x08
#define DV_DEBUG5 0x10
#define DV_SYSERR 0x1000
#define DV_SYSTRACE 0x2000
#else
#endif
#endif /* _KERNEL */
#ifdef __cplusplus
}
#endif
#endif /* _SYS_DV_NODE_H */