Home | History | Annotate | Line # | Download | only in raidframe
rf_netbsd.h revision 1.35.6.1
      1  1.35.6.1   thorpej /*	$NetBSD: rf_netbsd.h,v 1.35.6.1 2021/08/01 22:42:31 thorpej 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  *
     19       1.1     oster  * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
     20       1.1     oster  * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
     21       1.1     oster  * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
     22       1.1     oster  * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
     23       1.1     oster  * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
     24       1.1     oster  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
     25       1.1     oster  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
     26       1.1     oster  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
     27       1.1     oster  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
     28       1.1     oster  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
     29       1.1     oster  * POSSIBILITY OF SUCH DAMAGE.
     30       1.1     oster  */
     31       1.1     oster 
     32       1.1     oster #ifndef _RF__RF_NETBSDSTUFF_H_
     33       1.1     oster #define _RF__RF_NETBSDSTUFF_H_
     34       1.1     oster 
     35       1.1     oster #include <sys/fcntl.h>
     36       1.1     oster #include <sys/systm.h>
     37       1.1     oster #include <sys/vnode.h>
     38      1.14     oster #include <sys/pool.h>
     39      1.27  christos #include <sys/disk.h>
     40       1.1     oster 
     41      1.27  christos #include <dev/dkvar.h>
     42      1.13     oster #include <dev/raidframe/raidframevar.h>
     43       1.1     oster 
     44       1.1     oster struct raidcinfo {
     45       1.4     oster 	struct vnode *ci_vp;	/* component device's vnode */
     46       1.4     oster 	dev_t   ci_dev;		/* component device's dev_t */
     47       1.4     oster 	RF_ComponentLabel_t ci_label; /* components RAIDframe label */
     48       1.1     oster #if 0
     49       1.3     oster 	size_t  ci_size;	/* size */
     50       1.3     oster 	char   *ci_path;	/* path to component */
     51       1.3     oster 	size_t  ci_pathlen;	/* length of component path */
     52       1.1     oster #endif
     53       1.1     oster };
     54       1.4     oster 
     55       1.7     oster 
     56      1.14     oster /* a little structure to serve as a container for all the various
     57  1.35.6.1   thorpej    per-device pools used in RAIDframe */
     58      1.14     oster 
     59      1.14     oster struct RF_Pools_s {
     60      1.14     oster 	struct pool asm_hdr;     /* Access Stripe Map Header */
     61      1.14     oster 	struct pool asmap;       /* Access Stripe Map */
     62      1.17     oster 	struct pool asmhle;      /* Access Stripe Map Header List Elements */
     63  1.35.6.1   thorpej 	struct pool bufio;       /* Buffer IO Pool */
     64      1.34  christos 	struct pool callbackf;   /* Callback function descriptors */
     65      1.34  christos 	struct pool callbackv;   /* Callback value descriptors */
     66      1.14     oster 	struct pool dagh;        /* DAG headers */
     67      1.16     oster 	struct pool dagnode;     /* DAG nodes */
     68      1.14     oster 	struct pool daglist;     /* DAG lists */
     69      1.18     oster 	struct pool dagpcache;   /* DAG pointer/param cache */
     70      1.14     oster 	struct pool dqd;         /* Disk Queue Data */
     71      1.17     oster 	struct pool fss;         /* Failed Stripe Structures */
     72      1.14     oster 	struct pool funclist;    /* Function Lists */
     73      1.14     oster 	struct pool mcpair;      /* Mutex/Cond Pairs */
     74      1.14     oster 	struct pool pda;         /* Physical Disk Access structures */
     75      1.15     oster 	struct pool pss;         /* Parity Stripe Status */
     76      1.14     oster 	struct pool rad;         /* Raid Access Descriptors */
     77      1.14     oster 	struct pool reconbuffer; /* reconstruction buffer (header) pool */
     78      1.14     oster 	struct pool revent;      /* reconstruct events */
     79      1.14     oster 	struct pool stripelock;  /* StripeLock */
     80      1.17     oster 	struct pool vfple;       /* VoidFunctionPtr List Elements */
     81      1.19     oster 	struct pool vple;        /* VoidPointer List Elements */
     82      1.14     oster };
     83      1.14     oster 
     84  1.35.6.1   thorpej #define RF_MAX_POOLNAMELEN 30
     85  1.35.6.1   thorpej struct RF_PoolNames_s {
     86  1.35.6.1   thorpej 	char asm_hdr[RF_MAX_POOLNAMELEN];     /* Access Stripe Map Header */
     87  1.35.6.1   thorpej 	char asmap[RF_MAX_POOLNAMELEN];       /* Access Stripe Map */
     88  1.35.6.1   thorpej 	char asmhle[RF_MAX_POOLNAMELEN];      /* Access Stripe Map Header List Elements */
     89  1.35.6.1   thorpej 	char bufio[RF_MAX_POOLNAMELEN];       /* Buffer IO Pool */
     90  1.35.6.1   thorpej 	char callbackf[RF_MAX_POOLNAMELEN];   /* Callback function descriptors */
     91  1.35.6.1   thorpej 	char callbackv[RF_MAX_POOLNAMELEN];   /* Callback value descriptors */
     92  1.35.6.1   thorpej 	char dagh[RF_MAX_POOLNAMELEN];        /* DAG headers */
     93  1.35.6.1   thorpej 	char dagnode[RF_MAX_POOLNAMELEN];     /* DAG nodes */
     94  1.35.6.1   thorpej 	char daglist[RF_MAX_POOLNAMELEN];     /* DAG lists */
     95  1.35.6.1   thorpej 	char dagpcache[RF_MAX_POOLNAMELEN];   /* DAG pointer/param cache */
     96  1.35.6.1   thorpej 	char dqd[RF_MAX_POOLNAMELEN];         /* Disk Queue Data */
     97  1.35.6.1   thorpej 	char fss[RF_MAX_POOLNAMELEN];         /* Failed Stripe Structures */
     98  1.35.6.1   thorpej 	char funclist[RF_MAX_POOLNAMELEN];    /* Function Lists */
     99  1.35.6.1   thorpej 	char mcpair[RF_MAX_POOLNAMELEN];      /* Mutex/Cond Pairs */
    100  1.35.6.1   thorpej 	char pda[RF_MAX_POOLNAMELEN];         /* Physical Disk Access structures */
    101  1.35.6.1   thorpej 	char pss[RF_MAX_POOLNAMELEN];         /* Parity Stripe Status */
    102  1.35.6.1   thorpej 	char rad[RF_MAX_POOLNAMELEN];         /* Raid Access Descriptors */
    103  1.35.6.1   thorpej 	char reconbuffer[RF_MAX_POOLNAMELEN]; /* reconstruction buffer (header) pool */
    104  1.35.6.1   thorpej 	char revent[RF_MAX_POOLNAMELEN];      /* reconstruct events */
    105  1.35.6.1   thorpej 	char stripelock[RF_MAX_POOLNAMELEN];  /* StripeLock */
    106  1.35.6.1   thorpej 	char vfple[RF_MAX_POOLNAMELEN];       /* VoidFunctionPtr List Elements */
    107  1.35.6.1   thorpej 	char vple[RF_MAX_POOLNAMELEN];        /* VoidPointer List Elements */
    108  1.35.6.1   thorpej };
    109  1.35.6.1   thorpej 
    110  1.35.6.1   thorpej extern struct pool rf_alloclist_pool;   /* AllocList */
    111  1.35.6.1   thorpej void rf_pool_init(RF_Raid_t *, char *, struct pool *, size_t, const char *, size_t, size_t);
    112      1.30  christos int rf_buf_queue_check(RF_Raid_t *);
    113      1.14     oster 
    114       1.7     oster /* XXX probably belongs in a different .h file. */
    115       1.7     oster typedef struct RF_AutoConfig_s {
    116       1.8     oster 	char devname[56];       /* the name of this component */
    117      1.12     oster 	int flag;               /* a general-purpose flag */
    118       1.8     oster 	dev_t dev;              /* the device for this component */
    119       1.8     oster 	struct vnode *vp;       /* Mr. Vnode Pointer */
    120       1.8     oster 	RF_ComponentLabel_t *clabel;  /* the label */
    121      1.22     perry 	struct RF_AutoConfig_s *next; /* the next autoconfig structure
    122       1.8     oster 				         in this set. */
    123       1.7     oster } RF_AutoConfig_t;
    124       1.7     oster 
    125       1.7     oster typedef struct RF_ConfigSet_s {
    126       1.8     oster 	struct RF_AutoConfig_s *ac; /* all of the autoconfig structures for
    127       1.8     oster 				       this config set. */
    128       1.8     oster 	int rootable;               /* Set to 1 if this set can be root */
    129       1.7     oster 	struct RF_ConfigSet_s *next;
    130       1.7     oster } RF_ConfigSet_t;
    131       1.4     oster 
    132      1.35  jdolecek extern const int rf_b_pass;
    133      1.35  jdolecek 
    134       1.4     oster #endif /* _RF__RF_NETBSDSTUFF_H_ */
    135