\hypertarget{geom__ccd_8c_source}{}\doxysection{geom\+\_\+ccd.\+c}
\label{geom__ccd_8c_source}\index{geom/geom\_ccd.c@{geom/geom\_ccd.c}}
\mbox{\hyperlink{geom__ccd_8c}{Go to the documentation of this file.}}
\begin{DoxyCode}{0}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00001}00001 \textcolor{comment}{/*-\/}}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00002}00002 \textcolor{comment}{ * SPDX-\/License-\/Identifier: (BSD-\/2-\/Clause-\/NetBSD AND BSD-\/3-\/Clause)}}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00003}00003 \textcolor{comment}{ *}}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00004}00004 \textcolor{comment}{ * Copyright (c) 2003 Poul-\/Henning Kamp.}}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00005}00005 \textcolor{comment}{ * Copyright (c) 1996, 1997 The NetBSD Foundation, Inc.}}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00006}00006 \textcolor{comment}{ * All rights reserved.}}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00007}00007 \textcolor{comment}{ *}}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00008}00008 \textcolor{comment}{ * This code is derived from software contributed to The NetBSD Foundation}}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00009}00009 \textcolor{comment}{ * by Jason R. Thorpe.}}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00010}00010 \textcolor{comment}{ *}}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00011}00011 \textcolor{comment}{ * Redistribution and use in source and binary forms, with or without}}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00012}00012 \textcolor{comment}{ * modification, are permitted provided that the following conditions}}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00013}00013 \textcolor{comment}{ * are met:}}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00014}00014 \textcolor{comment}{ * 1. Redistributions of source code must retain the above copyright}}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00015}00015 \textcolor{comment}{ *    notice, this list of conditions and the following disclaimer.}}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00016}00016 \textcolor{comment}{ * 2. Redistributions in binary form must reproduce the above copyright}}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00017}00017 \textcolor{comment}{ *    notice, this list of conditions and the following disclaimer in the}}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00018}00018 \textcolor{comment}{ *    documentation and/or other materials provided with the distribution.}}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00019}00019 \textcolor{comment}{ *}}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00020}00020 \textcolor{comment}{ * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS}}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00021}00021 \textcolor{comment}{ * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED}}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00022}00022 \textcolor{comment}{ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR}}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00023}00023 \textcolor{comment}{ * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS}}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00024}00024 \textcolor{comment}{ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR}}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00025}00025 \textcolor{comment}{ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF}}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00026}00026 \textcolor{comment}{ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS}}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00027}00027 \textcolor{comment}{ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN}}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00028}00028 \textcolor{comment}{ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)}}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00029}00029 \textcolor{comment}{ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE}}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00030}00030 \textcolor{comment}{ * POSSIBILITY OF SUCH DAMAGE.}}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00031}00031 \textcolor{comment}{ *}}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00032}00032 \textcolor{comment}{ * \$NetBSD: ccd.c,v 1.22 1995/12/08 19:13:26 thorpej Exp \$ }}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00033}00033 \textcolor{comment}{ */}}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00034}00034 }
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00035}00035 \textcolor{comment}{/*-\/}}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00036}00036 \textcolor{comment}{ * Copyright (c) 1988 University of Utah.}}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00037}00037 \textcolor{comment}{ * Copyright (c) 1990, 1993}}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00038}00038 \textcolor{comment}{ *      The Regents of the University of California.  All rights reserved.}}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00039}00039 \textcolor{comment}{ *}}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00040}00040 \textcolor{comment}{ * This code is derived from software contributed to Berkeley by}}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00041}00041 \textcolor{comment}{ * the Systems Programming Group of the University of Utah Computer}}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00042}00042 \textcolor{comment}{ * Science Department.}}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00043}00043 \textcolor{comment}{ *}}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00044}00044 \textcolor{comment}{ * Redistribution and use in source and binary forms, with or without}}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00045}00045 \textcolor{comment}{ * modification, are permitted provided that the following conditions}}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00046}00046 \textcolor{comment}{ * are met:}}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00047}00047 \textcolor{comment}{ * 1. Redistributions of source code must retain the above copyright}}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00048}00048 \textcolor{comment}{ *    notice, this list of conditions and the following disclaimer.}}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00049}00049 \textcolor{comment}{ * 2. Redistributions in binary form must reproduce the above copyright}}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00050}00050 \textcolor{comment}{ *    notice, this list of conditions and the following disclaimer in the}}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00051}00051 \textcolor{comment}{ *    documentation and/or other materials provided with the distribution.}}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00052}00052 \textcolor{comment}{ * 3. Neither the name of the University nor the names of its contributors}}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00053}00053 \textcolor{comment}{ *    may be used to endorse or promote products derived from this software}}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00054}00054 \textcolor{comment}{ *    without specific prior written permission.}}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00055}00055 \textcolor{comment}{ *}}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00056}00056 \textcolor{comment}{ * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND}}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00057}00057 \textcolor{comment}{ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE}}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00058}00058 \textcolor{comment}{ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE}}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00059}00059 \textcolor{comment}{ * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE}}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00060}00060 \textcolor{comment}{ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL}}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00061}00061 \textcolor{comment}{ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS}}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00062}00062 \textcolor{comment}{ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)}}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00063}00063 \textcolor{comment}{ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT}}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00064}00064 \textcolor{comment}{ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY}}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00065}00065 \textcolor{comment}{ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF}}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00066}00066 \textcolor{comment}{ * SUCH DAMAGE.}}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00067}00067 \textcolor{comment}{ *}}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00068}00068 \textcolor{comment}{ * from: Utah \$Hdr: cd.c 1.6 90/11/28\$}}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00069}00069 \textcolor{comment}{ *}}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00070}00070 \textcolor{comment}{ *      @(\#)cd.c        8.2 (Berkeley) 11/16/93}}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00071}00071 \textcolor{comment}{ */}}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00072}00072 }
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00073}00073 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00074}00074 \textcolor{comment}{ * Dynamic configuration and disklabel support by:}}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00075}00075 \textcolor{comment}{ *      Jason R. Thorpe <thorpej@nas.nasa.gov>}}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00076}00076 \textcolor{comment}{ *      Numerical Aerodynamic Simulation Facility}}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00077}00077 \textcolor{comment}{ *      Mail Stop 258-\/6}}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00078}00078 \textcolor{comment}{ *      NASA Ames Research Center}}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00079}00079 \textcolor{comment}{ *      Moffett Field, CA 94035}}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00080}00080 \textcolor{comment}{ */}}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00081}00081 }
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00082}00082 \textcolor{preprocessor}{\#include <sys/cdefs.h>}}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00083}\mbox{\hyperlink{geom__ccd_8c_a8c3ef283470a68cd30afe9b8a72cb60f}{00083}} \mbox{\hyperlink{geom__ccd_8c_a8c3ef283470a68cd30afe9b8a72cb60f}{\_\_FBSDID}}(\textcolor{stringliteral}{"{}\$FreeBSD\$"{}});}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00084}00084 }
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00085}00085 \textcolor{preprocessor}{\#include <sys/param.h>}}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00086}00086 \textcolor{preprocessor}{\#include <sys/systm.h>}}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00087}00087 \textcolor{preprocessor}{\#include <sys/kernel.h>}}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00088}00088 \textcolor{preprocessor}{\#include <sys/module.h>}}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00089}00089 \textcolor{preprocessor}{\#include <sys/bio.h>}}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00090}00090 \textcolor{preprocessor}{\#include <sys/malloc.h>}}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00091}00091 \textcolor{preprocessor}{\#include <sys/sbuf.h>}}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00092}00092 \textcolor{preprocessor}{\#include <\mbox{\hyperlink{geom_8h}{geom/geom.h}}>}}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00093}00093 }
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00094}00094 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00095}00095 \textcolor{comment}{ * Number of blocks to untouched in front of a component partition.}}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00096}00096 \textcolor{comment}{ * This is to avoid violating its disklabel area when it starts at the}}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00097}00097 \textcolor{comment}{ * beginning of the slice.}}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00098}00098 \textcolor{comment}{ */}}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00099}00099 \textcolor{preprocessor}{\#if !defined(CCD\_OFFSET)}}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00100}\mbox{\hyperlink{geom__ccd_8c_ac5ea0fc44e8c5feaad3245cb7376ff71}{00100}} \textcolor{preprocessor}{\#define CCD\_OFFSET 16}}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00101}00101 \textcolor{preprocessor}{\#endif}}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00102}00102 }
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00103}00103 \textcolor{comment}{/* sc\_flags */}}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00104}\mbox{\hyperlink{geom__ccd_8c_aa25094a1129b7c55dd7fc5712dfde8b1}{00104}} \textcolor{preprocessor}{\#define CCDF\_UNIFORM    0x02    }\textcolor{comment}{/* use LCCD of sizes for uniform interleave */}\textcolor{preprocessor}{}}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00105}\mbox{\hyperlink{geom__ccd_8c_a0af89084730d0dc0d1dbc17f08474712}{00105}} \textcolor{preprocessor}{\#define CCDF\_MIRROR     0x04    }\textcolor{comment}{/* use mirroring */}\textcolor{preprocessor}{}}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00106}\mbox{\hyperlink{geom__ccd_8c_ac3e68afc08e3907bf1867092da9f5550}{00106}} \textcolor{preprocessor}{\#define CCDF\_NO\_OFFSET  0x08    }\textcolor{comment}{/* do not leave space in front */}\textcolor{preprocessor}{}}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00107}\mbox{\hyperlink{geom__ccd_8c_af583f62c6eb7522c82ccc1c50d6562cc}{00107}} \textcolor{preprocessor}{\#define CCDF\_LINUX      0x10    }\textcolor{comment}{/* use Linux compatibility mode */}\textcolor{preprocessor}{}}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00108}00108 }
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00109}00109 \textcolor{comment}{/* Mask of user-\/settable ccd flags. */}}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00110}\mbox{\hyperlink{geom__ccd_8c_ae5c7f4540b8813240b64c6ca6a49d8ee}{00110}} \textcolor{preprocessor}{\#define CCDF\_USERMASK   (CCDF\_UNIFORM|CCDF\_MIRROR)}}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00111}00111 }
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00112}00112 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00113}00113 \textcolor{comment}{ * Interleave description table.}}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00114}00114 \textcolor{comment}{ * Computed at boot time to speed irregular-\/interleave lookups.}}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00115}00115 \textcolor{comment}{ * The idea is that we interleave in "{}groups"{}.  First we interleave}}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00116}00116 \textcolor{comment}{ * evenly over all component disks up to the size of the smallest}}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00117}00117 \textcolor{comment}{ * component (the first group), then we interleave evenly over all}}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00118}00118 \textcolor{comment}{ * remaining disks up to the size of the next-\/smallest (second group),}}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00119}00119 \textcolor{comment}{ * and so on.}}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00120}00120 \textcolor{comment}{ *}}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00121}00121 \textcolor{comment}{ * Each table entry describes the interleave characteristics of one}}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00122}00122 \textcolor{comment}{ * of these groups.  For example if a concatenated disk consisted of}}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00123}00123 \textcolor{comment}{ * three components of 5, 3, and 7 DEV\_BSIZE blocks interleaved at}}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00124}00124 \textcolor{comment}{ * DEV\_BSIZE (1), the table would have three entries:}}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00125}00125 \textcolor{comment}{ *}}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00126}00126 \textcolor{comment}{ *      ndisk   startblk        startoff        dev}}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00127}00127 \textcolor{comment}{ *      3       0               0               0, 1, 2}}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00128}00128 \textcolor{comment}{ *      2       9               3               0, 2}}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00129}00129 \textcolor{comment}{ *      1       13              5               2}}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00130}00130 \textcolor{comment}{ *      0       -\/               -\/               -\/}}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00131}00131 \textcolor{comment}{ *}}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00132}00132 \textcolor{comment}{ * which says that the first nine blocks (0-\/8) are interleaved over}}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00133}00133 \textcolor{comment}{ * 3 disks (0, 1, 2) starting at block offset 0 on any component disk,}}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00134}00134 \textcolor{comment}{ * the next 4 blocks (9-\/12) are interleaved over 2 disks (0, 2) starting}}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00135}00135 \textcolor{comment}{ * at component block 3, and the remaining blocks (13-\/14) are on disk}}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00136}00136 \textcolor{comment}{ * 2 starting at offset 5.}}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00137}00137 \textcolor{comment}{ */}}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00138}\mbox{\hyperlink{structccdiinfo}{00138}} \textcolor{keyword}{struct }\mbox{\hyperlink{structccdiinfo}{ccdiinfo}} \{}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00139}\mbox{\hyperlink{structccdiinfo_a8583c99222de33bdf7174dcad4c2fb08}{00139}}         \textcolor{keywordtype}{int}     \mbox{\hyperlink{structccdiinfo_a8583c99222de33bdf7174dcad4c2fb08}{ii\_ndisk}};       \textcolor{comment}{/* \# of disks range is interleaved over */}}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00140}\mbox{\hyperlink{structccdiinfo_a05d470b7ef4521e2c2d039f01c643de0}{00140}}         daddr\_t \mbox{\hyperlink{structccdiinfo_a05d470b7ef4521e2c2d039f01c643de0}{ii\_startblk}}; \textcolor{comment}{/* starting scaled block \# for range */}}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00141}\mbox{\hyperlink{structccdiinfo_a19181e1028bb1be9c6e860fed159cc18}{00141}}         daddr\_t \mbox{\hyperlink{structccdiinfo_a19181e1028bb1be9c6e860fed159cc18}{ii\_startoff}}; \textcolor{comment}{/* starting component offset (block \#) */}}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00142}\mbox{\hyperlink{structccdiinfo_a277555f36073b89425186d0f6980d87f}{00142}}         \textcolor{keywordtype}{int}     *\mbox{\hyperlink{structccdiinfo_a277555f36073b89425186d0f6980d87f}{ii\_index}};      \textcolor{comment}{/* ordered list of components in range */}}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00143}00143 \};}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00144}00144 }
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00145}00145 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00146}00146 \textcolor{comment}{ * Component info table.}}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00147}00147 \textcolor{comment}{ * Describes a single component of a concatenated disk.}}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00148}00148 \textcolor{comment}{ */}}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00149}\mbox{\hyperlink{structccdcinfo}{00149}} \textcolor{keyword}{struct }\mbox{\hyperlink{structccdcinfo}{ccdcinfo}} \{}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00150}\mbox{\hyperlink{structccdcinfo_aa6449b2678bf834924203c2c4de0d275}{00150}}         daddr\_t         \mbox{\hyperlink{structccdcinfo_aa6449b2678bf834924203c2c4de0d275}{ci\_size}};                 \textcolor{comment}{/* size */}}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00151}\mbox{\hyperlink{structccdcinfo_abaa4e01d56613bf59ff47c2388b46f7e}{00151}}         \textcolor{keyword}{struct }\mbox{\hyperlink{structg__provider}{g\_provider}} *\mbox{\hyperlink{structccdcinfo_abaa4e01d56613bf59ff47c2388b46f7e}{ci\_provider}};            \textcolor{comment}{/* provider */}}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00152}\mbox{\hyperlink{structccdcinfo_ac5e44bcfc20463ae75831482a6ec670e}{00152}}         \textcolor{keyword}{struct }\mbox{\hyperlink{structg__consumer}{g\_consumer}} *\mbox{\hyperlink{structccdcinfo_ac5e44bcfc20463ae75831482a6ec670e}{ci\_consumer}};            \textcolor{comment}{/* consumer */}}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00153}00153 \};}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00154}00154 }
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00155}00155 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00156}00156 \textcolor{comment}{ * A concatenated disk is described by this structure.}}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00157}00157 \textcolor{comment}{ */}}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00158}00158 }
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00159}\mbox{\hyperlink{structccd__s}{00159}} \textcolor{keyword}{struct }\mbox{\hyperlink{structccd__s}{ccd\_s}} \{}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00160}00160         LIST\_ENTRY(\mbox{\hyperlink{structccd__s}{ccd\_s}}) list;}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00161}00161 }
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00162}00162         \textcolor{keywordtype}{int}              sc\_unit;               \textcolor{comment}{/* logical unit number */}}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00163}00163         \textcolor{keywordtype}{int}              sc\_flags;              \textcolor{comment}{/* flags */}}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00164}00164         daddr\_t          sc\_size;               \textcolor{comment}{/* size of ccd */}}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00165}00165         \textcolor{keywordtype}{int}              sc\_ileave;             \textcolor{comment}{/* interleave */}}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00166}00166         u\_int            sc\_ndisks;             \textcolor{comment}{/* number of components */}}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00167}00167         \textcolor{keyword}{struct }\mbox{\hyperlink{structccdcinfo}{ccdcinfo}}  *sc\_cinfo;             \textcolor{comment}{/* component info */}}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00168}00168         \textcolor{keyword}{struct }\mbox{\hyperlink{structccdiinfo}{ccdiinfo}}  *sc\_itable;            \textcolor{comment}{/* interleave table */}}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00169}00169         uint32\_t         sc\_secsize;            \textcolor{comment}{/* \# bytes per sector */}}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00170}00170         \textcolor{keywordtype}{int}              sc\_pick;               \textcolor{comment}{/* side of mirror picked */}}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00171}00171         daddr\_t          sc\_blk[2];             \textcolor{comment}{/* mirror localization */}}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00172}00172         uint32\_t         sc\_offset;             \textcolor{comment}{/* actual offset used */}}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00173}00173 \};}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00174}00174 }
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00175}\mbox{\hyperlink{geom__ccd_8c_a8d41ed53c52ebedf84bb8f92b06a2fa0}{00175}} \textcolor{keyword}{static} \mbox{\hyperlink{geom_8h_a2a6559adb145f83df6a58cfbc2be6759}{g\_start\_t}} \mbox{\hyperlink{geom__ccd_8c_a8d41ed53c52ebedf84bb8f92b06a2fa0}{g\_ccd\_start}};}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00176}00176 \textcolor{keyword}{static} \textcolor{keywordtype}{void} \mbox{\hyperlink{geom__ccd_8c_a276110e5894423d38221d23ebf34491a}{ccdiodone}}(\textcolor{keyword}{struct} bio *\mbox{\hyperlink{g__part__if_8m_a3786db8db96c32f69df9f7cd325a7507}{bp}});}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00177}00177 \textcolor{keyword}{static} \textcolor{keywordtype}{void} \mbox{\hyperlink{geom__ccd_8c_a12e99f6e629331d4eec0e54b695ccf93}{ccdinterleave}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structccd__s}{ccd\_s}} *);}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00178}00178 \textcolor{keyword}{static} \textcolor{keywordtype}{int} \mbox{\hyperlink{geom__ccd_8c_ad3b4d693a48cea9f994c978981af9a0c}{ccdinit}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structgctl__req}{gctl\_req}} *\mbox{\hyperlink{g__part__if_8m_a7a9f20c97e75f805eb506910bd3e70d3}{req}}, \textcolor{keyword}{struct} \mbox{\hyperlink{structccd__s}{ccd\_s}} *);}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00179}00179 \textcolor{keyword}{static} \textcolor{keywordtype}{int} \mbox{\hyperlink{geom__ccd_8c_ab71cab085f82b755822c7f669467b443}{ccdbuffer}}(\textcolor{keyword}{struct} bio **ret, \textcolor{keyword}{struct} \mbox{\hyperlink{structccd__s}{ccd\_s}} *,}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00180}00180                       \textcolor{keyword}{struct} bio *, daddr\_t, caddr\_t, \textcolor{keywordtype}{long});}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00181}00181 }
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00182}00182 \textcolor{keyword}{static} \textcolor{keywordtype}{void}}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00183}\mbox{\hyperlink{geom__ccd_8c_ab7c04a47ffe066c2b761249a33bcec5c}{00183}} \mbox{\hyperlink{geom__ccd_8c_ab7c04a47ffe066c2b761249a33bcec5c}{g\_ccd\_orphan}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structg__consumer}{g\_consumer}} *\mbox{\hyperlink{g__part__if_8m_a294f18324585ff37641fb8aa1c9ccd82}{cp}})}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00184}00184 \{}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00185}00185         \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00186}00186 \textcolor{comment}{         * XXX: We don't do anything here.  It is not obvious}}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00187}00187 \textcolor{comment}{         * XXX: what DTRT would be, so we do what the previous}}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00188}00188 \textcolor{comment}{         * XXX: code did: ignore it and let the user cope.}}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00189}00189 \textcolor{comment}{         */}}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00190}00190 \}}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00191}00191 }
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00192}00192 \textcolor{keyword}{static} \textcolor{keywordtype}{int}}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00193}\mbox{\hyperlink{geom__ccd_8c_a564568bc6e69b3321f1557526626c4a1}{00193}} \mbox{\hyperlink{geom__ccd_8c_a564568bc6e69b3321f1557526626c4a1}{g\_ccd\_access}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structg__provider}{g\_provider}} *\mbox{\hyperlink{g__part__if_8m_a9bc7638f295763b77465c5ebebbd3442}{pp}}, \textcolor{keywordtype}{int} dr, \textcolor{keywordtype}{int} dw, \textcolor{keywordtype}{int} de)}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00194}00194 \{}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00195}00195         \textcolor{keyword}{struct }\mbox{\hyperlink{structg__geom}{g\_geom}} *\mbox{\hyperlink{g__part__if_8m_abdc908a08b24cd2e589de2f44e40eeb9}{gp}};}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00196}00196         \textcolor{keyword}{struct }\mbox{\hyperlink{structg__consumer}{g\_consumer}} *cp1, *cp2;}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00197}00197         \textcolor{keywordtype}{int} error;}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00198}00198 }
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00199}00199         de += dr;}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00200}00200         de += dw;}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00201}00201 }
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00202}00202         \mbox{\hyperlink{g__part__if_8m_abdc908a08b24cd2e589de2f44e40eeb9}{gp}} = \mbox{\hyperlink{g__part__if_8m_a9bc7638f295763b77465c5ebebbd3442}{pp}}-\/>\mbox{\hyperlink{structg__provider_afe5c92b8a2a9e4cdf1cab6daa96923c1}{geom}};}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00203}00203         error = ENXIO;}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00204}00204         LIST\_FOREACH(cp1, \&\mbox{\hyperlink{g__part__if_8m_abdc908a08b24cd2e589de2f44e40eeb9}{gp}}-\/>consumer, consumer) \{}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00205}00205                 error = \mbox{\hyperlink{geom_8h_a27b7c72cc3bc5a4d07ce5976e1aa1b58}{g\_access}}(cp1, dr, dw, de);}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00206}00206                 \textcolor{keywordflow}{if} (error) \{}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00207}00207                         LIST\_FOREACH(cp2, \&\mbox{\hyperlink{g__part__if_8m_abdc908a08b24cd2e589de2f44e40eeb9}{gp}}-\/>consumer, consumer) \{}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00208}00208                                 \textcolor{keywordflow}{if} (cp1 == cp2)}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00209}00209                                         \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00210}00210                                 \mbox{\hyperlink{geom_8h_a27b7c72cc3bc5a4d07ce5976e1aa1b58}{g\_access}}(cp2, -\/dr, -\/dw, -\/de);}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00211}00211                         \}}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00212}00212                         \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00213}00213                 \}}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00214}00214         \}}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00215}00215         \textcolor{keywordflow}{return} (error);}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00216}00216 \}}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00217}00217 }
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00218}00218 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00219}00219 \textcolor{comment}{ * Free the softc and its substructures.}}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00220}00220 \textcolor{comment}{ */}}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00221}00221 \textcolor{keyword}{static} \textcolor{keywordtype}{void}}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00222}\mbox{\hyperlink{geom__ccd_8c_aa2cadf86085cb7947dfd28fa9a7a2822}{00222}} \mbox{\hyperlink{geom__ccd_8c_aa2cadf86085cb7947dfd28fa9a7a2822}{g\_ccd\_freesc}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structccd__s}{ccd\_s}} *sc)}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00223}00223 \{}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00224}00224         \textcolor{keyword}{struct }\mbox{\hyperlink{structccdiinfo}{ccdiinfo}} *ii;}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00225}00225 }
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00226}00226         \mbox{\hyperlink{geom_8h_ad9924deb20de7b40cb6cf06e5ae28855}{g\_free}}(sc-\/>sc\_cinfo);}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00227}00227         \textcolor{keywordflow}{if} (sc-\/>sc\_itable != NULL) \{}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00228}00228                 \textcolor{keywordflow}{for} (ii = sc-\/>sc\_itable; ii-\/>\mbox{\hyperlink{structccdiinfo_a8583c99222de33bdf7174dcad4c2fb08}{ii\_ndisk}} > 0; ii++)}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00229}00229                         \textcolor{keywordflow}{if} (ii-\/>\mbox{\hyperlink{structccdiinfo_a277555f36073b89425186d0f6980d87f}{ii\_index}} != NULL)}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00230}00230                                 \mbox{\hyperlink{geom_8h_ad9924deb20de7b40cb6cf06e5ae28855}{g\_free}}(ii-\/>\mbox{\hyperlink{structccdiinfo_a277555f36073b89425186d0f6980d87f}{ii\_index}});}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00231}00231                 \mbox{\hyperlink{geom_8h_ad9924deb20de7b40cb6cf06e5ae28855}{g\_free}}(sc-\/>sc\_itable);}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00232}00232         \}}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00233}00233         \mbox{\hyperlink{geom_8h_ad9924deb20de7b40cb6cf06e5ae28855}{g\_free}}(sc);}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00234}00234 \}}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00235}00235 }
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00236}00236 \textcolor{keyword}{static} \textcolor{keywordtype}{int}}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00237}\mbox{\hyperlink{geom__ccd_8c_ad3b4d693a48cea9f994c978981af9a0c}{00237}} \mbox{\hyperlink{geom__ccd_8c_ad3b4d693a48cea9f994c978981af9a0c}{ccdinit}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structgctl__req}{gctl\_req}} *\mbox{\hyperlink{g__part__if_8m_a7a9f20c97e75f805eb506910bd3e70d3}{req}}, \textcolor{keyword}{struct} \mbox{\hyperlink{structccd__s}{ccd\_s}} *cs)}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00238}00238 \{}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00239}00239         \textcolor{keyword}{struct }\mbox{\hyperlink{structccdcinfo}{ccdcinfo}} *ci;}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00240}00240         daddr\_t size;}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00241}00241         \textcolor{keywordtype}{int} ix;}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00242}00242         daddr\_t minsize;}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00243}00243         \textcolor{keywordtype}{int} maxsecsize;}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00244}00244         off\_t mediasize;}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00245}00245         u\_int sectorsize;}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00246}00246 }
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00247}00247         cs-\/>sc\_size = 0;}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00248}00248 }
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00249}00249         maxsecsize = 0;}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00250}00250         minsize = 0;}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00251}00251 }
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00252}00252         \textcolor{keywordflow}{if} (cs-\/>sc\_flags \& \mbox{\hyperlink{geom__ccd_8c_af583f62c6eb7522c82ccc1c50d6562cc}{CCDF\_LINUX}}) \{}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00253}00253                 cs-\/>sc\_offset = 0;}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00254}00254                 cs-\/>sc\_ileave *= 2;}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00255}00255                 \textcolor{keywordflow}{if} (cs-\/>sc\_flags \& \mbox{\hyperlink{geom__ccd_8c_a0af89084730d0dc0d1dbc17f08474712}{CCDF\_MIRROR}} \&\& cs-\/>sc\_ndisks != 2)}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00256}00256                         \mbox{\hyperlink{geom_8h_a1d51201471b52be7e19a98b0fcb144de}{gctl\_error}}(\mbox{\hyperlink{g__part__if_8m_a7a9f20c97e75f805eb506910bd3e70d3}{req}}, \textcolor{stringliteral}{"{}Mirror mode for Linux raids is "{}}}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00257}00257                                         \textcolor{stringliteral}{"{}only supported with 2 devices"{}});}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00258}00258         \} \textcolor{keywordflow}{else} \{}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00259}00259                 \textcolor{keywordflow}{if} (cs-\/>sc\_flags \& \mbox{\hyperlink{geom__ccd_8c_ac3e68afc08e3907bf1867092da9f5550}{CCDF\_NO\_OFFSET}})}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00260}00260                         cs-\/>sc\_offset = 0;}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00261}00261                 \textcolor{keywordflow}{else}}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00262}00262                         cs-\/>sc\_offset = \mbox{\hyperlink{geom__ccd_8c_ac5ea0fc44e8c5feaad3245cb7376ff71}{CCD\_OFFSET}};}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00263}00263         \}}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00264}00264         \textcolor{keywordflow}{for} (ix = 0; ix < cs-\/>sc\_ndisks; ix++) \{}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00265}00265                 ci = \&cs-\/>sc\_cinfo[ix];}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00266}00266 }
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00267}00267                 mediasize = ci-\/>\mbox{\hyperlink{structccdcinfo_abaa4e01d56613bf59ff47c2388b46f7e}{ci\_provider}}-\/>\mbox{\hyperlink{structg__provider_a8f47c464c78aa91fa4ca5143ed3cd15e}{mediasize}};}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00268}00268                 sectorsize = ci-\/>\mbox{\hyperlink{structccdcinfo_abaa4e01d56613bf59ff47c2388b46f7e}{ci\_provider}}-\/>\mbox{\hyperlink{structg__provider_aea3cd43d41461790b8d0afcd8c49a355}{sectorsize}};}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00269}00269                 \textcolor{keywordflow}{if} (sectorsize > maxsecsize)}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00270}00270                         maxsecsize = sectorsize;}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00271}00271                 size = mediasize / DEV\_BSIZE -\/ cs-\/>sc\_offset;}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00272}00272 }
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00273}00273                 \textcolor{comment}{/* Truncate to interleave boundary */}}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00274}00274 }
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00275}00275                 \textcolor{keywordflow}{if} (cs-\/>sc\_ileave > 1)}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00276}00276                         size -\/= size \% cs-\/>sc\_ileave;}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00277}00277 }
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00278}00278                 \textcolor{keywordflow}{if} (size == 0) \{}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00279}00279                         \mbox{\hyperlink{geom_8h_a1d51201471b52be7e19a98b0fcb144de}{gctl\_error}}(\mbox{\hyperlink{g__part__if_8m_a7a9f20c97e75f805eb506910bd3e70d3}{req}}, \textcolor{stringliteral}{"{}Component \%s has effective size zero"{}},}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00280}00280                             ci-\/>\mbox{\hyperlink{structccdcinfo_abaa4e01d56613bf59ff47c2388b46f7e}{ci\_provider}}-\/>\mbox{\hyperlink{structg__provider_a2bffb416ee58cf4df7839c6fd5ec004a}{name}});}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00281}00281                         \textcolor{keywordflow}{return}(ENODEV);}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00282}00282                 \}}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00283}00283 }
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00284}00284                 \textcolor{keywordflow}{if} (minsize == 0 || size < minsize)}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00285}00285                         minsize = size;}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00286}00286                 ci-\/>\mbox{\hyperlink{structccdcinfo_aa6449b2678bf834924203c2c4de0d275}{ci\_size}} = size;}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00287}00287                 cs-\/>sc\_size += size;}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00288}00288         \}}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00289}00289 }
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00290}00290         \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00291}00291 \textcolor{comment}{         * Don't allow the interleave to be smaller than}}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00292}00292 \textcolor{comment}{         * the biggest component sector.}}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00293}00293 \textcolor{comment}{         */}}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00294}00294         \textcolor{keywordflow}{if} ((cs-\/>sc\_ileave > 0) \&\&}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00295}00295             (cs-\/>sc\_ileave < (maxsecsize / DEV\_BSIZE))) \{}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00296}00296                 \mbox{\hyperlink{geom_8h_a1d51201471b52be7e19a98b0fcb144de}{gctl\_error}}(\mbox{\hyperlink{g__part__if_8m_a7a9f20c97e75f805eb506910bd3e70d3}{req}}, \textcolor{stringliteral}{"{}Interleave to small for sector size"{}});}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00297}00297                 \textcolor{keywordflow}{return}(EINVAL);}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00298}00298         \}}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00299}00299 }
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00300}00300         \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00301}00301 \textcolor{comment}{         * If uniform interleave is desired set all sizes to that of}}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00302}00302 \textcolor{comment}{         * the smallest component.  This will guarantee that a single}}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00303}00303 \textcolor{comment}{         * interleave table is generated.}}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00304}00304 \textcolor{comment}{         *}}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00305}00305 \textcolor{comment}{         * Lost space must be taken into account when calculating the}}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00306}00306 \textcolor{comment}{         * overall size.  Half the space is lost when CCDF\_MIRROR is}}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00307}00307 \textcolor{comment}{         * specified.}}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00308}00308 \textcolor{comment}{         */}}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00309}00309         \textcolor{keywordflow}{if} (cs-\/>sc\_flags \& \mbox{\hyperlink{geom__ccd_8c_aa25094a1129b7c55dd7fc5712dfde8b1}{CCDF\_UNIFORM}}) \{}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00310}00310                 \textcolor{keywordflow}{for} (ix = 0; ix < cs-\/>sc\_ndisks; ix++) \{}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00311}00311                         ci = \&cs-\/>sc\_cinfo[ix];}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00312}00312                         ci-\/>\mbox{\hyperlink{structccdcinfo_aa6449b2678bf834924203c2c4de0d275}{ci\_size}} = minsize;}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00313}00313                 \}}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00314}00314                 cs-\/>sc\_size = cs-\/>sc\_ndisks * minsize;}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00315}00315         \}}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00316}00316 }
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00317}00317         \textcolor{keywordflow}{if} (cs-\/>sc\_flags \& \mbox{\hyperlink{geom__ccd_8c_a0af89084730d0dc0d1dbc17f08474712}{CCDF\_MIRROR}}) \{}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00318}00318                 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00319}00319 \textcolor{comment}{                 * Check to see if an even number of components}}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00320}00320 \textcolor{comment}{                 * have been specified.  The interleave must also}}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00321}00321 \textcolor{comment}{                 * be non-\/zero in order for us to be able to }}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00322}00322 \textcolor{comment}{                 * guarantee the topology.}}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00323}00323 \textcolor{comment}{                 */}}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00324}00324                 \textcolor{keywordflow}{if} (cs-\/>sc\_ndisks \% 2) \{}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00325}00325                         \mbox{\hyperlink{geom_8h_a1d51201471b52be7e19a98b0fcb144de}{gctl\_error}}(\mbox{\hyperlink{g__part__if_8m_a7a9f20c97e75f805eb506910bd3e70d3}{req}},}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00326}00326                               \textcolor{stringliteral}{"{}Mirroring requires an even number of disks"{}});}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00327}00327                         \textcolor{keywordflow}{return}(EINVAL);}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00328}00328                 \}}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00329}00329                 \textcolor{keywordflow}{if} (cs-\/>sc\_ileave == 0) \{}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00330}00330                         \mbox{\hyperlink{geom_8h_a1d51201471b52be7e19a98b0fcb144de}{gctl\_error}}(\mbox{\hyperlink{g__part__if_8m_a7a9f20c97e75f805eb506910bd3e70d3}{req}},}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00331}00331                              \textcolor{stringliteral}{"{}An interleave must be specified when mirroring"{}});}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00332}00332                         \textcolor{keywordflow}{return}(EINVAL);}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00333}00333                 \}}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00334}00334                 cs-\/>sc\_size = (cs-\/>sc\_ndisks/2) * minsize;}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00335}00335         \} }
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00336}00336 }
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00337}00337         \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00338}00338 \textcolor{comment}{         * Construct the interleave table.}}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00339}00339 \textcolor{comment}{         */}}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00340}00340         \mbox{\hyperlink{geom__ccd_8c_a12e99f6e629331d4eec0e54b695ccf93}{ccdinterleave}}(cs);}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00341}00341 }
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00342}00342         \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00343}00343 \textcolor{comment}{         * Create pseudo-\/geometry based on 1MB cylinders.  It's}}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00344}00344 \textcolor{comment}{         * pretty close.}}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00345}00345 \textcolor{comment}{         */}}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00346}00346         cs-\/>sc\_secsize = maxsecsize;}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00347}00347 }
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00348}00348         \textcolor{keywordflow}{return} (0);}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00349}00349 \}}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00350}00350 }
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00351}00351 \textcolor{keyword}{static} \textcolor{keywordtype}{void}}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00352}\mbox{\hyperlink{geom__ccd_8c_a12e99f6e629331d4eec0e54b695ccf93}{00352}} \mbox{\hyperlink{geom__ccd_8c_a12e99f6e629331d4eec0e54b695ccf93}{ccdinterleave}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structccd__s}{ccd\_s}} *cs)}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00353}00353 \{}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00354}00354         \textcolor{keyword}{struct }\mbox{\hyperlink{structccdcinfo}{ccdcinfo}} *ci, *smallci;}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00355}00355         \textcolor{keyword}{struct }\mbox{\hyperlink{structccdiinfo}{ccdiinfo}} *ii;}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00356}00356         daddr\_t bn, lbn;}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00357}00357         \textcolor{keywordtype}{int} ix;}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00358}00358         daddr\_t size;}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00359}00359 }
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00360}00360         \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00361}00361 \textcolor{comment}{         * Allocate an interleave table.  The worst case occurs when each}}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00362}00362 \textcolor{comment}{         * of N disks is of a different size, resulting in N interleave}}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00363}00363 \textcolor{comment}{         * tables.}}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00364}00364 \textcolor{comment}{         *}}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00365}00365 \textcolor{comment}{         * Chances are this is too big, but we don't care.}}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00366}00366 \textcolor{comment}{         */}}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00367}00367         size = (cs-\/>sc\_ndisks + 1) * \textcolor{keyword}{sizeof}(\textcolor{keyword}{struct} \mbox{\hyperlink{structccdiinfo}{ccdiinfo}});}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00368}00368         cs-\/>sc\_itable = \mbox{\hyperlink{geom_8h_a0f190247baa73dc863a79fea9d5f6b4f}{g\_malloc}}(size, M\_WAITOK | M\_ZERO);}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00369}00369 }
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00370}00370         \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00371}00371 \textcolor{comment}{         * Trivial case: no interleave (actually interleave of disk size).}}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00372}00372 \textcolor{comment}{         * Each table entry represents a single component in its entirety.}}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00373}00373 \textcolor{comment}{         *}}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00374}00374 \textcolor{comment}{         * An interleave of 0 may not be used with a mirror setup.}}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00375}00375 \textcolor{comment}{         */}}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00376}00376         \textcolor{keywordflow}{if} (cs-\/>sc\_ileave == 0) \{}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00377}00377                 bn = 0;}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00378}00378                 ii = cs-\/>sc\_itable;}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00379}00379 }
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00380}00380                 \textcolor{keywordflow}{for} (ix = 0; ix < cs-\/>sc\_ndisks; ix++) \{}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00381}00381                         \textcolor{comment}{/* Allocate space for ii\_index. */}}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00382}00382                         ii-\/>\mbox{\hyperlink{structccdiinfo_a277555f36073b89425186d0f6980d87f}{ii\_index}} = \mbox{\hyperlink{geom_8h_a0f190247baa73dc863a79fea9d5f6b4f}{g\_malloc}}(\textcolor{keyword}{sizeof}(\textcolor{keywordtype}{int}), M\_WAITOK);}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00383}00383                         ii-\/>\mbox{\hyperlink{structccdiinfo_a8583c99222de33bdf7174dcad4c2fb08}{ii\_ndisk}} = 1;}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00384}00384                         ii-\/>\mbox{\hyperlink{structccdiinfo_a05d470b7ef4521e2c2d039f01c643de0}{ii\_startblk}} = bn;}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00385}00385                         ii-\/>\mbox{\hyperlink{structccdiinfo_a19181e1028bb1be9c6e860fed159cc18}{ii\_startoff}} = 0;}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00386}00386                         ii-\/>\mbox{\hyperlink{structccdiinfo_a277555f36073b89425186d0f6980d87f}{ii\_index}}[0] = ix;}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00387}00387                         bn += cs-\/>sc\_cinfo[ix].ci\_size;}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00388}00388                         ii++;}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00389}00389                 \}}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00390}00390                 ii-\/>\mbox{\hyperlink{structccdiinfo_a8583c99222de33bdf7174dcad4c2fb08}{ii\_ndisk}} = 0;}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00391}00391                 \textcolor{keywordflow}{return};}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00392}00392         \}}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00393}00393 }
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00394}00394         \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00395}00395 \textcolor{comment}{         * The following isn't fast or pretty; it doesn't have to be.}}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00396}00396 \textcolor{comment}{         */}}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00397}00397         size = 0;}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00398}00398         bn = lbn = 0;}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00399}00399         \textcolor{keywordflow}{for} (ii = cs-\/>sc\_itable; ; ii++) \{}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00400}00400                 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00401}00401 \textcolor{comment}{                 * Allocate space for ii\_index.  We might allocate more then}}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00402}00402 \textcolor{comment}{                 * we use.}}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00403}00403 \textcolor{comment}{                 */}}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00404}00404                 ii-\/>\mbox{\hyperlink{structccdiinfo_a277555f36073b89425186d0f6980d87f}{ii\_index}} = \mbox{\hyperlink{geom_8h_a0f190247baa73dc863a79fea9d5f6b4f}{g\_malloc}}((\textcolor{keyword}{sizeof}(\textcolor{keywordtype}{int}) * cs-\/>sc\_ndisks),}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00405}00405                     M\_WAITOK);}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00406}00406 }
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00407}00407                 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00408}00408 \textcolor{comment}{                 * Locate the smallest of the remaining components}}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00409}00409 \textcolor{comment}{                 */}}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00410}00410                 smallci = NULL;}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00411}00411                 \textcolor{keywordflow}{for} (ci = cs-\/>sc\_cinfo; ci < \&cs-\/>sc\_cinfo[cs-\/>sc\_ndisks]; }
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00412}00412                     ci++) \{}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00413}00413                         \textcolor{keywordflow}{if} (ci-\/>\mbox{\hyperlink{structccdcinfo_aa6449b2678bf834924203c2c4de0d275}{ci\_size}} > size \&\&}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00414}00414                             (smallci == NULL ||}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00415}00415                              ci-\/>\mbox{\hyperlink{structccdcinfo_aa6449b2678bf834924203c2c4de0d275}{ci\_size}} < smallci-\/>\mbox{\hyperlink{structccdcinfo_aa6449b2678bf834924203c2c4de0d275}{ci\_size}})) \{}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00416}00416                                 smallci = ci;}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00417}00417                         \}}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00418}00418                 \}}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00419}00419 }
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00420}00420                 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00421}00421 \textcolor{comment}{                 * Nobody left, all done}}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00422}00422 \textcolor{comment}{                 */}}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00423}00423                 \textcolor{keywordflow}{if} (smallci == NULL) \{}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00424}00424                         ii-\/>\mbox{\hyperlink{structccdiinfo_a8583c99222de33bdf7174dcad4c2fb08}{ii\_ndisk}} = 0;}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00425}00425                         \mbox{\hyperlink{geom_8h_ad9924deb20de7b40cb6cf06e5ae28855}{g\_free}}(ii-\/>\mbox{\hyperlink{structccdiinfo_a277555f36073b89425186d0f6980d87f}{ii\_index}});}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00426}00426                         ii-\/>\mbox{\hyperlink{structccdiinfo_a277555f36073b89425186d0f6980d87f}{ii\_index}} = NULL;}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00427}00427                         \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00428}00428                 \}}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00429}00429 }
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00430}00430                 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00431}00431 \textcolor{comment}{                 * Record starting logical block using an sc\_ileave blocksize.}}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00432}00432 \textcolor{comment}{                 */}}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00433}00433                 ii-\/>\mbox{\hyperlink{structccdiinfo_a05d470b7ef4521e2c2d039f01c643de0}{ii\_startblk}} = bn / cs-\/>sc\_ileave;}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00434}00434 }
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00435}00435                 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00436}00436 \textcolor{comment}{                 * Record starting component block using an sc\_ileave }}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00437}00437 \textcolor{comment}{                 * blocksize.  This value is relative to the beginning of}}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00438}00438 \textcolor{comment}{                 * a component disk.}}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00439}00439 \textcolor{comment}{                 */}}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00440}00440                 ii-\/>\mbox{\hyperlink{structccdiinfo_a19181e1028bb1be9c6e860fed159cc18}{ii\_startoff}} = lbn;}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00441}00441 }
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00442}00442                 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00443}00443 \textcolor{comment}{                 * Determine how many disks take part in this interleave}}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00444}00444 \textcolor{comment}{                 * and record their indices.}}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00445}00445 \textcolor{comment}{                 */}}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00446}00446                 ix = 0;}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00447}00447                 \textcolor{keywordflow}{for} (ci = cs-\/>sc\_cinfo; }
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00448}00448                     ci < \&cs-\/>sc\_cinfo[cs-\/>sc\_ndisks]; ci++) \{}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00449}00449                         \textcolor{keywordflow}{if} (ci-\/>\mbox{\hyperlink{structccdcinfo_aa6449b2678bf834924203c2c4de0d275}{ci\_size}} >= smallci-\/>\mbox{\hyperlink{structccdcinfo_aa6449b2678bf834924203c2c4de0d275}{ci\_size}}) \{}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00450}00450                                 ii-\/>\mbox{\hyperlink{structccdiinfo_a277555f36073b89425186d0f6980d87f}{ii\_index}}[ix++] = ci -\/ cs-\/>sc\_cinfo;}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00451}00451                         \}}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00452}00452                 \}}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00453}00453                 ii-\/>\mbox{\hyperlink{structccdiinfo_a8583c99222de33bdf7174dcad4c2fb08}{ii\_ndisk}} = ix;}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00454}00454                 bn += ix * (smallci-\/>\mbox{\hyperlink{structccdcinfo_aa6449b2678bf834924203c2c4de0d275}{ci\_size}} -\/ size);}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00455}00455                 lbn = smallci-\/>\mbox{\hyperlink{structccdcinfo_aa6449b2678bf834924203c2c4de0d275}{ci\_size}} / cs-\/>sc\_ileave;}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00456}00456                 size = smallci-\/>\mbox{\hyperlink{structccdcinfo_aa6449b2678bf834924203c2c4de0d275}{ci\_size}};}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00457}00457         \}}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00458}00458 \}}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00459}00459 }
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00460}00460 \textcolor{keyword}{static} \textcolor{keywordtype}{void}}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00461}\mbox{\hyperlink{geom__ccd_8c_a64876e934b3300510117f7bce1d7297a}{00461}} \mbox{\hyperlink{geom__ccd_8c_a8d41ed53c52ebedf84bb8f92b06a2fa0}{g\_ccd\_start}}(\textcolor{keyword}{struct} bio *\mbox{\hyperlink{g__part__if_8m_a3786db8db96c32f69df9f7cd325a7507}{bp}})}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00462}00462 \{}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00463}00463         \textcolor{keywordtype}{long} bcount, rcount;}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00464}00464         \textcolor{keyword}{struct }bio *cbp[2];}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00465}00465         caddr\_t addr;}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00466}00466         daddr\_t bn;}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00467}00467         \textcolor{keywordtype}{int} err;}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00468}00468         \textcolor{keyword}{struct }\mbox{\hyperlink{structccd__s}{ccd\_s}} *cs;}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00469}00469 }
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00470}00470         cs = \mbox{\hyperlink{g__part__if_8m_a3786db8db96c32f69df9f7cd325a7507}{bp}}-\/>bio\_to-\/>geom-\/>softc;}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00471}00471 }
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00472}00472         \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00473}00473 \textcolor{comment}{         * Block all GETATTR requests, we wouldn't know which of our}}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00474}00474 \textcolor{comment}{         * subdevices we should ship it off to.}}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00475}00475 \textcolor{comment}{         * XXX: this may not be the right policy.}}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00476}00476 \textcolor{comment}{         */}}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00477}00477         \textcolor{keywordflow}{if}(\mbox{\hyperlink{g__part__if_8m_a3786db8db96c32f69df9f7cd325a7507}{bp}}-\/>bio\_cmd == BIO\_GETATTR) \{}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00478}00478                 \mbox{\hyperlink{geom_8h_a0975be2dcd40a26a56a1a9bfc80433e1}{g\_io\_deliver}}(\mbox{\hyperlink{g__part__if_8m_a3786db8db96c32f69df9f7cd325a7507}{bp}}, EINVAL);}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00479}00479                 \textcolor{keywordflow}{return};}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00480}00480         \}}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00481}00481 }
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00482}00482         \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00483}00483 \textcolor{comment}{         * Translate the partition-\/relative block number to an absolute.}}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00484}00484 \textcolor{comment}{         */}}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00485}00485         bn = \mbox{\hyperlink{g__part__if_8m_a3786db8db96c32f69df9f7cd325a7507}{bp}}-\/>bio\_offset / cs-\/>sc\_secsize;}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00486}00486 }
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00487}00487         \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00488}00488 \textcolor{comment}{         * Allocate component buffers and fire off the requests}}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00489}00489 \textcolor{comment}{         */}}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00490}00490         addr = \mbox{\hyperlink{g__part__if_8m_a3786db8db96c32f69df9f7cd325a7507}{bp}}-\/>bio\_data;}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00491}00491         \textcolor{keywordflow}{for} (bcount = \mbox{\hyperlink{g__part__if_8m_a3786db8db96c32f69df9f7cd325a7507}{bp}}-\/>bio\_length; bcount > 0; bcount -\/= rcount) \{}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00492}00492                 err = \mbox{\hyperlink{geom__ccd_8c_ab71cab085f82b755822c7f669467b443}{ccdbuffer}}(cbp, cs, \mbox{\hyperlink{g__part__if_8m_a3786db8db96c32f69df9f7cd325a7507}{bp}}, bn, addr, bcount);}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00493}00493                 \textcolor{keywordflow}{if} (err) \{}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00494}00494                         \mbox{\hyperlink{g__part__if_8m_a3786db8db96c32f69df9f7cd325a7507}{bp}}-\/>bio\_completed += bcount;}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00495}00495                         \textcolor{keywordflow}{if} (\mbox{\hyperlink{g__part__if_8m_a3786db8db96c32f69df9f7cd325a7507}{bp}}-\/>bio\_error == 0)}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00496}00496                                 \mbox{\hyperlink{g__part__if_8m_a3786db8db96c32f69df9f7cd325a7507}{bp}}-\/>bio\_error = err;}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00497}00497                         \textcolor{keywordflow}{if} (\mbox{\hyperlink{g__part__if_8m_a3786db8db96c32f69df9f7cd325a7507}{bp}}-\/>bio\_completed == \mbox{\hyperlink{g__part__if_8m_a3786db8db96c32f69df9f7cd325a7507}{bp}}-\/>bio\_length)}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00498}00498                                 \mbox{\hyperlink{geom_8h_a0975be2dcd40a26a56a1a9bfc80433e1}{g\_io\_deliver}}(\mbox{\hyperlink{g__part__if_8m_a3786db8db96c32f69df9f7cd325a7507}{bp}}, \mbox{\hyperlink{g__part__if_8m_a3786db8db96c32f69df9f7cd325a7507}{bp}}-\/>bio\_error);}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00499}00499                         \textcolor{keywordflow}{return};}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00500}00500                 \}}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00501}00501                 rcount = cbp[0]-\/>bio\_length;}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00502}00502 }
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00503}00503                 \textcolor{keywordflow}{if} (cs-\/>sc\_flags \& \mbox{\hyperlink{geom__ccd_8c_a0af89084730d0dc0d1dbc17f08474712}{CCDF\_MIRROR}}) \{}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00504}00504                         \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00505}00505 \textcolor{comment}{                         * Mirroring.  Writes go to both disks, reads are}}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00506}00506 \textcolor{comment}{                         * taken from whichever disk seems most appropriate.}}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00507}00507 \textcolor{comment}{                         *}}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00508}00508 \textcolor{comment}{                         * We attempt to localize reads to the disk whos arm}}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00509}00509 \textcolor{comment}{                         * is nearest the read request.  We ignore seeks due}}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00510}00510 \textcolor{comment}{                         * to writes when making this determination and we}}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00511}00511 \textcolor{comment}{                         * also try to avoid hogging.}}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00512}00512 \textcolor{comment}{                         */}}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00513}00513                         \textcolor{keywordflow}{if} (cbp[0]-\/>bio\_cmd != BIO\_READ) \{}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00514}00514                                 \mbox{\hyperlink{geom_8h_aa433c0ba9e8cad7c7da1f9e17b46eb7a}{g\_io\_request}}(cbp[0], cbp[0]-\/>bio\_from);}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00515}00515                                 \mbox{\hyperlink{geom_8h_aa433c0ba9e8cad7c7da1f9e17b46eb7a}{g\_io\_request}}(cbp[1], cbp[1]-\/>bio\_from);}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00516}00516                         \} \textcolor{keywordflow}{else} \{}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00517}00517                                 \textcolor{keywordtype}{int} pick = cs-\/>sc\_pick;}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00518}00518                                 daddr\_t range = cs-\/>sc\_size / 16;}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00519}00519 }
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00520}00520                                 \textcolor{keywordflow}{if} (bn < cs-\/>sc\_blk[pick] -\/ range ||}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00521}00521                                     bn > cs-\/>sc\_blk[pick] + range}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00522}00522                                 ) \{}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00523}00523                                         cs-\/>sc\_pick = pick = 1 -\/ pick;}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00524}00524                                 \}}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00525}00525                                 cs-\/>sc\_blk[pick] = bn + btodb(rcount);}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00526}00526                                 \mbox{\hyperlink{geom_8h_aa433c0ba9e8cad7c7da1f9e17b46eb7a}{g\_io\_request}}(cbp[pick], cbp[pick]-\/>bio\_from);}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00527}00527                         \}}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00528}00528                 \} \textcolor{keywordflow}{else} \{}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00529}00529                         \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00530}00530 \textcolor{comment}{                         * Not mirroring}}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00531}00531 \textcolor{comment}{                         */}}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00532}00532                         \mbox{\hyperlink{geom_8h_aa433c0ba9e8cad7c7da1f9e17b46eb7a}{g\_io\_request}}(cbp[0], cbp[0]-\/>bio\_from);}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00533}00533                 \}}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00534}00534                 bn += btodb(rcount);}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00535}00535                 addr += rcount;}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00536}00536         \}}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00537}00537 \}}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00538}00538 }
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00539}00539 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00540}00540 \textcolor{comment}{ * Build a component buffer header.}}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00541}00541 \textcolor{comment}{ */}}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00542}00542 \textcolor{keyword}{static} \textcolor{keywordtype}{int}}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00543}\mbox{\hyperlink{geom__ccd_8c_ab71cab085f82b755822c7f669467b443}{00543}} \mbox{\hyperlink{geom__ccd_8c_ab71cab085f82b755822c7f669467b443}{ccdbuffer}}(\textcolor{keyword}{struct} bio **cb, \textcolor{keyword}{struct} \mbox{\hyperlink{structccd__s}{ccd\_s}} *cs, \textcolor{keyword}{struct} bio *\mbox{\hyperlink{g__part__if_8m_a3786db8db96c32f69df9f7cd325a7507}{bp}}, daddr\_t bn, caddr\_t addr, \textcolor{keywordtype}{long} bcount)}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00544}00544 \{}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00545}00545         \textcolor{keyword}{struct }\mbox{\hyperlink{structccdcinfo}{ccdcinfo}} *ci, *ci2 = NULL;}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00546}00546         \textcolor{keyword}{struct }bio *cbp;}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00547}00547         daddr\_t cbn, cboff;}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00548}00548         off\_t cbc;}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00549}00549 }
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00550}00550         \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00551}00551 \textcolor{comment}{         * Determine which component bn falls in.}}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00552}00552 \textcolor{comment}{         */}}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00553}00553         cbn = bn;}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00554}00554         cboff = 0;}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00555}00555 }
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00556}00556         \textcolor{keywordflow}{if} (cs-\/>sc\_ileave == 0) \{}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00557}00557                 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00558}00558 \textcolor{comment}{                 * Serially concatenated and neither a mirror nor a parity}}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00559}00559 \textcolor{comment}{                 * config.  This is a special case.}}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00560}00560 \textcolor{comment}{                 */}}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00561}00561                 daddr\_t sblk;}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00562}00562 }
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00563}00563                 sblk = 0;}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00564}00564                 \textcolor{keywordflow}{for} (ci = cs-\/>sc\_cinfo; cbn >= sblk + ci-\/>\mbox{\hyperlink{structccdcinfo_aa6449b2678bf834924203c2c4de0d275}{ci\_size}}; ci++)}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00565}00565                         sblk += ci-\/>\mbox{\hyperlink{structccdcinfo_aa6449b2678bf834924203c2c4de0d275}{ci\_size}};}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00566}00566                 cbn -\/= sblk;}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00567}00567         \} \textcolor{keywordflow}{else} \{}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00568}00568                 \textcolor{keyword}{struct }\mbox{\hyperlink{structccdiinfo}{ccdiinfo}} *ii;}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00569}00569                 \textcolor{keywordtype}{int} ccdisk, off;}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00570}00570 }
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00571}00571                 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00572}00572 \textcolor{comment}{                 * Calculate cbn, the logical superblock (sc\_ileave chunks),}}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00573}00573 \textcolor{comment}{                 * and cboff, a normal block offset (DEV\_BSIZE chunks) relative}}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00574}00574 \textcolor{comment}{                 * to cbn.}}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00575}00575 \textcolor{comment}{                 */}}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00576}00576                 cboff = cbn \% cs-\/>sc\_ileave;    \textcolor{comment}{/* DEV\_BSIZE gran */}}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00577}00577                 cbn = cbn / cs-\/>sc\_ileave;      \textcolor{comment}{/* DEV\_BSIZE * ileave gran */}}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00578}00578 }
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00579}00579                 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00580}00580 \textcolor{comment}{                 * Figure out which interleave table to use.}}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00581}00581 \textcolor{comment}{                 */}}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00582}00582                 \textcolor{keywordflow}{for} (ii = cs-\/>sc\_itable; ii-\/>\mbox{\hyperlink{structccdiinfo_a8583c99222de33bdf7174dcad4c2fb08}{ii\_ndisk}}; ii++) \{}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00583}00583                         \textcolor{keywordflow}{if} (ii-\/>\mbox{\hyperlink{structccdiinfo_a05d470b7ef4521e2c2d039f01c643de0}{ii\_startblk}} > cbn)}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00584}00584                                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00585}00585                 \}}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00586}00586                 ii-\/-\/;}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00587}00587 }
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00588}00588                 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00589}00589 \textcolor{comment}{                 * off is the logical superblock relative to the beginning }}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00590}00590 \textcolor{comment}{                 * of this interleave block.  }}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00591}00591 \textcolor{comment}{                 */}}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00592}00592                 off = cbn -\/ ii-\/>\mbox{\hyperlink{structccdiinfo_a05d470b7ef4521e2c2d039f01c643de0}{ii\_startblk}};}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00593}00593 }
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00594}00594                 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00595}00595 \textcolor{comment}{                 * We must calculate which disk component to use (ccdisk),}}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00596}00596 \textcolor{comment}{                 * and recalculate cbn to be the superblock relative to}}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00597}00597 \textcolor{comment}{                 * the beginning of the component.  This is typically done by}}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00598}00598 \textcolor{comment}{                 * adding 'off' and ii-\/>ii\_startoff together.  However, 'off'}}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00599}00599 \textcolor{comment}{                 * must typically be divided by the number of components in}}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00600}00600 \textcolor{comment}{                 * this interleave array to be properly convert it from a}}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00601}00601 \textcolor{comment}{                 * CCD-\/relative logical superblock number to a }}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00602}00602 \textcolor{comment}{                 * component-\/relative superblock number.}}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00603}00603 \textcolor{comment}{                 */}}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00604}00604                 \textcolor{keywordflow}{if} (ii-\/>\mbox{\hyperlink{structccdiinfo_a8583c99222de33bdf7174dcad4c2fb08}{ii\_ndisk}} == 1) \{}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00605}00605                         \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00606}00606 \textcolor{comment}{                         * When we have just one disk, it can't be a mirror}}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00607}00607 \textcolor{comment}{                         * or a parity config.}}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00608}00608 \textcolor{comment}{                         */}}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00609}00609                         ccdisk = ii-\/>\mbox{\hyperlink{structccdiinfo_a277555f36073b89425186d0f6980d87f}{ii\_index}}[0];}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00610}00610                         cbn = ii-\/>\mbox{\hyperlink{structccdiinfo_a19181e1028bb1be9c6e860fed159cc18}{ii\_startoff}} + off;}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00611}00611                 \} \textcolor{keywordflow}{else} \{}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00612}00612                         \textcolor{keywordflow}{if} (cs-\/>sc\_flags \& \mbox{\hyperlink{geom__ccd_8c_a0af89084730d0dc0d1dbc17f08474712}{CCDF\_MIRROR}}) \{}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00613}00613                                 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00614}00614 \textcolor{comment}{                                 * We have forced a uniform mapping, resulting}}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00615}00615 \textcolor{comment}{                                 * in a single interleave array.  We double}}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00616}00616 \textcolor{comment}{                                 * up on the first half of the available}}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00617}00617 \textcolor{comment}{                                 * components and our mirror is in the second}}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00618}00618 \textcolor{comment}{                                 * half.  This only works with a single }}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00619}00619 \textcolor{comment}{                                 * interleave array because doubling up}}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00620}00620 \textcolor{comment}{                                 * doubles the number of sectors, so there}}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00621}00621 \textcolor{comment}{                                 * cannot be another interleave array because}}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00622}00622 \textcolor{comment}{                                 * the next interleave array's calculations}}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00623}00623 \textcolor{comment}{                                 * would be off.}}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00624}00624 \textcolor{comment}{                                 */}}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00625}00625                                 \textcolor{keywordtype}{int} ndisk2 = ii-\/>\mbox{\hyperlink{structccdiinfo_a8583c99222de33bdf7174dcad4c2fb08}{ii\_ndisk}} / 2;}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00626}00626                                 ccdisk = ii-\/>\mbox{\hyperlink{structccdiinfo_a277555f36073b89425186d0f6980d87f}{ii\_index}}[off \% ndisk2];}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00627}00627                                 cbn = ii-\/>\mbox{\hyperlink{structccdiinfo_a19181e1028bb1be9c6e860fed159cc18}{ii\_startoff}} + off / ndisk2;}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00628}00628                                 ci2 = \&cs-\/>sc\_cinfo[ccdisk + ndisk2];}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00629}00629                         \} \textcolor{keywordflow}{else} \{}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00630}00630                                 ccdisk = ii-\/>\mbox{\hyperlink{structccdiinfo_a277555f36073b89425186d0f6980d87f}{ii\_index}}[off \% ii-\/>\mbox{\hyperlink{structccdiinfo_a8583c99222de33bdf7174dcad4c2fb08}{ii\_ndisk}}];}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00631}00631                                 cbn = ii-\/>\mbox{\hyperlink{structccdiinfo_a19181e1028bb1be9c6e860fed159cc18}{ii\_startoff}} + off / ii-\/>\mbox{\hyperlink{structccdiinfo_a8583c99222de33bdf7174dcad4c2fb08}{ii\_ndisk}};}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00632}00632                         \}}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00633}00633                 \}}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00634}00634 }
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00635}00635                 ci = \&cs-\/>sc\_cinfo[ccdisk];}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00636}00636 }
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00637}00637                 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00638}00638 \textcolor{comment}{                 * Convert cbn from a superblock to a normal block so it}}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00639}00639 \textcolor{comment}{                 * can be used to calculate (along with cboff) the normal}}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00640}00640 \textcolor{comment}{                 * block index into this particular disk.}}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00641}00641 \textcolor{comment}{                 */}}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00642}00642                 cbn *= cs-\/>sc\_ileave;}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00643}00643         \}}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00644}00644 }
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00645}00645         \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00646}00646 \textcolor{comment}{         * Fill in the component buf structure.}}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00647}00647 \textcolor{comment}{         */}}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00648}00648         cbp = \mbox{\hyperlink{geom_8h_a4ef26e4ec68e35e8f892692c524a3d4f}{g\_clone\_bio}}(\mbox{\hyperlink{g__part__if_8m_a3786db8db96c32f69df9f7cd325a7507}{bp}});}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00649}00649         \textcolor{keywordflow}{if} (cbp == NULL)}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00650}00650                 \textcolor{keywordflow}{return} (ENOMEM);}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00651}00651         cbp-\/>bio\_done = \mbox{\hyperlink{geom_8h_a3b40808daecd7db79de16471ac14397a}{g\_std\_done}};}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00652}00652         cbp-\/>bio\_offset = dbtob(cbn + cboff + cs-\/>sc\_offset);}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00653}00653         cbp-\/>bio\_data = addr;}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00654}00654         \textcolor{keywordflow}{if} (cs-\/>sc\_ileave == 0)}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00655}00655               cbc = dbtob((off\_t)(ci-\/>\mbox{\hyperlink{structccdcinfo_aa6449b2678bf834924203c2c4de0d275}{ci\_size}} -\/ cbn));}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00656}00656         \textcolor{keywordflow}{else}}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00657}00657               cbc = dbtob((off\_t)(cs-\/>sc\_ileave -\/ cboff));}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00658}00658         cbp-\/>bio\_length = (cbc < bcount) ? cbc : bcount;}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00659}00659 }
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00660}00660         cbp-\/>bio\_from = ci-\/>\mbox{\hyperlink{structccdcinfo_ac5e44bcfc20463ae75831482a6ec670e}{ci\_consumer}};}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00661}00661         cb[0] = cbp;}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00662}00662 }
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00663}00663         \textcolor{keywordflow}{if} (cs-\/>sc\_flags \& \mbox{\hyperlink{geom__ccd_8c_a0af89084730d0dc0d1dbc17f08474712}{CCDF\_MIRROR}}) \{}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00664}00664                 cbp = \mbox{\hyperlink{geom_8h_a4ef26e4ec68e35e8f892692c524a3d4f}{g\_clone\_bio}}(\mbox{\hyperlink{g__part__if_8m_a3786db8db96c32f69df9f7cd325a7507}{bp}});}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00665}00665                 \textcolor{keywordflow}{if} (cbp == NULL)}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00666}00666                         \textcolor{keywordflow}{return} (ENOMEM);}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00667}00667                 cbp-\/>bio\_done = cb[0]-\/>bio\_done = \mbox{\hyperlink{geom__ccd_8c_a276110e5894423d38221d23ebf34491a}{ccdiodone}};}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00668}00668                 cbp-\/>bio\_offset = cb[0]-\/>bio\_offset;}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00669}00669                 cbp-\/>bio\_data = cb[0]-\/>bio\_data;}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00670}00670                 cbp-\/>bio\_length = cb[0]-\/>bio\_length;}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00671}00671                 cbp-\/>bio\_from = ci2-\/>\mbox{\hyperlink{structccdcinfo_ac5e44bcfc20463ae75831482a6ec670e}{ci\_consumer}};}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00672}00672                 cbp-\/>bio\_caller1 = cb[0];}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00673}00673                 cb[0]-\/>bio\_caller1 = cbp;}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00674}00674                 cb[1] = cbp;}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00675}00675         \}}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00676}00676         \textcolor{keywordflow}{return} (0);}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00677}00677 \}}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00678}00678 }
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00679}00679 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00680}00680 \textcolor{comment}{ * Called only for mirrored operations.}}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00681}00681 \textcolor{comment}{ */}}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00682}00682 \textcolor{keyword}{static} \textcolor{keywordtype}{void}}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00683}\mbox{\hyperlink{geom__ccd_8c_a276110e5894423d38221d23ebf34491a}{00683}} \mbox{\hyperlink{geom__ccd_8c_a276110e5894423d38221d23ebf34491a}{ccdiodone}}(\textcolor{keyword}{struct} bio *cbp)}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00684}00684 \{}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00685}00685         \textcolor{keyword}{struct }bio *mbp, *pbp;}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00686}00686 }
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00687}00687         mbp = cbp-\/>bio\_caller1;}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00688}00688         pbp = cbp-\/>bio\_parent;}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00689}00689 }
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00690}00690         \textcolor{keywordflow}{if} (pbp-\/>bio\_cmd == BIO\_READ) \{}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00691}00691                 \textcolor{keywordflow}{if} (cbp-\/>bio\_error == 0) \{}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00692}00692                         \textcolor{comment}{/* We will not be needing the partner bio */}}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00693}00693                         \textcolor{keywordflow}{if} (mbp != NULL) \{}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00694}00694                                 pbp-\/>bio\_inbed++;}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00695}00695                                 \mbox{\hyperlink{geom_8h_ae3cbea7d4bf48f25bb609df3d3f0bb28}{g\_destroy\_bio}}(mbp);}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00696}00696                         \}}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00697}00697                         \mbox{\hyperlink{geom_8h_a3b40808daecd7db79de16471ac14397a}{g\_std\_done}}(cbp);}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00698}00698                         \textcolor{keywordflow}{return};}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00699}00699                 \}}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00700}00700                 \textcolor{keywordflow}{if} (mbp != NULL) \{}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00701}00701                         \textcolor{comment}{/* Try partner the bio instead */}}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00702}00702                         mbp-\/>bio\_caller1 = NULL;}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00703}00703                         pbp-\/>bio\_inbed++;}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00704}00704                         \mbox{\hyperlink{geom_8h_ae3cbea7d4bf48f25bb609df3d3f0bb28}{g\_destroy\_bio}}(cbp);}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00705}00705                         \mbox{\hyperlink{geom_8h_aa433c0ba9e8cad7c7da1f9e17b46eb7a}{g\_io\_request}}(mbp, mbp-\/>bio\_from);}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00706}00706                         \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00707}00707 \textcolor{comment}{                         * XXX: If this comes back OK, we should actually}}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00708}00708 \textcolor{comment}{                         * try to write the good data on the failed mirror}}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00709}00709 \textcolor{comment}{                         */}}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00710}00710                         \textcolor{keywordflow}{return};}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00711}00711                 \}}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00712}00712                 \mbox{\hyperlink{geom_8h_a3b40808daecd7db79de16471ac14397a}{g\_std\_done}}(cbp);}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00713}00713                 \textcolor{keywordflow}{return};}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00714}00714         \}}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00715}00715         \textcolor{keywordflow}{if} (mbp != NULL) \{}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00716}00716                 mbp-\/>bio\_caller1 = NULL;}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00717}00717                 pbp-\/>bio\_inbed++;}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00718}00718                 \textcolor{keywordflow}{if} (cbp-\/>bio\_error != 0 \&\& pbp-\/>bio\_error == 0)}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00719}00719                         pbp-\/>bio\_error = cbp-\/>bio\_error;}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00720}00720                 \mbox{\hyperlink{geom_8h_ae3cbea7d4bf48f25bb609df3d3f0bb28}{g\_destroy\_bio}}(cbp);}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00721}00721                 \textcolor{keywordflow}{return};}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00722}00722         \}}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00723}00723         \mbox{\hyperlink{geom_8h_a3b40808daecd7db79de16471ac14397a}{g\_std\_done}}(cbp);}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00724}00724 \}}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00725}00725 }
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00726}00726 \textcolor{keyword}{static} \textcolor{keywordtype}{void}}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00727}\mbox{\hyperlink{geom__ccd_8c_a37965cd8efabebd772959caa55f67e22}{00727}} \mbox{\hyperlink{geom__ccd_8c_a37965cd8efabebd772959caa55f67e22}{g\_ccd\_create}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structgctl__req}{gctl\_req}} *\mbox{\hyperlink{g__part__if_8m_a7a9f20c97e75f805eb506910bd3e70d3}{req}}, \textcolor{keyword}{struct} \mbox{\hyperlink{structg__class}{g\_class}} *\mbox{\hyperlink{g__raid__md__if_8m_a4f7502795edfd2493d3d223d0df33e1d}{mp}})}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00728}00728 \{}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00729}00729         \textcolor{keywordtype}{int} *unit, *ileave, *nprovider;}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00730}00730         \textcolor{keyword}{struct }\mbox{\hyperlink{structg__geom}{g\_geom}} *\mbox{\hyperlink{g__part__if_8m_abdc908a08b24cd2e589de2f44e40eeb9}{gp}};}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00731}00731         \textcolor{keyword}{struct }\mbox{\hyperlink{structg__consumer}{g\_consumer}} *\mbox{\hyperlink{g__part__if_8m_a294f18324585ff37641fb8aa1c9ccd82}{cp}};}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00732}00732         \textcolor{keyword}{struct }\mbox{\hyperlink{structg__provider}{g\_provider}} *\mbox{\hyperlink{g__part__if_8m_a9bc7638f295763b77465c5ebebbd3442}{pp}};}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00733}00733         \textcolor{keyword}{struct }\mbox{\hyperlink{structccd__s}{ccd\_s}} *sc;}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00734}00734         \textcolor{keyword}{struct }sbuf *\mbox{\hyperlink{g__part__if_8m_a4c23eb4bab5aa5d69bd84384b94d1f79}{sb}};}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00735}00735         \textcolor{keywordtype}{char} \mbox{\hyperlink{g__part__if_8m_ac14417684334d01b4e1e807a19d92816}{buf}}[20];}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00736}00736         \textcolor{keywordtype}{int} i, error;}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00737}00737 }
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00738}00738         \mbox{\hyperlink{geom_8h_a1898dc8c812faa5de231ab840e8562bf}{g\_topology\_assert}}();}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00739}00739         unit = \mbox{\hyperlink{geom_8h_ab762d12640f528d8f1f60eee92bf5f3b}{gctl\_get\_paraml}}(\mbox{\hyperlink{g__part__if_8m_a7a9f20c97e75f805eb506910bd3e70d3}{req}}, \textcolor{stringliteral}{"{}unit"{}}, \textcolor{keyword}{sizeof} (*unit));}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00740}00740         \textcolor{keywordflow}{if} (unit == NULL) \{}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00741}00741                 \mbox{\hyperlink{geom_8h_a1d51201471b52be7e19a98b0fcb144de}{gctl\_error}}(\mbox{\hyperlink{g__part__if_8m_a7a9f20c97e75f805eb506910bd3e70d3}{req}}, \textcolor{stringliteral}{"{}unit parameter not given"{}});}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00742}00742                 \textcolor{keywordflow}{return};}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00743}00743         \}}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00744}00744         ileave = \mbox{\hyperlink{geom_8h_ab762d12640f528d8f1f60eee92bf5f3b}{gctl\_get\_paraml}}(\mbox{\hyperlink{g__part__if_8m_a7a9f20c97e75f805eb506910bd3e70d3}{req}}, \textcolor{stringliteral}{"{}ileave"{}}, \textcolor{keyword}{sizeof} (*ileave));}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00745}00745         \textcolor{keywordflow}{if} (ileave == NULL) \{}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00746}00746                 \mbox{\hyperlink{geom_8h_a1d51201471b52be7e19a98b0fcb144de}{gctl\_error}}(\mbox{\hyperlink{g__part__if_8m_a7a9f20c97e75f805eb506910bd3e70d3}{req}}, \textcolor{stringliteral}{"{}ileave parameter not given"{}});}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00747}00747                 \textcolor{keywordflow}{return};}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00748}00748         \}}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00749}00749         nprovider = \mbox{\hyperlink{geom_8h_ab762d12640f528d8f1f60eee92bf5f3b}{gctl\_get\_paraml}}(\mbox{\hyperlink{g__part__if_8m_a7a9f20c97e75f805eb506910bd3e70d3}{req}}, \textcolor{stringliteral}{"{}nprovider"{}}, \textcolor{keyword}{sizeof} (*nprovider));}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00750}00750         \textcolor{keywordflow}{if} (nprovider == NULL) \{}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00751}00751                 \mbox{\hyperlink{geom_8h_a1d51201471b52be7e19a98b0fcb144de}{gctl\_error}}(\mbox{\hyperlink{g__part__if_8m_a7a9f20c97e75f805eb506910bd3e70d3}{req}}, \textcolor{stringliteral}{"{}nprovider parameter not given"{}});}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00752}00752                 \textcolor{keywordflow}{return};}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00753}00753         \}}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00754}00754 }
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00755}00755         \textcolor{comment}{/* Check for duplicate unit */}}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00756}00756         LIST\_FOREACH(\mbox{\hyperlink{g__part__if_8m_abdc908a08b24cd2e589de2f44e40eeb9}{gp}}, \&\mbox{\hyperlink{g__raid__md__if_8m_a4f7502795edfd2493d3d223d0df33e1d}{mp}}-\/>geom, geom) \{}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00757}00757                 sc = \mbox{\hyperlink{g__part__if_8m_abdc908a08b24cd2e589de2f44e40eeb9}{gp}}-\/>\mbox{\hyperlink{structg__geom_aa83c08c83459420f6cbcfe64c6099466}{softc}};}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00758}00758                 \textcolor{keywordflow}{if} (sc != NULL \&\& sc-\/>sc\_unit == *unit) \{}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00759}00759                         \mbox{\hyperlink{geom_8h_a1d51201471b52be7e19a98b0fcb144de}{gctl\_error}}(\mbox{\hyperlink{g__part__if_8m_a7a9f20c97e75f805eb506910bd3e70d3}{req}}, \textcolor{stringliteral}{"{}Unit \%d already configured"{}}, *unit);}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00760}00760                         \textcolor{keywordflow}{return};}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00761}00761                 \}}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00762}00762         \}}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00763}00763 }
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00764}00764         \textcolor{keywordflow}{if} (*nprovider <= 0) \{}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00765}00765                 \mbox{\hyperlink{geom_8h_a1d51201471b52be7e19a98b0fcb144de}{gctl\_error}}(\mbox{\hyperlink{g__part__if_8m_a7a9f20c97e75f805eb506910bd3e70d3}{req}}, \textcolor{stringliteral}{"{}Bogus nprovider argument (= \%d)"{}}, *nprovider);}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00766}00766                 \textcolor{keywordflow}{return};}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00767}00767         \}}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00768}00768 }
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00769}00769         \textcolor{comment}{/* Check all providers are valid */}}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00770}00770         \textcolor{keywordflow}{for} (i = 0; i < *nprovider; i++) \{}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00771}00771                 snprintf(\mbox{\hyperlink{g__part__if_8m_ac14417684334d01b4e1e807a19d92816}{buf}}, \textcolor{keyword}{sizeof}(\mbox{\hyperlink{g__part__if_8m_ac14417684334d01b4e1e807a19d92816}{buf}}), \textcolor{stringliteral}{"{}provider\%d"{}}, i);}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00772}00772                 \mbox{\hyperlink{g__part__if_8m_a9bc7638f295763b77465c5ebebbd3442}{pp}} = \mbox{\hyperlink{geom_8h_a02d62eea445edba7982f681b41c6c307}{gctl\_get\_provider}}(\mbox{\hyperlink{g__part__if_8m_a7a9f20c97e75f805eb506910bd3e70d3}{req}}, \mbox{\hyperlink{g__part__if_8m_ac14417684334d01b4e1e807a19d92816}{buf}});}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00773}00773                 \textcolor{keywordflow}{if} (\mbox{\hyperlink{g__part__if_8m_a9bc7638f295763b77465c5ebebbd3442}{pp}} == NULL)}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00774}00774                         \textcolor{keywordflow}{return};}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00775}00775         \}}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00776}00776 }
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00777}00777         \mbox{\hyperlink{g__part__if_8m_abdc908a08b24cd2e589de2f44e40eeb9}{gp}} = \mbox{\hyperlink{geom_8h_a4000befe2ff4b405b8333ccc5b0fdb41}{g\_new\_geomf}}(\mbox{\hyperlink{g__raid__md__if_8m_a4f7502795edfd2493d3d223d0df33e1d}{mp}}, \textcolor{stringliteral}{"{}ccd\%d"{}}, *unit);}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00778}00778         sc = \mbox{\hyperlink{geom_8h_a0f190247baa73dc863a79fea9d5f6b4f}{g\_malloc}}(\textcolor{keyword}{sizeof} *sc, M\_WAITOK | M\_ZERO);}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00779}00779         \mbox{\hyperlink{g__part__if_8m_abdc908a08b24cd2e589de2f44e40eeb9}{gp}}-\/>\mbox{\hyperlink{structg__geom_aa83c08c83459420f6cbcfe64c6099466}{softc}} = sc;}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00780}00780         sc-\/>sc\_ndisks = *nprovider;}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00781}00781 }
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00782}00782         \textcolor{comment}{/* Allocate space for the component info. */}}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00783}00783         sc-\/>sc\_cinfo = \mbox{\hyperlink{geom_8h_a0f190247baa73dc863a79fea9d5f6b4f}{g\_malloc}}(sc-\/>sc\_ndisks * \textcolor{keyword}{sizeof}(\textcolor{keyword}{struct} \mbox{\hyperlink{structccdcinfo}{ccdcinfo}}),}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00784}00784             M\_WAITOK | M\_ZERO);}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00785}00785 }
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00786}00786         \textcolor{comment}{/* Create consumers and attach to all providers */}}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00787}00787         \textcolor{keywordflow}{for} (i = 0; i < *nprovider; i++) \{}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00788}00788                 snprintf(\mbox{\hyperlink{g__part__if_8m_ac14417684334d01b4e1e807a19d92816}{buf}}, \textcolor{keyword}{sizeof}(\mbox{\hyperlink{g__part__if_8m_ac14417684334d01b4e1e807a19d92816}{buf}}), \textcolor{stringliteral}{"{}provider\%d"{}}, i);}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00789}00789                 \mbox{\hyperlink{g__part__if_8m_a9bc7638f295763b77465c5ebebbd3442}{pp}} = \mbox{\hyperlink{geom_8h_a02d62eea445edba7982f681b41c6c307}{gctl\_get\_provider}}(\mbox{\hyperlink{g__part__if_8m_a7a9f20c97e75f805eb506910bd3e70d3}{req}}, \mbox{\hyperlink{g__part__if_8m_ac14417684334d01b4e1e807a19d92816}{buf}});}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00790}00790                 \mbox{\hyperlink{g__part__if_8m_a294f18324585ff37641fb8aa1c9ccd82}{cp}} = \mbox{\hyperlink{geom_8h_aef9ca3f0eecc1b245c3c9cd0bac1cdc4}{g\_new\_consumer}}(\mbox{\hyperlink{g__part__if_8m_abdc908a08b24cd2e589de2f44e40eeb9}{gp}});}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00791}00791                 error = \mbox{\hyperlink{geom_8h_a7f6ee69db47bae6ff5284f6a9cfceb91}{g\_attach}}(\mbox{\hyperlink{g__part__if_8m_a294f18324585ff37641fb8aa1c9ccd82}{cp}}, \mbox{\hyperlink{g__part__if_8m_a9bc7638f295763b77465c5ebebbd3442}{pp}});}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00792}00792                 KASSERT(error == 0, (\textcolor{stringliteral}{"{}attach to \%s failed"{}}, \mbox{\hyperlink{g__part__if_8m_a9bc7638f295763b77465c5ebebbd3442}{pp}}-\/>\mbox{\hyperlink{structg__provider_a2bffb416ee58cf4df7839c6fd5ec004a}{name}}));}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00793}00793                 sc-\/>sc\_cinfo[i].ci\_consumer = \mbox{\hyperlink{g__part__if_8m_a294f18324585ff37641fb8aa1c9ccd82}{cp}};}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00794}00794                 sc-\/>sc\_cinfo[i].ci\_provider = \mbox{\hyperlink{g__part__if_8m_a9bc7638f295763b77465c5ebebbd3442}{pp}};}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00795}00795         \}}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00796}00796 }
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00797}00797         sc-\/>sc\_unit = *unit;}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00798}00798         sc-\/>sc\_ileave = *ileave;}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00799}00799 }
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00800}00800         \textcolor{keywordflow}{if} (\mbox{\hyperlink{geom_8h_a3e3d6786258b3336d55a96607f9b8eb8}{gctl\_get\_param}}(\mbox{\hyperlink{g__part__if_8m_a7a9f20c97e75f805eb506910bd3e70d3}{req}}, \textcolor{stringliteral}{"{}no\_offset"{}}, NULL))}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00801}00801                 sc-\/>sc\_flags |= \mbox{\hyperlink{geom__ccd_8c_ac3e68afc08e3907bf1867092da9f5550}{CCDF\_NO\_OFFSET}};}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00802}00802         \textcolor{keywordflow}{if} (\mbox{\hyperlink{geom_8h_a3e3d6786258b3336d55a96607f9b8eb8}{gctl\_get\_param}}(\mbox{\hyperlink{g__part__if_8m_a7a9f20c97e75f805eb506910bd3e70d3}{req}}, \textcolor{stringliteral}{"{}linux"{}}, NULL))}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00803}00803                 sc-\/>sc\_flags |= \mbox{\hyperlink{geom__ccd_8c_af583f62c6eb7522c82ccc1c50d6562cc}{CCDF\_LINUX}};}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00804}00804 }
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00805}00805         \textcolor{keywordflow}{if} (\mbox{\hyperlink{geom_8h_a3e3d6786258b3336d55a96607f9b8eb8}{gctl\_get\_param}}(\mbox{\hyperlink{g__part__if_8m_a7a9f20c97e75f805eb506910bd3e70d3}{req}}, \textcolor{stringliteral}{"{}uniform"{}}, NULL))}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00806}00806                 sc-\/>sc\_flags |= \mbox{\hyperlink{geom__ccd_8c_aa25094a1129b7c55dd7fc5712dfde8b1}{CCDF\_UNIFORM}};}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00807}00807         \textcolor{keywordflow}{if} (\mbox{\hyperlink{geom_8h_a3e3d6786258b3336d55a96607f9b8eb8}{gctl\_get\_param}}(\mbox{\hyperlink{g__part__if_8m_a7a9f20c97e75f805eb506910bd3e70d3}{req}}, \textcolor{stringliteral}{"{}mirror"{}}, NULL))}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00808}00808                 sc-\/>sc\_flags |= \mbox{\hyperlink{geom__ccd_8c_a0af89084730d0dc0d1dbc17f08474712}{CCDF\_MIRROR}};}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00809}00809 }
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00810}00810         \textcolor{keywordflow}{if} (sc-\/>sc\_ileave == 0 \&\& (sc-\/>sc\_flags \& \mbox{\hyperlink{geom__ccd_8c_a0af89084730d0dc0d1dbc17f08474712}{CCDF\_MIRROR}})) \{}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00811}00811                 printf(\textcolor{stringliteral}{"{}\%s: disabling mirror, interleave is 0\(\backslash\)n"{}}, \mbox{\hyperlink{g__part__if_8m_abdc908a08b24cd2e589de2f44e40eeb9}{gp}}-\/>\mbox{\hyperlink{structg__geom_af64450500f1fea18f639b191a5017107}{name}});}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00812}00812                 sc-\/>sc\_flags \&= \string~(\mbox{\hyperlink{geom__ccd_8c_a0af89084730d0dc0d1dbc17f08474712}{CCDF\_MIRROR}});}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00813}00813         \}}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00814}00814 }
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00815}00815         \textcolor{keywordflow}{if} ((sc-\/>sc\_flags \& \mbox{\hyperlink{geom__ccd_8c_a0af89084730d0dc0d1dbc17f08474712}{CCDF\_MIRROR}}) \&\& !(sc-\/>sc\_flags \& \mbox{\hyperlink{geom__ccd_8c_aa25094a1129b7c55dd7fc5712dfde8b1}{CCDF\_UNIFORM}})) \{}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00816}00816                 printf(\textcolor{stringliteral}{"{}\%s: mirror/parity forces uniform flag\(\backslash\)n"{}}, \mbox{\hyperlink{g__part__if_8m_abdc908a08b24cd2e589de2f44e40eeb9}{gp}}-\/>\mbox{\hyperlink{structg__geom_af64450500f1fea18f639b191a5017107}{name}});}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00817}00817                 sc-\/>sc\_flags |= \mbox{\hyperlink{geom__ccd_8c_aa25094a1129b7c55dd7fc5712dfde8b1}{CCDF\_UNIFORM}};}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00818}00818         \}}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00819}00819 }
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00820}00820         error = \mbox{\hyperlink{geom__ccd_8c_ad3b4d693a48cea9f994c978981af9a0c}{ccdinit}}(\mbox{\hyperlink{g__part__if_8m_a7a9f20c97e75f805eb506910bd3e70d3}{req}}, sc);}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00821}00821         \textcolor{keywordflow}{if} (error != 0) \{}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00822}00822                 \mbox{\hyperlink{geom__ccd_8c_aa2cadf86085cb7947dfd28fa9a7a2822}{g\_ccd\_freesc}}(sc);}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00823}00823                 \mbox{\hyperlink{g__part__if_8m_abdc908a08b24cd2e589de2f44e40eeb9}{gp}}-\/>\mbox{\hyperlink{structg__geom_aa83c08c83459420f6cbcfe64c6099466}{softc}} = NULL;}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00824}00824                 \mbox{\hyperlink{geom_8h_a87a0eb5de79ed5e49fcfec012f213c9b}{g\_wither\_geom}}(\mbox{\hyperlink{g__part__if_8m_abdc908a08b24cd2e589de2f44e40eeb9}{gp}}, ENXIO);}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00825}00825                 \textcolor{keywordflow}{return};}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00826}00826         \}}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00827}00827 }
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00828}00828         \mbox{\hyperlink{g__part__if_8m_a9bc7638f295763b77465c5ebebbd3442}{pp}} = \mbox{\hyperlink{geom_8h_a79a5fe6e79cbc1a257454a3554fa11ef}{g\_new\_providerf}}(\mbox{\hyperlink{g__part__if_8m_abdc908a08b24cd2e589de2f44e40eeb9}{gp}}, \textcolor{stringliteral}{"{}\%s"{}}, \mbox{\hyperlink{g__part__if_8m_abdc908a08b24cd2e589de2f44e40eeb9}{gp}}-\/>\mbox{\hyperlink{structg__geom_af64450500f1fea18f639b191a5017107}{name}});}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00829}00829         \mbox{\hyperlink{g__part__if_8m_a9bc7638f295763b77465c5ebebbd3442}{pp}}-\/>\mbox{\hyperlink{structg__provider_a8f47c464c78aa91fa4ca5143ed3cd15e}{mediasize}} = sc-\/>sc\_size * (off\_t)sc-\/>sc\_secsize;}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00830}00830         \mbox{\hyperlink{g__part__if_8m_a9bc7638f295763b77465c5ebebbd3442}{pp}}-\/>\mbox{\hyperlink{structg__provider_aea3cd43d41461790b8d0afcd8c49a355}{sectorsize}} = sc-\/>sc\_secsize;}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00831}00831         \mbox{\hyperlink{geom_8h_a7a46b49361266e9bb4b1441aade2c48f}{g\_error\_provider}}(\mbox{\hyperlink{g__part__if_8m_a9bc7638f295763b77465c5ebebbd3442}{pp}}, 0);}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00832}00832 }
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00833}00833         \mbox{\hyperlink{g__part__if_8m_a4c23eb4bab5aa5d69bd84384b94d1f79}{sb}} = sbuf\_new\_auto();}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00834}00834         sbuf\_printf(\mbox{\hyperlink{g__part__if_8m_a4c23eb4bab5aa5d69bd84384b94d1f79}{sb}}, \textcolor{stringliteral}{"{}ccd\%d: \%d components "{}}, sc-\/>sc\_unit, *nprovider);}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00835}00835         \textcolor{keywordflow}{for} (i = 0; i < *nprovider; i++) \{}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00836}00836                 sbuf\_printf(\mbox{\hyperlink{g__part__if_8m_a4c23eb4bab5aa5d69bd84384b94d1f79}{sb}}, \textcolor{stringliteral}{"{}\%s\%s"{}},}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00837}00837                     i == 0 ? \textcolor{stringliteral}{"{}("{}} : \textcolor{stringliteral}{"{}, "{}}, }
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00838}00838                     sc-\/>sc\_cinfo[i].ci\_provider-\/>name);}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00839}00839         \}}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00840}00840         sbuf\_printf(\mbox{\hyperlink{g__part__if_8m_a4c23eb4bab5aa5d69bd84384b94d1f79}{sb}}, \textcolor{stringliteral}{"{}), \%jd blocks "{}}, (off\_t)\mbox{\hyperlink{g__part__if_8m_a9bc7638f295763b77465c5ebebbd3442}{pp}}-\/>\mbox{\hyperlink{structg__provider_a8f47c464c78aa91fa4ca5143ed3cd15e}{mediasize}} / DEV\_BSIZE);}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00841}00841         \textcolor{keywordflow}{if} (sc-\/>sc\_ileave != 0)}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00842}00842                 sbuf\_printf(\mbox{\hyperlink{g__part__if_8m_a4c23eb4bab5aa5d69bd84384b94d1f79}{sb}}, \textcolor{stringliteral}{"{}interleaved at \%d blocks\(\backslash\)n"{}},}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00843}00843                         sc-\/>sc\_ileave);}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00844}00844         \textcolor{keywordflow}{else}}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00845}00845                 sbuf\_printf(\mbox{\hyperlink{g__part__if_8m_a4c23eb4bab5aa5d69bd84384b94d1f79}{sb}}, \textcolor{stringliteral}{"{}concatenated\(\backslash\)n"{}});}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00846}00846         sbuf\_finish(\mbox{\hyperlink{g__part__if_8m_a4c23eb4bab5aa5d69bd84384b94d1f79}{sb}});}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00847}00847         \mbox{\hyperlink{geom_8h_a0e59ccc0c24cea0ff0cee98b64021ba5}{gctl\_set\_param\_err}}(\mbox{\hyperlink{g__part__if_8m_a7a9f20c97e75f805eb506910bd3e70d3}{req}}, \textcolor{stringliteral}{"{}output"{}}, sbuf\_data(\mbox{\hyperlink{g__part__if_8m_a4c23eb4bab5aa5d69bd84384b94d1f79}{sb}}), sbuf\_len(\mbox{\hyperlink{g__part__if_8m_a4c23eb4bab5aa5d69bd84384b94d1f79}{sb}}) + 1);}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00848}00848         sbuf\_delete(\mbox{\hyperlink{g__part__if_8m_a4c23eb4bab5aa5d69bd84384b94d1f79}{sb}});}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00849}00849 \}}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00850}00850 }
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00851}00851 \textcolor{keyword}{static} \textcolor{keywordtype}{int}}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00852}\mbox{\hyperlink{geom__ccd_8c_a9cd7f5aec55653e0cf0524eea0cab7c0}{00852}} \mbox{\hyperlink{geom__ccd_8c_a9cd7f5aec55653e0cf0524eea0cab7c0}{g\_ccd\_destroy\_geom}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structgctl__req}{gctl\_req}} *\mbox{\hyperlink{g__part__if_8m_a7a9f20c97e75f805eb506910bd3e70d3}{req}}, \textcolor{keyword}{struct} \mbox{\hyperlink{structg__class}{g\_class}} *\mbox{\hyperlink{g__raid__md__if_8m_a4f7502795edfd2493d3d223d0df33e1d}{mp}}, \textcolor{keyword}{struct} \mbox{\hyperlink{structg__geom}{g\_geom}} *\mbox{\hyperlink{g__part__if_8m_abdc908a08b24cd2e589de2f44e40eeb9}{gp}})}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00853}00853 \{}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00854}00854         \textcolor{keyword}{struct }\mbox{\hyperlink{structg__provider}{g\_provider}} *\mbox{\hyperlink{g__part__if_8m_a9bc7638f295763b77465c5ebebbd3442}{pp}};}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00855}00855         \textcolor{keyword}{struct }\mbox{\hyperlink{structccd__s}{ccd\_s}} *sc;}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00856}00856 }
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00857}00857         \mbox{\hyperlink{geom_8h_a1898dc8c812faa5de231ab840e8562bf}{g\_topology\_assert}}();}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00858}00858         sc = \mbox{\hyperlink{g__part__if_8m_abdc908a08b24cd2e589de2f44e40eeb9}{gp}}-\/>\mbox{\hyperlink{structg__geom_aa83c08c83459420f6cbcfe64c6099466}{softc}};}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00859}00859         \mbox{\hyperlink{g__part__if_8m_a9bc7638f295763b77465c5ebebbd3442}{pp}} = LIST\_FIRST(\&\mbox{\hyperlink{g__part__if_8m_abdc908a08b24cd2e589de2f44e40eeb9}{gp}}-\/>provider);}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00860}00860         \textcolor{keywordflow}{if} (sc == NULL || \mbox{\hyperlink{g__part__if_8m_a9bc7638f295763b77465c5ebebbd3442}{pp}} == NULL)}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00861}00861                 \textcolor{keywordflow}{return} (EBUSY);}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00862}00862         \textcolor{keywordflow}{if} (\mbox{\hyperlink{g__part__if_8m_a9bc7638f295763b77465c5ebebbd3442}{pp}}-\/>\mbox{\hyperlink{structg__provider_a62d7db6055318331bae725b44d58c140}{acr}} != 0 || \mbox{\hyperlink{g__part__if_8m_a9bc7638f295763b77465c5ebebbd3442}{pp}}-\/>\mbox{\hyperlink{structg__provider_abc6824f999ce8b17107d833c908c83e6}{acw}} != 0 || \mbox{\hyperlink{g__part__if_8m_a9bc7638f295763b77465c5ebebbd3442}{pp}}-\/>\mbox{\hyperlink{structg__provider_ae46b0f6e935dcb33a2a06556dbcbeb4c}{ace}} != 0) \{}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00863}00863                 \mbox{\hyperlink{geom_8h_a1d51201471b52be7e19a98b0fcb144de}{gctl\_error}}(\mbox{\hyperlink{g__part__if_8m_a7a9f20c97e75f805eb506910bd3e70d3}{req}}, \textcolor{stringliteral}{"{}\%s is open(r\%dw\%de\%d)"{}}, \mbox{\hyperlink{g__part__if_8m_abdc908a08b24cd2e589de2f44e40eeb9}{gp}}-\/>\mbox{\hyperlink{structg__geom_af64450500f1fea18f639b191a5017107}{name}},}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00864}00864                     \mbox{\hyperlink{g__part__if_8m_a9bc7638f295763b77465c5ebebbd3442}{pp}}-\/>\mbox{\hyperlink{structg__provider_a62d7db6055318331bae725b44d58c140}{acr}}, \mbox{\hyperlink{g__part__if_8m_a9bc7638f295763b77465c5ebebbd3442}{pp}}-\/>\mbox{\hyperlink{structg__provider_abc6824f999ce8b17107d833c908c83e6}{acw}}, \mbox{\hyperlink{g__part__if_8m_a9bc7638f295763b77465c5ebebbd3442}{pp}}-\/>\mbox{\hyperlink{structg__provider_ae46b0f6e935dcb33a2a06556dbcbeb4c}{ace}});}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00865}00865                 \textcolor{keywordflow}{return} (EBUSY);}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00866}00866         \}}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00867}00867         \mbox{\hyperlink{geom__ccd_8c_aa2cadf86085cb7947dfd28fa9a7a2822}{g\_ccd\_freesc}}(sc);}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00868}00868         \mbox{\hyperlink{g__part__if_8m_abdc908a08b24cd2e589de2f44e40eeb9}{gp}}-\/>\mbox{\hyperlink{structg__geom_aa83c08c83459420f6cbcfe64c6099466}{softc}} = NULL;}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00869}00869         \mbox{\hyperlink{geom_8h_a87a0eb5de79ed5e49fcfec012f213c9b}{g\_wither\_geom}}(\mbox{\hyperlink{g__part__if_8m_abdc908a08b24cd2e589de2f44e40eeb9}{gp}}, ENXIO);}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00870}00870         \textcolor{keywordflow}{return} (0);}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00871}00871 \}}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00872}00872 }
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00873}00873 \textcolor{keyword}{static} \textcolor{keywordtype}{void}}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00874}\mbox{\hyperlink{geom__ccd_8c_a1bd0522f450eca6e1f5f2a136a25459a}{00874}} \mbox{\hyperlink{geom__ccd_8c_a1bd0522f450eca6e1f5f2a136a25459a}{g\_ccd\_list}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structgctl__req}{gctl\_req}} *\mbox{\hyperlink{g__part__if_8m_a7a9f20c97e75f805eb506910bd3e70d3}{req}}, \textcolor{keyword}{struct} \mbox{\hyperlink{structg__class}{g\_class}} *\mbox{\hyperlink{g__raid__md__if_8m_a4f7502795edfd2493d3d223d0df33e1d}{mp}})}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00875}00875 \{}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00876}00876         \textcolor{keyword}{struct }sbuf *\mbox{\hyperlink{g__part__if_8m_a4c23eb4bab5aa5d69bd84384b94d1f79}{sb}};}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00877}00877         \textcolor{keyword}{struct }\mbox{\hyperlink{structccd__s}{ccd\_s}} *cs;}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00878}00878         \textcolor{keyword}{struct }\mbox{\hyperlink{structg__geom}{g\_geom}} *\mbox{\hyperlink{g__part__if_8m_abdc908a08b24cd2e589de2f44e40eeb9}{gp}};}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00879}00879         \textcolor{keywordtype}{int} i, unit, *up;}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00880}00880 }
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00881}00881         up = \mbox{\hyperlink{geom_8h_ab762d12640f528d8f1f60eee92bf5f3b}{gctl\_get\_paraml}}(\mbox{\hyperlink{g__part__if_8m_a7a9f20c97e75f805eb506910bd3e70d3}{req}}, \textcolor{stringliteral}{"{}unit"{}}, \textcolor{keyword}{sizeof} (*up));}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00882}00882         \textcolor{keywordflow}{if} (up == NULL) \{}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00883}00883                 \mbox{\hyperlink{geom_8h_a1d51201471b52be7e19a98b0fcb144de}{gctl\_error}}(\mbox{\hyperlink{g__part__if_8m_a7a9f20c97e75f805eb506910bd3e70d3}{req}}, \textcolor{stringliteral}{"{}unit parameter not given"{}});}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00884}00884                 \textcolor{keywordflow}{return};}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00885}00885         \}}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00886}00886         unit = *up;}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00887}00887         \mbox{\hyperlink{g__part__if_8m_a4c23eb4bab5aa5d69bd84384b94d1f79}{sb}} = sbuf\_new\_auto();}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00888}00888         LIST\_FOREACH(\mbox{\hyperlink{g__part__if_8m_abdc908a08b24cd2e589de2f44e40eeb9}{gp}}, \&\mbox{\hyperlink{g__raid__md__if_8m_a4f7502795edfd2493d3d223d0df33e1d}{mp}}-\/>geom, geom) \{}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00889}00889                 cs = \mbox{\hyperlink{g__part__if_8m_abdc908a08b24cd2e589de2f44e40eeb9}{gp}}-\/>\mbox{\hyperlink{structg__geom_aa83c08c83459420f6cbcfe64c6099466}{softc}};}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00890}00890                 \textcolor{keywordflow}{if} (cs == NULL || (unit >= 0 \&\& unit != cs-\/>sc\_unit))}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00891}00891                         \textcolor{keywordflow}{continue};}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00892}00892                 sbuf\_printf(\mbox{\hyperlink{g__part__if_8m_a4c23eb4bab5aa5d69bd84384b94d1f79}{sb}}, \textcolor{stringliteral}{"{}ccd\%d\(\backslash\)t\(\backslash\)t\%d\(\backslash\)t\%d\(\backslash\)t"{}},}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00893}00893                     cs-\/>sc\_unit, cs-\/>sc\_ileave, cs-\/>sc\_flags \& \mbox{\hyperlink{geom__ccd_8c_ae5c7f4540b8813240b64c6ca6a49d8ee}{CCDF\_USERMASK}});}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00894}00894                         }
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00895}00895                 \textcolor{keywordflow}{for} (i = 0; i < cs-\/>sc\_ndisks; ++i) \{}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00896}00896                         sbuf\_printf(\mbox{\hyperlink{g__part__if_8m_a4c23eb4bab5aa5d69bd84384b94d1f79}{sb}}, \textcolor{stringliteral}{"{}\%s/dev/\%s"{}}, i == 0 ? \textcolor{stringliteral}{"{}"{}} : \textcolor{stringliteral}{"{} "{}},}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00897}00897                             cs-\/>sc\_cinfo[i].ci\_provider-\/>name);}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00898}00898                 \}}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00899}00899                 sbuf\_printf(\mbox{\hyperlink{g__part__if_8m_a4c23eb4bab5aa5d69bd84384b94d1f79}{sb}}, \textcolor{stringliteral}{"{}\(\backslash\)n"{}});}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00900}00900         \}}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00901}00901         sbuf\_finish(\mbox{\hyperlink{g__part__if_8m_a4c23eb4bab5aa5d69bd84384b94d1f79}{sb}});}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00902}00902         \mbox{\hyperlink{geom_8h_a0e59ccc0c24cea0ff0cee98b64021ba5}{gctl\_set\_param\_err}}(\mbox{\hyperlink{g__part__if_8m_a7a9f20c97e75f805eb506910bd3e70d3}{req}}, \textcolor{stringliteral}{"{}output"{}}, sbuf\_data(\mbox{\hyperlink{g__part__if_8m_a4c23eb4bab5aa5d69bd84384b94d1f79}{sb}}), sbuf\_len(\mbox{\hyperlink{g__part__if_8m_a4c23eb4bab5aa5d69bd84384b94d1f79}{sb}}) + 1);}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00903}00903         sbuf\_delete(\mbox{\hyperlink{g__part__if_8m_a4c23eb4bab5aa5d69bd84384b94d1f79}{sb}});}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00904}00904 \}}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00905}00905 }
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00906}00906 \textcolor{keyword}{static} \textcolor{keywordtype}{void}}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00907}\mbox{\hyperlink{geom__ccd_8c_a8adef90d86c50b27505c519d4e226793}{00907}} \mbox{\hyperlink{geom__ccd_8c_a8adef90d86c50b27505c519d4e226793}{g\_ccd\_config}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structgctl__req}{gctl\_req}} *\mbox{\hyperlink{g__part__if_8m_a7a9f20c97e75f805eb506910bd3e70d3}{req}}, \textcolor{keyword}{struct} \mbox{\hyperlink{structg__class}{g\_class}} *\mbox{\hyperlink{g__raid__md__if_8m_a4f7502795edfd2493d3d223d0df33e1d}{mp}}, \textcolor{keywordtype}{char} \textcolor{keyword}{const} *verb)}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00908}00908 \{}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00909}00909         \textcolor{keyword}{struct }\mbox{\hyperlink{structg__geom}{g\_geom}} *\mbox{\hyperlink{g__part__if_8m_abdc908a08b24cd2e589de2f44e40eeb9}{gp}};}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00910}00910 }
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00911}00911         \mbox{\hyperlink{geom_8h_a1898dc8c812faa5de231ab840e8562bf}{g\_topology\_assert}}();}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00912}00912         \textcolor{keywordflow}{if} (!strcmp(verb, \textcolor{stringliteral}{"{}create geom"{}})) \{}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00913}00913                 \mbox{\hyperlink{geom__ccd_8c_a37965cd8efabebd772959caa55f67e22}{g\_ccd\_create}}(\mbox{\hyperlink{g__part__if_8m_a7a9f20c97e75f805eb506910bd3e70d3}{req}}, \mbox{\hyperlink{g__raid__md__if_8m_a4f7502795edfd2493d3d223d0df33e1d}{mp}});}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00914}00914         \} \textcolor{keywordflow}{else} \textcolor{keywordflow}{if} (!strcmp(verb, \textcolor{stringliteral}{"{}destroy geom"{}})) \{}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00915}00915                 \mbox{\hyperlink{g__part__if_8m_abdc908a08b24cd2e589de2f44e40eeb9}{gp}} = \mbox{\hyperlink{geom_8h_abed39403ebb1af29764ffa772cfce2a5}{gctl\_get\_geom}}(\mbox{\hyperlink{g__part__if_8m_a7a9f20c97e75f805eb506910bd3e70d3}{req}}, \mbox{\hyperlink{g__raid__md__if_8m_a4f7502795edfd2493d3d223d0df33e1d}{mp}}, \textcolor{stringliteral}{"{}geom"{}});}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00916}00916                 \textcolor{keywordflow}{if} (\mbox{\hyperlink{g__part__if_8m_abdc908a08b24cd2e589de2f44e40eeb9}{gp}} != NULL)}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00917}00917                         \mbox{\hyperlink{geom__ccd_8c_a9cd7f5aec55653e0cf0524eea0cab7c0}{g\_ccd\_destroy\_geom}}(\mbox{\hyperlink{g__part__if_8m_a7a9f20c97e75f805eb506910bd3e70d3}{req}}, \mbox{\hyperlink{g__raid__md__if_8m_a4f7502795edfd2493d3d223d0df33e1d}{mp}}, \mbox{\hyperlink{g__part__if_8m_abdc908a08b24cd2e589de2f44e40eeb9}{gp}});}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00918}00918         \} \textcolor{keywordflow}{else} \textcolor{keywordflow}{if} (!strcmp(verb, \textcolor{stringliteral}{"{}list"{}})) \{}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00919}00919                 \mbox{\hyperlink{geom__ccd_8c_a1bd0522f450eca6e1f5f2a136a25459a}{g\_ccd\_list}}(\mbox{\hyperlink{g__part__if_8m_a7a9f20c97e75f805eb506910bd3e70d3}{req}}, \mbox{\hyperlink{g__raid__md__if_8m_a4f7502795edfd2493d3d223d0df33e1d}{mp}});}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00920}00920         \} \textcolor{keywordflow}{else} \{}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00921}00921                 \mbox{\hyperlink{geom_8h_a1d51201471b52be7e19a98b0fcb144de}{gctl\_error}}(\mbox{\hyperlink{g__part__if_8m_a7a9f20c97e75f805eb506910bd3e70d3}{req}}, \textcolor{stringliteral}{"{}unknown verb"{}});}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00922}00922         \}}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00923}00923 \}}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00924}00924 }
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00925}\mbox{\hyperlink{geom__ccd_8c_adb50b9744a8e0e46f6003f0a2161846b}{00925}} \textcolor{keyword}{static} \textcolor{keyword}{struct }\mbox{\hyperlink{structg__class}{g\_class}} \mbox{\hyperlink{geom__ccd_8c_adb50b9744a8e0e46f6003f0a2161846b}{g\_ccd\_class}} = \{}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00926}00926         .\mbox{\hyperlink{structg__class_a66bf8381cf0afbf7ccdebfa6b90a4a96}{name}} = \textcolor{stringliteral}{"{}CCD"{}},}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00927}00927         .version = \mbox{\hyperlink{geom_8h_a33025dbc893de9dc049ba2f30283bc5a}{G\_VERSION}},}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00928}00928         .ctlreq = \mbox{\hyperlink{geom__ccd_8c_a8adef90d86c50b27505c519d4e226793}{g\_ccd\_config}},}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00929}00929         .destroy\_geom = \mbox{\hyperlink{geom__ccd_8c_a9cd7f5aec55653e0cf0524eea0cab7c0}{g\_ccd\_destroy\_geom}},}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00930}00930         .start = \mbox{\hyperlink{geom__ccd_8c_a8d41ed53c52ebedf84bb8f92b06a2fa0}{g\_ccd\_start}},}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00931}00931         .orphan = \mbox{\hyperlink{geom__ccd_8c_ab7c04a47ffe066c2b761249a33bcec5c}{g\_ccd\_orphan}},}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00932}00932         .access = \mbox{\hyperlink{geom__ccd_8c_a564568bc6e69b3321f1557526626c4a1}{g\_ccd\_access}},}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00933}00933 \};}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00934}00934 }
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00935}\mbox{\hyperlink{geom__ccd_8c_a90d9e5f42f88f664402fb6f57255772b}{00935}} \mbox{\hyperlink{geom__ccd_8c_a90d9e5f42f88f664402fb6f57255772b}{DECLARE\_GEOM\_CLASS}}(\mbox{\hyperlink{geom__ccd_8c_adb50b9744a8e0e46f6003f0a2161846b}{g\_ccd\_class}}, g\_ccd);}
\DoxyCodeLine{\Hypertarget{geom__ccd_8c_source_l00936}\mbox{\hyperlink{geom__ccd_8c_a40ff54b4143a31f8c0166bcea0822e20}{00936}} \mbox{\hyperlink{geom__ccd_8c_a40ff54b4143a31f8c0166bcea0822e20}{MODULE\_VERSION}}(geom\_ccd, 0);}

\end{DoxyCode}
