Home | History | Annotate | Line # | Download | only in raidframe
rf_netbsd.h revision 1.13.18.6
      1  1.13.18.6  skrll /*	$NetBSD: rf_netbsd.h,v 1.13.18.6 2005/11/10 14:07:40 skrll Exp $	*/
      2        1.1  oster 
      3        1.1  oster /*-
      4        1.1  oster  * Copyright (c) 1996, 1997, 1998 The NetBSD Foundation, Inc.
      5        1.1  oster  * All rights reserved.
      6        1.1  oster  *
      7        1.1  oster  * This code is derived from software contributed to The NetBSD Foundation
      8        1.6     ad  * by Greg Oster; Jason R. Thorpe.
      9        1.1  oster  *
     10        1.1  oster  * Redistribution and use in source and binary forms, with or without
     11        1.1  oster  * modification, are permitted provided that the following conditions
     12        1.1  oster  * are met:
     13        1.1  oster  * 1. Redistributions of source code must retain the above copyright
     14        1.1  oster  *    notice, this list of conditions and the following disclaimer.
     15        1.1  oster  * 2. Redistributions in binary form must reproduce the above copyright
     16        1.1  oster  *    notice, this list of conditions and the following disclaimer in the
     17        1.1  oster  *    documentation and/or other materials provided with the distribution.
     18        1.1  oster  * 3. All advertising materials mentioning features or use of this software
     19        1.1  oster  *    must display the following acknowledgement:
     20        1.1  oster  *        This product includes software developed by the NetBSD
     21        1.1  oster  *        Foundation, Inc. and its contributors.
     22        1.1  oster  * 4. Neither the name of The NetBSD Foundation nor the names of its
     23        1.1  oster  *    contributors may be used to endorse or promote products derived
     24        1.1  oster  *    from this software without specific prior written permission.
     25        1.1  oster  *
     26        1.1  oster  * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
     27        1.1  oster  * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
     28        1.1  oster  * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
     29        1.1  oster  * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
     30        1.1  oster  * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
     31        1.1  oster  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
     32        1.1  oster  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
     33        1.1  oster  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
     34        1.1  oster  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
     35        1.1  oster  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
     36        1.1  oster  * POSSIBILITY OF SUCH DAMAGE.
     37        1.1  oster  */
     38        1.1  oster 
     39        1.1  oster #ifndef _RF__RF_NETBSDSTUFF_H_
     40        1.1  oster #define _RF__RF_NETBSDSTUFF_H_
     41        1.1  oster 
     42        1.1  oster #include <sys/fcntl.h>
     43        1.1  oster #include <sys/systm.h>
     44        1.1  oster #include <sys/namei.h>
     45        1.1  oster #include <sys/vnode.h>
     46  1.13.18.1  skrll #include <sys/pool.h>
     47        1.1  oster 
     48       1.13  oster #include <dev/raidframe/raidframevar.h>
     49        1.1  oster 
     50        1.1  oster struct raidcinfo {
     51        1.4  oster 	struct vnode *ci_vp;	/* component device's vnode */
     52        1.4  oster 	dev_t   ci_dev;		/* component device's dev_t */
     53        1.4  oster 	RF_ComponentLabel_t ci_label; /* components RAIDframe label */
     54        1.1  oster #if 0
     55        1.3  oster 	size_t  ci_size;	/* size */
     56        1.3  oster 	char   *ci_path;	/* path to component */
     57        1.3  oster 	size_t  ci_pathlen;	/* length of component path */
     58        1.1  oster #endif
     59        1.1  oster };
     60        1.4  oster 
     61        1.7  oster 
     62  1.13.18.1  skrll /* a little structure to serve as a container for all the various
     63  1.13.18.1  skrll    global pools used in RAIDframe */
     64  1.13.18.1  skrll 
     65  1.13.18.1  skrll struct RF_Pools_s {
     66  1.13.18.1  skrll 	struct pool alloclist;   /* AllocList */
     67  1.13.18.1  skrll 	struct pool asm_hdr;     /* Access Stripe Map Header */
     68  1.13.18.1  skrll 	struct pool asmap;       /* Access Stripe Map */
     69  1.13.18.1  skrll 	struct pool asmhle;      /* Access Stripe Map Header List Elements */
     70  1.13.18.1  skrll 	struct pool callback;    /* Callback descriptors */
     71  1.13.18.1  skrll 	struct pool cbuf;        /* Component buffers */
     72  1.13.18.1  skrll 	struct pool dagh;        /* DAG headers */
     73  1.13.18.1  skrll 	struct pool dagnode;     /* DAG nodes */
     74  1.13.18.1  skrll 	struct pool daglist;     /* DAG lists */
     75  1.13.18.1  skrll 	struct pool dagpcache;   /* DAG pointer/param cache */
     76  1.13.18.1  skrll 	struct pool dqd;         /* Disk Queue Data */
     77  1.13.18.1  skrll 	struct pool fss;         /* Failed Stripe Structures */
     78  1.13.18.1  skrll 	struct pool funclist;    /* Function Lists */
     79  1.13.18.1  skrll 	struct pool mcpair;      /* Mutex/Cond Pairs */
     80  1.13.18.1  skrll 	struct pool pda;         /* Physical Disk Access structures */
     81  1.13.18.1  skrll 	struct pool pss;         /* Parity Stripe Status */
     82  1.13.18.1  skrll 	struct pool pss_issued;  /* Parity Stripe Status Issued */
     83  1.13.18.1  skrll 	struct pool rad;         /* Raid Access Descriptors */
     84  1.13.18.1  skrll 	struct pool reconbuffer; /* reconstruction buffer (header) pool */
     85  1.13.18.1  skrll 	struct pool revent;      /* reconstruct events */
     86  1.13.18.1  skrll 	struct pool stripelock;  /* StripeLock */
     87  1.13.18.1  skrll 	struct pool vfple;       /* VoidFunctionPtr List Elements */
     88  1.13.18.1  skrll 	struct pool vple;        /* VoidPointer List Elements */
     89  1.13.18.1  skrll };
     90  1.13.18.1  skrll 
     91  1.13.18.1  skrll extern struct RF_Pools_s rf_pools;
     92  1.13.18.6  skrll void rf_pool_init(struct pool *, size_t, const char *, size_t, size_t);
     93  1.13.18.6  skrll int rf_buf_queue_check(int);
     94        1.7  oster 
     95        1.7  oster /* XXX probably belongs in a different .h file. */
     96        1.7  oster typedef struct RF_AutoConfig_s {
     97        1.8  oster 	char devname[56];       /* the name of this component */
     98       1.12  oster 	int flag;               /* a general-purpose flag */
     99        1.8  oster 	dev_t dev;              /* the device for this component */
    100        1.8  oster 	struct vnode *vp;       /* Mr. Vnode Pointer */
    101        1.8  oster 	RF_ComponentLabel_t *clabel;  /* the label */
    102  1.13.18.5  skrll 	struct RF_AutoConfig_s *next; /* the next autoconfig structure
    103        1.8  oster 				         in this set. */
    104        1.7  oster } RF_AutoConfig_t;
    105        1.7  oster 
    106        1.7  oster typedef struct RF_ConfigSet_s {
    107        1.8  oster 	struct RF_AutoConfig_s *ac; /* all of the autoconfig structures for
    108        1.8  oster 				       this config set. */
    109        1.8  oster 	int rootable;               /* Set to 1 if this set can be root */
    110        1.7  oster 	struct RF_ConfigSet_s *next;
    111        1.7  oster } RF_ConfigSet_t;
    112        1.4  oster 
    113        1.4  oster #endif /* _RF__RF_NETBSDSTUFF_H_ */
    114