devfs_int.h revision 150342
1149144Sphk/*- 2149144Sphk * Copyright (c) 2005 Poul-Henning Kamp. All rights reserved. 3149144Sphk * 4149144Sphk * Redistribution and use in source and binary forms, with or without 5149144Sphk * modification, are permitted provided that the following conditions 6149144Sphk * are met: 7149144Sphk * 1. Redistributions of source code must retain the above copyright 8149144Sphk * notice, this list of conditions and the following disclaimer. 9149144Sphk * 2. Neither the name of the University nor the names of its contributors 10149144Sphk * may be used to endorse or promote products derived from this software 11149144Sphk * without specific prior written permission. 12149144Sphk * 13149144Sphk * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND 14149144Sphk * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 15149144Sphk * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 16149144Sphk * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE 17149144Sphk * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 18149144Sphk * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 19149144Sphk * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 20149144Sphk * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 21149144Sphk * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 22149144Sphk * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 23149144Sphk * SUCH DAMAGE. 24149144Sphk * 25149144Sphk * $FreeBSD: head/sys/fs/devfs/devfs_int.h 150342 2005-09-19 19:56:48Z phk $ 26149144Sphk */ 27149144Sphk 28149144Sphk/* 29149144Sphk * This file documents a private interface and it SHALL only be used 30149144Sphk * by kern/kern_conf.c and fs/devfs/... 31149144Sphk */ 32149144Sphk 33149144Sphk#ifndef _FS_DEVFS_DEVFS_INT_H_ 34149144Sphk#define _FS_DEVFS_DEVFS_INT_H_ 35149144Sphk 36149144Sphk#include <sys/queue.h> 37149144Sphk 38149144Sphk#ifdef _KERNEL 39149144Sphk 40150342Sphkstruct devfs_dirent; 41150342Sphk 42150342Sphkstruct cdev_priv { 43150342Sphk struct cdev cdp_c; 44150342Sphk TAILQ_ENTRY(cdev_priv) cdp_list; 45150342Sphk 46150342Sphk u_int cdp_inode; 47150342Sphk 48150342Sphk u_int cdp_flags; 49150342Sphk#define CDP_ACTIVE (1 << 0) 50150342Sphk 51150342Sphk u_int cdp_inuse; 52150342Sphk u_int cdp_maxdirent; 53150342Sphk struct devfs_dirent **cdp_dirents; 54150342Sphk struct devfs_dirent *cdp_dirent0; 55150342Sphk}; 56150342Sphk 57150342Sphkstruct cdev *devfs_alloc(void); 58150342Sphkvoid devfs_free(struct cdev *); 59149144Sphkvoid devfs_create(struct cdev *dev); 60149144Sphkvoid devfs_destroy(struct cdev *dev); 61149144Sphk 62150342Sphkextern struct unrhdr *devfs_inos; 63150342Sphkextern struct mtx devmtx; 64150342Sphk 65149144Sphk#endif /* _KERNEL */ 66149144Sphk 67149144Sphk#endif /* !_FS_DEVFS_DEVFS_INT_H_ */ 68