\hypertarget{geom__vinum__subr_8c_source}{}\doxysection{geom\+\_\+vinum\+\_\+subr.\+c}
\label{geom__vinum__subr_8c_source}\index{geom/vinum/geom\_vinum\_subr.c@{geom/vinum/geom\_vinum\_subr.c}}
\mbox{\hyperlink{geom__vinum__subr_8c}{Go to the documentation of this file.}}
\begin{DoxyCode}{0}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00001}00001 \textcolor{comment}{/*-\/}}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00002}00002 \textcolor{comment}{ * SPDX-\/License-\/Identifier: BSD-\/4-\/Clause}}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00003}00003 \textcolor{comment}{ *}}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00004}00004 \textcolor{comment}{ * Copyright (c) 2004, 2007 Lukas Ertl}}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00005}00005 \textcolor{comment}{ * Copyright (c) 2007, 2009 Ulf Lilleengen}}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00006}00006 \textcolor{comment}{ * Copyright (c) 1997, 1998, 1999}}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00007}00007 \textcolor{comment}{ *      Nan Yang Computer Services Limited.  All rights reserved.}}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00008}00008 \textcolor{comment}{ *}}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00009}00009 \textcolor{comment}{ *  Parts written by Greg Lehey}}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00010}00010 \textcolor{comment}{ *}}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00011}00011 \textcolor{comment}{ *  This software is distributed under the so-\/called ``Berkeley}}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00012}00012 \textcolor{comment}{ *  License'':}}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00013}00013 \textcolor{comment}{ *}}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00014}00014 \textcolor{comment}{ * Redistribution and use in source and binary forms, with or without}}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00015}00015 \textcolor{comment}{ * modification, are permitted provided that the following conditions}}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00016}00016 \textcolor{comment}{ * are met:}}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00017}00017 \textcolor{comment}{ * 1. Redistributions of source code must retain the above copyright}}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00018}00018 \textcolor{comment}{ *    notice, this list of conditions and the following disclaimer.}}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00019}00019 \textcolor{comment}{ * 2. Redistributions in binary form must reproduce the above copyright}}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00020}00020 \textcolor{comment}{ *    notice, this list of conditions and the following disclaimer in the}}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00021}00021 \textcolor{comment}{ *    documentation and/or other materials provided with the distribution.}}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00022}00022 \textcolor{comment}{ * 3. All advertising materials mentioning features or use of this software}}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00023}00023 \textcolor{comment}{ *    must display the following acknowledgement:}}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00024}00024 \textcolor{comment}{ *      This product includes software developed by Nan Yang Computer}}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00025}00025 \textcolor{comment}{ *      Services Limited.}}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00026}00026 \textcolor{comment}{ * 4. Neither the name of the Company nor the names of its contributors}}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00027}00027 \textcolor{comment}{ *    may be used to endorse or promote products derived from this software}}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00028}00028 \textcolor{comment}{ *    without specific prior written permission.}}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00029}00029 \textcolor{comment}{ *}}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00030}00030 \textcolor{comment}{ * This software is provided ``as is'', and any express or implied}}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00031}00031 \textcolor{comment}{ * warranties, including, but not limited to, the implied warranties of}}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00032}00032 \textcolor{comment}{ * merchantability and fitness for a particular purpose are disclaimed.}}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00033}00033 \textcolor{comment}{ * In no event shall the company or contributors be liable for any}}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00034}00034 \textcolor{comment}{ * direct, indirect, incidental, special, exemplary, or consequential}}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00035}00035 \textcolor{comment}{ * damages (including, but not limited to, procurement of substitute}}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00036}00036 \textcolor{comment}{ * goods or services; loss of use, data, or profits; or business}}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00037}00037 \textcolor{comment}{ * interruption) however caused and on any theory of liability, whether}}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00038}00038 \textcolor{comment}{ * in contract, strict liability, or tort (including negligence or}}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00039}00039 \textcolor{comment}{ * otherwise) arising in any way out of the use of this software, even if}}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00040}00040 \textcolor{comment}{ * advised of the possibility of such damage.}}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00041}00041 \textcolor{comment}{ *}}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00042}00042 \textcolor{comment}{ */}}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00043}00043 }
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00044}00044 \textcolor{preprocessor}{\#include <sys/cdefs.h>}}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00045}\mbox{\hyperlink{geom__vinum__subr_8c_a8c3ef283470a68cd30afe9b8a72cb60f}{00045}} \mbox{\hyperlink{geom__vinum__subr_8c_a8c3ef283470a68cd30afe9b8a72cb60f}{\_\_FBSDID}}(\textcolor{stringliteral}{"{}\$FreeBSD\$"{}});}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00046}00046 }
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00047}00047 \textcolor{preprocessor}{\#include <sys/param.h>}}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00048}00048 \textcolor{preprocessor}{\#include <sys/malloc.h>}}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00049}00049 \textcolor{preprocessor}{\#include <sys/sbuf.h>}}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00050}00050 \textcolor{preprocessor}{\#include <sys/systm.h>}}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00051}00051 }
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00052}00052 \textcolor{preprocessor}{\#include <\mbox{\hyperlink{geom_8h}{geom/geom.h}}>}}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00053}00053 \textcolor{preprocessor}{\#include <\mbox{\hyperlink{geom__dbg_8h}{geom/geom\_dbg.h}}>}}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00054}00054 \textcolor{preprocessor}{\#include <\mbox{\hyperlink{geom__vinum__var_8h}{geom/vinum/geom\_vinum\_var.h}}>}}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00055}00055 \textcolor{preprocessor}{\#include <\mbox{\hyperlink{geom__vinum_8h}{geom/vinum/geom\_vinum.h}}>}}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00056}00056 \textcolor{preprocessor}{\#include <\mbox{\hyperlink{geom__vinum__share_8h}{geom/vinum/geom\_vinum\_share.h}}>}}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00057}00057 }
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00058}00058 \textcolor{keywordtype}{int}     \mbox{\hyperlink{geom__vinum__subr_8c_aac03ec88756a65df7c9b390092e2cc44}{gv\_drive\_is\_newer}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structgv__softc}{gv\_softc}} *, \textcolor{keyword}{struct} \mbox{\hyperlink{structgv__drive}{gv\_drive}} *);}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00059}00059 \textcolor{keyword}{static} off\_t \mbox{\hyperlink{geom__vinum__subr_8c_a93d5155dfa9c8d6de8e8a7773616286d}{gv\_plex\_smallest\_sd}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structgv__plex}{gv\_plex}} *);}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00060}00060 }
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00061}00061 \textcolor{keywordtype}{void}}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00062}\mbox{\hyperlink{geom__vinum_8h_a2138c1e950e1e63397aa61c9d29a27d6}{00062}} \mbox{\hyperlink{geom__vinum__subr_8c_a7f642a37f801e93fe53cf8f620329fc1}{gv\_parse\_config}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structgv__softc}{gv\_softc}} *sc, \textcolor{keywordtype}{char} *\mbox{\hyperlink{g__part__if_8m_ac14417684334d01b4e1e807a19d92816}{buf}}, \textcolor{keyword}{struct} \mbox{\hyperlink{structgv__drive}{gv\_drive}} *d)}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00063}00063 \{}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00064}00064         \textcolor{keywordtype}{char} *aptr, *bptr, *cptr;}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00065}00065         \textcolor{keyword}{struct }\mbox{\hyperlink{structgv__volume}{gv\_volume}} *v, *v2;}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00066}00066         \textcolor{keyword}{struct }\mbox{\hyperlink{structgv__plex}{gv\_plex}} *p, *p2;}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00067}00067         \textcolor{keyword}{struct }\mbox{\hyperlink{structgv__sd}{gv\_sd}} *s, *s2;}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00068}00068         \textcolor{keywordtype}{int} error, is\_newer, tokens;}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00069}00069         \textcolor{keywordtype}{char} *token[\mbox{\hyperlink{geom__vinum__share_8h_a15f4946670cf9cf385cb9b9acbb60070}{GV\_MAXARGS}}];}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00070}00070 }
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00071}00071         is\_newer = \mbox{\hyperlink{geom__vinum__subr_8c_aac03ec88756a65df7c9b390092e2cc44}{gv\_drive\_is\_newer}}(sc, d);}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00072}00072 }
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00073}00073         \textcolor{comment}{/* Until the end of the string *buf. */}}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00074}00074         \textcolor{keywordflow}{for} (aptr = \mbox{\hyperlink{g__part__if_8m_ac14417684334d01b4e1e807a19d92816}{buf}}; *aptr != \textcolor{charliteral}{'\(\backslash\)0'}; aptr = bptr) \{}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00075}00075                 bptr = aptr;}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00076}00076                 cptr = aptr;}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00077}00077 }
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00078}00078                 \textcolor{comment}{/* Separate input lines. */}}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00079}00079                 \textcolor{keywordflow}{while} (*bptr != \textcolor{charliteral}{'\(\backslash\)n'})}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00080}00080                         bptr++;}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00081}00081                 *bptr = \textcolor{charliteral}{'\(\backslash\)0'};}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00082}00082                 bptr++;}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00083}00083 }
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00084}00084                 tokens = \mbox{\hyperlink{geom__vinum__share_8c_af0255ebddd354697d7e5f82ad3b256c5}{gv\_tokenize}}(cptr, token, \mbox{\hyperlink{geom__vinum__share_8h_a15f4946670cf9cf385cb9b9acbb60070}{GV\_MAXARGS}});}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00085}00085 }
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00086}00086                 \textcolor{keywordflow}{if} (tokens <= 0)}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00087}00087                         \textcolor{keywordflow}{continue};}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00088}00088 }
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00089}00089                 \textcolor{keywordflow}{if} (!strcmp(token[0], \textcolor{stringliteral}{"{}volume"{}})) \{}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00090}00090                         v = \mbox{\hyperlink{geom__vinum__share_8c_ae67bd5de86889be4abcefe32cc4ef5b9}{gv\_new\_volume}}(tokens, token);}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00091}00091                         \textcolor{keywordflow}{if} (v == NULL) \{}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00092}00092                                 \mbox{\hyperlink{geom__vinum_8h_a28cdbd7c30e435ff9ec8676f493593a0}{G\_VINUM\_DEBUG}}(0, \textcolor{stringliteral}{"{}config parse failed volume"{}});}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00093}00093                                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00094}00094                         \}}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00095}00095 }
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00096}00096                         v2 = \mbox{\hyperlink{geom__vinum__subr_8c_a8239ceaedf41ce2e9605183a0f1ca750}{gv\_find\_vol}}(sc, v-\/>\mbox{\hyperlink{structgv__volume_a3369e150403037bca7ed34ea68f25ce0}{name}});}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00097}00097                         \textcolor{keywordflow}{if} (v2 != NULL) \{}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00098}00098                                 \textcolor{keywordflow}{if} (is\_newer) \{}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00099}00099                                         v2-\/>\mbox{\hyperlink{structgv__volume_a54dd71f304a3aefc237c7cef1dac9777}{state}} = v-\/>\mbox{\hyperlink{structgv__volume_a54dd71f304a3aefc237c7cef1dac9777}{state}};}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00100}00100                                         \mbox{\hyperlink{geom__vinum_8h_a28cdbd7c30e435ff9ec8676f493593a0}{G\_VINUM\_DEBUG}}(2, \textcolor{stringliteral}{"{}newer volume found!"{}});}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00101}00101                                 \}}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00102}00102                                 \mbox{\hyperlink{geom_8h_ad9924deb20de7b40cb6cf06e5ae28855}{g\_free}}(v);}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00103}00103                                 \textcolor{keywordflow}{continue};}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00104}00104                         \}}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00105}00105 }
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00106}00106                         \mbox{\hyperlink{geom__vinum_8h_a6253324a15c9a70255e3f54d309ffbbf}{gv\_create\_volume}}(sc, v);}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00107}00107 }
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00108}00108                 \} \textcolor{keywordflow}{else} \textcolor{keywordflow}{if} (!strcmp(token[0], \textcolor{stringliteral}{"{}plex"{}})) \{}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00109}00109                         p = \mbox{\hyperlink{geom__vinum__share_8c_addb05ff8eac29330e41e01a5345fbe55}{gv\_new\_plex}}(tokens, token);}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00110}00110                         \textcolor{keywordflow}{if} (p == NULL) \{}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00111}00111                                 \mbox{\hyperlink{geom__vinum_8h_a28cdbd7c30e435ff9ec8676f493593a0}{G\_VINUM\_DEBUG}}(0, \textcolor{stringliteral}{"{}config parse failed plex"{}});}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00112}00112                                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00113}00113                         \}}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00114}00114 }
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00115}00115                         p2 = \mbox{\hyperlink{geom__vinum__subr_8c_ae8b89ce517f0ba1cda50aaa3ccb3b0ad}{gv\_find\_plex}}(sc, p-\/>\mbox{\hyperlink{structgv__plex_a0978e4d5dd271f5403af3cf98ae02103}{name}});}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00116}00116                         \textcolor{keywordflow}{if} (p2 != NULL) \{}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00117}00117                                 \textcolor{comment}{/* XXX */}}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00118}00118                                 \textcolor{keywordflow}{if} (is\_newer) \{}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00119}00119                                         p2-\/>\mbox{\hyperlink{structgv__plex_a323004a8a80cc2691e845ba155ad55f0}{state}} = p-\/>\mbox{\hyperlink{structgv__plex_a323004a8a80cc2691e845ba155ad55f0}{state}};}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00120}00120                                         \mbox{\hyperlink{geom__vinum_8h_a28cdbd7c30e435ff9ec8676f493593a0}{G\_VINUM\_DEBUG}}(2, \textcolor{stringliteral}{"{}newer plex found!"{}});}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00121}00121                                 \}}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00122}00122                                 \mbox{\hyperlink{geom_8h_ad9924deb20de7b40cb6cf06e5ae28855}{g\_free}}(p);}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00123}00123                                 \textcolor{keywordflow}{continue};}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00124}00124                         \}}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00125}00125 }
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00126}00126                         error = \mbox{\hyperlink{geom__vinum_8h_a62689006ab48f1e07d743f209183ee44}{gv\_create\_plex}}(sc, p);}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00127}00127                         \textcolor{keywordflow}{if} (error)}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00128}00128                                 \textcolor{keywordflow}{continue};}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00129}00129                         \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00130}00130 \textcolor{comment}{                         * These flags were set in gv\_create\_plex() and are not}}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00131}00131 \textcolor{comment}{                         * needed here (on-\/disk config parsing).}}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00132}00132 \textcolor{comment}{                         */}}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00133}00133                         p-\/>\mbox{\hyperlink{structgv__plex_a5c5a39055cb50589d0f9ee76860d6a12}{flags}} \&= \string~GV\_PLEX\_ADDED;}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00134}00134 }
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00135}00135                 \} \textcolor{keywordflow}{else} \textcolor{keywordflow}{if} (!strcmp(token[0], \textcolor{stringliteral}{"{}sd"{}})) \{}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00136}00136                         s = \mbox{\hyperlink{geom__vinum__share_8c_a7517b87d56c22c17cabd434b0b4bcb27}{gv\_new\_sd}}(tokens, token);}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00137}00137 }
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00138}00138                         \textcolor{keywordflow}{if} (s == NULL) \{}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00139}00139                                 \mbox{\hyperlink{geom__vinum_8h_a28cdbd7c30e435ff9ec8676f493593a0}{G\_VINUM\_DEBUG}}(0, \textcolor{stringliteral}{"{}config parse failed subdisk"{}});}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00140}00140                                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00141}00141                         \}}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00142}00142 }
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00143}00143                         s2 = \mbox{\hyperlink{geom__vinum__subr_8c_abf0c758149ccf41d32b659f777a0d12e}{gv\_find\_sd}}(sc, s-\/>\mbox{\hyperlink{structgv__sd_a835bdd1e1c9adf03425b91c873eebf1e}{name}});}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00144}00144                         \textcolor{keywordflow}{if} (s2 != NULL) \{}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00145}00145                                 \textcolor{comment}{/* XXX */}}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00146}00146                                 \textcolor{keywordflow}{if} (is\_newer) \{}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00147}00147                                         s2-\/>\mbox{\hyperlink{structgv__sd_ae69fbd03ecc14fbc16b0d4ed0421b59d}{state}} = s-\/>\mbox{\hyperlink{structgv__sd_ae69fbd03ecc14fbc16b0d4ed0421b59d}{state}};}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00148}00148                                         \mbox{\hyperlink{geom__vinum_8h_a28cdbd7c30e435ff9ec8676f493593a0}{G\_VINUM\_DEBUG}}(2, \textcolor{stringliteral}{"{}newer subdisk found!"{}});}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00149}00149                                 \}}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00150}00150                                 \mbox{\hyperlink{geom_8h_ad9924deb20de7b40cb6cf06e5ae28855}{g\_free}}(s);}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00151}00151                                 \textcolor{keywordflow}{continue};}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00152}00152                         \}}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00153}00153 }
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00154}00154                         \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00155}00155 \textcolor{comment}{                         * Signal that this subdisk was tasted, and could}}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00156}00156 \textcolor{comment}{                         * possibly reference a drive that isn't in our config}}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00157}00157 \textcolor{comment}{                         * yet.}}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00158}00158 \textcolor{comment}{                         */}}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00159}00159                         s-\/>\mbox{\hyperlink{structgv__sd_a84a4472842dd92c5ebcf7b103be32c90}{flags}} |= \mbox{\hyperlink{geom__vinum__var_8h_a6afc2a50dc71d53a4aa15f84eac2c254}{GV\_SD\_TASTED}};}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00160}00160 }
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00161}00161                         \textcolor{keywordflow}{if} (s-\/>\mbox{\hyperlink{structgv__sd_ae69fbd03ecc14fbc16b0d4ed0421b59d}{state}} == \mbox{\hyperlink{geom__vinum__var_8h_a85ea8962028c1319a7fd5cd7adc4e497}{GV\_SD\_UP}})}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00162}00162                                 s-\/>\mbox{\hyperlink{structgv__sd_a84a4472842dd92c5ebcf7b103be32c90}{flags}} |= \mbox{\hyperlink{geom__vinum__var_8h_a580eee21c71602cef6f2e6443719adb8}{GV\_SD\_CANGOUP}};}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00163}00163 }
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00164}00164                         error = \mbox{\hyperlink{geom__vinum_8h_a86c577f5b3bb6a8d2bd09f44f07fa3e0}{gv\_create\_sd}}(sc, s);}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00165}00165                         \textcolor{keywordflow}{if} (error)}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00166}00166                                 \textcolor{keywordflow}{continue};}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00167}00167 }
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00168}00168                         \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00169}00169 \textcolor{comment}{                         * This flag was set in gv\_create\_sd() and is not}}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00170}00170 \textcolor{comment}{                         * needed here (on-\/disk config parsing).}}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00171}00171 \textcolor{comment}{                         */}}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00172}00172                         s-\/>\mbox{\hyperlink{structgv__sd_a84a4472842dd92c5ebcf7b103be32c90}{flags}} \&= \string~GV\_SD\_NEWBORN;}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00173}00173                         s-\/>\mbox{\hyperlink{structgv__sd_a84a4472842dd92c5ebcf7b103be32c90}{flags}} \&= \string~GV\_SD\_GROW;}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00174}00174                 \}}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00175}00175         \}}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00176}00176 \}}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00177}00177 }
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00178}00178 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00179}00179 \textcolor{comment}{ * Format the vinum configuration properly.  If ondisk is non-\/zero then the}}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00180}00180 \textcolor{comment}{ * configuration is intended to be written to disk later.}}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00181}00181 \textcolor{comment}{ */}}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00182}00182 \textcolor{keywordtype}{void}}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00183}\mbox{\hyperlink{geom__vinum_8h_a648dad3068f6e60194ff25666b30da72}{00183}} \mbox{\hyperlink{geom__vinum__subr_8c_afbd17a3ad16885aea2681c896777861d}{gv\_format\_config}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structgv__softc}{gv\_softc}} *sc, \textcolor{keyword}{struct} sbuf *\mbox{\hyperlink{g__part__if_8m_a4c23eb4bab5aa5d69bd84384b94d1f79}{sb}}, \textcolor{keywordtype}{int} ondisk, \textcolor{keywordtype}{char} *prefix)}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00184}00184 \{}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00185}00185         \textcolor{keyword}{struct }\mbox{\hyperlink{structgv__drive}{gv\_drive}} *d;}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00186}00186         \textcolor{keyword}{struct }\mbox{\hyperlink{structgv__sd}{gv\_sd}} *s;}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00187}00187         \textcolor{keyword}{struct }\mbox{\hyperlink{structgv__plex}{gv\_plex}} *p;}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00188}00188         \textcolor{keyword}{struct }\mbox{\hyperlink{structgv__volume}{gv\_volume}} *v;}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00189}00189 }
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00190}00190         \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00191}00191 \textcolor{comment}{         * We don't need the drive configuration if we're not writing the}}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00192}00192 \textcolor{comment}{         * config to disk.}}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00193}00193 \textcolor{comment}{         */}}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00194}00194         \textcolor{keywordflow}{if} (!ondisk) \{}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00195}00195                 LIST\_FOREACH(d, \&sc-\/>drives, drive) \{}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00196}00196                         sbuf\_printf(\mbox{\hyperlink{g__part__if_8m_a4c23eb4bab5aa5d69bd84384b94d1f79}{sb}}, \textcolor{stringliteral}{"{}\%sdrive \%s device /dev/\%s\(\backslash\)n"{}}, prefix,}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00197}00197                             d-\/>\mbox{\hyperlink{structgv__drive_a69e5c72365075804074d21c056111ebf}{name}}, d-\/>\mbox{\hyperlink{structgv__drive_a940421a9537b8ce86596e18365122ae6}{device}});}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00198}00198                 \}}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00199}00199         \}}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00200}00200 }
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00201}00201         LIST\_FOREACH(v, \&sc-\/>volumes, \mbox{\hyperlink{g__raid__tr__if_8m_a1b9eb8854031ced0905afde9f72c9ea8}{volume}}) \{}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00202}00202                 \textcolor{keywordflow}{if} (!ondisk)}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00203}00203                         sbuf\_printf(\mbox{\hyperlink{g__part__if_8m_a4c23eb4bab5aa5d69bd84384b94d1f79}{sb}}, \textcolor{stringliteral}{"{}\%s"{}}, prefix);}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00204}00204                 sbuf\_printf(\mbox{\hyperlink{g__part__if_8m_a4c23eb4bab5aa5d69bd84384b94d1f79}{sb}}, \textcolor{stringliteral}{"{}volume \%s"{}}, v-\/>\mbox{\hyperlink{structgv__volume_a3369e150403037bca7ed34ea68f25ce0}{name}});}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00205}00205                 \textcolor{keywordflow}{if} (ondisk)}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00206}00206                         sbuf\_printf(\mbox{\hyperlink{g__part__if_8m_a4c23eb4bab5aa5d69bd84384b94d1f79}{sb}}, \textcolor{stringliteral}{"{} state \%s"{}}, \mbox{\hyperlink{geom__vinum__share_8c_a6f26fc1855ffc33ef0cb67d45d947de5}{gv\_volstate}}(v-\/>\mbox{\hyperlink{structgv__volume_a54dd71f304a3aefc237c7cef1dac9777}{state}}));}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00207}00207                 sbuf\_printf(\mbox{\hyperlink{g__part__if_8m_a4c23eb4bab5aa5d69bd84384b94d1f79}{sb}}, \textcolor{stringliteral}{"{}\(\backslash\)n"{}});}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00208}00208         \}}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00209}00209 }
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00210}00210         LIST\_FOREACH(p, \&sc-\/>plexes, plex) \{}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00211}00211                 \textcolor{keywordflow}{if} (!ondisk)}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00212}00212                         sbuf\_printf(\mbox{\hyperlink{g__part__if_8m_a4c23eb4bab5aa5d69bd84384b94d1f79}{sb}}, \textcolor{stringliteral}{"{}\%s"{}}, prefix);}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00213}00213                 sbuf\_printf(\mbox{\hyperlink{g__part__if_8m_a4c23eb4bab5aa5d69bd84384b94d1f79}{sb}}, \textcolor{stringliteral}{"{}plex name \%s org \%s "{}}, p-\/>\mbox{\hyperlink{structgv__plex_a0978e4d5dd271f5403af3cf98ae02103}{name}},}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00214}00214                     \mbox{\hyperlink{geom__vinum__share_8c_a67e48e2ae7c16f39789c555512d511ef}{gv\_plexorg}}(p-\/>\mbox{\hyperlink{structgv__plex_ac35ac16eab74d053052bdb850ff7efbd}{org}}));}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00215}00215                 \textcolor{keywordflow}{if} (\mbox{\hyperlink{geom__vinum__subr_8c_aa44b137d81c6e7d24985925c3f003d00}{gv\_is\_striped}}(p))}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00216}00216                         sbuf\_printf(\mbox{\hyperlink{g__part__if_8m_a4c23eb4bab5aa5d69bd84384b94d1f79}{sb}}, \textcolor{stringliteral}{"{}\%ds "{}}, p-\/>\mbox{\hyperlink{structgv__plex_a670e4abf06a7ee6c9737aeffd3e1e15e}{stripesize}} / 512);}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00217}00217                 \textcolor{keywordflow}{if} (p-\/>\mbox{\hyperlink{structgv__plex_a8e2820d6bd8419d81213f77131d6bd5c}{vol\_sc}} != NULL)}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00218}00218                         sbuf\_printf(\mbox{\hyperlink{g__part__if_8m_a4c23eb4bab5aa5d69bd84384b94d1f79}{sb}}, \textcolor{stringliteral}{"{}vol \%s"{}}, p-\/>\mbox{\hyperlink{structgv__plex_a3dba998991302b326667692db3ab2ac5}{volume}});}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00219}00219                 \textcolor{keywordflow}{if} (ondisk)}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00220}00220                         sbuf\_printf(\mbox{\hyperlink{g__part__if_8m_a4c23eb4bab5aa5d69bd84384b94d1f79}{sb}}, \textcolor{stringliteral}{"{} state \%s"{}}, \mbox{\hyperlink{geom__vinum__share_8c_a8bae1daaa46161fa23672f2b220b30a8}{gv\_plexstate}}(p-\/>\mbox{\hyperlink{structgv__plex_a323004a8a80cc2691e845ba155ad55f0}{state}}));}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00221}00221                 sbuf\_printf(\mbox{\hyperlink{g__part__if_8m_a4c23eb4bab5aa5d69bd84384b94d1f79}{sb}}, \textcolor{stringliteral}{"{}\(\backslash\)n"{}});}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00222}00222         \}}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00223}00223 }
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00224}00224         LIST\_FOREACH(s, \&sc-\/>subdisks, \mbox{\hyperlink{g__raid__md__if_8m_a910062273088d146e8533398780701eb}{sd}}) \{}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00225}00225                 \textcolor{keywordflow}{if} (!ondisk)}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00226}00226                         sbuf\_printf(\mbox{\hyperlink{g__part__if_8m_a4c23eb4bab5aa5d69bd84384b94d1f79}{sb}}, \textcolor{stringliteral}{"{}\%s"{}}, prefix);}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00227}00227                 sbuf\_printf(\mbox{\hyperlink{g__part__if_8m_a4c23eb4bab5aa5d69bd84384b94d1f79}{sb}}, \textcolor{stringliteral}{"{}sd name \%s drive \%s len \%jds driveoffset "{}}}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00228}00228                     \textcolor{stringliteral}{"{}\%jds"{}}, s-\/>\mbox{\hyperlink{structgv__sd_a835bdd1e1c9adf03425b91c873eebf1e}{name}}, s-\/>\mbox{\hyperlink{structgv__sd_abb67fc2a84afb2c110794b6de19d55d6}{drive}}, s-\/>\mbox{\hyperlink{structgv__sd_a7caba67088081bb1e3ede489c8b0dbbc}{size}} / 512,}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00229}00229                     s-\/>\mbox{\hyperlink{structgv__sd_a7affffaf0220e9c53c090bb6f41fb2b4}{drive\_offset}} / 512);}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00230}00230                 \textcolor{keywordflow}{if} (s-\/>\mbox{\hyperlink{structgv__sd_a6894be1eac4716d6eb2bd9e08b9643cf}{plex\_sc}} != NULL) \{}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00231}00231                         sbuf\_printf(\mbox{\hyperlink{g__part__if_8m_a4c23eb4bab5aa5d69bd84384b94d1f79}{sb}}, \textcolor{stringliteral}{"{} plex \%s plexoffset \%jds"{}}, s-\/>\mbox{\hyperlink{structgv__sd_abc2c739f0fbd33ce2480d93752375f22}{plex}},}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00232}00232                             s-\/>\mbox{\hyperlink{structgv__sd_aec325f89682a834bf445a955dd6b8dac}{plex\_offset}} / 512);}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00233}00233                 \}}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00234}00234                 \textcolor{keywordflow}{if} (ondisk)}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00235}00235                         sbuf\_printf(\mbox{\hyperlink{g__part__if_8m_a4c23eb4bab5aa5d69bd84384b94d1f79}{sb}}, \textcolor{stringliteral}{"{} state \%s"{}}, \mbox{\hyperlink{geom__vinum__share_8c_a3d13d2bb3d32f3fe52928022b2d5c602}{gv\_sdstate}}(s-\/>\mbox{\hyperlink{structgv__sd_ae69fbd03ecc14fbc16b0d4ed0421b59d}{state}}));}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00236}00236                 sbuf\_printf(\mbox{\hyperlink{g__part__if_8m_a4c23eb4bab5aa5d69bd84384b94d1f79}{sb}}, \textcolor{stringliteral}{"{}\(\backslash\)n"{}});}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00237}00237         \}}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00238}00238 \}}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00239}00239 }
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00240}00240 \textcolor{keyword}{static} off\_t}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00241}\mbox{\hyperlink{geom__vinum__subr_8c_a93d5155dfa9c8d6de8e8a7773616286d}{00241}} \mbox{\hyperlink{geom__vinum__subr_8c_a93d5155dfa9c8d6de8e8a7773616286d}{gv\_plex\_smallest\_sd}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structgv__plex}{gv\_plex}} *p)}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00242}00242 \{}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00243}00243         \textcolor{keyword}{struct }\mbox{\hyperlink{structgv__sd}{gv\_sd}} *s;}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00244}00244         off\_t smallest;}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00245}00245 }
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00246}00246         KASSERT(p != NULL, (\textcolor{stringliteral}{"{}gv\_plex\_smallest\_sd: NULL p"{}}));}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00247}00247 }
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00248}00248         s = LIST\_FIRST(\&p-\/>subdisks);}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00249}00249         \textcolor{keywordflow}{if} (s == NULL)}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00250}00250                 \textcolor{keywordflow}{return} (-\/1);}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00251}00251         smallest = s-\/>\mbox{\hyperlink{structgv__sd_a7caba67088081bb1e3ede489c8b0dbbc}{size}};}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00252}00252         LIST\_FOREACH(s, \&p-\/>subdisks, in\_plex) \{}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00253}00253                 \textcolor{keywordflow}{if} (s-\/>\mbox{\hyperlink{structgv__sd_a7caba67088081bb1e3ede489c8b0dbbc}{size}} < smallest)}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00254}00254                         smallest = s-\/>\mbox{\hyperlink{structgv__sd_a7caba67088081bb1e3ede489c8b0dbbc}{size}};}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00255}00255         \}}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00256}00256         \textcolor{keywordflow}{return} (smallest);}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00257}00257 \}}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00258}00258 }
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00259}00259 \textcolor{comment}{/* Walk over plexes in a volume and count how many are down. */}}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00260}00260 \textcolor{keywordtype}{int}}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00261}\mbox{\hyperlink{geom__vinum_8h_a996474203002f5349c6a0ec074971dfa}{00261}} \mbox{\hyperlink{geom__vinum__subr_8c_ab0bc8ee96dfef9dbf6dd01d6ff6b6167}{gv\_plexdown}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structgv__volume}{gv\_volume}} *v)}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00262}00262 \{}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00263}00263         \textcolor{keywordtype}{int} plexdown;}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00264}00264         \textcolor{keyword}{struct }\mbox{\hyperlink{structgv__plex}{gv\_plex}} *p;}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00265}00265 }
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00266}00266         KASSERT(v != NULL, (\textcolor{stringliteral}{"{}gv\_plexdown: NULL v"{}}));}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00267}00267 }
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00268}00268         plexdown = 0;}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00269}00269 }
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00270}00270         LIST\_FOREACH(p, \&v-\/>plexes, plex) \{}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00271}00271                 \textcolor{keywordflow}{if} (p-\/>\mbox{\hyperlink{structgv__plex_a323004a8a80cc2691e845ba155ad55f0}{state}} == \mbox{\hyperlink{geom__vinum__var_8h_a9eebfaad55e358e87acc6a9bacc163b7}{GV\_PLEX\_DOWN}})}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00272}00272                         plexdown++;}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00273}00273         \}}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00274}00274         \textcolor{keywordflow}{return} (plexdown);}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00275}00275 \}}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00276}00276 }
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00277}00277 \textcolor{keywordtype}{int}}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00278}\mbox{\hyperlink{geom__vinum_8h_a17abaca027474298fdf6074597194169}{00278}} \mbox{\hyperlink{geom__vinum__subr_8c_a249c39be94716091a0da30b89d5f2600}{gv\_sd\_to\_plex}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structgv__sd}{gv\_sd}} *s, \textcolor{keyword}{struct} \mbox{\hyperlink{structgv__plex}{gv\_plex}} *p)}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00279}00279 \{}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00280}00280         \textcolor{keyword}{struct }\mbox{\hyperlink{structgv__sd}{gv\_sd}} *s2;}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00281}00281         off\_t psizeorig, remainder, smallest;}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00282}00282 }
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00283}00283         \textcolor{comment}{/* If this subdisk was already given to this plex, do nothing. */}}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00284}00284         \textcolor{keywordflow}{if} (s-\/>\mbox{\hyperlink{structgv__sd_a6894be1eac4716d6eb2bd9e08b9643cf}{plex\_sc}} == p)}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00285}00285                 \textcolor{keywordflow}{return} (0);}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00286}00286 }
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00287}00287         \textcolor{comment}{/* Check correct size of this subdisk. */}}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00288}00288         s2 = LIST\_FIRST(\&p-\/>subdisks);}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00289}00289         \textcolor{comment}{/* Adjust the subdisk-\/size if necessary. */}}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00290}00290         \textcolor{keywordflow}{if} (s2 != NULL \&\& \mbox{\hyperlink{geom__vinum__subr_8c_aa44b137d81c6e7d24985925c3f003d00}{gv\_is\_striped}}(p)) \{}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00291}00291                 \textcolor{comment}{/* First adjust to the stripesize. */}}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00292}00292                 remainder = s-\/>\mbox{\hyperlink{structgv__sd_a7caba67088081bb1e3ede489c8b0dbbc}{size}} \% p-\/>\mbox{\hyperlink{structgv__plex_a670e4abf06a7ee6c9737aeffd3e1e15e}{stripesize}};}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00293}00293 }
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00294}00294                 \textcolor{keywordflow}{if} (remainder) \{}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00295}00295                         \mbox{\hyperlink{geom__vinum_8h_a28cdbd7c30e435ff9ec8676f493593a0}{G\_VINUM\_DEBUG}}(1, \textcolor{stringliteral}{"{}size of sd \%s is not a "{}}}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00296}00296                             \textcolor{stringliteral}{"{}multiple of plex stripesize, taking off "{}}}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00297}00297                             \textcolor{stringliteral}{"{}\%jd bytes"{}}, s-\/>\mbox{\hyperlink{structgv__sd_a835bdd1e1c9adf03425b91c873eebf1e}{name}},}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00298}00298                             (intmax\_t)remainder);}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00299}00299                         \mbox{\hyperlink{geom__vinum__subr_8c_ad5a5db0c16dd92d707b46c823d32cacc}{gv\_adjust\_freespace}}(s, remainder);}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00300}00300                 \}}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00301}00301 }
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00302}00302                 smallest = \mbox{\hyperlink{geom__vinum__subr_8c_a93d5155dfa9c8d6de8e8a7773616286d}{gv\_plex\_smallest\_sd}}(p);}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00303}00303                 \textcolor{comment}{/* Then take off extra if other subdisks are smaller. */}}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00304}00304                 remainder = s-\/>\mbox{\hyperlink{structgv__sd_a7caba67088081bb1e3ede489c8b0dbbc}{size}} -\/ smallest;}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00305}00305 }
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00306}00306                 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00307}00307 \textcolor{comment}{                 * Don't allow a remainder below zero for running plexes, it's too}}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00308}00308 \textcolor{comment}{                 * painful, and if someone were to accidentally do this, the}}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00309}00309 \textcolor{comment}{                 * resulting array might be smaller than the original... not god }}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00310}00310 \textcolor{comment}{                 */}}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00311}00311                 \textcolor{keywordflow}{if} (remainder < 0) \{}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00312}00312                         \textcolor{keywordflow}{if} (!(p-\/>\mbox{\hyperlink{structgv__plex_a5c5a39055cb50589d0f9ee76860d6a12}{flags}} \& \mbox{\hyperlink{geom__vinum__var_8h_a2e831125a547303e6d2be8b2d0734a24}{GV\_PLEX\_NEWBORN}})) \{}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00313}00313                                 \mbox{\hyperlink{geom__vinum_8h_a28cdbd7c30e435ff9ec8676f493593a0}{G\_VINUM\_DEBUG}}(0, \textcolor{stringliteral}{"{}sd \%s too small for plex \%s!"{}},}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00314}00314                                     s-\/>\mbox{\hyperlink{structgv__sd_a835bdd1e1c9adf03425b91c873eebf1e}{name}}, p-\/>\mbox{\hyperlink{structgv__plex_a0978e4d5dd271f5403af3cf98ae02103}{name}});}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00315}00315                                 \textcolor{keywordflow}{return} (\mbox{\hyperlink{geom__vinum__var_8h_a3d73ee9cebd3e0cd7c6001d70ccf027c}{GV\_ERR\_BADSIZE}});}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00316}00316                         \}}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00317}00317                         \textcolor{comment}{/* Adjust other subdisks. */}}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00318}00318                         LIST\_FOREACH(s2, \&p-\/>subdisks, in\_plex) \{}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00319}00319                                 \mbox{\hyperlink{geom__vinum_8h_a28cdbd7c30e435ff9ec8676f493593a0}{G\_VINUM\_DEBUG}}(1, \textcolor{stringliteral}{"{}size of sd \%s is to big, "{}}}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00320}00320                                     \textcolor{stringliteral}{"{}taking off \%jd bytes"{}}, s-\/>\mbox{\hyperlink{structgv__sd_a835bdd1e1c9adf03425b91c873eebf1e}{name}},}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00321}00321                                     (intmax\_t)remainder);}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00322}00322                                 \mbox{\hyperlink{geom__vinum__subr_8c_ad5a5db0c16dd92d707b46c823d32cacc}{gv\_adjust\_freespace}}(s2, (remainder * -\/1));}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00323}00323                         \}}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00324}00324                 \} \textcolor{keywordflow}{else} \textcolor{keywordflow}{if} (remainder > 0) \{}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00325}00325                         \mbox{\hyperlink{geom__vinum_8h_a28cdbd7c30e435ff9ec8676f493593a0}{G\_VINUM\_DEBUG}}(1, \textcolor{stringliteral}{"{}size of sd \%s is to big, "{}}}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00326}00326                             \textcolor{stringliteral}{"{}taking off \%jd bytes"{}}, s-\/>\mbox{\hyperlink{structgv__sd_a835bdd1e1c9adf03425b91c873eebf1e}{name}},}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00327}00327                             (intmax\_t)remainder);}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00328}00328                         \mbox{\hyperlink{geom__vinum__subr_8c_ad5a5db0c16dd92d707b46c823d32cacc}{gv\_adjust\_freespace}}(s, remainder);}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00329}00329                 \}}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00330}00330         \}}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00331}00331 }
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00332}00332         \textcolor{comment}{/* Find the correct plex offset for this subdisk, if needed. */}}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00333}00333         \textcolor{keywordflow}{if} (s-\/>\mbox{\hyperlink{structgv__sd_aec325f89682a834bf445a955dd6b8dac}{plex\_offset}} == -\/1) \{}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00334}00334                 \textcolor{comment}{/* }}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00335}00335 \textcolor{comment}{                 * First set it to 0 to catch the case where we had a detached}}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00336}00336 \textcolor{comment}{                 * subdisk that didn't get any good offset.}}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00337}00337 \textcolor{comment}{                 */}}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00338}00338                 s-\/>\mbox{\hyperlink{structgv__sd_aec325f89682a834bf445a955dd6b8dac}{plex\_offset}} = 0;}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00339}00339                 \textcolor{keywordflow}{if} (p-\/>\mbox{\hyperlink{structgv__plex_ab8419aad736c119ac828740cce0e235c}{sdcount}}) \{}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00340}00340                         LIST\_FOREACH(s2, \&p-\/>subdisks, in\_plex) \{}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00341}00341                                 \textcolor{keywordflow}{if} (\mbox{\hyperlink{geom__vinum__subr_8c_aa44b137d81c6e7d24985925c3f003d00}{gv\_is\_striped}}(p))}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00342}00342                                         s-\/>\mbox{\hyperlink{structgv__sd_aec325f89682a834bf445a955dd6b8dac}{plex\_offset}} = p-\/>\mbox{\hyperlink{structgv__plex_ab8419aad736c119ac828740cce0e235c}{sdcount}} *}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00343}00343                                             p-\/>\mbox{\hyperlink{structgv__plex_a670e4abf06a7ee6c9737aeffd3e1e15e}{stripesize}};}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00344}00344                                 \textcolor{keywordflow}{else}}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00345}00345                                         s-\/>\mbox{\hyperlink{structgv__sd_aec325f89682a834bf445a955dd6b8dac}{plex\_offset}} = s2-\/>\mbox{\hyperlink{structgv__sd_aec325f89682a834bf445a955dd6b8dac}{plex\_offset}} +}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00346}00346                                             s2-\/>\mbox{\hyperlink{structgv__sd_a7caba67088081bb1e3ede489c8b0dbbc}{size}};}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00347}00347                         \}}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00348}00348                 \}}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00349}00349         \}}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00350}00350 }
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00351}00351         \textcolor{comment}{/* There are no subdisks for this plex yet, just insert it. */}}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00352}00352         \textcolor{keywordflow}{if} (LIST\_EMPTY(\&p-\/>subdisks)) \{}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00353}00353                 LIST\_INSERT\_HEAD(\&p-\/>subdisks, s, in\_plex);}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00354}00354 }
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00355}00355         \textcolor{comment}{/* Insert in correct order, depending on plex\_offset. */}}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00356}00356         \} \textcolor{keywordflow}{else} \{}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00357}00357                 LIST\_FOREACH(s2, \&p-\/>subdisks, in\_plex) \{}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00358}00358                         \textcolor{keywordflow}{if} (s-\/>\mbox{\hyperlink{structgv__sd_aec325f89682a834bf445a955dd6b8dac}{plex\_offset}} < s2-\/>\mbox{\hyperlink{structgv__sd_aec325f89682a834bf445a955dd6b8dac}{plex\_offset}}) \{}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00359}00359                                 LIST\_INSERT\_BEFORE(s2, s, in\_plex);}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00360}00360                                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00361}00361                         \} \textcolor{keywordflow}{else} \textcolor{keywordflow}{if} (LIST\_NEXT(s2, in\_plex) == NULL) \{}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00362}00362                                 LIST\_INSERT\_AFTER(s2, s, in\_plex);}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00363}00363                                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00364}00364                         \}}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00365}00365                 \}}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00366}00366         \}}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00367}00367 }
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00368}00368         s-\/>\mbox{\hyperlink{structgv__sd_a6894be1eac4716d6eb2bd9e08b9643cf}{plex\_sc}} = p;}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00369}00369         \textcolor{comment}{/* Adjust the size of our plex. We check if the plex misses a subdisk,}}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00370}00370 \textcolor{comment}{         * so we don't make the plex smaller than it actually should be.}}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00371}00371 \textcolor{comment}{         */}}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00372}00372         psizeorig = p-\/>\mbox{\hyperlink{structgv__plex_ae8a3821966c400898f7dd237e0f678c8}{size}};}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00373}00373         p-\/>\mbox{\hyperlink{structgv__plex_ae8a3821966c400898f7dd237e0f678c8}{size}} = \mbox{\hyperlink{geom__vinum__subr_8c_a020d0db67150b0b09a61424320a564e5}{gv\_plex\_size}}(p);}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00374}00374         \textcolor{comment}{/* Make sure the size is not changed. */}}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00375}00375         \textcolor{keywordflow}{if} (p-\/>\mbox{\hyperlink{structgv__plex_aa0b4fc0266e80422d86f1e451505e1b4}{sddetached}} > 0) \{}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00376}00376                 \textcolor{keywordflow}{if} (p-\/>\mbox{\hyperlink{structgv__plex_ae8a3821966c400898f7dd237e0f678c8}{size}} < psizeorig) \{}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00377}00377                         p-\/>\mbox{\hyperlink{structgv__plex_ae8a3821966c400898f7dd237e0f678c8}{size}} = psizeorig;}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00378}00378                         \textcolor{comment}{/* We make sure wee need another subdisk. */}}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00379}00379                         \textcolor{keywordflow}{if} (p-\/>\mbox{\hyperlink{structgv__plex_aa0b4fc0266e80422d86f1e451505e1b4}{sddetached}} == 1)}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00380}00380                                 p-\/>\mbox{\hyperlink{structgv__plex_aa0b4fc0266e80422d86f1e451505e1b4}{sddetached}}++;}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00381}00381                 \}}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00382}00382                 p-\/>\mbox{\hyperlink{structgv__plex_aa0b4fc0266e80422d86f1e451505e1b4}{sddetached}}-\/-\/;}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00383}00383         \} \textcolor{keywordflow}{else} \{}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00384}00384                 \textcolor{keywordflow}{if} ((p-\/>\mbox{\hyperlink{structgv__plex_ac35ac16eab74d053052bdb850ff7efbd}{org}} == \mbox{\hyperlink{geom__vinum__var_8h_a77d0838869414279112148a8b1efee50}{GV\_PLEX\_RAID5}} ||}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00385}00385                     p-\/>\mbox{\hyperlink{structgv__plex_ac35ac16eab74d053052bdb850ff7efbd}{org}} == \mbox{\hyperlink{geom__vinum__var_8h_a02ae949789d43dde7a6e5540aab97beb}{GV\_PLEX\_STRIPED}}) \&\&}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00386}00386                     !(p-\/>\mbox{\hyperlink{structgv__plex_a5c5a39055cb50589d0f9ee76860d6a12}{flags}} \& \mbox{\hyperlink{geom__vinum__var_8h_a2e831125a547303e6d2be8b2d0734a24}{GV\_PLEX\_NEWBORN}}) \&\& }
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00387}00387                     p-\/>\mbox{\hyperlink{structgv__plex_a323004a8a80cc2691e845ba155ad55f0}{state}} == \mbox{\hyperlink{geom__vinum__var_8h_a2a5ed58267acc541957b387d71bd868d}{GV\_PLEX\_UP}}) \{}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00388}00388                         s-\/>\mbox{\hyperlink{structgv__sd_a84a4472842dd92c5ebcf7b103be32c90}{flags}} |= \mbox{\hyperlink{geom__vinum__var_8h_a0cd7617b098897b809b9c9c9498a7605}{GV\_SD\_GROW}};}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00389}00389                 \}}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00390}00390                 p-\/>\mbox{\hyperlink{structgv__plex_ab8419aad736c119ac828740cce0e235c}{sdcount}}++;}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00391}00391         \}}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00392}00392 }
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00393}00393         \textcolor{keywordflow}{return} (0);}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00394}00394 \}}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00395}00395 }
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00396}00396 \textcolor{keywordtype}{void}}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00397}\mbox{\hyperlink{geom__vinum_8h_a83711fe4cc9a2aacd2a0e0ef838a50a8}{00397}} \mbox{\hyperlink{geom__vinum__subr_8c_a969623373c6b329670821de7d5f32fc1}{gv\_update\_vol\_size}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structgv__volume}{gv\_volume}} *v, off\_t \mbox{\hyperlink{structgv__sd_a7caba67088081bb1e3ede489c8b0dbbc}{size}})}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00398}00398 \{}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00399}00399         \textcolor{keywordflow}{if} (v == NULL)}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00400}00400                 \textcolor{keywordflow}{return};}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00401}00401         \textcolor{keywordflow}{if} (v-\/>\mbox{\hyperlink{structgv__volume_a22436521ee96530c09a185172fb53bf7}{provider}} != NULL) \{}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00402}00402                 \mbox{\hyperlink{geom_8h_a232419d2cfa06ff3f4ff7551041aed31}{g\_topology\_lock}}();}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00403}00403                 v-\/>\mbox{\hyperlink{structgv__volume_a22436521ee96530c09a185172fb53bf7}{provider}}-\/>\mbox{\hyperlink{structg__provider_a8f47c464c78aa91fa4ca5143ed3cd15e}{mediasize}} = \mbox{\hyperlink{structgv__sd_a7caba67088081bb1e3ede489c8b0dbbc}{size}};}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00404}00404                 \mbox{\hyperlink{geom_8h_a4628d4de49ba84e7a6126cc30d23b83a}{g\_topology\_unlock}}();}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00405}00405         \}}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00406}00406         v-\/>\mbox{\hyperlink{structgv__volume_a9afdb949e852e0ee49733e7fe18bade2}{size}} = \mbox{\hyperlink{structgv__sd_a7caba67088081bb1e3ede489c8b0dbbc}{size}};}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00407}00407 \}}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00408}00408 }
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00409}00409 \textcolor{comment}{/* Return how many subdisks that constitute the original plex. */}}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00410}00410 \textcolor{keywordtype}{int}}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00411}\mbox{\hyperlink{geom__vinum_8h_ab332f378dde34dc30db1b4e44280175d}{00411}} \mbox{\hyperlink{geom__vinum__subr_8c_a72b3ac8b61bf2b89c73609e4d9c2e694}{gv\_sdcount}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structgv__plex}{gv\_plex}} *p, \textcolor{keywordtype}{int} growing)}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00412}00412 \{}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00413}00413         \textcolor{keyword}{struct }\mbox{\hyperlink{structgv__sd}{gv\_sd}} *s;}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00414}00414         \textcolor{keywordtype}{int} sdcount;}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00415}00415 }
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00416}00416         sdcount = p-\/>\mbox{\hyperlink{structgv__plex_ab8419aad736c119ac828740cce0e235c}{sdcount}};}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00417}00417         \textcolor{keywordflow}{if} (growing) \{}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00418}00418                 LIST\_FOREACH(s, \&p-\/>subdisks, in\_plex) \{}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00419}00419                         \textcolor{keywordflow}{if} (s-\/>\mbox{\hyperlink{structgv__sd_a84a4472842dd92c5ebcf7b103be32c90}{flags}} \& \mbox{\hyperlink{geom__vinum__var_8h_a0cd7617b098897b809b9c9c9498a7605}{GV\_SD\_GROW}})}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00420}00420                                 sdcount-\/-\/;}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00421}00421                 \}}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00422}00422         \}}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00423}00423 }
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00424}00424         \textcolor{keywordflow}{return} (sdcount);}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00425}00425 \}}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00426}00426 }
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00427}00427 \textcolor{comment}{/* Calculates the plex size. */}}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00428}00428 off\_t}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00429}\mbox{\hyperlink{geom__vinum_8h_a7470ddc9972e31bf7d82f35bcc157d13}{00429}} \mbox{\hyperlink{geom__vinum__subr_8c_a020d0db67150b0b09a61424320a564e5}{gv\_plex\_size}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structgv__plex}{gv\_plex}} *p)}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00430}00430 \{}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00431}00431         \textcolor{keyword}{struct }\mbox{\hyperlink{structgv__sd}{gv\_sd}} *s;}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00432}00432         off\_t \mbox{\hyperlink{structgv__sd_a7caba67088081bb1e3ede489c8b0dbbc}{size}};}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00433}00433         \textcolor{keywordtype}{int} sdcount;}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00434}00434 }
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00435}00435         KASSERT(p != NULL, (\textcolor{stringliteral}{"{}gv\_plex\_size: NULL p"{}}));}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00436}00436 }
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00437}00437         \textcolor{comment}{/* Adjust the size of our plex. */}}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00438}00438         \mbox{\hyperlink{structgv__sd_a7caba67088081bb1e3ede489c8b0dbbc}{size}} = 0;}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00439}00439         sdcount = \mbox{\hyperlink{geom__vinum__subr_8c_a72b3ac8b61bf2b89c73609e4d9c2e694}{gv\_sdcount}}(p, 1);}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00440}00440         \textcolor{keywordflow}{switch} (p-\/>\mbox{\hyperlink{structgv__plex_ac35ac16eab74d053052bdb850ff7efbd}{org}}) \{}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00441}00441         \textcolor{keywordflow}{case} \mbox{\hyperlink{geom__vinum__var_8h_a49fa4ea4e60154b1e54c70eb1f53cf19}{GV\_PLEX\_CONCAT}}:}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00442}00442                 LIST\_FOREACH(s, \&p-\/>subdisks, in\_plex)}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00443}00443                         \mbox{\hyperlink{structgv__sd_a7caba67088081bb1e3ede489c8b0dbbc}{size}} += s-\/>\mbox{\hyperlink{structgv__sd_a7caba67088081bb1e3ede489c8b0dbbc}{size}};}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00444}00444                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00445}00445         \textcolor{keywordflow}{case} \mbox{\hyperlink{geom__vinum__var_8h_a02ae949789d43dde7a6e5540aab97beb}{GV\_PLEX\_STRIPED}}:}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00446}00446                 s = LIST\_FIRST(\&p-\/>subdisks);}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00447}00447                 \mbox{\hyperlink{structgv__sd_a7caba67088081bb1e3ede489c8b0dbbc}{size}} = ((s != NULL) ? (sdcount * s-\/>\mbox{\hyperlink{structgv__sd_a7caba67088081bb1e3ede489c8b0dbbc}{size}}) : 0);}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00448}00448                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00449}00449         \textcolor{keywordflow}{case} \mbox{\hyperlink{geom__vinum__var_8h_a77d0838869414279112148a8b1efee50}{GV\_PLEX\_RAID5}}:}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00450}00450                 s = LIST\_FIRST(\&p-\/>subdisks);}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00451}00451                 \mbox{\hyperlink{structgv__sd_a7caba67088081bb1e3ede489c8b0dbbc}{size}} = ((s != NULL) ? ((sdcount -\/ 1) * s-\/>\mbox{\hyperlink{structgv__sd_a7caba67088081bb1e3ede489c8b0dbbc}{size}}) : 0);}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00452}00452                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00453}00453         \}}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00454}00454 }
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00455}00455         \textcolor{keywordflow}{return} (\mbox{\hyperlink{structgv__sd_a7caba67088081bb1e3ede489c8b0dbbc}{size}});}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00456}00456 \}}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00457}00457 }
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00458}00458 \textcolor{comment}{/* Returns the size of a volume. */}}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00459}00459 off\_t}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00460}\mbox{\hyperlink{geom__vinum_8h_ab643e8ffd49bc6145637b3c31254d473}{00460}} \mbox{\hyperlink{geom__vinum__subr_8c_a10c85623a48090fa703c19836119762c}{gv\_vol\_size}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structgv__volume}{gv\_volume}} *v)}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00461}00461 \{}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00462}00462         \textcolor{keyword}{struct }\mbox{\hyperlink{structgv__plex}{gv\_plex}} *p;}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00463}00463         off\_t minplexsize;}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00464}00464 }
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00465}00465         KASSERT(v != NULL, (\textcolor{stringliteral}{"{}gv\_vol\_size: NULL v"{}}));}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00466}00466 }
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00467}00467         p = LIST\_FIRST(\&v-\/>plexes);}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00468}00468         \textcolor{keywordflow}{if} (p == NULL)}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00469}00469                 \textcolor{keywordflow}{return} (0);}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00470}00470 }
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00471}00471         minplexsize = p-\/>\mbox{\hyperlink{structgv__plex_ae8a3821966c400898f7dd237e0f678c8}{size}};}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00472}00472         LIST\_FOREACH(p, \&v-\/>plexes, in\_volume) \{}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00473}00473                 \textcolor{keywordflow}{if} (p-\/>\mbox{\hyperlink{structgv__plex_ae8a3821966c400898f7dd237e0f678c8}{size}} < minplexsize) \{}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00474}00474                         minplexsize = p-\/>\mbox{\hyperlink{structgv__plex_ae8a3821966c400898f7dd237e0f678c8}{size}};}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00475}00475                 \}}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00476}00476         \}}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00477}00477         \textcolor{keywordflow}{return} (minplexsize);}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00478}00478 \}}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00479}00479 }
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00480}00480 \textcolor{keywordtype}{void}}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00481}\mbox{\hyperlink{geom__vinum_8h_a383c776e74d8567c9b1b08edf56d49e6}{00481}} \mbox{\hyperlink{geom__vinum__subr_8c_a3ed93ab6c1f0ba83be5bbba78260aa78}{gv\_update\_plex\_config}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structgv__plex}{gv\_plex}} *p)}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00482}00482 \{}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00483}00483         \textcolor{keyword}{struct }\mbox{\hyperlink{structgv__sd}{gv\_sd}} *s, *s2;}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00484}00484         off\_t remainder;}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00485}00485         \textcolor{keywordtype}{int} required\_sds, \mbox{\hyperlink{structgv__sd_ae69fbd03ecc14fbc16b0d4ed0421b59d}{state}};}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00486}00486 }
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00487}00487         KASSERT(p != NULL, (\textcolor{stringliteral}{"{}gv\_update\_plex\_config: NULL p"{}}));}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00488}00488 }
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00489}00489         \textcolor{comment}{/* The plex was added to an already running volume. */}}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00490}00490         \textcolor{keywordflow}{if} (p-\/>\mbox{\hyperlink{structgv__plex_a5c5a39055cb50589d0f9ee76860d6a12}{flags}} \& \mbox{\hyperlink{geom__vinum__var_8h_a91211c9ace4ead21f86f44503697faf2}{GV\_PLEX\_ADDED}})}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00491}00491                 \mbox{\hyperlink{geom__vinum_8h_a6b370b29fa92afef6aa654a9e1eb5f0d}{gv\_set\_plex\_state}}(p, \mbox{\hyperlink{geom__vinum__var_8h_a9eebfaad55e358e87acc6a9bacc163b7}{GV\_PLEX\_DOWN}}, \mbox{\hyperlink{geom__vinum__var_8h_aff3aa8190eaa79b37017c0a247c4bfb9}{GV\_SETSTATE\_FORCE}});}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00492}00492 }
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00493}00493         \textcolor{keywordflow}{switch} (p-\/>\mbox{\hyperlink{structgv__plex_ac35ac16eab74d053052bdb850ff7efbd}{org}}) \{}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00494}00494         \textcolor{keywordflow}{case} \mbox{\hyperlink{geom__vinum__var_8h_a02ae949789d43dde7a6e5540aab97beb}{GV\_PLEX\_STRIPED}}:}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00495}00495                 required\_sds = 2;}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00496}00496                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00497}00497         \textcolor{keywordflow}{case} \mbox{\hyperlink{geom__vinum__var_8h_a77d0838869414279112148a8b1efee50}{GV\_PLEX\_RAID5}}:}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00498}00498                 required\_sds = 3;}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00499}00499                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00500}00500         \textcolor{keywordflow}{case} \mbox{\hyperlink{geom__vinum__var_8h_a49fa4ea4e60154b1e54c70eb1f53cf19}{GV\_PLEX\_CONCAT}}:}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00501}00501         \textcolor{keywordflow}{default}:}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00502}00502                 required\_sds = 0;}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00503}00503                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00504}00504         \}}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00505}00505 }
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00506}00506         \textcolor{keywordflow}{if} (required\_sds) \{}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00507}00507                 \textcolor{keywordflow}{if} (p-\/>\mbox{\hyperlink{structgv__plex_ab8419aad736c119ac828740cce0e235c}{sdcount}} < required\_sds) \{}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00508}00508                         \mbox{\hyperlink{geom__vinum_8h_a6b370b29fa92afef6aa654a9e1eb5f0d}{gv\_set\_plex\_state}}(p, \mbox{\hyperlink{geom__vinum__var_8h_a9eebfaad55e358e87acc6a9bacc163b7}{GV\_PLEX\_DOWN}}, \mbox{\hyperlink{geom__vinum__var_8h_aff3aa8190eaa79b37017c0a247c4bfb9}{GV\_SETSTATE\_FORCE}});}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00509}00509                 \}}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00510}00510 }
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00511}00511                 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00512}00512 \textcolor{comment}{                 * The subdisks in striped plexes must all have the same size.}}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00513}00513 \textcolor{comment}{                 */}}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00514}00514                 s = LIST\_FIRST(\&p-\/>subdisks);}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00515}00515                 LIST\_FOREACH(s2, \&p-\/>subdisks, in\_plex) \{}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00516}00516                         \textcolor{keywordflow}{if} (s-\/>\mbox{\hyperlink{structgv__sd_a7caba67088081bb1e3ede489c8b0dbbc}{size}} != s2-\/>\mbox{\hyperlink{structgv__sd_a7caba67088081bb1e3ede489c8b0dbbc}{size}}) \{}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00517}00517                                 \mbox{\hyperlink{geom__vinum_8h_a28cdbd7c30e435ff9ec8676f493593a0}{G\_VINUM\_DEBUG}}(0, \textcolor{stringliteral}{"{}subdisk size mismatch \%s"{}}}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00518}00518                                     \textcolor{stringliteral}{"{}(\%jd) <> \%s (\%jd)"{}}, s-\/>\mbox{\hyperlink{structgv__sd_a835bdd1e1c9adf03425b91c873eebf1e}{name}}, s-\/>\mbox{\hyperlink{structgv__sd_a7caba67088081bb1e3ede489c8b0dbbc}{size}},}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00519}00519                                     s2-\/>\mbox{\hyperlink{structgv__sd_a835bdd1e1c9adf03425b91c873eebf1e}{name}}, s2-\/>\mbox{\hyperlink{structgv__sd_a7caba67088081bb1e3ede489c8b0dbbc}{size}});}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00520}00520                                 \mbox{\hyperlink{geom__vinum_8h_a6b370b29fa92afef6aa654a9e1eb5f0d}{gv\_set\_plex\_state}}(p, \mbox{\hyperlink{geom__vinum__var_8h_a9eebfaad55e358e87acc6a9bacc163b7}{GV\_PLEX\_DOWN}},}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00521}00521                                     \mbox{\hyperlink{geom__vinum__var_8h_aff3aa8190eaa79b37017c0a247c4bfb9}{GV\_SETSTATE\_FORCE}});}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00522}00522                         \}}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00523}00523                 \}}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00524}00524 }
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00525}00525                 LIST\_FOREACH(s, \&p-\/>subdisks, in\_plex) \{}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00526}00526                         \textcolor{comment}{/* Trim subdisk sizes to match the stripe size. */}}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00527}00527                         remainder = s-\/>\mbox{\hyperlink{structgv__sd_a7caba67088081bb1e3ede489c8b0dbbc}{size}} \% p-\/>\mbox{\hyperlink{structgv__plex_a670e4abf06a7ee6c9737aeffd3e1e15e}{stripesize}};}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00528}00528                         \textcolor{keywordflow}{if} (remainder) \{}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00529}00529                                 \mbox{\hyperlink{geom__vinum_8h_a28cdbd7c30e435ff9ec8676f493593a0}{G\_VINUM\_DEBUG}}(1, \textcolor{stringliteral}{"{}size of sd \%s is not a "{}}}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00530}00530                                     \textcolor{stringliteral}{"{}multiple of plex stripesize, taking off "{}}}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00531}00531                                     \textcolor{stringliteral}{"{}\%jd bytes"{}}, s-\/>\mbox{\hyperlink{structgv__sd_a835bdd1e1c9adf03425b91c873eebf1e}{name}}, (intmax\_t)remainder);}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00532}00532                                 \mbox{\hyperlink{geom__vinum__subr_8c_ad5a5db0c16dd92d707b46c823d32cacc}{gv\_adjust\_freespace}}(s, remainder);}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00533}00533                         \}}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00534}00534                 \}}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00535}00535         \}}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00536}00536 }
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00537}00537         p-\/>\mbox{\hyperlink{structgv__plex_ae8a3821966c400898f7dd237e0f678c8}{size}} = \mbox{\hyperlink{geom__vinum__subr_8c_a020d0db67150b0b09a61424320a564e5}{gv\_plex\_size}}(p);}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00538}00538         \textcolor{keywordflow}{if} (p-\/>\mbox{\hyperlink{structgv__plex_ab8419aad736c119ac828740cce0e235c}{sdcount}} == 0)}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00539}00539                 \mbox{\hyperlink{geom__vinum_8h_a6b370b29fa92afef6aa654a9e1eb5f0d}{gv\_set\_plex\_state}}(p, \mbox{\hyperlink{geom__vinum__var_8h_a9eebfaad55e358e87acc6a9bacc163b7}{GV\_PLEX\_DOWN}}, \mbox{\hyperlink{geom__vinum__var_8h_aff3aa8190eaa79b37017c0a247c4bfb9}{GV\_SETSTATE\_FORCE}});}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00540}00540         \textcolor{keywordflow}{else} \textcolor{keywordflow}{if} (p-\/>\mbox{\hyperlink{structgv__plex_ac35ac16eab74d053052bdb850ff7efbd}{org}} == \mbox{\hyperlink{geom__vinum__var_8h_a77d0838869414279112148a8b1efee50}{GV\_PLEX\_RAID5}} \&\& p-\/>\mbox{\hyperlink{structgv__plex_a5c5a39055cb50589d0f9ee76860d6a12}{flags}} \& \mbox{\hyperlink{geom__vinum__var_8h_a2e831125a547303e6d2be8b2d0734a24}{GV\_PLEX\_NEWBORN}}) \{}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00541}00541                 LIST\_FOREACH(s, \&p-\/>subdisks, in\_plex)}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00542}00542                         \mbox{\hyperlink{geom__vinum_8h_a2dc4176c195982e77ba79874f999300e}{gv\_set\_sd\_state}}(s, \mbox{\hyperlink{geom__vinum__var_8h_a85ea8962028c1319a7fd5cd7adc4e497}{GV\_SD\_UP}}, \mbox{\hyperlink{geom__vinum__var_8h_aff3aa8190eaa79b37017c0a247c4bfb9}{GV\_SETSTATE\_FORCE}});}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00543}00543                 \textcolor{comment}{/* If added to a volume, we want the plex to be down. */}}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00544}00544                 \mbox{\hyperlink{structgv__sd_ae69fbd03ecc14fbc16b0d4ed0421b59d}{state}} = (p-\/>\mbox{\hyperlink{structgv__plex_a5c5a39055cb50589d0f9ee76860d6a12}{flags}} \& \mbox{\hyperlink{geom__vinum__var_8h_a91211c9ace4ead21f86f44503697faf2}{GV\_PLEX\_ADDED}}) ? \mbox{\hyperlink{geom__vinum__var_8h_a9eebfaad55e358e87acc6a9bacc163b7}{GV\_PLEX\_DOWN}} : \mbox{\hyperlink{geom__vinum__var_8h_a2a5ed58267acc541957b387d71bd868d}{GV\_PLEX\_UP}};}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00545}00545                 \mbox{\hyperlink{geom__vinum_8h_a6b370b29fa92afef6aa654a9e1eb5f0d}{gv\_set\_plex\_state}}(p, \mbox{\hyperlink{structgv__sd_ae69fbd03ecc14fbc16b0d4ed0421b59d}{state}}, \mbox{\hyperlink{geom__vinum__var_8h_aff3aa8190eaa79b37017c0a247c4bfb9}{GV\_SETSTATE\_FORCE}});}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00546}00546                 p-\/>\mbox{\hyperlink{structgv__plex_a5c5a39055cb50589d0f9ee76860d6a12}{flags}} \&= \string~GV\_PLEX\_ADDED;}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00547}00547         \} \textcolor{keywordflow}{else} \textcolor{keywordflow}{if} (p-\/>\mbox{\hyperlink{structgv__plex_a5c5a39055cb50589d0f9ee76860d6a12}{flags}} \& \mbox{\hyperlink{geom__vinum__var_8h_a91211c9ace4ead21f86f44503697faf2}{GV\_PLEX\_ADDED}}) \{}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00548}00548                 LIST\_FOREACH(s, \&p-\/>subdisks, in\_plex)}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00549}00549                         \mbox{\hyperlink{geom__vinum_8h_a2dc4176c195982e77ba79874f999300e}{gv\_set\_sd\_state}}(s, \mbox{\hyperlink{geom__vinum__var_8h_a5dd4abf3a748b1a4ee0da0bab79840d2}{GV\_SD\_STALE}}, \mbox{\hyperlink{geom__vinum__var_8h_aff3aa8190eaa79b37017c0a247c4bfb9}{GV\_SETSTATE\_FORCE}});}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00550}00550                 \mbox{\hyperlink{geom__vinum_8h_a6b370b29fa92afef6aa654a9e1eb5f0d}{gv\_set\_plex\_state}}(p, \mbox{\hyperlink{geom__vinum__var_8h_a9eebfaad55e358e87acc6a9bacc163b7}{GV\_PLEX\_DOWN}}, \mbox{\hyperlink{geom__vinum__var_8h_aff3aa8190eaa79b37017c0a247c4bfb9}{GV\_SETSTATE\_FORCE}});}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00551}00551                 p-\/>\mbox{\hyperlink{structgv__plex_a5c5a39055cb50589d0f9ee76860d6a12}{flags}} \&= \string~GV\_PLEX\_ADDED;}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00552}00552         \} \textcolor{keywordflow}{else} \textcolor{keywordflow}{if} (p-\/>\mbox{\hyperlink{structgv__plex_a323004a8a80cc2691e845ba155ad55f0}{state}} == \mbox{\hyperlink{geom__vinum__var_8h_a2a5ed58267acc541957b387d71bd868d}{GV\_PLEX\_UP}}) \{}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00553}00553                 LIST\_FOREACH(s, \&p-\/>subdisks, in\_plex) \{}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00554}00554                         \textcolor{keywordflow}{if} (s-\/>\mbox{\hyperlink{structgv__sd_a84a4472842dd92c5ebcf7b103be32c90}{flags}} \& \mbox{\hyperlink{geom__vinum__var_8h_a0cd7617b098897b809b9c9c9498a7605}{GV\_SD\_GROW}}) \{}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00555}00555                                 \mbox{\hyperlink{geom__vinum_8h_a6b370b29fa92afef6aa654a9e1eb5f0d}{gv\_set\_plex\_state}}(p, \mbox{\hyperlink{geom__vinum__var_8h_a768ff0748cb47b0fa77b1381d770e6e9}{GV\_PLEX\_GROWABLE}},}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00556}00556                                     \mbox{\hyperlink{geom__vinum__var_8h_aff3aa8190eaa79b37017c0a247c4bfb9}{GV\_SETSTATE\_FORCE}});}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00557}00557                                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00558}00558                         \}}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00559}00559                 \}}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00560}00560         \}}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00561}00561         \textcolor{comment}{/* Our plex is grown up now. */}}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00562}00562         p-\/>\mbox{\hyperlink{structgv__plex_a5c5a39055cb50589d0f9ee76860d6a12}{flags}} \&= \string~GV\_PLEX\_NEWBORN;}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00563}00563 \}}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00564}00564 }
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00565}00565 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00566}00566 \textcolor{comment}{ * Give a subdisk to a drive, check and adjust several parameters, adjust}}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00567}00567 \textcolor{comment}{ * freelist.}}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00568}00568 \textcolor{comment}{ */}}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00569}00569 \textcolor{keywordtype}{int}}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00570}\mbox{\hyperlink{geom__vinum_8h_adf7992ee21000ae517cb765d7bed79a4}{00570}} \mbox{\hyperlink{geom__vinum__subr_8c_a9ca091be417a47802070b820473abdc3}{gv\_sd\_to\_drive}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structgv__sd}{gv\_sd}} *s, \textcolor{keyword}{struct} \mbox{\hyperlink{structgv__drive}{gv\_drive}} *d)}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00571}00571 \{}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00572}00572         \textcolor{keyword}{struct }\mbox{\hyperlink{structgv__sd}{gv\_sd}} *s2;}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00573}00573         \textcolor{keyword}{struct }\mbox{\hyperlink{structgv__freelist}{gv\_freelist}} *fl, *fl2;}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00574}00574         off\_t tmp;}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00575}00575         \textcolor{keywordtype}{int} i;}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00576}00576 }
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00577}00577         fl2 = NULL;}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00578}00578 }
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00579}00579         \textcolor{comment}{/* Shortcut for "{}referenced"{} drives. */}}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00580}00580         \textcolor{keywordflow}{if} (d-\/>\mbox{\hyperlink{structgv__drive_a9786a03e20a91ab9c73a7aa93b90629a}{flags}} \& \mbox{\hyperlink{geom__vinum__var_8h_a2d0154c5734105d6367843e651300fa5}{GV\_DRIVE\_REFERENCED}}) \{}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00581}00581                 s-\/>\mbox{\hyperlink{structgv__sd_a2b31867e2118053e8a27ce048a84335e}{drive\_sc}} = d;}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00582}00582                 \textcolor{keywordflow}{return} (0);}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00583}00583         \}}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00584}00584 }
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00585}00585         \textcolor{comment}{/* Check if this subdisk was already given to this drive. */}}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00586}00586         \textcolor{keywordflow}{if} (s-\/>\mbox{\hyperlink{structgv__sd_a2b31867e2118053e8a27ce048a84335e}{drive\_sc}} != NULL) \{}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00587}00587                 \textcolor{keywordflow}{if} (s-\/>\mbox{\hyperlink{structgv__sd_a2b31867e2118053e8a27ce048a84335e}{drive\_sc}} == d) \{}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00588}00588                         \textcolor{keywordflow}{if} (!(s-\/>\mbox{\hyperlink{structgv__sd_a84a4472842dd92c5ebcf7b103be32c90}{flags}} \& \mbox{\hyperlink{geom__vinum__var_8h_a6afc2a50dc71d53a4aa15f84eac2c254}{GV\_SD\_TASTED}})) \{}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00589}00589                                 \textcolor{keywordflow}{return} (0);}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00590}00590                         \}}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00591}00591                 \} \textcolor{keywordflow}{else} \{}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00592}00592                         \mbox{\hyperlink{geom__vinum_8h_a28cdbd7c30e435ff9ec8676f493593a0}{G\_VINUM\_DEBUG}}(0, \textcolor{stringliteral}{"{}error giving subdisk '\%s' to '\%s' "{}}}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00593}00593                             \textcolor{stringliteral}{"{}(already on '\%s')"{}}, s-\/>\mbox{\hyperlink{structgv__sd_a835bdd1e1c9adf03425b91c873eebf1e}{name}}, d-\/>\mbox{\hyperlink{structgv__drive_a69e5c72365075804074d21c056111ebf}{name}},}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00594}00594                             s-\/>\mbox{\hyperlink{structgv__sd_a2b31867e2118053e8a27ce048a84335e}{drive\_sc}}-\/>\mbox{\hyperlink{structgv__drive_a69e5c72365075804074d21c056111ebf}{name}});}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00595}00595                         \textcolor{keywordflow}{return} (\mbox{\hyperlink{geom__vinum__var_8h_a99756b5de9852cd4510167afb3c477df}{GV\_ERR\_ISATTACHED}});}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00596}00596                 \}}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00597}00597         \}}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00598}00598 }
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00599}00599         \textcolor{comment}{/* Preliminary checks. */}}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00600}00600         \textcolor{keywordflow}{if} ((s-\/>\mbox{\hyperlink{structgv__sd_a7caba67088081bb1e3ede489c8b0dbbc}{size}} > d-\/>\mbox{\hyperlink{structgv__drive_abb6ee3ed5a472c5e12dd25fc9991e5a3}{avail}}) || (d-\/>\mbox{\hyperlink{structgv__drive_a01732fd038eda27dfcc68fd2972bb725}{freelist\_entries}} == 0)) \{}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00601}00601                 \mbox{\hyperlink{geom__vinum_8h_a28cdbd7c30e435ff9ec8676f493593a0}{G\_VINUM\_DEBUG}}(0, \textcolor{stringliteral}{"{}not enough space on '\%s' for '\%s'"{}}, d-\/>\mbox{\hyperlink{structgv__drive_a69e5c72365075804074d21c056111ebf}{name}},}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00602}00602                     s-\/>\mbox{\hyperlink{structgv__sd_a835bdd1e1c9adf03425b91c873eebf1e}{name}});}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00603}00603                 \textcolor{keywordflow}{return} (\mbox{\hyperlink{geom__vinum__var_8h_a615fef907719df54f5cc52528ce446a9}{GV\_ERR\_NOSPACE}});}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00604}00604         \}}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00605}00605 }
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00606}00606         \textcolor{comment}{/* If no size was given for this subdisk, try to auto-\/size it... */}}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00607}00607         \textcolor{keywordflow}{if} (s-\/>\mbox{\hyperlink{structgv__sd_a7caba67088081bb1e3ede489c8b0dbbc}{size}} == -\/1) \{}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00608}00608                 \textcolor{comment}{/* Find the largest available slot. */}}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00609}00609                 LIST\_FOREACH(fl, \&d-\/>freelist, freelist) \{}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00610}00610                         \textcolor{keywordflow}{if} (fl-\/>\mbox{\hyperlink{structgv__freelist_a24c49538b2057655ead0d0b71772d3b4}{size}} < s-\/>\mbox{\hyperlink{structgv__sd_a7caba67088081bb1e3ede489c8b0dbbc}{size}})}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00611}00611                                 \textcolor{keywordflow}{continue};}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00612}00612                         s-\/>\mbox{\hyperlink{structgv__sd_a7caba67088081bb1e3ede489c8b0dbbc}{size}} = fl-\/>\mbox{\hyperlink{structgv__freelist_a24c49538b2057655ead0d0b71772d3b4}{size}};}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00613}00613                         s-\/>\mbox{\hyperlink{structgv__sd_a7affffaf0220e9c53c090bb6f41fb2b4}{drive\_offset}} = fl-\/>\mbox{\hyperlink{structgv__freelist_a1729993ab39e0f0299785dc7a914eeab}{offset}};}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00614}00614                         fl2 = fl;}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00615}00615                 \}}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00616}00616 }
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00617}00617                 \textcolor{comment}{/* No good slot found? */}}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00618}00618                 \textcolor{keywordflow}{if} (s-\/>\mbox{\hyperlink{structgv__sd_a7caba67088081bb1e3ede489c8b0dbbc}{size}} == -\/1) \{}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00619}00619                         \mbox{\hyperlink{geom__vinum_8h_a28cdbd7c30e435ff9ec8676f493593a0}{G\_VINUM\_DEBUG}}(0, \textcolor{stringliteral}{"{}unable to autosize '\%s' on '\%s'"{}},}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00620}00620                             s-\/>\mbox{\hyperlink{structgv__sd_a835bdd1e1c9adf03425b91c873eebf1e}{name}}, d-\/>\mbox{\hyperlink{structgv__drive_a69e5c72365075804074d21c056111ebf}{name}});}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00621}00621                         \textcolor{keywordflow}{return} (\mbox{\hyperlink{geom__vinum__var_8h_a3d73ee9cebd3e0cd7c6001d70ccf027c}{GV\_ERR\_BADSIZE}});}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00622}00622                 \}}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00623}00623 }
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00624}00624         \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00625}00625 \textcolor{comment}{         * ... or check if we have a free slot that's large enough for the}}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00626}00626 \textcolor{comment}{         * given size.}}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00627}00627 \textcolor{comment}{         */}}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00628}00628         \} \textcolor{keywordflow}{else} \{}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00629}00629                 i = 0;}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00630}00630                 LIST\_FOREACH(fl, \&d-\/>freelist, freelist) \{}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00631}00631                         \textcolor{keywordflow}{if} (fl-\/>\mbox{\hyperlink{structgv__freelist_a24c49538b2057655ead0d0b71772d3b4}{size}} < s-\/>\mbox{\hyperlink{structgv__sd_a7caba67088081bb1e3ede489c8b0dbbc}{size}})}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00632}00632                                 \textcolor{keywordflow}{continue};}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00633}00633                         \textcolor{comment}{/* Assign drive offset, if not given. */}}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00634}00634                         \textcolor{keywordflow}{if} (s-\/>\mbox{\hyperlink{structgv__sd_a7affffaf0220e9c53c090bb6f41fb2b4}{drive\_offset}} == -\/1)}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00635}00635                                 s-\/>\mbox{\hyperlink{structgv__sd_a7affffaf0220e9c53c090bb6f41fb2b4}{drive\_offset}} = fl-\/>\mbox{\hyperlink{structgv__freelist_a1729993ab39e0f0299785dc7a914eeab}{offset}};}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00636}00636                         fl2 = fl;}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00637}00637                         i++;}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00638}00638                         \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00639}00639                 \}}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00640}00640 }
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00641}00641                 \textcolor{comment}{/* Couldn't find a good free slot. */}}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00642}00642                 \textcolor{keywordflow}{if} (i == 0) \{}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00643}00643                         \mbox{\hyperlink{geom__vinum_8h_a28cdbd7c30e435ff9ec8676f493593a0}{G\_VINUM\_DEBUG}}(0, \textcolor{stringliteral}{"{}free slots to small for '\%s' on '\%s'"{}},}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00644}00644                             s-\/>\mbox{\hyperlink{structgv__sd_a835bdd1e1c9adf03425b91c873eebf1e}{name}}, d-\/>\mbox{\hyperlink{structgv__drive_a69e5c72365075804074d21c056111ebf}{name}});}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00645}00645                         \textcolor{keywordflow}{return} (\mbox{\hyperlink{geom__vinum__var_8h_a615fef907719df54f5cc52528ce446a9}{GV\_ERR\_NOSPACE}});}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00646}00646                 \}}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00647}00647         \}}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00648}00648 }
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00649}00649         \textcolor{comment}{/* No drive offset given, try to calculate it. */}}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00650}00650         \textcolor{keywordflow}{if} (s-\/>\mbox{\hyperlink{structgv__sd_a7affffaf0220e9c53c090bb6f41fb2b4}{drive\_offset}} == -\/1) \{}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00651}00651                 \textcolor{comment}{/* Add offsets and sizes from other subdisks on this drive. */}}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00652}00652                 LIST\_FOREACH(s2, \&d-\/>subdisks, from\_drive) \{}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00653}00653                         s-\/>\mbox{\hyperlink{structgv__sd_a7affffaf0220e9c53c090bb6f41fb2b4}{drive\_offset}} = s2-\/>\mbox{\hyperlink{structgv__sd_a7affffaf0220e9c53c090bb6f41fb2b4}{drive\_offset}} + s2-\/>\mbox{\hyperlink{structgv__sd_a7caba67088081bb1e3ede489c8b0dbbc}{size}};}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00654}00654                 \}}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00655}00655 }
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00656}00656                 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00657}00657 \textcolor{comment}{                 * If there are no other subdisks yet, then set the default}}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00658}00658 \textcolor{comment}{                 * offset to GV\_DATA\_START.}}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00659}00659 \textcolor{comment}{                 */}}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00660}00660                 \textcolor{keywordflow}{if} (s-\/>\mbox{\hyperlink{structgv__sd_a7affffaf0220e9c53c090bb6f41fb2b4}{drive\_offset}} == -\/1)}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00661}00661                         s-\/>\mbox{\hyperlink{structgv__sd_a7affffaf0220e9c53c090bb6f41fb2b4}{drive\_offset}} = \mbox{\hyperlink{geom__vinum__var_8h_a41a10b380adbacc1eebe7ed20a3cfdad}{GV\_DATA\_START}};}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00662}00662 }
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00663}00663         \textcolor{comment}{/* Check if we have a free slot at the given drive offset. */}}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00664}00664         \} \textcolor{keywordflow}{else} \{}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00665}00665                 i = 0;}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00666}00666                 LIST\_FOREACH(fl, \&d-\/>freelist, freelist) \{}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00667}00667                         \textcolor{comment}{/* Yes, this subdisk fits. */}}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00668}00668                         \textcolor{keywordflow}{if} ((fl-\/>\mbox{\hyperlink{structgv__freelist_a1729993ab39e0f0299785dc7a914eeab}{offset}} <= s-\/>\mbox{\hyperlink{structgv__sd_a7affffaf0220e9c53c090bb6f41fb2b4}{drive\_offset}}) \&\&}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00669}00669                             (fl-\/>\mbox{\hyperlink{structgv__freelist_a1729993ab39e0f0299785dc7a914eeab}{offset}} + fl-\/>\mbox{\hyperlink{structgv__freelist_a24c49538b2057655ead0d0b71772d3b4}{size}} >=}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00670}00670                             s-\/>\mbox{\hyperlink{structgv__sd_a7affffaf0220e9c53c090bb6f41fb2b4}{drive\_offset}} + s-\/>\mbox{\hyperlink{structgv__sd_a7caba67088081bb1e3ede489c8b0dbbc}{size}})) \{}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00671}00671                                 i++;}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00672}00672                                 fl2 = fl;}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00673}00673                                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00674}00674                         \}}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00675}00675                 \}}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00676}00676 }
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00677}00677                 \textcolor{comment}{/* Couldn't find a good free slot. */}}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00678}00678                 \textcolor{keywordflow}{if} (i == 0) \{}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00679}00679                         \mbox{\hyperlink{geom__vinum_8h_a28cdbd7c30e435ff9ec8676f493593a0}{G\_VINUM\_DEBUG}}(0, \textcolor{stringliteral}{"{}given drive\_offset for '\%s' won't fit "{}}}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00680}00680                             \textcolor{stringliteral}{"{}on '\%s'"{}}, s-\/>\mbox{\hyperlink{structgv__sd_a835bdd1e1c9adf03425b91c873eebf1e}{name}}, d-\/>\mbox{\hyperlink{structgv__drive_a69e5c72365075804074d21c056111ebf}{name}});}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00681}00681                         \textcolor{keywordflow}{return} (\mbox{\hyperlink{geom__vinum__var_8h_a615fef907719df54f5cc52528ce446a9}{GV\_ERR\_NOSPACE}});}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00682}00682                 \}}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00683}00683         \}}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00684}00684 }
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00685}00685         \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00686}00686 \textcolor{comment}{         * Now that all parameters are checked and set up, we can give the}}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00687}00687 \textcolor{comment}{         * subdisk to the drive and adjust the freelist.}}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00688}00688 \textcolor{comment}{         */}}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00689}00689 }
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00690}00690         \textcolor{comment}{/* First, adjust the freelist. */}}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00691}00691         LIST\_FOREACH(fl, \&d-\/>freelist, freelist) \{}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00692}00692                 \textcolor{comment}{/* Look for the free slot that we have found before. */}}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00693}00693                 \textcolor{keywordflow}{if} (fl != fl2)}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00694}00694                         \textcolor{keywordflow}{continue};}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00695}00695 }
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00696}00696                 \textcolor{comment}{/* The subdisk starts at the beginning of the free slot. */}}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00697}00697                 \textcolor{keywordflow}{if} (fl-\/>\mbox{\hyperlink{structgv__freelist_a1729993ab39e0f0299785dc7a914eeab}{offset}} == s-\/>\mbox{\hyperlink{structgv__sd_a7affffaf0220e9c53c090bb6f41fb2b4}{drive\_offset}}) \{}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00698}00698                         fl-\/>\mbox{\hyperlink{structgv__freelist_a1729993ab39e0f0299785dc7a914eeab}{offset}} += s-\/>\mbox{\hyperlink{structgv__sd_a7caba67088081bb1e3ede489c8b0dbbc}{size}};}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00699}00699                         fl-\/>\mbox{\hyperlink{structgv__freelist_a24c49538b2057655ead0d0b71772d3b4}{size}} -\/= s-\/>\mbox{\hyperlink{structgv__sd_a7caba67088081bb1e3ede489c8b0dbbc}{size}};}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00700}00700 }
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00701}00701                         \textcolor{comment}{/* The subdisk uses the whole slot, so remove it. */}}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00702}00702                         \textcolor{keywordflow}{if} (fl-\/>\mbox{\hyperlink{structgv__freelist_a24c49538b2057655ead0d0b71772d3b4}{size}} == 0) \{}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00703}00703                                 d-\/>\mbox{\hyperlink{structgv__drive_a01732fd038eda27dfcc68fd2972bb725}{freelist\_entries}}-\/-\/;}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00704}00704                                 LIST\_REMOVE(fl, freelist);}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00705}00705                         \}}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00706}00706                 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00707}00707 \textcolor{comment}{                 * The subdisk does not start at the beginning of the free}}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00708}00708 \textcolor{comment}{                 * slot.}}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00709}00709 \textcolor{comment}{                 */}}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00710}00710                 \} \textcolor{keywordflow}{else} \{}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00711}00711                         tmp = fl-\/>\mbox{\hyperlink{structgv__freelist_a1729993ab39e0f0299785dc7a914eeab}{offset}} + fl-\/>\mbox{\hyperlink{structgv__freelist_a24c49538b2057655ead0d0b71772d3b4}{size}};}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00712}00712                         fl-\/>\mbox{\hyperlink{structgv__freelist_a24c49538b2057655ead0d0b71772d3b4}{size}} = s-\/>\mbox{\hyperlink{structgv__sd_a7affffaf0220e9c53c090bb6f41fb2b4}{drive\_offset}} -\/ fl-\/>\mbox{\hyperlink{structgv__freelist_a1729993ab39e0f0299785dc7a914eeab}{offset}};}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00713}00713 }
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00714}00714                         \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00715}00715 \textcolor{comment}{                         * The subdisk didn't use the complete rest of the free}}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00716}00716 \textcolor{comment}{                         * slot, so we need to split it.}}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00717}00717 \textcolor{comment}{                         */}}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00718}00718                         \textcolor{keywordflow}{if} (s-\/>\mbox{\hyperlink{structgv__sd_a7affffaf0220e9c53c090bb6f41fb2b4}{drive\_offset}} + s-\/>\mbox{\hyperlink{structgv__sd_a7caba67088081bb1e3ede489c8b0dbbc}{size}} != tmp) \{}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00719}00719                                 fl2 = \mbox{\hyperlink{geom_8h_a0f190247baa73dc863a79fea9d5f6b4f}{g\_malloc}}(\textcolor{keyword}{sizeof}(*fl2), M\_WAITOK | M\_ZERO);}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00720}00720                                 fl2-\/>\mbox{\hyperlink{structgv__freelist_a1729993ab39e0f0299785dc7a914eeab}{offset}} = s-\/>\mbox{\hyperlink{structgv__sd_a7affffaf0220e9c53c090bb6f41fb2b4}{drive\_offset}} + s-\/>\mbox{\hyperlink{structgv__sd_a7caba67088081bb1e3ede489c8b0dbbc}{size}};}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00721}00721                                 fl2-\/>\mbox{\hyperlink{structgv__freelist_a24c49538b2057655ead0d0b71772d3b4}{size}} = tmp -\/ fl2-\/>\mbox{\hyperlink{structgv__freelist_a1729993ab39e0f0299785dc7a914eeab}{offset}};}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00722}00722                                 LIST\_INSERT\_AFTER(fl, fl2, freelist);}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00723}00723                                 d-\/>\mbox{\hyperlink{structgv__drive_a01732fd038eda27dfcc68fd2972bb725}{freelist\_entries}}++;}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00724}00724                         \}}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00725}00725                 \}}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00726}00726                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00727}00727         \}}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00728}00728 }
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00729}00729         \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00730}00730 \textcolor{comment}{         * This is the first subdisk on this drive, just insert it into the}}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00731}00731 \textcolor{comment}{         * list.}}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00732}00732 \textcolor{comment}{         */}}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00733}00733         \textcolor{keywordflow}{if} (LIST\_EMPTY(\&d-\/>subdisks)) \{}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00734}00734                 LIST\_INSERT\_HEAD(\&d-\/>subdisks, s, from\_drive);}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00735}00735 }
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00736}00736         \textcolor{comment}{/* There are other subdisks, so insert this one in correct order. */}}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00737}00737         \} \textcolor{keywordflow}{else} \{}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00738}00738                 LIST\_FOREACH(s2, \&d-\/>subdisks, from\_drive) \{}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00739}00739                         \textcolor{keywordflow}{if} (s-\/>\mbox{\hyperlink{structgv__sd_a7affffaf0220e9c53c090bb6f41fb2b4}{drive\_offset}} < s2-\/>\mbox{\hyperlink{structgv__sd_a7affffaf0220e9c53c090bb6f41fb2b4}{drive\_offset}}) \{}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00740}00740                                 LIST\_INSERT\_BEFORE(s2, s, from\_drive);}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00741}00741                                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00742}00742                         \} \textcolor{keywordflow}{else} \textcolor{keywordflow}{if} (LIST\_NEXT(s2, from\_drive) == NULL) \{}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00743}00743                                 LIST\_INSERT\_AFTER(s2, s, from\_drive);}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00744}00744                                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00745}00745                         \}}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00746}00746                 \}}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00747}00747         \}}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00748}00748 }
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00749}00749         d-\/>\mbox{\hyperlink{structgv__drive_a8a8479a25677d4bf6bb239b9fe906a8f}{sdcount}}++;}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00750}00750         d-\/>\mbox{\hyperlink{structgv__drive_abb6ee3ed5a472c5e12dd25fc9991e5a3}{avail}} -\/= s-\/>\mbox{\hyperlink{structgv__sd_a7caba67088081bb1e3ede489c8b0dbbc}{size}};}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00751}00751 }
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00752}00752         s-\/>\mbox{\hyperlink{structgv__sd_a84a4472842dd92c5ebcf7b103be32c90}{flags}} \&= \string~GV\_SD\_TASTED;}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00753}00753 }
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00754}00754         \textcolor{comment}{/* Link back from the subdisk to this drive. */}}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00755}00755         s-\/>\mbox{\hyperlink{structgv__sd_a2b31867e2118053e8a27ce048a84335e}{drive\_sc}} = d;}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00756}00756 }
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00757}00757         \textcolor{keywordflow}{return} (0);}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00758}00758 \}}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00759}00759 }
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00760}00760 \textcolor{keywordtype}{void}}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00761}\mbox{\hyperlink{geom__vinum_8h_ab023e4c23b7d9333ad523ec0021e13cc}{00761}} \mbox{\hyperlink{geom__vinum__subr_8c_a791c905fb2c7d3d8f332e22725b3288b}{gv\_free\_sd}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structgv__sd}{gv\_sd}} *s)}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00762}00762 \{}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00763}00763         \textcolor{keyword}{struct }\mbox{\hyperlink{structgv__drive}{gv\_drive}} *d;}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00764}00764         \textcolor{keyword}{struct }\mbox{\hyperlink{structgv__freelist}{gv\_freelist}} *fl, *fl2;}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00765}00765 }
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00766}00766         KASSERT(s != NULL, (\textcolor{stringliteral}{"{}gv\_free\_sd: NULL s"{}}));}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00767}00767 }
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00768}00768         d = s-\/>\mbox{\hyperlink{structgv__sd_a2b31867e2118053e8a27ce048a84335e}{drive\_sc}};}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00769}00769         \textcolor{keywordflow}{if} (d == NULL)}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00770}00770                 \textcolor{keywordflow}{return};}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00771}00771 }
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00772}00772         \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00773}00773 \textcolor{comment}{         * First, find the free slot that's immediately before or after this}}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00774}00774 \textcolor{comment}{         * subdisk.}}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00775}00775 \textcolor{comment}{         */}}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00776}00776         fl = NULL;}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00777}00777         LIST\_FOREACH(fl, \&d-\/>freelist, freelist) \{}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00778}00778                 \textcolor{keywordflow}{if} (fl-\/>\mbox{\hyperlink{structgv__freelist_a1729993ab39e0f0299785dc7a914eeab}{offset}} == s-\/>\mbox{\hyperlink{structgv__sd_a7affffaf0220e9c53c090bb6f41fb2b4}{drive\_offset}} + s-\/>\mbox{\hyperlink{structgv__sd_a7caba67088081bb1e3ede489c8b0dbbc}{size}})}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00779}00779                         \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00780}00780                 \textcolor{keywordflow}{if} (fl-\/>\mbox{\hyperlink{structgv__freelist_a1729993ab39e0f0299785dc7a914eeab}{offset}} + fl-\/>\mbox{\hyperlink{structgv__freelist_a24c49538b2057655ead0d0b71772d3b4}{size}} == s-\/>\mbox{\hyperlink{structgv__sd_a7affffaf0220e9c53c090bb6f41fb2b4}{drive\_offset}})}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00781}00781                         \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00782}00782         \}}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00783}00783 }
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00784}00784         \textcolor{comment}{/* If there is no free slot behind this subdisk, so create one. */}}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00785}00785         \textcolor{keywordflow}{if} (fl == NULL) \{}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00786}00786                 fl = \mbox{\hyperlink{geom_8h_a0f190247baa73dc863a79fea9d5f6b4f}{g\_malloc}}(\textcolor{keyword}{sizeof}(*fl), M\_WAITOK | M\_ZERO);}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00787}00787                 fl-\/>\mbox{\hyperlink{structgv__freelist_a24c49538b2057655ead0d0b71772d3b4}{size}} = s-\/>\mbox{\hyperlink{structgv__sd_a7caba67088081bb1e3ede489c8b0dbbc}{size}};}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00788}00788                 fl-\/>\mbox{\hyperlink{structgv__freelist_a1729993ab39e0f0299785dc7a914eeab}{offset}} = s-\/>\mbox{\hyperlink{structgv__sd_a7affffaf0220e9c53c090bb6f41fb2b4}{drive\_offset}};}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00789}00789 }
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00790}00790                 \textcolor{keywordflow}{if} (d-\/>\mbox{\hyperlink{structgv__drive_a01732fd038eda27dfcc68fd2972bb725}{freelist\_entries}} == 0) \{}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00791}00791                         LIST\_INSERT\_HEAD(\&d-\/>freelist, fl, freelist);}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00792}00792                 \} \textcolor{keywordflow}{else} \{}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00793}00793                         LIST\_FOREACH(fl2, \&d-\/>freelist, freelist) \{}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00794}00794                                 \textcolor{keywordflow}{if} (fl-\/>\mbox{\hyperlink{structgv__freelist_a1729993ab39e0f0299785dc7a914eeab}{offset}} < fl2-\/>\mbox{\hyperlink{structgv__freelist_a1729993ab39e0f0299785dc7a914eeab}{offset}}) \{}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00795}00795                                         LIST\_INSERT\_BEFORE(fl2, fl, freelist);}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00796}00796                                         \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00797}00797                                 \} \textcolor{keywordflow}{else} \textcolor{keywordflow}{if} (LIST\_NEXT(fl2, freelist) == NULL) \{}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00798}00798                                         LIST\_INSERT\_AFTER(fl2, fl, freelist);}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00799}00799                                         \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00800}00800                                 \}}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00801}00801                         \}}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00802}00802                 \}}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00803}00803 }
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00804}00804                 d-\/>\mbox{\hyperlink{structgv__drive_a01732fd038eda27dfcc68fd2972bb725}{freelist\_entries}}++;}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00805}00805 }
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00806}00806         \textcolor{comment}{/* Expand the free slot we just found. */}}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00807}00807         \} \textcolor{keywordflow}{else} \{}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00808}00808                 fl-\/>\mbox{\hyperlink{structgv__freelist_a24c49538b2057655ead0d0b71772d3b4}{size}} += s-\/>\mbox{\hyperlink{structgv__sd_a7caba67088081bb1e3ede489c8b0dbbc}{size}};}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00809}00809                 \textcolor{keywordflow}{if} (fl-\/>\mbox{\hyperlink{structgv__freelist_a1729993ab39e0f0299785dc7a914eeab}{offset}} > s-\/>\mbox{\hyperlink{structgv__sd_a7affffaf0220e9c53c090bb6f41fb2b4}{drive\_offset}})}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00810}00810                         fl-\/>\mbox{\hyperlink{structgv__freelist_a1729993ab39e0f0299785dc7a914eeab}{offset}} = s-\/>\mbox{\hyperlink{structgv__sd_a7affffaf0220e9c53c090bb6f41fb2b4}{drive\_offset}};}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00811}00811         \}}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00812}00812 }
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00813}00813         d-\/>\mbox{\hyperlink{structgv__drive_abb6ee3ed5a472c5e12dd25fc9991e5a3}{avail}} += s-\/>\mbox{\hyperlink{structgv__sd_a7caba67088081bb1e3ede489c8b0dbbc}{size}};}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00814}00814         d-\/>\mbox{\hyperlink{structgv__drive_a8a8479a25677d4bf6bb239b9fe906a8f}{sdcount}}-\/-\/;}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00815}00815 \}}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00816}00816 }
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00817}00817 \textcolor{keywordtype}{void}}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00818}\mbox{\hyperlink{geom__vinum_8h_aa818f2d0523b36f9aff18eae1017797c}{00818}} \mbox{\hyperlink{geom__vinum__subr_8c_ad5a5db0c16dd92d707b46c823d32cacc}{gv\_adjust\_freespace}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structgv__sd}{gv\_sd}} *s, off\_t remainder)}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00819}00819 \{}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00820}00820         \textcolor{keyword}{struct }\mbox{\hyperlink{structgv__drive}{gv\_drive}} *d;}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00821}00821         \textcolor{keyword}{struct }\mbox{\hyperlink{structgv__freelist}{gv\_freelist}} *fl, *fl2;}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00822}00822 }
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00823}00823         KASSERT(s != NULL, (\textcolor{stringliteral}{"{}gv\_adjust\_freespace: NULL s"{}}));}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00824}00824         d = s-\/>\mbox{\hyperlink{structgv__sd_a2b31867e2118053e8a27ce048a84335e}{drive\_sc}};}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00825}00825         KASSERT(d != NULL, (\textcolor{stringliteral}{"{}gv\_adjust\_freespace: NULL d"{}}));}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00826}00826 }
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00827}00827         \textcolor{comment}{/* First, find the free slot that's immediately after this subdisk. */}}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00828}00828         fl = NULL;}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00829}00829         LIST\_FOREACH(fl, \&d-\/>freelist, freelist) \{}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00830}00830                 \textcolor{keywordflow}{if} (fl-\/>\mbox{\hyperlink{structgv__freelist_a1729993ab39e0f0299785dc7a914eeab}{offset}} == s-\/>\mbox{\hyperlink{structgv__sd_a7affffaf0220e9c53c090bb6f41fb2b4}{drive\_offset}} + s-\/>\mbox{\hyperlink{structgv__sd_a7caba67088081bb1e3ede489c8b0dbbc}{size}})}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00831}00831                         \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00832}00832         \}}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00833}00833 }
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00834}00834         \textcolor{comment}{/* If there is no free slot behind this subdisk, so create one. */}}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00835}00835         \textcolor{keywordflow}{if} (fl == NULL) \{}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00836}00836                 fl = \mbox{\hyperlink{geom_8h_a0f190247baa73dc863a79fea9d5f6b4f}{g\_malloc}}(\textcolor{keyword}{sizeof}(*fl), M\_WAITOK | M\_ZERO);}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00837}00837                 fl-\/>\mbox{\hyperlink{structgv__freelist_a24c49538b2057655ead0d0b71772d3b4}{size}} = remainder;}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00838}00838                 fl-\/>\mbox{\hyperlink{structgv__freelist_a1729993ab39e0f0299785dc7a914eeab}{offset}} = s-\/>\mbox{\hyperlink{structgv__sd_a7affffaf0220e9c53c090bb6f41fb2b4}{drive\_offset}} + s-\/>\mbox{\hyperlink{structgv__sd_a7caba67088081bb1e3ede489c8b0dbbc}{size}} -\/ remainder;}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00839}00839 }
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00840}00840                 \textcolor{keywordflow}{if} (d-\/>\mbox{\hyperlink{structgv__drive_a01732fd038eda27dfcc68fd2972bb725}{freelist\_entries}} == 0) \{}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00841}00841                         LIST\_INSERT\_HEAD(\&d-\/>freelist, fl, freelist);}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00842}00842                 \} \textcolor{keywordflow}{else} \{}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00843}00843                         LIST\_FOREACH(fl2, \&d-\/>freelist, freelist) \{}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00844}00844                                 \textcolor{keywordflow}{if} (fl-\/>\mbox{\hyperlink{structgv__freelist_a1729993ab39e0f0299785dc7a914eeab}{offset}} < fl2-\/>\mbox{\hyperlink{structgv__freelist_a1729993ab39e0f0299785dc7a914eeab}{offset}}) \{}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00845}00845                                         LIST\_INSERT\_BEFORE(fl2, fl, freelist);}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00846}00846                                         \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00847}00847                                 \} \textcolor{keywordflow}{else} \textcolor{keywordflow}{if} (LIST\_NEXT(fl2, freelist) == NULL) \{}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00848}00848                                         LIST\_INSERT\_AFTER(fl2, fl, freelist);}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00849}00849                                         \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00850}00850                                 \}}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00851}00851                         \}}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00852}00852                 \}}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00853}00853 }
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00854}00854                 d-\/>\mbox{\hyperlink{structgv__drive_a01732fd038eda27dfcc68fd2972bb725}{freelist\_entries}}++;}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00855}00855 }
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00856}00856         \textcolor{comment}{/* Expand the free slot we just found. */}}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00857}00857         \} \textcolor{keywordflow}{else} \{}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00858}00858                 fl-\/>\mbox{\hyperlink{structgv__freelist_a1729993ab39e0f0299785dc7a914eeab}{offset}} -\/= remainder;}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00859}00859                 fl-\/>\mbox{\hyperlink{structgv__freelist_a24c49538b2057655ead0d0b71772d3b4}{size}} += remainder;}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00860}00860         \}}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00861}00861 }
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00862}00862         s-\/>\mbox{\hyperlink{structgv__sd_a7caba67088081bb1e3ede489c8b0dbbc}{size}} -\/= remainder;}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00863}00863         d-\/>\mbox{\hyperlink{structgv__drive_abb6ee3ed5a472c5e12dd25fc9991e5a3}{avail}} += remainder;}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00864}00864 \}}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00865}00865 }
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00866}00866 \textcolor{comment}{/* Check if the given plex is a striped one. */}}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00867}00867 \textcolor{keywordtype}{int}}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00868}\mbox{\hyperlink{geom__vinum_8h_a0eb7579a2dcad1c46531d0d649bc96ae}{00868}} \mbox{\hyperlink{geom__vinum__subr_8c_aa44b137d81c6e7d24985925c3f003d00}{gv\_is\_striped}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structgv__plex}{gv\_plex}} *p)}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00869}00869 \{}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00870}00870         KASSERT(p != NULL, (\textcolor{stringliteral}{"{}gv\_is\_striped: NULL p"{}}));}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00871}00871         \textcolor{keywordflow}{switch}(p-\/>\mbox{\hyperlink{structgv__plex_ac35ac16eab74d053052bdb850ff7efbd}{org}}) \{}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00872}00872         \textcolor{keywordflow}{case} \mbox{\hyperlink{geom__vinum__var_8h_a02ae949789d43dde7a6e5540aab97beb}{GV\_PLEX\_STRIPED}}:}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00873}00873         \textcolor{keywordflow}{case} \mbox{\hyperlink{geom__vinum__var_8h_a77d0838869414279112148a8b1efee50}{GV\_PLEX\_RAID5}}:}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00874}00874                 \textcolor{keywordflow}{return} (1);}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00875}00875         \textcolor{keywordflow}{default}:}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00876}00876                 \textcolor{keywordflow}{return} (0);}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00877}00877         \}}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00878}00878 \}}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00879}00879 }
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00880}00880 \textcolor{comment}{/* Find a volume by name. */}}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00881}00881 \textcolor{keyword}{struct }\mbox{\hyperlink{structgv__volume}{gv\_volume}} *}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00882}\mbox{\hyperlink{geom__vinum_8h_a2fb94d2e82510ca78bb8c88fbc12315e}{00882}} \mbox{\hyperlink{geom__vinum__subr_8c_a8239ceaedf41ce2e9605183a0f1ca750}{gv\_find\_vol}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structgv__softc}{gv\_softc}} *sc, \textcolor{keywordtype}{char} *\mbox{\hyperlink{g__part__if_8m_aff5d3acc33944ecb11914d04ef06bb54}{name}})}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00883}00883 \{}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00884}00884         \textcolor{keyword}{struct }\mbox{\hyperlink{structgv__volume}{gv\_volume}} *v;}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00885}00885 }
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00886}00886         LIST\_FOREACH(v, \&sc-\/>volumes, \mbox{\hyperlink{g__raid__tr__if_8m_a1b9eb8854031ced0905afde9f72c9ea8}{volume}}) \{}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00887}00887                 \textcolor{keywordflow}{if} (!strncmp(v-\/>\mbox{\hyperlink{structgv__volume_a3369e150403037bca7ed34ea68f25ce0}{name}}, \mbox{\hyperlink{g__part__if_8m_aff5d3acc33944ecb11914d04ef06bb54}{name}}, \mbox{\hyperlink{geom__vinum__var_8h_a4527a51313b9d7ed77b6d0ff5c461623}{GV\_MAXVOLNAME}}))}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00888}00888                         \textcolor{keywordflow}{return} (v);}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00889}00889         \}}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00890}00890 }
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00891}00891         \textcolor{keywordflow}{return} (NULL);}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00892}00892 \}}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00893}00893 }
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00894}00894 \textcolor{comment}{/* Find a plex by name. */}}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00895}00895 \textcolor{keyword}{struct }\mbox{\hyperlink{structgv__plex}{gv\_plex}} *}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00896}\mbox{\hyperlink{geom__vinum_8h_acf034b996fb50e3a99f2f0d98ffecc53}{00896}} \mbox{\hyperlink{geom__vinum__subr_8c_ae8b89ce517f0ba1cda50aaa3ccb3b0ad}{gv\_find\_plex}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structgv__softc}{gv\_softc}} *sc, \textcolor{keywordtype}{char} *\mbox{\hyperlink{g__part__if_8m_aff5d3acc33944ecb11914d04ef06bb54}{name}})}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00897}00897 \{}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00898}00898         \textcolor{keyword}{struct }\mbox{\hyperlink{structgv__plex}{gv\_plex}} *p;}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00899}00899 }
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00900}00900         LIST\_FOREACH(p, \&sc-\/>plexes, plex) \{}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00901}00901                 \textcolor{keywordflow}{if} (!strncmp(p-\/>\mbox{\hyperlink{structgv__plex_a0978e4d5dd271f5403af3cf98ae02103}{name}}, \mbox{\hyperlink{g__part__if_8m_aff5d3acc33944ecb11914d04ef06bb54}{name}}, \mbox{\hyperlink{geom__vinum__var_8h_aa8c6366f0e203d09152dc02f2d4fda3a}{GV\_MAXPLEXNAME}}))}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00902}00902                         \textcolor{keywordflow}{return} (p);}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00903}00903         \}}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00904}00904 }
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00905}00905         \textcolor{keywordflow}{return} (NULL);}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00906}00906 \}}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00907}00907 }
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00908}00908 \textcolor{comment}{/* Find a subdisk by name. */}}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00909}00909 \textcolor{keyword}{struct }\mbox{\hyperlink{structgv__sd}{gv\_sd}} *}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00910}\mbox{\hyperlink{geom__vinum_8h_ada178b6592b1acfe37ad3eecc8075769}{00910}} \mbox{\hyperlink{geom__vinum__subr_8c_abf0c758149ccf41d32b659f777a0d12e}{gv\_find\_sd}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structgv__softc}{gv\_softc}} *sc, \textcolor{keywordtype}{char} *\mbox{\hyperlink{g__part__if_8m_aff5d3acc33944ecb11914d04ef06bb54}{name}})}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00911}00911 \{}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00912}00912         \textcolor{keyword}{struct }\mbox{\hyperlink{structgv__sd}{gv\_sd}} *s;}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00913}00913 }
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00914}00914         LIST\_FOREACH(s, \&sc-\/>subdisks, \mbox{\hyperlink{g__raid__md__if_8m_a910062273088d146e8533398780701eb}{sd}}) \{}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00915}00915                 \textcolor{keywordflow}{if} (!strncmp(s-\/>\mbox{\hyperlink{structgv__sd_a835bdd1e1c9adf03425b91c873eebf1e}{name}}, \mbox{\hyperlink{g__part__if_8m_aff5d3acc33944ecb11914d04ef06bb54}{name}}, \mbox{\hyperlink{geom__vinum__var_8h_a107a2bc0616c9e28a0bd12e967d4c5b4}{GV\_MAXSDNAME}}))}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00916}00916                         \textcolor{keywordflow}{return} (s);}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00917}00917         \}}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00918}00918 }
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00919}00919         \textcolor{keywordflow}{return} (NULL);}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00920}00920 \}}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00921}00921 }
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00922}00922 \textcolor{comment}{/* Find a drive by name. */}}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00923}00923 \textcolor{keyword}{struct }\mbox{\hyperlink{structgv__drive}{gv\_drive}} *}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00924}\mbox{\hyperlink{geom__vinum_8h_a6bfd18558261750b40b0bfe3c18c4b8f}{00924}} \mbox{\hyperlink{geom__vinum__subr_8c_abf2e431db785fb030bcec36565e90d34}{gv\_find\_drive}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structgv__softc}{gv\_softc}} *sc, \textcolor{keywordtype}{char} *\mbox{\hyperlink{g__part__if_8m_aff5d3acc33944ecb11914d04ef06bb54}{name}})}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00925}00925 \{}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00926}00926         \textcolor{keyword}{struct }\mbox{\hyperlink{structgv__drive}{gv\_drive}} *d;}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00927}00927 }
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00928}00928         LIST\_FOREACH(d, \&sc-\/>drives, drive) \{}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00929}00929                 \textcolor{keywordflow}{if} (!strncmp(d-\/>\mbox{\hyperlink{structgv__drive_a69e5c72365075804074d21c056111ebf}{name}}, \mbox{\hyperlink{g__part__if_8m_aff5d3acc33944ecb11914d04ef06bb54}{name}}, \mbox{\hyperlink{geom__vinum__var_8h_a5b0ca71b395a8780c1056041a4a3f56c}{GV\_MAXDRIVENAME}}))}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00930}00930                         \textcolor{keywordflow}{return} (d);}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00931}00931         \}}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00932}00932 }
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00933}00933         \textcolor{keywordflow}{return} (NULL);}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00934}00934 \}}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00935}00935 }
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00936}00936 \textcolor{comment}{/* Find a drive given a device. */}}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00937}00937 \textcolor{keyword}{struct }\mbox{\hyperlink{structgv__drive}{gv\_drive}} *}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00938}\mbox{\hyperlink{geom__vinum_8h_a7b4aef00869a37fd1186a581a47184df}{00938}} \mbox{\hyperlink{geom__vinum__subr_8c_af321c782e1f1b5dfb509b9da8a9649d1}{gv\_find\_drive\_device}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structgv__softc}{gv\_softc}} *sc, \textcolor{keywordtype}{char} *\mbox{\hyperlink{structgv__drive_a940421a9537b8ce86596e18365122ae6}{device}})}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00939}00939 \{}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00940}00940         \textcolor{keyword}{struct }\mbox{\hyperlink{structgv__drive}{gv\_drive}} *d;}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00941}00941 }
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00942}00942         LIST\_FOREACH(d, \&sc-\/>drives, drive) \{}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00943}00943                 \textcolor{keywordflow}{if}(!strcmp(d-\/>\mbox{\hyperlink{structgv__drive_a940421a9537b8ce86596e18365122ae6}{device}}, \mbox{\hyperlink{structgv__drive_a940421a9537b8ce86596e18365122ae6}{device}}))}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00944}00944                         \textcolor{keywordflow}{return} (d);}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00945}00945         \}}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00946}00946 }
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00947}00947         \textcolor{keywordflow}{return} (NULL);}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00948}00948 \}}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00949}00949 }
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00950}00950 \textcolor{comment}{/* Check if any consumer of the given geom is open. */}}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00951}00951 \textcolor{keywordtype}{int}}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00952}\mbox{\hyperlink{geom__vinum_8h_afc60119e84b762b87ad7f506e87d3478}{00952}} \mbox{\hyperlink{geom__vinum__subr_8c_a98db6962c37b2d4bae2bf1f306d2b3fd}{gv\_consumer\_is\_open}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structg__consumer}{g\_consumer}} *\mbox{\hyperlink{g__part__if_8m_a294f18324585ff37641fb8aa1c9ccd82}{cp}})}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00953}00953 \{}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00954}00954         \textcolor{keywordflow}{if} (\mbox{\hyperlink{g__part__if_8m_a294f18324585ff37641fb8aa1c9ccd82}{cp}} == NULL)}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00955}00955                 \textcolor{keywordflow}{return} (0);}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00956}00956 }
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00957}00957         \textcolor{keywordflow}{if} (\mbox{\hyperlink{g__part__if_8m_a294f18324585ff37641fb8aa1c9ccd82}{cp}}-\/>\mbox{\hyperlink{structg__consumer_a40c3b377327dc07731eaf19340004033}{acr}} || \mbox{\hyperlink{g__part__if_8m_a294f18324585ff37641fb8aa1c9ccd82}{cp}}-\/>\mbox{\hyperlink{structg__consumer_a28f563df0299e7e1ab9a1121b6e483eb}{acw}} || \mbox{\hyperlink{g__part__if_8m_a294f18324585ff37641fb8aa1c9ccd82}{cp}}-\/>\mbox{\hyperlink{structg__consumer_ace7a7f6859bd4cf00ff910bda08bb05a}{ace}})}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00958}00958                 \textcolor{keywordflow}{return} (1);}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00959}00959 }
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00960}00960         \textcolor{keywordflow}{return} (0);}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00961}00961 \}}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00962}00962 }
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00963}00963 \textcolor{keywordtype}{int}}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00964}\mbox{\hyperlink{geom__vinum_8h_ae338f192dec3e4a3cfd3bc369a9a09dd}{00964}} \mbox{\hyperlink{geom__vinum__subr_8c_a0506e8ebe72a6dd4fc32e63acc6ecf64}{gv\_provider\_is\_open}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structg__provider}{g\_provider}} *\mbox{\hyperlink{g__part__if_8m_a9bc7638f295763b77465c5ebebbd3442}{pp}})}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00965}00965 \{}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00966}00966         \textcolor{keywordflow}{if} (\mbox{\hyperlink{g__part__if_8m_a9bc7638f295763b77465c5ebebbd3442}{pp}} == NULL)}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00967}00967                 \textcolor{keywordflow}{return} (0);}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00968}00968 }
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00969}00969         \textcolor{keywordflow}{if} (\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__vinum__subr_8c_source_l00970}00970                 \textcolor{keywordflow}{return} (1);}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00971}00971 }
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00972}00972         \textcolor{keywordflow}{return} (0);}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00973}00973 \}}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00974}00974 }
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00975}00975 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00976}00976 \textcolor{comment}{ * Compare the modification dates of the drives.}}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00977}00977 \textcolor{comment}{ * Return 1 if a > b, 0 otherwise.}}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00978}00978 \textcolor{comment}{ */}}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00979}00979 \textcolor{keywordtype}{int}}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00980}\mbox{\hyperlink{geom__vinum__subr_8c_aac03ec88756a65df7c9b390092e2cc44}{00980}} \mbox{\hyperlink{geom__vinum__subr_8c_aac03ec88756a65df7c9b390092e2cc44}{gv\_drive\_is\_newer}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structgv__softc}{gv\_softc}} *sc, \textcolor{keyword}{struct} \mbox{\hyperlink{structgv__drive}{gv\_drive}} *d)}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00981}00981 \{}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00982}00982         \textcolor{keyword}{struct }\mbox{\hyperlink{structgv__drive}{gv\_drive}} *d2;}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00983}00983         \textcolor{keyword}{struct }timeval *a, *b;}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00984}00984 }
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00985}00985         KASSERT(!LIST\_EMPTY(\&sc-\/>drives),}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00986}00986             (\textcolor{stringliteral}{"{}gv\_is\_drive\_newer: empty drive list"{}}));}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00987}00987 }
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00988}00988         a = \&d-\/>\mbox{\hyperlink{structgv__drive_a22fd8c09eb90dd896835874d2a0c2601}{hdr}}-\/>\mbox{\hyperlink{structgv__hdr_a1b79d91c9f053afaf4f3b2c484d86ad6}{label}}.\mbox{\hyperlink{structgv__label_ab9734ccbc7a3a4f46ffbbff40c4a41c4}{last\_update}};}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00989}00989         LIST\_FOREACH(d2, \&sc-\/>drives, drive) \{}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00990}00990                 \textcolor{keywordflow}{if} ((d == d2) || (d2-\/>\mbox{\hyperlink{structgv__drive_af2b798d0717a723c580025dc04416ce7}{state}} != \mbox{\hyperlink{geom__vinum__var_8h_a8a76c535d700d8c84cb573b43fd010f7}{GV\_DRIVE\_UP}}) ||}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00991}00991                     (d2-\/>\mbox{\hyperlink{structgv__drive_a22fd8c09eb90dd896835874d2a0c2601}{hdr}} == NULL))}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00992}00992                         \textcolor{keywordflow}{continue};}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00993}00993                 b = \&d2-\/>\mbox{\hyperlink{structgv__drive_a22fd8c09eb90dd896835874d2a0c2601}{hdr}}-\/>\mbox{\hyperlink{structgv__hdr_a1b79d91c9f053afaf4f3b2c484d86ad6}{label}}.\mbox{\hyperlink{structgv__label_ab9734ccbc7a3a4f46ffbbff40c4a41c4}{last\_update}};}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00994}00994                 \textcolor{keywordflow}{if} (timevalcmp(a, b, >))}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00995}00995                         \textcolor{keywordflow}{return} (1);}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00996}00996         \}}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00997}00997 }
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00998}00998         \textcolor{keywordflow}{return} (0);}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l00999}00999 \}}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l01000}01000 }
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l01001}01001 \textcolor{comment}{/* Return the type of object identified by string 'name'. */}}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l01002}01002 \textcolor{keywordtype}{int}}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l01003}\mbox{\hyperlink{geom__vinum_8h_adf857930fd65dd84870be1db99e860f7}{01003}} \mbox{\hyperlink{geom__vinum__subr_8c_ab82e34dff4c0c7e75d82b028c3b4d899}{gv\_object\_type}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structgv__softc}{gv\_softc}} *sc, \textcolor{keywordtype}{char} *\mbox{\hyperlink{g__part__if_8m_aff5d3acc33944ecb11914d04ef06bb54}{name}})}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l01004}01004 \{}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l01005}01005         \textcolor{keyword}{struct }\mbox{\hyperlink{structgv__drive}{gv\_drive}} *d;}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l01006}01006         \textcolor{keyword}{struct }\mbox{\hyperlink{structgv__plex}{gv\_plex}} *p;}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l01007}01007         \textcolor{keyword}{struct }\mbox{\hyperlink{structgv__sd}{gv\_sd}} *s;}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l01008}01008         \textcolor{keyword}{struct }\mbox{\hyperlink{structgv__volume}{gv\_volume}} *v;}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l01009}01009 }
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l01010}01010         LIST\_FOREACH(v, \&sc-\/>volumes, \mbox{\hyperlink{g__raid__tr__if_8m_a1b9eb8854031ced0905afde9f72c9ea8}{volume}}) \{}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l01011}01011                 \textcolor{keywordflow}{if} (!strncmp(v-\/>\mbox{\hyperlink{structgv__volume_a3369e150403037bca7ed34ea68f25ce0}{name}}, \mbox{\hyperlink{g__part__if_8m_aff5d3acc33944ecb11914d04ef06bb54}{name}}, \mbox{\hyperlink{geom__vinum__var_8h_a4527a51313b9d7ed77b6d0ff5c461623}{GV\_MAXVOLNAME}}))}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l01012}01012                         \textcolor{keywordflow}{return} (\mbox{\hyperlink{geom__vinum__var_8h_ac00b5b481f097143593b6ac29dd4156f}{GV\_TYPE\_VOL}});}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l01013}01013         \}}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l01014}01014 }
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l01015}01015         LIST\_FOREACH(p, \&sc-\/>plexes, plex) \{}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l01016}01016                 \textcolor{keywordflow}{if} (!strncmp(p-\/>\mbox{\hyperlink{structgv__plex_a0978e4d5dd271f5403af3cf98ae02103}{name}}, \mbox{\hyperlink{g__part__if_8m_aff5d3acc33944ecb11914d04ef06bb54}{name}}, \mbox{\hyperlink{geom__vinum__var_8h_aa8c6366f0e203d09152dc02f2d4fda3a}{GV\_MAXPLEXNAME}}))}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l01017}01017                         \textcolor{keywordflow}{return} (\mbox{\hyperlink{geom__vinum__var_8h_a2a21f3f69c0e60c425744a299cd49a6f}{GV\_TYPE\_PLEX}});}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l01018}01018         \}}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l01019}01019 }
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l01020}01020         LIST\_FOREACH(s, \&sc-\/>subdisks, \mbox{\hyperlink{g__raid__md__if_8m_a910062273088d146e8533398780701eb}{sd}}) \{}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l01021}01021                 \textcolor{keywordflow}{if} (!strncmp(s-\/>\mbox{\hyperlink{structgv__sd_a835bdd1e1c9adf03425b91c873eebf1e}{name}}, \mbox{\hyperlink{g__part__if_8m_aff5d3acc33944ecb11914d04ef06bb54}{name}}, \mbox{\hyperlink{geom__vinum__var_8h_a107a2bc0616c9e28a0bd12e967d4c5b4}{GV\_MAXSDNAME}}))}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l01022}01022                         \textcolor{keywordflow}{return} (\mbox{\hyperlink{geom__vinum__var_8h_acb4b8aa524c3ba1c7abaa181a5cb6bb9}{GV\_TYPE\_SD}});}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l01023}01023         \}}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l01024}01024 }
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l01025}01025         LIST\_FOREACH(d, \&sc-\/>drives, drive) \{}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l01026}01026                 \textcolor{keywordflow}{if} (!strncmp(d-\/>\mbox{\hyperlink{structgv__drive_a69e5c72365075804074d21c056111ebf}{name}}, \mbox{\hyperlink{g__part__if_8m_aff5d3acc33944ecb11914d04ef06bb54}{name}}, \mbox{\hyperlink{geom__vinum__var_8h_a5b0ca71b395a8780c1056041a4a3f56c}{GV\_MAXDRIVENAME}}))}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l01027}01027                         \textcolor{keywordflow}{return} (\mbox{\hyperlink{geom__vinum__var_8h_a4f601240cfd57a614dee2cca5a2e9d67}{GV\_TYPE\_DRIVE}});}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l01028}01028         \}}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l01029}01029 }
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l01030}01030         \textcolor{keywordflow}{return} (\mbox{\hyperlink{geom__vinum__var_8h_ab8633f9cf1571091fdadc9e3e0521955}{GV\_ERR\_NOTFOUND}});}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l01031}01031 \}}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l01032}01032 }
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l01033}01033 \textcolor{keywordtype}{void}}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l01034}\mbox{\hyperlink{geom__vinum_8h_a5f803d19d887b23ee30ad8ad7854bcb7}{01034}} \mbox{\hyperlink{geom__vinum__subr_8c_a0ecd439dcfe2603db13f330993173e76}{gv\_setup\_objects}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structgv__softc}{gv\_softc}} *sc)}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l01035}01035 \{}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l01036}01036         \textcolor{keyword}{struct }\mbox{\hyperlink{structg__provider}{g\_provider}} *\mbox{\hyperlink{g__part__if_8m_a9bc7638f295763b77465c5ebebbd3442}{pp}};}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l01037}01037         \textcolor{keyword}{struct }\mbox{\hyperlink{structgv__volume}{gv\_volume}} *v;}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l01038}01038         \textcolor{keyword}{struct }\mbox{\hyperlink{structgv__plex}{gv\_plex}} *p;}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l01039}01039         \textcolor{keyword}{struct }\mbox{\hyperlink{structgv__sd}{gv\_sd}} *s;}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l01040}01040         \textcolor{keyword}{struct }\mbox{\hyperlink{structgv__drive}{gv\_drive}} *d;}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l01041}01041 }
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l01042}01042         LIST\_FOREACH(s, \&sc-\/>subdisks, \mbox{\hyperlink{g__raid__md__if_8m_a910062273088d146e8533398780701eb}{sd}}) \{}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l01043}01043                 d = \mbox{\hyperlink{geom__vinum__subr_8c_abf2e431db785fb030bcec36565e90d34}{gv\_find\_drive}}(sc, s-\/>\mbox{\hyperlink{structgv__sd_abb67fc2a84afb2c110794b6de19d55d6}{drive}});}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l01044}01044                 \textcolor{keywordflow}{if} (d != NULL)}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l01045}01045                         \mbox{\hyperlink{geom__vinum__subr_8c_a9ca091be417a47802070b820473abdc3}{gv\_sd\_to\_drive}}(s, d);}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l01046}01046                 p = \mbox{\hyperlink{geom__vinum__subr_8c_ae8b89ce517f0ba1cda50aaa3ccb3b0ad}{gv\_find\_plex}}(sc, s-\/>\mbox{\hyperlink{structgv__sd_abc2c739f0fbd33ce2480d93752375f22}{plex}});}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l01047}01047                 \textcolor{keywordflow}{if} (p != NULL)}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l01048}01048                         \mbox{\hyperlink{geom__vinum__subr_8c_a249c39be94716091a0da30b89d5f2600}{gv\_sd\_to\_plex}}(s, p);}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l01049}01049                 \mbox{\hyperlink{geom__vinum_8h_a409b1521aec9681f61786308d57836e3}{gv\_update\_sd\_state}}(s);}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l01050}01050         \}}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l01051}01051 }
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l01052}01052         LIST\_FOREACH(p, \&sc-\/>plexes, plex) \{}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l01053}01053                 \mbox{\hyperlink{geom__vinum__subr_8c_a3ed93ab6c1f0ba83be5bbba78260aa78}{gv\_update\_plex\_config}}(p);}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l01054}01054                 v = \mbox{\hyperlink{geom__vinum__subr_8c_a8239ceaedf41ce2e9605183a0f1ca750}{gv\_find\_vol}}(sc, p-\/>\mbox{\hyperlink{structgv__plex_a3dba998991302b326667692db3ab2ac5}{volume}});}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l01055}01055                 \textcolor{keywordflow}{if} (v != NULL \&\& p-\/>\mbox{\hyperlink{structgv__plex_a8e2820d6bd8419d81213f77131d6bd5c}{vol\_sc}} != v) \{}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l01056}01056                         p-\/>\mbox{\hyperlink{structgv__plex_a8e2820d6bd8419d81213f77131d6bd5c}{vol\_sc}} = v;}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l01057}01057                         v-\/>\mbox{\hyperlink{structgv__volume_a6a2fb4e2da02537035c219df64a65a80}{plexcount}}++;}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l01058}01058                         LIST\_INSERT\_HEAD(\&v-\/>plexes, p, in\_volume);}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l01059}01059                 \}}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l01060}01060                 \mbox{\hyperlink{geom__vinum__subr_8c_a3ed93ab6c1f0ba83be5bbba78260aa78}{gv\_update\_plex\_config}}(p);}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l01061}01061         \}}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l01062}01062 }
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l01063}01063         LIST\_FOREACH(v, \&sc-\/>volumes, \mbox{\hyperlink{g__raid__tr__if_8m_a1b9eb8854031ced0905afde9f72c9ea8}{volume}}) \{}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l01064}01064                 v-\/>\mbox{\hyperlink{structgv__volume_a9afdb949e852e0ee49733e7fe18bade2}{size}} = \mbox{\hyperlink{geom__vinum__subr_8c_a10c85623a48090fa703c19836119762c}{gv\_vol\_size}}(v);}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l01065}01065                 \textcolor{keywordflow}{if} (v-\/>\mbox{\hyperlink{structgv__volume_a22436521ee96530c09a185172fb53bf7}{provider}} == NULL) \{}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l01066}01066                         \mbox{\hyperlink{geom_8h_a232419d2cfa06ff3f4ff7551041aed31}{g\_topology\_lock}}();}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l01067}01067                         \mbox{\hyperlink{g__part__if_8m_a9bc7638f295763b77465c5ebebbd3442}{pp}} = \mbox{\hyperlink{geom_8h_a79a5fe6e79cbc1a257454a3554fa11ef}{g\_new\_providerf}}(sc-\/>\mbox{\hyperlink{structgv__softc_a1e8edc954044192e67411991c0c91c2d}{geom}}, \textcolor{stringliteral}{"{}gvinum/\%s"{}}, v-\/>\mbox{\hyperlink{structgv__volume_a3369e150403037bca7ed34ea68f25ce0}{name}});}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l01068}01068                         \mbox{\hyperlink{g__part__if_8m_a9bc7638f295763b77465c5ebebbd3442}{pp}}-\/>\mbox{\hyperlink{structg__provider_a8f47c464c78aa91fa4ca5143ed3cd15e}{mediasize}} = v-\/>\mbox{\hyperlink{structgv__volume_a9afdb949e852e0ee49733e7fe18bade2}{size}};}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l01069}01069                         \mbox{\hyperlink{g__part__if_8m_a9bc7638f295763b77465c5ebebbd3442}{pp}}-\/>\mbox{\hyperlink{structg__provider_aea3cd43d41461790b8d0afcd8c49a355}{sectorsize}} = 512;    \textcolor{comment}{/* XXX */}}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l01070}01070                         \mbox{\hyperlink{geom_8h_a7a46b49361266e9bb4b1441aade2c48f}{g\_error\_provider}}(\mbox{\hyperlink{g__part__if_8m_a9bc7638f295763b77465c5ebebbd3442}{pp}}, 0);}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l01071}01071                         v-\/>\mbox{\hyperlink{structgv__volume_a22436521ee96530c09a185172fb53bf7}{provider}} = \mbox{\hyperlink{g__part__if_8m_a9bc7638f295763b77465c5ebebbd3442}{pp}};}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l01072}01072                         \mbox{\hyperlink{g__part__if_8m_a9bc7638f295763b77465c5ebebbd3442}{pp}}-\/>\mbox{\hyperlink{structg__provider_a5516d1ee51e75b228f047f827f46431b}{private}} = v;}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l01073}01073                         \mbox{\hyperlink{geom_8h_a4628d4de49ba84e7a6126cc30d23b83a}{g\_topology\_unlock}}();}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l01074}01074                 \} \textcolor{keywordflow}{else} \textcolor{keywordflow}{if} (v-\/>\mbox{\hyperlink{structgv__volume_a22436521ee96530c09a185172fb53bf7}{provider}}-\/>\mbox{\hyperlink{structg__provider_a8f47c464c78aa91fa4ca5143ed3cd15e}{mediasize}} != v-\/>\mbox{\hyperlink{structgv__volume_a9afdb949e852e0ee49733e7fe18bade2}{size}}) \{}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l01075}01075                         \mbox{\hyperlink{geom_8h_a232419d2cfa06ff3f4ff7551041aed31}{g\_topology\_lock}}();}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l01076}01076                         v-\/>\mbox{\hyperlink{structgv__volume_a22436521ee96530c09a185172fb53bf7}{provider}}-\/>\mbox{\hyperlink{structg__provider_a8f47c464c78aa91fa4ca5143ed3cd15e}{mediasize}} = v-\/>\mbox{\hyperlink{structgv__volume_a9afdb949e852e0ee49733e7fe18bade2}{size}};}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l01077}01077                         \mbox{\hyperlink{geom_8h_a4628d4de49ba84e7a6126cc30d23b83a}{g\_topology\_unlock}}();}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l01078}01078                 \}}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l01079}01079                 v-\/>\mbox{\hyperlink{structgv__volume_a152fb6b79767817e0c97ff08279501be}{flags}} \&= \string~GV\_VOL\_NEWBORN;}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l01080}01080                 \mbox{\hyperlink{geom__vinum_8h_a08b54d0875737c40c15f7516ca72396a}{gv\_update\_vol\_state}}(v);}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l01081}01081         \}}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l01082}01082 \}}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l01083}01083 }
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l01084}01084 \textcolor{keywordtype}{void}}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l01085}\mbox{\hyperlink{geom__vinum_8h_a86f582a58ced222aab078aac2cc6e303}{01085}} \mbox{\hyperlink{geom__vinum__subr_8c_abfa242aea846cdb7151ac57b70ade0ad}{gv\_cleanup}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structgv__softc}{gv\_softc}} *sc)}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l01086}01086 \{}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l01087}01087         \textcolor{keyword}{struct }\mbox{\hyperlink{structgv__volume}{gv\_volume}} *v, *v2;}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l01088}01088         \textcolor{keyword}{struct }\mbox{\hyperlink{structgv__plex}{gv\_plex}} *p, *p2;}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l01089}01089         \textcolor{keyword}{struct }\mbox{\hyperlink{structgv__sd}{gv\_sd}} *s, *s2;}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l01090}01090         \textcolor{keyword}{struct }\mbox{\hyperlink{structgv__drive}{gv\_drive}} *d, *d2;}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l01091}01091         \textcolor{keyword}{struct }\mbox{\hyperlink{structgv__freelist}{gv\_freelist}} *fl, *fl2;}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l01092}01092 }
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l01093}01093         mtx\_lock(\&sc-\/>\mbox{\hyperlink{structgv__softc_a04414d0bbb98bcc3a1167fbe75dfc914}{config\_mtx}});}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l01094}01094         LIST\_FOREACH\_SAFE(v, \&sc-\/>volumes, \mbox{\hyperlink{g__raid__tr__if_8m_a1b9eb8854031ced0905afde9f72c9ea8}{volume}}, v2) \{}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l01095}01095                 LIST\_REMOVE(v, \mbox{\hyperlink{g__raid__tr__if_8m_a1b9eb8854031ced0905afde9f72c9ea8}{volume}});}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l01096}01096                 \mbox{\hyperlink{geom_8h_ad9924deb20de7b40cb6cf06e5ae28855}{g\_free}}(v-\/>\mbox{\hyperlink{structgv__volume_a3dac8fbcbadf0de1ad609fbe91e4a8f0}{wqueue}});}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l01097}01097                 \mbox{\hyperlink{geom_8h_ad9924deb20de7b40cb6cf06e5ae28855}{g\_free}}(v);}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l01098}01098         \}}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l01099}01099         LIST\_FOREACH\_SAFE(p, \&sc-\/>plexes, plex, p2) \{}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l01100}01100                 LIST\_REMOVE(p, plex);}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l01101}01101                 \mbox{\hyperlink{geom_8h_ad9924deb20de7b40cb6cf06e5ae28855}{g\_free}}(p-\/>\mbox{\hyperlink{structgv__plex_a0337c05399b527c7c515740e851e57d4}{bqueue}});}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l01102}01102                 \mbox{\hyperlink{geom_8h_ad9924deb20de7b40cb6cf06e5ae28855}{g\_free}}(p-\/>\mbox{\hyperlink{structgv__plex_aa0e0c78ec187fb3900bcefa7e9775e60}{rqueue}});}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l01103}01103                 \mbox{\hyperlink{geom_8h_ad9924deb20de7b40cb6cf06e5ae28855}{g\_free}}(p-\/>\mbox{\hyperlink{structgv__plex_a4b161b7fba91c7e3f29732f1bc0a8075}{wqueue}});}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l01104}01104                 \mbox{\hyperlink{geom_8h_ad9924deb20de7b40cb6cf06e5ae28855}{g\_free}}(p);}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l01105}01105         \}}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l01106}01106         LIST\_FOREACH\_SAFE(s, \&sc-\/>subdisks, \mbox{\hyperlink{g__raid__md__if_8m_a910062273088d146e8533398780701eb}{sd}}, s2) \{}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l01107}01107                 LIST\_REMOVE(s, \mbox{\hyperlink{g__raid__md__if_8m_a910062273088d146e8533398780701eb}{sd}});}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l01108}01108                 \mbox{\hyperlink{geom_8h_ad9924deb20de7b40cb6cf06e5ae28855}{g\_free}}(s);}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l01109}01109         \}}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l01110}01110         LIST\_FOREACH\_SAFE(d, \&sc-\/>drives, drive, d2) \{}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l01111}01111                 LIST\_FOREACH\_SAFE(fl, \&d-\/>freelist, freelist, fl2) \{}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l01112}01112                         LIST\_REMOVE(fl, freelist);}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l01113}01113                         \mbox{\hyperlink{geom_8h_ad9924deb20de7b40cb6cf06e5ae28855}{g\_free}}(fl);}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l01114}01114                 \}}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l01115}01115                 LIST\_REMOVE(d, drive);}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l01116}01116                 \mbox{\hyperlink{geom_8h_ad9924deb20de7b40cb6cf06e5ae28855}{g\_free}}(d-\/>\mbox{\hyperlink{structgv__drive_a22fd8c09eb90dd896835874d2a0c2601}{hdr}});}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l01117}01117                 \mbox{\hyperlink{geom_8h_ad9924deb20de7b40cb6cf06e5ae28855}{g\_free}}(d);}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l01118}01118         \}}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l01119}01119         mtx\_destroy(\&sc-\/>\mbox{\hyperlink{structgv__softc_a04414d0bbb98bcc3a1167fbe75dfc914}{config\_mtx}});}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l01120}01120 \}}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l01121}01121 }
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l01122}01122 \textcolor{comment}{/* General 'attach' routine. */}}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l01123}01123 \textcolor{keywordtype}{int}}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l01124}\mbox{\hyperlink{geom__vinum_8h_a4096dd7f3ed9681fdd5a7940579bc743}{01124}} \mbox{\hyperlink{geom__vinum__subr_8c_a2223ded638b17efb6bc1f2dca64019e0}{gv\_attach\_plex}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structgv__plex}{gv\_plex}} *p, \textcolor{keyword}{struct} \mbox{\hyperlink{structgv__volume}{gv\_volume}} *v, \textcolor{keywordtype}{int} rename)}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l01125}01125 \{}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l01126}01126         \textcolor{keyword}{struct }\mbox{\hyperlink{structgv__sd}{gv\_sd}} *s;}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l01127}01127         \textcolor{keyword}{struct }\mbox{\hyperlink{structgv__softc}{gv\_softc}} *sc \mbox{\hyperlink{g__bde_8h_aabb5ad70c88f55209cff7ec5684d13c1}{\_\_diagused}};}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l01128}01128 }
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l01129}01129         \mbox{\hyperlink{geom_8h_a1898dc8c812faa5de231ab840e8562bf}{g\_topology\_assert}}();}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l01130}01130 }
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l01131}01131         sc = p-\/>\mbox{\hyperlink{structgv__plex_ad30d136a924b3367b9752c10f2391cdc}{vinumconf}};}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l01132}01132         KASSERT(sc != NULL, (\textcolor{stringliteral}{"{}NULL sc"{}}));}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l01133}01133 }
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l01134}01134         \textcolor{keywordflow}{if} (p-\/>\mbox{\hyperlink{structgv__plex_a8e2820d6bd8419d81213f77131d6bd5c}{vol\_sc}} != NULL) \{}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l01135}01135                 \mbox{\hyperlink{geom__vinum_8h_a28cdbd7c30e435ff9ec8676f493593a0}{G\_VINUM\_DEBUG}}(1, \textcolor{stringliteral}{"{}unable to attach \%s: already attached to \%s"{}},}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l01136}01136                     p-\/>\mbox{\hyperlink{structgv__plex_a0978e4d5dd271f5403af3cf98ae02103}{name}}, p-\/>\mbox{\hyperlink{structgv__plex_a3dba998991302b326667692db3ab2ac5}{volume}});}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l01137}01137                 \textcolor{keywordflow}{return} (\mbox{\hyperlink{geom__vinum__var_8h_a99756b5de9852cd4510167afb3c477df}{GV\_ERR\_ISATTACHED}});}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l01138}01138         \}}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l01139}01139 }
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l01140}01140         \textcolor{comment}{/* Stale all subdisks of this plex. */}}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l01141}01141         LIST\_FOREACH(s, \&p-\/>subdisks, in\_plex) \{}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l01142}01142                 \textcolor{keywordflow}{if} (s-\/>\mbox{\hyperlink{structgv__sd_ae69fbd03ecc14fbc16b0d4ed0421b59d}{state}} != \mbox{\hyperlink{geom__vinum__var_8h_a5dd4abf3a748b1a4ee0da0bab79840d2}{GV\_SD\_STALE}})}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l01143}01143                         \mbox{\hyperlink{geom__vinum_8h_a2dc4176c195982e77ba79874f999300e}{gv\_set\_sd\_state}}(s, \mbox{\hyperlink{geom__vinum__var_8h_a5dd4abf3a748b1a4ee0da0bab79840d2}{GV\_SD\_STALE}}, \mbox{\hyperlink{geom__vinum__var_8h_aff3aa8190eaa79b37017c0a247c4bfb9}{GV\_SETSTATE\_FORCE}});}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l01144}01144         \}}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l01145}01145         \textcolor{comment}{/* Attach to volume. Make sure volume is not up and running. */}}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l01146}01146         \textcolor{keywordflow}{if} (\mbox{\hyperlink{geom__vinum__subr_8c_a0506e8ebe72a6dd4fc32e63acc6ecf64}{gv\_provider\_is\_open}}(v-\/>\mbox{\hyperlink{structgv__volume_a22436521ee96530c09a185172fb53bf7}{provider}})) \{}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l01147}01147                 \mbox{\hyperlink{geom__vinum_8h_a28cdbd7c30e435ff9ec8676f493593a0}{G\_VINUM\_DEBUG}}(1, \textcolor{stringliteral}{"{}unable to attach \%s: volume \%s is busy"{}},}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l01148}01148                     p-\/>\mbox{\hyperlink{structgv__plex_a0978e4d5dd271f5403af3cf98ae02103}{name}}, v-\/>\mbox{\hyperlink{structgv__volume_a3369e150403037bca7ed34ea68f25ce0}{name}});}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l01149}01149                 \textcolor{keywordflow}{return} (\mbox{\hyperlink{geom__vinum__var_8h_a34608a22fc52b3fc8b0d849ee996e0a7}{GV\_ERR\_ISBUSY}});}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l01150}01150         \}}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l01151}01151         p-\/>\mbox{\hyperlink{structgv__plex_a8e2820d6bd8419d81213f77131d6bd5c}{vol\_sc}} = v;}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l01152}01152         strlcpy(p-\/>\mbox{\hyperlink{structgv__plex_a3dba998991302b326667692db3ab2ac5}{volume}}, v-\/>\mbox{\hyperlink{structgv__volume_a3369e150403037bca7ed34ea68f25ce0}{name}}, \textcolor{keyword}{sizeof}(p-\/>\mbox{\hyperlink{structgv__plex_a3dba998991302b326667692db3ab2ac5}{volume}}));}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l01153}01153         v-\/>\mbox{\hyperlink{structgv__volume_a6a2fb4e2da02537035c219df64a65a80}{plexcount}}++;}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l01154}01154         \textcolor{keywordflow}{if} (rename) \{}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l01155}01155                 snprintf(p-\/>\mbox{\hyperlink{structgv__plex_a0978e4d5dd271f5403af3cf98ae02103}{name}}, \textcolor{keyword}{sizeof}(p-\/>\mbox{\hyperlink{structgv__plex_a0978e4d5dd271f5403af3cf98ae02103}{name}}), \textcolor{stringliteral}{"{}\%s.p\%d"{}}, v-\/>\mbox{\hyperlink{structgv__volume_a3369e150403037bca7ed34ea68f25ce0}{name}},}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l01156}01156                     v-\/>\mbox{\hyperlink{structgv__volume_a6a2fb4e2da02537035c219df64a65a80}{plexcount}});}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l01157}01157         \}}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l01158}01158         LIST\_INSERT\_HEAD(\&v-\/>plexes, p, in\_volume);}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l01159}01159 }
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l01160}01160         \textcolor{comment}{/* Get plex up again. */}}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l01161}01161         \mbox{\hyperlink{geom__vinum__subr_8c_a969623373c6b329670821de7d5f32fc1}{gv\_update\_vol\_size}}(v, \mbox{\hyperlink{geom__vinum__subr_8c_a10c85623a48090fa703c19836119762c}{gv\_vol\_size}}(v));}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l01162}01162         \mbox{\hyperlink{geom__vinum_8h_a6b370b29fa92afef6aa654a9e1eb5f0d}{gv\_set\_plex\_state}}(p, \mbox{\hyperlink{geom__vinum__var_8h_a2a5ed58267acc541957b387d71bd868d}{GV\_PLEX\_UP}}, 0);}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l01163}01163         \mbox{\hyperlink{geom__vinum_8h_a893e3b157c798b3f925d71151d284dd9}{gv\_save\_config}}(p-\/>\mbox{\hyperlink{structgv__plex_ad30d136a924b3367b9752c10f2391cdc}{vinumconf}});}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l01164}01164         \textcolor{keywordflow}{return} (0);}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l01165}01165 \}}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l01166}01166 }
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l01167}01167 \textcolor{keywordtype}{int}}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l01168}\mbox{\hyperlink{geom__vinum_8h_ae2ed7ed3cf3d5458ab3d9e066a00fa1a}{01168}} \mbox{\hyperlink{geom__vinum__subr_8c_acf60cdc7299573a20f68cb17497d0bcf}{gv\_attach\_sd}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structgv__sd}{gv\_sd}} *s, \textcolor{keyword}{struct} \mbox{\hyperlink{structgv__plex}{gv\_plex}} *p, off\_t \mbox{\hyperlink{g__raid__tr__if_8m_ad5f0842c40c7e46344fd8df70187fa0f}{offset}}, \textcolor{keywordtype}{int} rename)}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l01169}01169 \{}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l01170}01170         \textcolor{keyword}{struct }\mbox{\hyperlink{structgv__sd}{gv\_sd}} *s2;}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l01171}01171         \textcolor{keywordtype}{int} error, sdcount;}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l01172}01172 }
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l01173}01173         \mbox{\hyperlink{geom_8h_a1898dc8c812faa5de231ab840e8562bf}{g\_topology\_assert}}();}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l01174}01174 }
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l01175}01175         \textcolor{comment}{/* If subdisk is attached, don't do it. */}}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l01176}01176         \textcolor{keywordflow}{if} (s-\/>\mbox{\hyperlink{structgv__sd_a6894be1eac4716d6eb2bd9e08b9643cf}{plex\_sc}} != NULL) \{}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l01177}01177                 \mbox{\hyperlink{geom__vinum_8h_a28cdbd7c30e435ff9ec8676f493593a0}{G\_VINUM\_DEBUG}}(1, \textcolor{stringliteral}{"{}unable to attach \%s: already attached to \%s"{}},}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l01178}01178                     s-\/>\mbox{\hyperlink{structgv__sd_a835bdd1e1c9adf03425b91c873eebf1e}{name}}, s-\/>\mbox{\hyperlink{structgv__sd_abc2c739f0fbd33ce2480d93752375f22}{plex}});}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l01179}01179                 \textcolor{keywordflow}{return} (\mbox{\hyperlink{geom__vinum__var_8h_a99756b5de9852cd4510167afb3c477df}{GV\_ERR\_ISATTACHED}});}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l01180}01180         \}}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l01181}01181 }
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l01182}01182         \mbox{\hyperlink{geom__vinum_8h_a2dc4176c195982e77ba79874f999300e}{gv\_set\_sd\_state}}(s, \mbox{\hyperlink{geom__vinum__var_8h_a5dd4abf3a748b1a4ee0da0bab79840d2}{GV\_SD\_STALE}}, \mbox{\hyperlink{geom__vinum__var_8h_aff3aa8190eaa79b37017c0a247c4bfb9}{GV\_SETSTATE\_FORCE}});}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l01183}01183         \textcolor{comment}{/* First check that this subdisk has a correct offset. If none other}}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l01184}01184 \textcolor{comment}{         * starts at the same, and it's correct module stripesize, it is */}}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l01185}01185         \textcolor{keywordflow}{if} (\mbox{\hyperlink{g__raid__tr__if_8m_ad5f0842c40c7e46344fd8df70187fa0f}{offset}} != -\/1 \&\& \mbox{\hyperlink{g__raid__tr__if_8m_ad5f0842c40c7e46344fd8df70187fa0f}{offset}} \% p-\/>\mbox{\hyperlink{structgv__plex_a670e4abf06a7ee6c9737aeffd3e1e15e}{stripesize}} != 0)}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l01186}01186                 \textcolor{keywordflow}{return} (\mbox{\hyperlink{geom__vinum__var_8h_af3db933b99d4c5e303ac210879c0d0e4}{GV\_ERR\_BADOFFSET}});}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l01187}01187         LIST\_FOREACH(s2, \&p-\/>subdisks, in\_plex) \{}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l01188}01188                 \textcolor{keywordflow}{if} (s2-\/>\mbox{\hyperlink{structgv__sd_aec325f89682a834bf445a955dd6b8dac}{plex\_offset}} == \mbox{\hyperlink{g__raid__tr__if_8m_ad5f0842c40c7e46344fd8df70187fa0f}{offset}})}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l01189}01189                         \textcolor{keywordflow}{return} (\mbox{\hyperlink{geom__vinum__var_8h_af3db933b99d4c5e303ac210879c0d0e4}{GV\_ERR\_BADOFFSET}});}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l01190}01190         \}}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l01191}01191 }
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l01192}01192         \textcolor{comment}{/* Attach the subdisk to the plex at given offset. */}}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l01193}01193         s-\/>\mbox{\hyperlink{structgv__sd_aec325f89682a834bf445a955dd6b8dac}{plex\_offset}} = \mbox{\hyperlink{g__raid__tr__if_8m_ad5f0842c40c7e46344fd8df70187fa0f}{offset}};}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l01194}01194         strlcpy(s-\/>\mbox{\hyperlink{structgv__sd_abc2c739f0fbd33ce2480d93752375f22}{plex}}, p-\/>\mbox{\hyperlink{structgv__plex_a0978e4d5dd271f5403af3cf98ae02103}{name}}, \textcolor{keyword}{sizeof}(s-\/>\mbox{\hyperlink{structgv__sd_abc2c739f0fbd33ce2480d93752375f22}{plex}}));}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l01195}01195 }
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l01196}01196         sdcount = p-\/>\mbox{\hyperlink{structgv__plex_ab8419aad736c119ac828740cce0e235c}{sdcount}};}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l01197}01197         error = \mbox{\hyperlink{geom__vinum__subr_8c_a249c39be94716091a0da30b89d5f2600}{gv\_sd\_to\_plex}}(s, p);}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l01198}01198         \textcolor{keywordflow}{if} (error)}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l01199}01199                 \textcolor{keywordflow}{return} (error);}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l01200}01200         \mbox{\hyperlink{geom__vinum__subr_8c_a3ed93ab6c1f0ba83be5bbba78260aa78}{gv\_update\_plex\_config}}(p);}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l01201}01201 }
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l01202}01202         \textcolor{keywordflow}{if} (rename) \{}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l01203}01203                 snprintf(s-\/>\mbox{\hyperlink{structgv__sd_a835bdd1e1c9adf03425b91c873eebf1e}{name}}, \textcolor{keyword}{sizeof}(s-\/>\mbox{\hyperlink{structgv__sd_a835bdd1e1c9adf03425b91c873eebf1e}{name}}), \textcolor{stringliteral}{"{}\%s.s\%d"{}}, s-\/>\mbox{\hyperlink{structgv__sd_abc2c739f0fbd33ce2480d93752375f22}{plex}},}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l01204}01204                     p-\/>\mbox{\hyperlink{structgv__plex_ab8419aad736c119ac828740cce0e235c}{sdcount}});}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l01205}01205         \}}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l01206}01206         \textcolor{keywordflow}{if} (p-\/>\mbox{\hyperlink{structgv__plex_a8e2820d6bd8419d81213f77131d6bd5c}{vol\_sc}} != NULL)}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l01207}01207                 \mbox{\hyperlink{geom__vinum__subr_8c_a969623373c6b329670821de7d5f32fc1}{gv\_update\_vol\_size}}(p-\/>\mbox{\hyperlink{structgv__plex_a8e2820d6bd8419d81213f77131d6bd5c}{vol\_sc}}, \mbox{\hyperlink{geom__vinum__subr_8c_a10c85623a48090fa703c19836119762c}{gv\_vol\_size}}(p-\/>\mbox{\hyperlink{structgv__plex_a8e2820d6bd8419d81213f77131d6bd5c}{vol\_sc}}));}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l01208}01208         \mbox{\hyperlink{geom__vinum_8h_a893e3b157c798b3f925d71151d284dd9}{gv\_save\_config}}(p-\/>\mbox{\hyperlink{structgv__plex_ad30d136a924b3367b9752c10f2391cdc}{vinumconf}});}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l01209}01209         \textcolor{comment}{/* We don't update the subdisk state since the user might have to}}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l01210}01210 \textcolor{comment}{         * initiate a rebuild/sync first. */}}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l01211}01211         \textcolor{keywordflow}{return} (0);}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l01212}01212 \}}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l01213}01213 }
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l01214}01214 \textcolor{comment}{/* Detach a plex from a volume. */}}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l01215}01215 \textcolor{keywordtype}{int}}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l01216}\mbox{\hyperlink{geom__vinum_8h_a239d419579841312021c9c04c1f274b0}{01216}} \mbox{\hyperlink{geom__vinum__subr_8c_af52fde77d3b42d6849825da14ea6769d}{gv\_detach\_plex}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structgv__plex}{gv\_plex}} *p, \textcolor{keywordtype}{int} \mbox{\hyperlink{structgv__sd_a84a4472842dd92c5ebcf7b103be32c90}{flags}})}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l01217}01217 \{}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l01218}01218         \textcolor{keyword}{struct }\mbox{\hyperlink{structgv__volume}{gv\_volume}} *v;}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l01219}01219 }
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l01220}01220         \mbox{\hyperlink{geom_8h_a1898dc8c812faa5de231ab840e8562bf}{g\_topology\_assert}}();}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l01221}01221         v = p-\/>\mbox{\hyperlink{structgv__plex_a8e2820d6bd8419d81213f77131d6bd5c}{vol\_sc}};}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l01222}01222 }
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l01223}01223         \textcolor{keywordflow}{if} (v == NULL) \{}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l01224}01224                 \mbox{\hyperlink{geom__vinum_8h_a28cdbd7c30e435ff9ec8676f493593a0}{G\_VINUM\_DEBUG}}(1, \textcolor{stringliteral}{"{}unable to detach \%s: already detached"{}},}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l01225}01225                     p-\/>\mbox{\hyperlink{structgv__plex_a0978e4d5dd271f5403af3cf98ae02103}{name}});}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l01226}01226                 \textcolor{keywordflow}{return} (0); \textcolor{comment}{/* Not an error. */}}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l01227}01227         \}}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l01228}01228 }
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l01229}01229         \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l01230}01230 \textcolor{comment}{         * Only proceed if forced or volume inactive.}}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l01231}01231 \textcolor{comment}{         */}}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l01232}01232         \textcolor{keywordflow}{if} (!(\mbox{\hyperlink{structgv__volume_a152fb6b79767817e0c97ff08279501be}{flags}} \& \mbox{\hyperlink{geom__vinum__var_8h_a916ff06e2bdbe5d20c32322c9a75128b}{GV\_FLAG\_F}}) \&\& (\mbox{\hyperlink{geom__vinum__subr_8c_a0506e8ebe72a6dd4fc32e63acc6ecf64}{gv\_provider\_is\_open}}(v-\/>\mbox{\hyperlink{structgv__volume_a22436521ee96530c09a185172fb53bf7}{provider}}) ||}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l01233}01233             p-\/>\mbox{\hyperlink{structgv__plex_a323004a8a80cc2691e845ba155ad55f0}{state}} == \mbox{\hyperlink{geom__vinum__var_8h_a2a5ed58267acc541957b387d71bd868d}{GV\_PLEX\_UP}})) \{}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l01234}01234                 \mbox{\hyperlink{geom__vinum_8h_a28cdbd7c30e435ff9ec8676f493593a0}{G\_VINUM\_DEBUG}}(1, \textcolor{stringliteral}{"{}unable to detach \%s: volume \%s is busy"{}},}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l01235}01235                     p-\/>\mbox{\hyperlink{structgv__plex_a0978e4d5dd271f5403af3cf98ae02103}{name}}, p-\/>\mbox{\hyperlink{structgv__plex_a3dba998991302b326667692db3ab2ac5}{volume}});}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l01236}01236                 \textcolor{keywordflow}{return} (\mbox{\hyperlink{geom__vinum__var_8h_a34608a22fc52b3fc8b0d849ee996e0a7}{GV\_ERR\_ISBUSY}});}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l01237}01237         \}}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l01238}01238         v-\/>\mbox{\hyperlink{structgv__volume_a6a2fb4e2da02537035c219df64a65a80}{plexcount}}-\/-\/;}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l01239}01239         \textcolor{comment}{/* Make sure someone don't read us when gone. */}}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l01240}01240         v-\/>\mbox{\hyperlink{structgv__volume_a349b7fc1e9087ff860b38ff4075e3345}{last\_read\_plex}} = NULL; }
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l01241}01241         LIST\_REMOVE(p, in\_volume);}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l01242}01242         p-\/>\mbox{\hyperlink{structgv__plex_a8e2820d6bd8419d81213f77131d6bd5c}{vol\_sc}} = NULL;}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l01243}01243         memset(p-\/>\mbox{\hyperlink{structgv__plex_a3dba998991302b326667692db3ab2ac5}{volume}}, 0, \mbox{\hyperlink{geom__vinum__var_8h_a4527a51313b9d7ed77b6d0ff5c461623}{GV\_MAXVOLNAME}});}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l01244}01244         \mbox{\hyperlink{geom__vinum__subr_8c_a969623373c6b329670821de7d5f32fc1}{gv\_update\_vol\_size}}(v, \mbox{\hyperlink{geom__vinum__subr_8c_a10c85623a48090fa703c19836119762c}{gv\_vol\_size}}(v));}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l01245}01245         \mbox{\hyperlink{geom__vinum_8h_a893e3b157c798b3f925d71151d284dd9}{gv\_save\_config}}(p-\/>\mbox{\hyperlink{structgv__plex_ad30d136a924b3367b9752c10f2391cdc}{vinumconf}});}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l01246}01246         \textcolor{keywordflow}{return} (0);}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l01247}01247 \}}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l01248}01248 }
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l01249}01249 \textcolor{comment}{/* Detach a subdisk from a plex. */}}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l01250}01250 \textcolor{keywordtype}{int}}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l01251}\mbox{\hyperlink{geom__vinum_8h_a4789e467a8d2c561d2bae31f529ddef1}{01251}} \mbox{\hyperlink{geom__vinum__subr_8c_a2c1bc6220970ee3f98a63deb2860ece6}{gv\_detach\_sd}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structgv__sd}{gv\_sd}} *s, \textcolor{keywordtype}{int} \mbox{\hyperlink{structgv__volume_a152fb6b79767817e0c97ff08279501be}{flags}})}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l01252}01252 \{}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l01253}01253         \textcolor{keyword}{struct }\mbox{\hyperlink{structgv__plex}{gv\_plex}} *p;}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l01254}01254 }
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l01255}01255         \mbox{\hyperlink{geom_8h_a1898dc8c812faa5de231ab840e8562bf}{g\_topology\_assert}}();}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l01256}01256         p = s-\/>\mbox{\hyperlink{structgv__sd_a6894be1eac4716d6eb2bd9e08b9643cf}{plex\_sc}};}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l01257}01257 }
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l01258}01258         \textcolor{keywordflow}{if} (p == NULL) \{}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l01259}01259                 \mbox{\hyperlink{geom__vinum_8h_a28cdbd7c30e435ff9ec8676f493593a0}{G\_VINUM\_DEBUG}}(1, \textcolor{stringliteral}{"{}unable to detach \%s: already detached"{}},}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l01260}01260                     s-\/>\mbox{\hyperlink{structgv__sd_a835bdd1e1c9adf03425b91c873eebf1e}{name}});}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l01261}01261                 \textcolor{keywordflow}{return} (0); \textcolor{comment}{/* Not an error. */}}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l01262}01262         \}}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l01263}01263 }
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l01264}01264         \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l01265}01265 \textcolor{comment}{         * Don't proceed if we're not forcing, and the plex is up, or degraded}}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l01266}01266 \textcolor{comment}{         * with this subdisk up.}}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l01267}01267 \textcolor{comment}{         */}}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l01268}01268         \textcolor{keywordflow}{if} (!(\mbox{\hyperlink{structgv__plex_a5c5a39055cb50589d0f9ee76860d6a12}{flags}} \& \mbox{\hyperlink{geom__vinum__var_8h_a916ff06e2bdbe5d20c32322c9a75128b}{GV\_FLAG\_F}}) \&\& ((p-\/>\mbox{\hyperlink{structgv__plex_a323004a8a80cc2691e845ba155ad55f0}{state}} > \mbox{\hyperlink{geom__vinum__var_8h_a80774ac8b615985dacf9f245fe370d7c}{GV\_PLEX\_DEGRADED}}) ||}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l01269}01269             ((p-\/>\mbox{\hyperlink{structgv__plex_a323004a8a80cc2691e845ba155ad55f0}{state}} == \mbox{\hyperlink{geom__vinum__var_8h_a80774ac8b615985dacf9f245fe370d7c}{GV\_PLEX\_DEGRADED}}) \&\& (s-\/>\mbox{\hyperlink{structgv__sd_ae69fbd03ecc14fbc16b0d4ed0421b59d}{state}} == \mbox{\hyperlink{geom__vinum__var_8h_a85ea8962028c1319a7fd5cd7adc4e497}{GV\_SD\_UP}})))) \{}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l01270}01270                 \mbox{\hyperlink{geom__vinum_8h_a28cdbd7c30e435ff9ec8676f493593a0}{G\_VINUM\_DEBUG}}(1, \textcolor{stringliteral}{"{}unable to detach \%s: plex \%s is busy"{}},}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l01271}01271                     s-\/>\mbox{\hyperlink{structgv__sd_a835bdd1e1c9adf03425b91c873eebf1e}{name}}, s-\/>\mbox{\hyperlink{structgv__sd_abc2c739f0fbd33ce2480d93752375f22}{plex}});}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l01272}01272                 \textcolor{keywordflow}{return} (\mbox{\hyperlink{geom__vinum__var_8h_a34608a22fc52b3fc8b0d849ee996e0a7}{GV\_ERR\_ISBUSY}});}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l01273}01273         \}}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l01274}01274 }
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l01275}01275         LIST\_REMOVE(s, in\_plex);}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l01276}01276         s-\/>\mbox{\hyperlink{structgv__sd_a6894be1eac4716d6eb2bd9e08b9643cf}{plex\_sc}} = NULL;}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l01277}01277         memset(s-\/>\mbox{\hyperlink{structgv__sd_abc2c739f0fbd33ce2480d93752375f22}{plex}}, 0, \mbox{\hyperlink{geom__vinum__var_8h_aa8c6366f0e203d09152dc02f2d4fda3a}{GV\_MAXPLEXNAME}});}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l01278}01278         p-\/>\mbox{\hyperlink{structgv__plex_aa0b4fc0266e80422d86f1e451505e1b4}{sddetached}}++;}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l01279}01279         \mbox{\hyperlink{geom__vinum_8h_a893e3b157c798b3f925d71151d284dd9}{gv\_save\_config}}(s-\/>\mbox{\hyperlink{structgv__sd_a5852499bf04d1041f8014be8424f1f95}{vinumconf}});}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l01280}01280         \textcolor{keywordflow}{return} (0);}
\DoxyCodeLine{\Hypertarget{geom__vinum__subr_8c_source_l01281}01281 \}}

\end{DoxyCode}
