\hypertarget{geom__vinum__rm_8c_source}{}\doxysection{geom\+\_\+vinum\+\_\+rm.\+c}
\label{geom__vinum__rm_8c_source}\index{geom/vinum/geom\_vinum\_rm.c@{geom/vinum/geom\_vinum\_rm.c}}
\mbox{\hyperlink{geom__vinum__rm_8c}{Go to the documentation of this file.}}
\begin{DoxyCode}{0}
\DoxyCodeLine{\Hypertarget{geom__vinum__rm_8c_source_l00001}00001 \textcolor{comment}{/*-\/}}
\DoxyCodeLine{\Hypertarget{geom__vinum__rm_8c_source_l00002}00002 \textcolor{comment}{ * SPDX-\/License-\/Identifier: BSD-\/2-\/Clause-\/FreeBSD}}
\DoxyCodeLine{\Hypertarget{geom__vinum__rm_8c_source_l00003}00003 \textcolor{comment}{ *}}
\DoxyCodeLine{\Hypertarget{geom__vinum__rm_8c_source_l00004}00004 \textcolor{comment}{ *  Copyright (c) 2004, 2007 Lukas Ertl}}
\DoxyCodeLine{\Hypertarget{geom__vinum__rm_8c_source_l00005}00005 \textcolor{comment}{ *  All rights reserved.}}
\DoxyCodeLine{\Hypertarget{geom__vinum__rm_8c_source_l00006}00006 \textcolor{comment}{ * }}
\DoxyCodeLine{\Hypertarget{geom__vinum__rm_8c_source_l00007}00007 \textcolor{comment}{ * Redistribution and use in source and binary forms, with or without}}
\DoxyCodeLine{\Hypertarget{geom__vinum__rm_8c_source_l00008}00008 \textcolor{comment}{ * modification, are permitted provided that the following conditions}}
\DoxyCodeLine{\Hypertarget{geom__vinum__rm_8c_source_l00009}00009 \textcolor{comment}{ * are met:}}
\DoxyCodeLine{\Hypertarget{geom__vinum__rm_8c_source_l00010}00010 \textcolor{comment}{ * 1. Redistributions of source code must retain the above copyright}}
\DoxyCodeLine{\Hypertarget{geom__vinum__rm_8c_source_l00011}00011 \textcolor{comment}{ *    notice, this list of conditions and the following disclaimer.}}
\DoxyCodeLine{\Hypertarget{geom__vinum__rm_8c_source_l00012}00012 \textcolor{comment}{ * 2. Redistributions in binary form must reproduce the above copyright}}
\DoxyCodeLine{\Hypertarget{geom__vinum__rm_8c_source_l00013}00013 \textcolor{comment}{ *    notice, this list of conditions and the following disclaimer in the}}
\DoxyCodeLine{\Hypertarget{geom__vinum__rm_8c_source_l00014}00014 \textcolor{comment}{ *    documentation and/or other materials provided with the distribution.}}
\DoxyCodeLine{\Hypertarget{geom__vinum__rm_8c_source_l00015}00015 \textcolor{comment}{ * }}
\DoxyCodeLine{\Hypertarget{geom__vinum__rm_8c_source_l00016}00016 \textcolor{comment}{ * THIS SOFTWARE IS PROVIDED BY AUTHOR AND CONTRIBUTORS ``AS IS'' AND}}
\DoxyCodeLine{\Hypertarget{geom__vinum__rm_8c_source_l00017}00017 \textcolor{comment}{ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE}}
\DoxyCodeLine{\Hypertarget{geom__vinum__rm_8c_source_l00018}00018 \textcolor{comment}{ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE}}
\DoxyCodeLine{\Hypertarget{geom__vinum__rm_8c_source_l00019}00019 \textcolor{comment}{ * ARE DISCLAIMED.  IN NO EVENT SHALL AUTHOR OR CONTRIBUTORS BE LIABLE}}
\DoxyCodeLine{\Hypertarget{geom__vinum__rm_8c_source_l00020}00020 \textcolor{comment}{ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL}}
\DoxyCodeLine{\Hypertarget{geom__vinum__rm_8c_source_l00021}00021 \textcolor{comment}{ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS}}
\DoxyCodeLine{\Hypertarget{geom__vinum__rm_8c_source_l00022}00022 \textcolor{comment}{ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)}}
\DoxyCodeLine{\Hypertarget{geom__vinum__rm_8c_source_l00023}00023 \textcolor{comment}{ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT}}
\DoxyCodeLine{\Hypertarget{geom__vinum__rm_8c_source_l00024}00024 \textcolor{comment}{ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY}}
\DoxyCodeLine{\Hypertarget{geom__vinum__rm_8c_source_l00025}00025 \textcolor{comment}{ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF}}
\DoxyCodeLine{\Hypertarget{geom__vinum__rm_8c_source_l00026}00026 \textcolor{comment}{ * SUCH DAMAGE.}}
\DoxyCodeLine{\Hypertarget{geom__vinum__rm_8c_source_l00027}00027 \textcolor{comment}{ *}}
\DoxyCodeLine{\Hypertarget{geom__vinum__rm_8c_source_l00028}00028 \textcolor{comment}{ */}}
\DoxyCodeLine{\Hypertarget{geom__vinum__rm_8c_source_l00029}00029 }
\DoxyCodeLine{\Hypertarget{geom__vinum__rm_8c_source_l00030}00030 \textcolor{preprocessor}{\#include <sys/cdefs.h>}}
\DoxyCodeLine{\Hypertarget{geom__vinum__rm_8c_source_l00031}\mbox{\hyperlink{geom__vinum__rm_8c_a8c3ef283470a68cd30afe9b8a72cb60f}{00031}} \mbox{\hyperlink{geom__vinum__rm_8c_a8c3ef283470a68cd30afe9b8a72cb60f}{\_\_FBSDID}}(\textcolor{stringliteral}{"{}\$FreeBSD\$"{}});}
\DoxyCodeLine{\Hypertarget{geom__vinum__rm_8c_source_l00032}00032 }
\DoxyCodeLine{\Hypertarget{geom__vinum__rm_8c_source_l00033}00033 \textcolor{preprocessor}{\#include <sys/param.h>}}
\DoxyCodeLine{\Hypertarget{geom__vinum__rm_8c_source_l00034}00034 \textcolor{preprocessor}{\#include <sys/libkern.h>}}
\DoxyCodeLine{\Hypertarget{geom__vinum__rm_8c_source_l00035}00035 \textcolor{preprocessor}{\#include <sys/malloc.h>}}
\DoxyCodeLine{\Hypertarget{geom__vinum__rm_8c_source_l00036}00036 }
\DoxyCodeLine{\Hypertarget{geom__vinum__rm_8c_source_l00037}00037 \textcolor{preprocessor}{\#include <\mbox{\hyperlink{geom_8h}{geom/geom.h}}>}}
\DoxyCodeLine{\Hypertarget{geom__vinum__rm_8c_source_l00038}00038 \textcolor{preprocessor}{\#include <\mbox{\hyperlink{geom__dbg_8h}{geom/geom\_dbg.h}}>}}
\DoxyCodeLine{\Hypertarget{geom__vinum__rm_8c_source_l00039}00039 \textcolor{preprocessor}{\#include <\mbox{\hyperlink{geom__vinum__var_8h}{geom/vinum/geom\_vinum\_var.h}}>}}
\DoxyCodeLine{\Hypertarget{geom__vinum__rm_8c_source_l00040}00040 \textcolor{preprocessor}{\#include <\mbox{\hyperlink{geom__vinum_8h}{geom/vinum/geom\_vinum.h}}>}}
\DoxyCodeLine{\Hypertarget{geom__vinum__rm_8c_source_l00041}00041 }
\DoxyCodeLine{\Hypertarget{geom__vinum__rm_8c_source_l00042}00042 \textcolor{comment}{/* General 'remove' routine. */}}
\DoxyCodeLine{\Hypertarget{geom__vinum__rm_8c_source_l00043}00043 \textcolor{keywordtype}{void}}
\DoxyCodeLine{\Hypertarget{geom__vinum__rm_8c_source_l00044}\mbox{\hyperlink{geom__vinum_8h_a915848df58883d205240d5d38ca90f41}{00044}} \mbox{\hyperlink{geom__vinum__rm_8c_ae3d3cb080af5668a56aa8f9bb397ffca}{gv\_remove}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structg__geom}{g\_geom}} *\mbox{\hyperlink{g__part__if_8m_abdc908a08b24cd2e589de2f44e40eeb9}{gp}}, \textcolor{keyword}{struct} \mbox{\hyperlink{structgctl__req}{gctl\_req}} *\mbox{\hyperlink{g__part__if_8m_a7a9f20c97e75f805eb506910bd3e70d3}{req}})}
\DoxyCodeLine{\Hypertarget{geom__vinum__rm_8c_source_l00045}00045 \{}
\DoxyCodeLine{\Hypertarget{geom__vinum__rm_8c_source_l00046}00046         \textcolor{keyword}{struct }\mbox{\hyperlink{structgv__softc}{gv\_softc}} *sc;}
\DoxyCodeLine{\Hypertarget{geom__vinum__rm_8c_source_l00047}00047         \textcolor{keyword}{struct }\mbox{\hyperlink{structgv__volume}{gv\_volume}} *v;}
\DoxyCodeLine{\Hypertarget{geom__vinum__rm_8c_source_l00048}00048         \textcolor{keyword}{struct }\mbox{\hyperlink{structgv__plex}{gv\_plex}} *p;}
\DoxyCodeLine{\Hypertarget{geom__vinum__rm_8c_source_l00049}00049         \textcolor{keyword}{struct }\mbox{\hyperlink{structgv__sd}{gv\_sd}} *s;}
\DoxyCodeLine{\Hypertarget{geom__vinum__rm_8c_source_l00050}00050         \textcolor{keyword}{struct }\mbox{\hyperlink{structgv__drive}{gv\_drive}} *d;}
\DoxyCodeLine{\Hypertarget{geom__vinum__rm_8c_source_l00051}00051         \textcolor{keywordtype}{int} *argc, *\mbox{\hyperlink{structgv__drive_a9786a03e20a91ab9c73a7aa93b90629a}{flags}};}
\DoxyCodeLine{\Hypertarget{geom__vinum__rm_8c_source_l00052}00052         \textcolor{keywordtype}{char} *argv, \mbox{\hyperlink{g__part__if_8m_ac14417684334d01b4e1e807a19d92816}{buf}}[20];}
\DoxyCodeLine{\Hypertarget{geom__vinum__rm_8c_source_l00053}00053         \textcolor{keywordtype}{int} i, \mbox{\hyperlink{geom__flashmap_8c_a763fd8db6bba8fbbbc113ca0d61c47c2}{type}};}
\DoxyCodeLine{\Hypertarget{geom__vinum__rm_8c_source_l00054}00054 }
\DoxyCodeLine{\Hypertarget{geom__vinum__rm_8c_source_l00055}00055         argc = \mbox{\hyperlink{geom_8h_ab762d12640f528d8f1f60eee92bf5f3b}{gctl\_get\_paraml}}(\mbox{\hyperlink{g__part__if_8m_a7a9f20c97e75f805eb506910bd3e70d3}{req}}, \textcolor{stringliteral}{"{}argc"{}}, \textcolor{keyword}{sizeof}(*argc));}
\DoxyCodeLine{\Hypertarget{geom__vinum__rm_8c_source_l00056}00056 }
\DoxyCodeLine{\Hypertarget{geom__vinum__rm_8c_source_l00057}00057         \textcolor{keywordflow}{if} (argc == NULL || *argc == 0) \{}
\DoxyCodeLine{\Hypertarget{geom__vinum__rm_8c_source_l00058}00058                 \mbox{\hyperlink{geom_8h_a1d51201471b52be7e19a98b0fcb144de}{gctl\_error}}(\mbox{\hyperlink{g__part__if_8m_a7a9f20c97e75f805eb506910bd3e70d3}{req}}, \textcolor{stringliteral}{"{}no arguments given"{}});}
\DoxyCodeLine{\Hypertarget{geom__vinum__rm_8c_source_l00059}00059                 \textcolor{keywordflow}{return};}
\DoxyCodeLine{\Hypertarget{geom__vinum__rm_8c_source_l00060}00060         \}}
\DoxyCodeLine{\Hypertarget{geom__vinum__rm_8c_source_l00061}00061 }
\DoxyCodeLine{\Hypertarget{geom__vinum__rm_8c_source_l00062}00062         \mbox{\hyperlink{structgv__drive_a9786a03e20a91ab9c73a7aa93b90629a}{flags}} = \mbox{\hyperlink{geom_8h_ab762d12640f528d8f1f60eee92bf5f3b}{gctl\_get\_paraml}}(\mbox{\hyperlink{g__part__if_8m_a7a9f20c97e75f805eb506910bd3e70d3}{req}}, \textcolor{stringliteral}{"{}flags"{}}, \textcolor{keyword}{sizeof}(*\mbox{\hyperlink{structgv__drive_a9786a03e20a91ab9c73a7aa93b90629a}{flags}}));}
\DoxyCodeLine{\Hypertarget{geom__vinum__rm_8c_source_l00063}00063         \textcolor{keywordflow}{if} (\mbox{\hyperlink{structgv__drive_a9786a03e20a91ab9c73a7aa93b90629a}{flags}} == NULL) \{}
\DoxyCodeLine{\Hypertarget{geom__vinum__rm_8c_source_l00064}00064                 \mbox{\hyperlink{geom_8h_a1d51201471b52be7e19a98b0fcb144de}{gctl\_error}}(\mbox{\hyperlink{g__part__if_8m_a7a9f20c97e75f805eb506910bd3e70d3}{req}}, \textcolor{stringliteral}{"{}no flags given"{}});}
\DoxyCodeLine{\Hypertarget{geom__vinum__rm_8c_source_l00065}00065                 \textcolor{keywordflow}{return};}
\DoxyCodeLine{\Hypertarget{geom__vinum__rm_8c_source_l00066}00066         \}}
\DoxyCodeLine{\Hypertarget{geom__vinum__rm_8c_source_l00067}00067 }
\DoxyCodeLine{\Hypertarget{geom__vinum__rm_8c_source_l00068}00068         sc = \mbox{\hyperlink{g__part__if_8m_abdc908a08b24cd2e589de2f44e40eeb9}{gp}}-\/>\mbox{\hyperlink{structg__geom_aa83c08c83459420f6cbcfe64c6099466}{softc}};}
\DoxyCodeLine{\Hypertarget{geom__vinum__rm_8c_source_l00069}00069 }
\DoxyCodeLine{\Hypertarget{geom__vinum__rm_8c_source_l00070}00070         \textcolor{comment}{/* XXX config locking */}}
\DoxyCodeLine{\Hypertarget{geom__vinum__rm_8c_source_l00071}00071 }
\DoxyCodeLine{\Hypertarget{geom__vinum__rm_8c_source_l00072}00072         \textcolor{keywordflow}{for} (i = 0; i < *argc; i++) \{}
\DoxyCodeLine{\Hypertarget{geom__vinum__rm_8c_source_l00073}00073                 snprintf(\mbox{\hyperlink{g__part__if_8m_ac14417684334d01b4e1e807a19d92816}{buf}}, \textcolor{keyword}{sizeof}(\mbox{\hyperlink{g__part__if_8m_ac14417684334d01b4e1e807a19d92816}{buf}}), \textcolor{stringliteral}{"{}argv\%d"{}}, i);}
\DoxyCodeLine{\Hypertarget{geom__vinum__rm_8c_source_l00074}00074                 argv = \mbox{\hyperlink{geom_8h_a3e3d6786258b3336d55a96607f9b8eb8}{gctl\_get\_param}}(\mbox{\hyperlink{g__part__if_8m_a7a9f20c97e75f805eb506910bd3e70d3}{req}}, \mbox{\hyperlink{g__part__if_8m_ac14417684334d01b4e1e807a19d92816}{buf}}, NULL);}
\DoxyCodeLine{\Hypertarget{geom__vinum__rm_8c_source_l00075}00075                 \textcolor{keywordflow}{if} (argv == NULL)}
\DoxyCodeLine{\Hypertarget{geom__vinum__rm_8c_source_l00076}00076                         \textcolor{keywordflow}{continue};}
\DoxyCodeLine{\Hypertarget{geom__vinum__rm_8c_source_l00077}00077                 \mbox{\hyperlink{geom__flashmap_8c_a763fd8db6bba8fbbbc113ca0d61c47c2}{type}} = \mbox{\hyperlink{geom__vinum_8h_adf857930fd65dd84870be1db99e860f7}{gv\_object\_type}}(sc, argv);}
\DoxyCodeLine{\Hypertarget{geom__vinum__rm_8c_source_l00078}00078                 \textcolor{keywordflow}{switch} (\mbox{\hyperlink{geom__flashmap_8c_a763fd8db6bba8fbbbc113ca0d61c47c2}{type}}) \{}
\DoxyCodeLine{\Hypertarget{geom__vinum__rm_8c_source_l00079}00079                 \textcolor{keywordflow}{case} \mbox{\hyperlink{geom__vinum__var_8h_ac00b5b481f097143593b6ac29dd4156f}{GV\_TYPE\_VOL}}:}
\DoxyCodeLine{\Hypertarget{geom__vinum__rm_8c_source_l00080}00080                         v = \mbox{\hyperlink{geom__vinum_8h_a2fb94d2e82510ca78bb8c88fbc12315e}{gv\_find\_vol}}(sc, argv);}
\DoxyCodeLine{\Hypertarget{geom__vinum__rm_8c_source_l00081}00081 }
\DoxyCodeLine{\Hypertarget{geom__vinum__rm_8c_source_l00082}00082                         \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{geom__vinum__rm_8c_source_l00083}00083 \textcolor{comment}{                         * If this volume has plexes, we want a recursive}}
\DoxyCodeLine{\Hypertarget{geom__vinum__rm_8c_source_l00084}00084 \textcolor{comment}{                         * removal.}}
\DoxyCodeLine{\Hypertarget{geom__vinum__rm_8c_source_l00085}00085 \textcolor{comment}{                         */}}
\DoxyCodeLine{\Hypertarget{geom__vinum__rm_8c_source_l00086}00086                         \textcolor{keywordflow}{if} (!LIST\_EMPTY(\&v-\/>plexes) \&\& !(*\mbox{\hyperlink{structgv__drive_a9786a03e20a91ab9c73a7aa93b90629a}{flags}} \& \mbox{\hyperlink{geom__vinum__var_8h_a99744114a3bac7a8fa5e51db81837c3d}{GV\_FLAG\_R}})) \{}
\DoxyCodeLine{\Hypertarget{geom__vinum__rm_8c_source_l00087}00087                                 \mbox{\hyperlink{geom_8h_a1d51201471b52be7e19a98b0fcb144de}{gctl\_error}}(\mbox{\hyperlink{g__part__if_8m_a7a9f20c97e75f805eb506910bd3e70d3}{req}}, \textcolor{stringliteral}{"{}volume '\%s' has attached "{}}}
\DoxyCodeLine{\Hypertarget{geom__vinum__rm_8c_source_l00088}00088                                     \textcolor{stringliteral}{"{}plexes -\/ need recursive removal"{}}, v-\/>\mbox{\hyperlink{structgv__volume_a3369e150403037bca7ed34ea68f25ce0}{name}});}
\DoxyCodeLine{\Hypertarget{geom__vinum__rm_8c_source_l00089}00089                                 \textcolor{keywordflow}{return};}
\DoxyCodeLine{\Hypertarget{geom__vinum__rm_8c_source_l00090}00090                         \}}
\DoxyCodeLine{\Hypertarget{geom__vinum__rm_8c_source_l00091}00091 }
\DoxyCodeLine{\Hypertarget{geom__vinum__rm_8c_source_l00092}00092                         \mbox{\hyperlink{geom__vinum_8h_ab8b55e981fb9c93aa56042746dd4bf5a}{gv\_post\_event}}(sc, \mbox{\hyperlink{geom__vinum__var_8h_ac17d0d1cd7fa94ded622c3395ccae3f0}{GV\_EVENT\_RM\_VOLUME}}, v, NULL, 0, 0);}
\DoxyCodeLine{\Hypertarget{geom__vinum__rm_8c_source_l00093}00093                         \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{geom__vinum__rm_8c_source_l00094}00094 }
\DoxyCodeLine{\Hypertarget{geom__vinum__rm_8c_source_l00095}00095                 \textcolor{keywordflow}{case} \mbox{\hyperlink{geom__vinum__var_8h_a2a21f3f69c0e60c425744a299cd49a6f}{GV\_TYPE\_PLEX}}:}
\DoxyCodeLine{\Hypertarget{geom__vinum__rm_8c_source_l00096}00096                         p = \mbox{\hyperlink{geom__vinum_8h_acf034b996fb50e3a99f2f0d98ffecc53}{gv\_find\_plex}}(sc, argv);}
\DoxyCodeLine{\Hypertarget{geom__vinum__rm_8c_source_l00097}00097 }
\DoxyCodeLine{\Hypertarget{geom__vinum__rm_8c_source_l00098}00098                         \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{geom__vinum__rm_8c_source_l00099}00099 \textcolor{comment}{                         * If this plex has subdisks, we want a recursive}}
\DoxyCodeLine{\Hypertarget{geom__vinum__rm_8c_source_l00100}00100 \textcolor{comment}{                         * removal.}}
\DoxyCodeLine{\Hypertarget{geom__vinum__rm_8c_source_l00101}00101 \textcolor{comment}{                         */}}
\DoxyCodeLine{\Hypertarget{geom__vinum__rm_8c_source_l00102}00102                         \textcolor{keywordflow}{if} (!LIST\_EMPTY(\&p-\/>subdisks) \&\&}
\DoxyCodeLine{\Hypertarget{geom__vinum__rm_8c_source_l00103}00103                             !(*\mbox{\hyperlink{structgv__drive_a9786a03e20a91ab9c73a7aa93b90629a}{flags}} \& \mbox{\hyperlink{geom__vinum__var_8h_a99744114a3bac7a8fa5e51db81837c3d}{GV\_FLAG\_R}})) \{}
\DoxyCodeLine{\Hypertarget{geom__vinum__rm_8c_source_l00104}00104                                 \mbox{\hyperlink{geom_8h_a1d51201471b52be7e19a98b0fcb144de}{gctl\_error}}(\mbox{\hyperlink{g__part__if_8m_a7a9f20c97e75f805eb506910bd3e70d3}{req}}, \textcolor{stringliteral}{"{}plex '\%s' has attached "{}}}
\DoxyCodeLine{\Hypertarget{geom__vinum__rm_8c_source_l00105}00105                                     \textcolor{stringliteral}{"{}subdisks -\/ need recursive removal"{}},}
\DoxyCodeLine{\Hypertarget{geom__vinum__rm_8c_source_l00106}00106                                     p-\/>\mbox{\hyperlink{structgv__plex_a0978e4d5dd271f5403af3cf98ae02103}{name}});}
\DoxyCodeLine{\Hypertarget{geom__vinum__rm_8c_source_l00107}00107                                 \textcolor{keywordflow}{return};}
\DoxyCodeLine{\Hypertarget{geom__vinum__rm_8c_source_l00108}00108                         \}}
\DoxyCodeLine{\Hypertarget{geom__vinum__rm_8c_source_l00109}00109 }
\DoxyCodeLine{\Hypertarget{geom__vinum__rm_8c_source_l00110}00110                         \textcolor{comment}{/* Don't allow removal of the only plex of a volume. */}}
\DoxyCodeLine{\Hypertarget{geom__vinum__rm_8c_source_l00111}00111                         \textcolor{keywordflow}{if} (p-\/>\mbox{\hyperlink{structgv__plex_a8e2820d6bd8419d81213f77131d6bd5c}{vol\_sc}} != NULL \&\& p-\/>\mbox{\hyperlink{structgv__plex_a8e2820d6bd8419d81213f77131d6bd5c}{vol\_sc}}-\/>\mbox{\hyperlink{structgv__volume_a6a2fb4e2da02537035c219df64a65a80}{plexcount}} == 1) \{}
\DoxyCodeLine{\Hypertarget{geom__vinum__rm_8c_source_l00112}00112                                 \mbox{\hyperlink{geom_8h_a1d51201471b52be7e19a98b0fcb144de}{gctl\_error}}(\mbox{\hyperlink{g__part__if_8m_a7a9f20c97e75f805eb506910bd3e70d3}{req}}, \textcolor{stringliteral}{"{}plex '\%s' is still attached "{}}}
\DoxyCodeLine{\Hypertarget{geom__vinum__rm_8c_source_l00113}00113                                     \textcolor{stringliteral}{"{}to volume '\%s'"{}}, p-\/>\mbox{\hyperlink{structgv__plex_a0978e4d5dd271f5403af3cf98ae02103}{name}}, p-\/>\mbox{\hyperlink{structgv__plex_a3dba998991302b326667692db3ab2ac5}{volume}});}
\DoxyCodeLine{\Hypertarget{geom__vinum__rm_8c_source_l00114}00114                                 \textcolor{keywordflow}{return};}
\DoxyCodeLine{\Hypertarget{geom__vinum__rm_8c_source_l00115}00115                         \}}
\DoxyCodeLine{\Hypertarget{geom__vinum__rm_8c_source_l00116}00116 }
\DoxyCodeLine{\Hypertarget{geom__vinum__rm_8c_source_l00117}00117                         \mbox{\hyperlink{geom__vinum_8h_ab8b55e981fb9c93aa56042746dd4bf5a}{gv\_post\_event}}(sc, \mbox{\hyperlink{geom__vinum__var_8h_ac801d3ac3883ae3f61ed231fffea6172}{GV\_EVENT\_RM\_PLEX}}, p, NULL, 0, 0);}
\DoxyCodeLine{\Hypertarget{geom__vinum__rm_8c_source_l00118}00118                         \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{geom__vinum__rm_8c_source_l00119}00119 }
\DoxyCodeLine{\Hypertarget{geom__vinum__rm_8c_source_l00120}00120                 \textcolor{keywordflow}{case} \mbox{\hyperlink{geom__vinum__var_8h_acb4b8aa524c3ba1c7abaa181a5cb6bb9}{GV\_TYPE\_SD}}:}
\DoxyCodeLine{\Hypertarget{geom__vinum__rm_8c_source_l00121}00121                         s = \mbox{\hyperlink{geom__vinum_8h_ada178b6592b1acfe37ad3eecc8075769}{gv\_find\_sd}}(sc, argv);}
\DoxyCodeLine{\Hypertarget{geom__vinum__rm_8c_source_l00122}00122 }
\DoxyCodeLine{\Hypertarget{geom__vinum__rm_8c_source_l00123}00123                         \textcolor{comment}{/* Don't allow removal if attached to a plex. */}}
\DoxyCodeLine{\Hypertarget{geom__vinum__rm_8c_source_l00124}00124                         \textcolor{keywordflow}{if} (s-\/>\mbox{\hyperlink{structgv__sd_a6894be1eac4716d6eb2bd9e08b9643cf}{plex\_sc}} != NULL) \{}
\DoxyCodeLine{\Hypertarget{geom__vinum__rm_8c_source_l00125}00125                                 \mbox{\hyperlink{geom_8h_a1d51201471b52be7e19a98b0fcb144de}{gctl\_error}}(\mbox{\hyperlink{g__part__if_8m_a7a9f20c97e75f805eb506910bd3e70d3}{req}}, \textcolor{stringliteral}{"{}subdisk '\%s' is still attached"{}}}
\DoxyCodeLine{\Hypertarget{geom__vinum__rm_8c_source_l00126}00126                                     \textcolor{stringliteral}{"{} to plex '\%s'"{}}, s-\/>\mbox{\hyperlink{structgv__sd_a835bdd1e1c9adf03425b91c873eebf1e}{name}}, s-\/>\mbox{\hyperlink{structgv__sd_a6894be1eac4716d6eb2bd9e08b9643cf}{plex\_sc}}-\/>\mbox{\hyperlink{structgv__plex_a0978e4d5dd271f5403af3cf98ae02103}{name}});}
\DoxyCodeLine{\Hypertarget{geom__vinum__rm_8c_source_l00127}00127                                 \textcolor{keywordflow}{return};}
\DoxyCodeLine{\Hypertarget{geom__vinum__rm_8c_source_l00128}00128                         \}}
\DoxyCodeLine{\Hypertarget{geom__vinum__rm_8c_source_l00129}00129 }
\DoxyCodeLine{\Hypertarget{geom__vinum__rm_8c_source_l00130}00130                         \mbox{\hyperlink{geom__vinum_8h_ab8b55e981fb9c93aa56042746dd4bf5a}{gv\_post\_event}}(sc, \mbox{\hyperlink{geom__vinum__var_8h_a108798cc4cad36a12b3086daf968ad3a}{GV\_EVENT\_RM\_SD}}, s, NULL, 0, 0);}
\DoxyCodeLine{\Hypertarget{geom__vinum__rm_8c_source_l00131}00131                         \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{geom__vinum__rm_8c_source_l00132}00132 }
\DoxyCodeLine{\Hypertarget{geom__vinum__rm_8c_source_l00133}00133                 \textcolor{keywordflow}{case} \mbox{\hyperlink{geom__vinum__var_8h_a4f601240cfd57a614dee2cca5a2e9d67}{GV\_TYPE\_DRIVE}}:}
\DoxyCodeLine{\Hypertarget{geom__vinum__rm_8c_source_l00134}00134                         d = \mbox{\hyperlink{geom__vinum_8h_a6bfd18558261750b40b0bfe3c18c4b8f}{gv\_find\_drive}}(sc, argv);}
\DoxyCodeLine{\Hypertarget{geom__vinum__rm_8c_source_l00135}00135                         \textcolor{comment}{/* We don't allow to remove open drives. */}}
\DoxyCodeLine{\Hypertarget{geom__vinum__rm_8c_source_l00136}00136                         \textcolor{keywordflow}{if} (\mbox{\hyperlink{geom__vinum_8h_afc60119e84b762b87ad7f506e87d3478}{gv\_consumer\_is\_open}}(d-\/>\mbox{\hyperlink{structgv__drive_a69dfc95c0bafb10b4239b5d45059e85d}{consumer}}) \&\&}
\DoxyCodeLine{\Hypertarget{geom__vinum__rm_8c_source_l00137}00137                             !(*\mbox{\hyperlink{structgv__drive_a9786a03e20a91ab9c73a7aa93b90629a}{flags}} \& \mbox{\hyperlink{geom__vinum__var_8h_a916ff06e2bdbe5d20c32322c9a75128b}{GV\_FLAG\_F}})) \{}
\DoxyCodeLine{\Hypertarget{geom__vinum__rm_8c_source_l00138}00138                                 \mbox{\hyperlink{geom_8h_a1d51201471b52be7e19a98b0fcb144de}{gctl\_error}}(\mbox{\hyperlink{g__part__if_8m_a7a9f20c97e75f805eb506910bd3e70d3}{req}}, \textcolor{stringliteral}{"{}drive '\%s' is open"{}}, d-\/>\mbox{\hyperlink{structgv__drive_a69e5c72365075804074d21c056111ebf}{name}});}
\DoxyCodeLine{\Hypertarget{geom__vinum__rm_8c_source_l00139}00139                                 \textcolor{keywordflow}{return};}
\DoxyCodeLine{\Hypertarget{geom__vinum__rm_8c_source_l00140}00140                         \}}
\DoxyCodeLine{\Hypertarget{geom__vinum__rm_8c_source_l00141}00141 }
\DoxyCodeLine{\Hypertarget{geom__vinum__rm_8c_source_l00142}00142                         \textcolor{comment}{/* A drive with subdisks needs a recursive removal. */}}
\DoxyCodeLine{\Hypertarget{geom__vinum__rm_8c_source_l00143}00143 \textcolor{comment}{/*                      if (!LIST\_EMPTY(\&d-\/>subdisks) \&\&}}
\DoxyCodeLine{\Hypertarget{geom__vinum__rm_8c_source_l00144}00144 \textcolor{comment}{                            !(*flags \& GV\_FLAG\_R)) \{}}
\DoxyCodeLine{\Hypertarget{geom__vinum__rm_8c_source_l00145}00145 \textcolor{comment}{                                gctl\_error(req, "{}drive '\%s' still has subdisks"{}}}
\DoxyCodeLine{\Hypertarget{geom__vinum__rm_8c_source_l00146}00146 \textcolor{comment}{                                    "{} -\/ need recursive removal"{}, d-\/>name);}}
\DoxyCodeLine{\Hypertarget{geom__vinum__rm_8c_source_l00147}00147 \textcolor{comment}{                                return;}}
\DoxyCodeLine{\Hypertarget{geom__vinum__rm_8c_source_l00148}00148 \textcolor{comment}{                        \}*/}}
\DoxyCodeLine{\Hypertarget{geom__vinum__rm_8c_source_l00149}00149 }
\DoxyCodeLine{\Hypertarget{geom__vinum__rm_8c_source_l00150}00150                         \mbox{\hyperlink{geom__vinum_8h_ab8b55e981fb9c93aa56042746dd4bf5a}{gv\_post\_event}}(sc, \mbox{\hyperlink{geom__vinum__var_8h_abb0a5ac4c1f727f5a4ce2bb3bdebc8f8}{GV\_EVENT\_RM\_DRIVE}}, d, NULL, *\mbox{\hyperlink{structgv__drive_a9786a03e20a91ab9c73a7aa93b90629a}{flags}},}
\DoxyCodeLine{\Hypertarget{geom__vinum__rm_8c_source_l00151}00151                             0);}
\DoxyCodeLine{\Hypertarget{geom__vinum__rm_8c_source_l00152}00152                         \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{geom__vinum__rm_8c_source_l00153}00153 }
\DoxyCodeLine{\Hypertarget{geom__vinum__rm_8c_source_l00154}00154                 \textcolor{keywordflow}{default}:}
\DoxyCodeLine{\Hypertarget{geom__vinum__rm_8c_source_l00155}00155                         \mbox{\hyperlink{geom_8h_a1d51201471b52be7e19a98b0fcb144de}{gctl\_error}}(\mbox{\hyperlink{g__part__if_8m_a7a9f20c97e75f805eb506910bd3e70d3}{req}}, \textcolor{stringliteral}{"{}unknown object '\%s'"{}}, argv);}
\DoxyCodeLine{\Hypertarget{geom__vinum__rm_8c_source_l00156}00156                         \textcolor{keywordflow}{return};}
\DoxyCodeLine{\Hypertarget{geom__vinum__rm_8c_source_l00157}00157                 \}}
\DoxyCodeLine{\Hypertarget{geom__vinum__rm_8c_source_l00158}00158         \}}
\DoxyCodeLine{\Hypertarget{geom__vinum__rm_8c_source_l00159}00159 }
\DoxyCodeLine{\Hypertarget{geom__vinum__rm_8c_source_l00160}00160         \mbox{\hyperlink{geom__vinum_8h_ab8b55e981fb9c93aa56042746dd4bf5a}{gv\_post\_event}}(sc, \mbox{\hyperlink{geom__vinum__var_8h_a3f48efe317df71ff850737d390626744}{GV\_EVENT\_SAVE\_CONFIG}}, sc, NULL, 0, 0);}
\DoxyCodeLine{\Hypertarget{geom__vinum__rm_8c_source_l00161}00161 \}}
\DoxyCodeLine{\Hypertarget{geom__vinum__rm_8c_source_l00162}00162 }
\DoxyCodeLine{\Hypertarget{geom__vinum__rm_8c_source_l00163}00163 \textcolor{comment}{/* Resets configuration */}}
\DoxyCodeLine{\Hypertarget{geom__vinum__rm_8c_source_l00164}00164 \textcolor{keywordtype}{int}}
\DoxyCodeLine{\Hypertarget{geom__vinum__rm_8c_source_l00165}\mbox{\hyperlink{geom__vinum_8h_a7358d1815654a6bd4fb7e1532bb97a1e}{00165}} \mbox{\hyperlink{geom__vinum__rm_8c_a7f80b21164c6c3dad50a77e192e7c648}{gv\_resetconfig}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structgv__softc}{gv\_softc}} *sc)}
\DoxyCodeLine{\Hypertarget{geom__vinum__rm_8c_source_l00166}00166 \{}
\DoxyCodeLine{\Hypertarget{geom__vinum__rm_8c_source_l00167}00167         \textcolor{keyword}{struct }\mbox{\hyperlink{structgv__drive}{gv\_drive}} *d, *d2;}
\DoxyCodeLine{\Hypertarget{geom__vinum__rm_8c_source_l00168}00168         \textcolor{keyword}{struct }\mbox{\hyperlink{structgv__volume}{gv\_volume}} *v, *v2;}
\DoxyCodeLine{\Hypertarget{geom__vinum__rm_8c_source_l00169}00169         \textcolor{keyword}{struct }\mbox{\hyperlink{structgv__plex}{gv\_plex}} *p, *p2;}
\DoxyCodeLine{\Hypertarget{geom__vinum__rm_8c_source_l00170}00170         \textcolor{keyword}{struct }\mbox{\hyperlink{structgv__sd}{gv\_sd}} *s, *s2;}
\DoxyCodeLine{\Hypertarget{geom__vinum__rm_8c_source_l00171}00171 }
\DoxyCodeLine{\Hypertarget{geom__vinum__rm_8c_source_l00172}00172         \textcolor{comment}{/* First make sure nothing is open. */}}
\DoxyCodeLine{\Hypertarget{geom__vinum__rm_8c_source_l00173}00173         LIST\_FOREACH\_SAFE(d, \&sc-\/>drives, \mbox{\hyperlink{structgv__sd_abb67fc2a84afb2c110794b6de19d55d6}{drive}}, d2) \{}
\DoxyCodeLine{\Hypertarget{geom__vinum__rm_8c_source_l00174}00174                 \textcolor{keywordflow}{if} (\mbox{\hyperlink{geom__vinum_8h_afc60119e84b762b87ad7f506e87d3478}{gv\_consumer\_is\_open}}(d-\/>\mbox{\hyperlink{structgv__drive_a69dfc95c0bafb10b4239b5d45059e85d}{consumer}})) \{}
\DoxyCodeLine{\Hypertarget{geom__vinum__rm_8c_source_l00175}00175                         \textcolor{keywordflow}{return} (\mbox{\hyperlink{geom__vinum__var_8h_a34608a22fc52b3fc8b0d849ee996e0a7}{GV\_ERR\_ISBUSY}});}
\DoxyCodeLine{\Hypertarget{geom__vinum__rm_8c_source_l00176}00176                 \}}
\DoxyCodeLine{\Hypertarget{geom__vinum__rm_8c_source_l00177}00177         \}}
\DoxyCodeLine{\Hypertarget{geom__vinum__rm_8c_source_l00178}00178 }
\DoxyCodeLine{\Hypertarget{geom__vinum__rm_8c_source_l00179}00179         \textcolor{comment}{/* Make sure nothing is going on internally. */}}
\DoxyCodeLine{\Hypertarget{geom__vinum__rm_8c_source_l00180}00180         LIST\_FOREACH\_SAFE(p, \&sc-\/>plexes, \mbox{\hyperlink{structgv__sd_abc2c739f0fbd33ce2480d93752375f22}{plex}}, p2) \{}
\DoxyCodeLine{\Hypertarget{geom__vinum__rm_8c_source_l00181}00181                 \textcolor{keywordflow}{if} (p-\/>\mbox{\hyperlink{structgv__plex_a5c5a39055cb50589d0f9ee76860d6a12}{flags}} \& (\mbox{\hyperlink{geom__vinum__var_8h_a13b286c390639eb1d6e8f3823443e7f0}{GV\_PLEX\_REBUILDING}} | \mbox{\hyperlink{geom__vinum__var_8h_a7c137a85de28fa7c787fe903acf5e3b0}{GV\_PLEX\_GROWING}}))}
\DoxyCodeLine{\Hypertarget{geom__vinum__rm_8c_source_l00182}00182                         \textcolor{keywordflow}{return} (\mbox{\hyperlink{geom__vinum__var_8h_a34608a22fc52b3fc8b0d849ee996e0a7}{GV\_ERR\_ISBUSY}});}
\DoxyCodeLine{\Hypertarget{geom__vinum__rm_8c_source_l00183}00183         \}}
\DoxyCodeLine{\Hypertarget{geom__vinum__rm_8c_source_l00184}00184 }
\DoxyCodeLine{\Hypertarget{geom__vinum__rm_8c_source_l00185}00185         \textcolor{comment}{/* Then if not, we remove everything. */}}
\DoxyCodeLine{\Hypertarget{geom__vinum__rm_8c_source_l00186}00186         LIST\_FOREACH\_SAFE(s, \&sc-\/>subdisks, \mbox{\hyperlink{g__raid__md__if_8m_a910062273088d146e8533398780701eb}{sd}}, s2)}
\DoxyCodeLine{\Hypertarget{geom__vinum__rm_8c_source_l00187}00187                 \mbox{\hyperlink{geom__vinum__rm_8c_aa83ccb21c8d2400aa2418b127d78e7b2}{gv\_rm\_sd}}(sc, s);}
\DoxyCodeLine{\Hypertarget{geom__vinum__rm_8c_source_l00188}00188         LIST\_FOREACH\_SAFE(d, \&sc-\/>drives, \mbox{\hyperlink{structgv__sd_abb67fc2a84afb2c110794b6de19d55d6}{drive}}, d2)}
\DoxyCodeLine{\Hypertarget{geom__vinum__rm_8c_source_l00189}00189                 \mbox{\hyperlink{geom__vinum__rm_8c_ae24149b4e4657de43605433027b349e7}{gv\_rm\_drive}}(sc, d, 0);}
\DoxyCodeLine{\Hypertarget{geom__vinum__rm_8c_source_l00190}00190         LIST\_FOREACH\_SAFE(p, \&sc-\/>plexes, \mbox{\hyperlink{structgv__sd_abc2c739f0fbd33ce2480d93752375f22}{plex}}, p2)}
\DoxyCodeLine{\Hypertarget{geom__vinum__rm_8c_source_l00191}00191                 \mbox{\hyperlink{geom__vinum__rm_8c_aaa3bd6c81346de6a35dd2bc16223e685}{gv\_rm\_plex}}(sc, p);}
\DoxyCodeLine{\Hypertarget{geom__vinum__rm_8c_source_l00192}00192         LIST\_FOREACH\_SAFE(v, \&sc-\/>volumes, \mbox{\hyperlink{g__raid__tr__if_8m_a1b9eb8854031ced0905afde9f72c9ea8}{volume}}, v2)}
\DoxyCodeLine{\Hypertarget{geom__vinum__rm_8c_source_l00193}00193                 \mbox{\hyperlink{geom__vinum__rm_8c_aa9b9b78154dec808ba7968b5644b6adc}{gv\_rm\_vol}}(sc, v);}
\DoxyCodeLine{\Hypertarget{geom__vinum__rm_8c_source_l00194}00194 }
\DoxyCodeLine{\Hypertarget{geom__vinum__rm_8c_source_l00195}00195         \mbox{\hyperlink{geom__vinum_8h_ab8b55e981fb9c93aa56042746dd4bf5a}{gv\_post\_event}}(sc, \mbox{\hyperlink{geom__vinum__var_8h_a3f48efe317df71ff850737d390626744}{GV\_EVENT\_SAVE\_CONFIG}}, sc, NULL, 0, 0);}
\DoxyCodeLine{\Hypertarget{geom__vinum__rm_8c_source_l00196}00196 }
\DoxyCodeLine{\Hypertarget{geom__vinum__rm_8c_source_l00197}00197         \textcolor{keywordflow}{return} (0);}
\DoxyCodeLine{\Hypertarget{geom__vinum__rm_8c_source_l00198}00198 \}}
\DoxyCodeLine{\Hypertarget{geom__vinum__rm_8c_source_l00199}00199 }
\DoxyCodeLine{\Hypertarget{geom__vinum__rm_8c_source_l00200}00200 \textcolor{comment}{/* Remove a volume. */}}
\DoxyCodeLine{\Hypertarget{geom__vinum__rm_8c_source_l00201}00201 \textcolor{keywordtype}{void}}
\DoxyCodeLine{\Hypertarget{geom__vinum__rm_8c_source_l00202}\mbox{\hyperlink{geom__vinum_8h_a11f117cb614cf9043a89dfd8f34824cf}{00202}} \mbox{\hyperlink{geom__vinum__rm_8c_aa9b9b78154dec808ba7968b5644b6adc}{gv\_rm\_vol}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structgv__softc}{gv\_softc}} *sc, \textcolor{keyword}{struct} \mbox{\hyperlink{structgv__volume}{gv\_volume}} *v)}
\DoxyCodeLine{\Hypertarget{geom__vinum__rm_8c_source_l00203}00203 \{}
\DoxyCodeLine{\Hypertarget{geom__vinum__rm_8c_source_l00204}00204         \textcolor{keyword}{struct }\mbox{\hyperlink{structg__provider}{g\_provider}} *\mbox{\hyperlink{g__part__if_8m_a9bc7638f295763b77465c5ebebbd3442}{pp}};}
\DoxyCodeLine{\Hypertarget{geom__vinum__rm_8c_source_l00205}00205         \textcolor{keyword}{struct }\mbox{\hyperlink{structgv__plex}{gv\_plex}} *p, *p2;}
\DoxyCodeLine{\Hypertarget{geom__vinum__rm_8c_source_l00206}00206 }
\DoxyCodeLine{\Hypertarget{geom__vinum__rm_8c_source_l00207}00207         KASSERT(v != NULL, (\textcolor{stringliteral}{"{}gv\_rm\_vol: NULL v"{}}));}
\DoxyCodeLine{\Hypertarget{geom__vinum__rm_8c_source_l00208}00208         \mbox{\hyperlink{g__part__if_8m_a9bc7638f295763b77465c5ebebbd3442}{pp}} = v-\/>\mbox{\hyperlink{structgv__volume_a22436521ee96530c09a185172fb53bf7}{provider}};}
\DoxyCodeLine{\Hypertarget{geom__vinum__rm_8c_source_l00209}00209         KASSERT(\mbox{\hyperlink{g__part__if_8m_a9bc7638f295763b77465c5ebebbd3442}{pp}} != NULL, (\textcolor{stringliteral}{"{}gv\_rm\_vol: NULL pp"{}}));}
\DoxyCodeLine{\Hypertarget{geom__vinum__rm_8c_source_l00210}00210 }
\DoxyCodeLine{\Hypertarget{geom__vinum__rm_8c_source_l00211}00211         \textcolor{comment}{/* Check if any of our consumers is open. */}}
\DoxyCodeLine{\Hypertarget{geom__vinum__rm_8c_source_l00212}00212         \textcolor{keywordflow}{if} (\mbox{\hyperlink{geom__vinum_8h_ae338f192dec3e4a3cfd3bc369a9a09dd}{gv\_provider\_is\_open}}(\mbox{\hyperlink{g__part__if_8m_a9bc7638f295763b77465c5ebebbd3442}{pp}})) \{}
\DoxyCodeLine{\Hypertarget{geom__vinum__rm_8c_source_l00213}00213                 \mbox{\hyperlink{geom__vinum_8h_a28cdbd7c30e435ff9ec8676f493593a0}{G\_VINUM\_DEBUG}}(0, \textcolor{stringliteral}{"{}unable to remove \%s: volume still in use"{}},}
\DoxyCodeLine{\Hypertarget{geom__vinum__rm_8c_source_l00214}00214                     v-\/>\mbox{\hyperlink{structgv__volume_a3369e150403037bca7ed34ea68f25ce0}{name}});}
\DoxyCodeLine{\Hypertarget{geom__vinum__rm_8c_source_l00215}00215                 \textcolor{keywordflow}{return};}
\DoxyCodeLine{\Hypertarget{geom__vinum__rm_8c_source_l00216}00216         \}}
\DoxyCodeLine{\Hypertarget{geom__vinum__rm_8c_source_l00217}00217 }
\DoxyCodeLine{\Hypertarget{geom__vinum__rm_8c_source_l00218}00218         \textcolor{comment}{/* Remove the plexes our volume has. */}}
\DoxyCodeLine{\Hypertarget{geom__vinum__rm_8c_source_l00219}00219         LIST\_FOREACH\_SAFE(p, \&v-\/>plexes, in\_volume, p2)}
\DoxyCodeLine{\Hypertarget{geom__vinum__rm_8c_source_l00220}00220                 \mbox{\hyperlink{geom__vinum__rm_8c_aaa3bd6c81346de6a35dd2bc16223e685}{gv\_rm\_plex}}(sc, p);}
\DoxyCodeLine{\Hypertarget{geom__vinum__rm_8c_source_l00221}00221 }
\DoxyCodeLine{\Hypertarget{geom__vinum__rm_8c_source_l00222}00222         \textcolor{comment}{/* Clean up. */}}
\DoxyCodeLine{\Hypertarget{geom__vinum__rm_8c_source_l00223}00223         LIST\_REMOVE(v, \mbox{\hyperlink{g__raid__tr__if_8m_a1b9eb8854031ced0905afde9f72c9ea8}{volume}});}
\DoxyCodeLine{\Hypertarget{geom__vinum__rm_8c_source_l00224}00224         \mbox{\hyperlink{geom_8h_ad9924deb20de7b40cb6cf06e5ae28855}{g\_free}}(v);}
\DoxyCodeLine{\Hypertarget{geom__vinum__rm_8c_source_l00225}00225 }
\DoxyCodeLine{\Hypertarget{geom__vinum__rm_8c_source_l00226}00226         \textcolor{comment}{/* Get rid of the volume's provider. */}}
\DoxyCodeLine{\Hypertarget{geom__vinum__rm_8c_source_l00227}00227         \textcolor{keywordflow}{if} (\mbox{\hyperlink{g__part__if_8m_a9bc7638f295763b77465c5ebebbd3442}{pp}} != NULL) \{}
\DoxyCodeLine{\Hypertarget{geom__vinum__rm_8c_source_l00228}00228                 \mbox{\hyperlink{geom_8h_a232419d2cfa06ff3f4ff7551041aed31}{g\_topology\_lock}}();}
\DoxyCodeLine{\Hypertarget{geom__vinum__rm_8c_source_l00229}00229                 \mbox{\hyperlink{geom_8h_a164882713025c4e0cc58b1ac8501bcf0}{g\_wither\_provider}}(\mbox{\hyperlink{g__part__if_8m_a9bc7638f295763b77465c5ebebbd3442}{pp}}, ENXIO);}
\DoxyCodeLine{\Hypertarget{geom__vinum__rm_8c_source_l00230}00230                 \mbox{\hyperlink{geom_8h_a4628d4de49ba84e7a6126cc30d23b83a}{g\_topology\_unlock}}();}
\DoxyCodeLine{\Hypertarget{geom__vinum__rm_8c_source_l00231}00231         \}}
\DoxyCodeLine{\Hypertarget{geom__vinum__rm_8c_source_l00232}00232 \}}
\DoxyCodeLine{\Hypertarget{geom__vinum__rm_8c_source_l00233}00233 }
\DoxyCodeLine{\Hypertarget{geom__vinum__rm_8c_source_l00234}00234 \textcolor{comment}{/* Remove a plex. */}}
\DoxyCodeLine{\Hypertarget{geom__vinum__rm_8c_source_l00235}00235 \textcolor{keywordtype}{void}}
\DoxyCodeLine{\Hypertarget{geom__vinum__rm_8c_source_l00236}\mbox{\hyperlink{geom__vinum_8h_a90d236f43d8a0f86cde32a89facbe562}{00236}} \mbox{\hyperlink{geom__vinum__rm_8c_aaa3bd6c81346de6a35dd2bc16223e685}{gv\_rm\_plex}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structgv__softc}{gv\_softc}} *sc, \textcolor{keyword}{struct} \mbox{\hyperlink{structgv__plex}{gv\_plex}} *p)}
\DoxyCodeLine{\Hypertarget{geom__vinum__rm_8c_source_l00237}00237 \{}
\DoxyCodeLine{\Hypertarget{geom__vinum__rm_8c_source_l00238}00238         \textcolor{keyword}{struct }\mbox{\hyperlink{structgv__volume}{gv\_volume}} *v;}
\DoxyCodeLine{\Hypertarget{geom__vinum__rm_8c_source_l00239}00239         \textcolor{keyword}{struct }\mbox{\hyperlink{structgv__sd}{gv\_sd}} *s, *s2;}
\DoxyCodeLine{\Hypertarget{geom__vinum__rm_8c_source_l00240}00240 }
\DoxyCodeLine{\Hypertarget{geom__vinum__rm_8c_source_l00241}00241         KASSERT(p != NULL, (\textcolor{stringliteral}{"{}gv\_rm\_plex: NULL p"{}}));}
\DoxyCodeLine{\Hypertarget{geom__vinum__rm_8c_source_l00242}00242         v = p-\/>\mbox{\hyperlink{structgv__plex_a8e2820d6bd8419d81213f77131d6bd5c}{vol\_sc}};}
\DoxyCodeLine{\Hypertarget{geom__vinum__rm_8c_source_l00243}00243 }
\DoxyCodeLine{\Hypertarget{geom__vinum__rm_8c_source_l00244}00244         \textcolor{comment}{/* Check if any of our consumers is open. */}}
\DoxyCodeLine{\Hypertarget{geom__vinum__rm_8c_source_l00245}00245         \textcolor{keywordflow}{if} (v != NULL \&\& \mbox{\hyperlink{geom__vinum_8h_ae338f192dec3e4a3cfd3bc369a9a09dd}{gv\_provider\_is\_open}}(v-\/>\mbox{\hyperlink{structgv__volume_a22436521ee96530c09a185172fb53bf7}{provider}}) \&\& v-\/>\mbox{\hyperlink{structgv__volume_a6a2fb4e2da02537035c219df64a65a80}{plexcount}} < 2) \{}
\DoxyCodeLine{\Hypertarget{geom__vinum__rm_8c_source_l00246}00246                 \mbox{\hyperlink{geom__vinum_8h_a28cdbd7c30e435ff9ec8676f493593a0}{G\_VINUM\_DEBUG}}(0, \textcolor{stringliteral}{"{}unable to remove \%s: volume still in use"{}},}
\DoxyCodeLine{\Hypertarget{geom__vinum__rm_8c_source_l00247}00247                     p-\/>\mbox{\hyperlink{structgv__plex_a0978e4d5dd271f5403af3cf98ae02103}{name}});}
\DoxyCodeLine{\Hypertarget{geom__vinum__rm_8c_source_l00248}00248                 \textcolor{keywordflow}{return};}
\DoxyCodeLine{\Hypertarget{geom__vinum__rm_8c_source_l00249}00249         \}}
\DoxyCodeLine{\Hypertarget{geom__vinum__rm_8c_source_l00250}00250 }
\DoxyCodeLine{\Hypertarget{geom__vinum__rm_8c_source_l00251}00251         \textcolor{comment}{/* Remove the subdisks our plex has. */}}
\DoxyCodeLine{\Hypertarget{geom__vinum__rm_8c_source_l00252}00252         LIST\_FOREACH\_SAFE(s, \&p-\/>subdisks, in\_plex, s2)}
\DoxyCodeLine{\Hypertarget{geom__vinum__rm_8c_source_l00253}00253                 \mbox{\hyperlink{geom__vinum__rm_8c_aa83ccb21c8d2400aa2418b127d78e7b2}{gv\_rm\_sd}}(sc, s);}
\DoxyCodeLine{\Hypertarget{geom__vinum__rm_8c_source_l00254}00254 }
\DoxyCodeLine{\Hypertarget{geom__vinum__rm_8c_source_l00255}00255         v = p-\/>\mbox{\hyperlink{structgv__plex_a8e2820d6bd8419d81213f77131d6bd5c}{vol\_sc}};}
\DoxyCodeLine{\Hypertarget{geom__vinum__rm_8c_source_l00256}00256         \textcolor{comment}{/* Clean up and let our geom fade away. */}}
\DoxyCodeLine{\Hypertarget{geom__vinum__rm_8c_source_l00257}00257         LIST\_REMOVE(p, \mbox{\hyperlink{structgv__sd_abc2c739f0fbd33ce2480d93752375f22}{plex}});}
\DoxyCodeLine{\Hypertarget{geom__vinum__rm_8c_source_l00258}00258         \textcolor{keywordflow}{if} (p-\/>\mbox{\hyperlink{structgv__plex_a8e2820d6bd8419d81213f77131d6bd5c}{vol\_sc}} != NULL) \{}
\DoxyCodeLine{\Hypertarget{geom__vinum__rm_8c_source_l00259}00259                 p-\/>\mbox{\hyperlink{structgv__plex_a8e2820d6bd8419d81213f77131d6bd5c}{vol\_sc}}-\/>\mbox{\hyperlink{structgv__volume_a6a2fb4e2da02537035c219df64a65a80}{plexcount}}-\/-\/;}
\DoxyCodeLine{\Hypertarget{geom__vinum__rm_8c_source_l00260}00260                 LIST\_REMOVE(p, in\_volume);}
\DoxyCodeLine{\Hypertarget{geom__vinum__rm_8c_source_l00261}00261                 p-\/>\mbox{\hyperlink{structgv__plex_a8e2820d6bd8419d81213f77131d6bd5c}{vol\_sc}} = NULL;}
\DoxyCodeLine{\Hypertarget{geom__vinum__rm_8c_source_l00262}00262                 \textcolor{comment}{/* Correctly update the volume size. */}}
\DoxyCodeLine{\Hypertarget{geom__vinum__rm_8c_source_l00263}00263                 \mbox{\hyperlink{geom__vinum_8h_a83711fe4cc9a2aacd2a0e0ef838a50a8}{gv\_update\_vol\_size}}(v, \mbox{\hyperlink{geom__vinum_8h_ab643e8ffd49bc6145637b3c31254d473}{gv\_vol\_size}}(v));}
\DoxyCodeLine{\Hypertarget{geom__vinum__rm_8c_source_l00264}00264         \}}
\DoxyCodeLine{\Hypertarget{geom__vinum__rm_8c_source_l00265}00265 }
\DoxyCodeLine{\Hypertarget{geom__vinum__rm_8c_source_l00266}00266         \mbox{\hyperlink{geom_8h_ad9924deb20de7b40cb6cf06e5ae28855}{g\_free}}(p);}
\DoxyCodeLine{\Hypertarget{geom__vinum__rm_8c_source_l00267}00267 \}}
\DoxyCodeLine{\Hypertarget{geom__vinum__rm_8c_source_l00268}00268 }
\DoxyCodeLine{\Hypertarget{geom__vinum__rm_8c_source_l00269}00269 \textcolor{comment}{/* Remove a subdisk. */}}
\DoxyCodeLine{\Hypertarget{geom__vinum__rm_8c_source_l00270}00270 \textcolor{keywordtype}{void}}
\DoxyCodeLine{\Hypertarget{geom__vinum__rm_8c_source_l00271}\mbox{\hyperlink{geom__vinum_8h_aa83ccb21c8d2400aa2418b127d78e7b2}{00271}} \mbox{\hyperlink{geom__vinum__rm_8c_aa83ccb21c8d2400aa2418b127d78e7b2}{gv\_rm\_sd}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structgv__softc}{gv\_softc}} *sc, \textcolor{keyword}{struct} \mbox{\hyperlink{structgv__sd}{gv\_sd}} *s)}
\DoxyCodeLine{\Hypertarget{geom__vinum__rm_8c_source_l00272}00272 \{}
\DoxyCodeLine{\Hypertarget{geom__vinum__rm_8c_source_l00273}00273         \textcolor{keyword}{struct }\mbox{\hyperlink{structgv__plex}{gv\_plex}} *p;}
\DoxyCodeLine{\Hypertarget{geom__vinum__rm_8c_source_l00274}00274         \textcolor{keyword}{struct }\mbox{\hyperlink{structgv__volume}{gv\_volume}} *v;}
\DoxyCodeLine{\Hypertarget{geom__vinum__rm_8c_source_l00275}00275 }
\DoxyCodeLine{\Hypertarget{geom__vinum__rm_8c_source_l00276}00276         KASSERT(s != NULL, (\textcolor{stringliteral}{"{}gv\_rm\_sd: NULL s"{}}));}
\DoxyCodeLine{\Hypertarget{geom__vinum__rm_8c_source_l00277}00277 }
\DoxyCodeLine{\Hypertarget{geom__vinum__rm_8c_source_l00278}00278         p = s-\/>\mbox{\hyperlink{structgv__sd_a6894be1eac4716d6eb2bd9e08b9643cf}{plex\_sc}};}
\DoxyCodeLine{\Hypertarget{geom__vinum__rm_8c_source_l00279}00279         v = NULL;}
\DoxyCodeLine{\Hypertarget{geom__vinum__rm_8c_source_l00280}00280 }
\DoxyCodeLine{\Hypertarget{geom__vinum__rm_8c_source_l00281}00281         \textcolor{comment}{/* Clean up. */}}
\DoxyCodeLine{\Hypertarget{geom__vinum__rm_8c_source_l00282}00282         \textcolor{keywordflow}{if} (p != NULL) \{}
\DoxyCodeLine{\Hypertarget{geom__vinum__rm_8c_source_l00283}00283                 LIST\_REMOVE(s, in\_plex);}
\DoxyCodeLine{\Hypertarget{geom__vinum__rm_8c_source_l00284}00284                 s-\/>\mbox{\hyperlink{structgv__sd_a6894be1eac4716d6eb2bd9e08b9643cf}{plex\_sc}} = NULL;}
\DoxyCodeLine{\Hypertarget{geom__vinum__rm_8c_source_l00285}00285                 p-\/>\mbox{\hyperlink{structgv__plex_ab8419aad736c119ac828740cce0e235c}{sdcount}}-\/-\/;}
\DoxyCodeLine{\Hypertarget{geom__vinum__rm_8c_source_l00286}00286                 \textcolor{comment}{/* Update the plexsize. */}}
\DoxyCodeLine{\Hypertarget{geom__vinum__rm_8c_source_l00287}00287                 p-\/>\mbox{\hyperlink{structgv__plex_ae8a3821966c400898f7dd237e0f678c8}{size}} = \mbox{\hyperlink{geom__vinum_8h_a7470ddc9972e31bf7d82f35bcc157d13}{gv\_plex\_size}}(p);}
\DoxyCodeLine{\Hypertarget{geom__vinum__rm_8c_source_l00288}00288                 v = p-\/>\mbox{\hyperlink{structgv__plex_a8e2820d6bd8419d81213f77131d6bd5c}{vol\_sc}};}
\DoxyCodeLine{\Hypertarget{geom__vinum__rm_8c_source_l00289}00289                 \textcolor{keywordflow}{if} (v != NULL) \{}
\DoxyCodeLine{\Hypertarget{geom__vinum__rm_8c_source_l00290}00290                         \textcolor{comment}{/* Update the size of our plex' volume. */}}
\DoxyCodeLine{\Hypertarget{geom__vinum__rm_8c_source_l00291}00291                         \mbox{\hyperlink{geom__vinum_8h_a83711fe4cc9a2aacd2a0e0ef838a50a8}{gv\_update\_vol\_size}}(v, \mbox{\hyperlink{geom__vinum_8h_ab643e8ffd49bc6145637b3c31254d473}{gv\_vol\_size}}(v));}
\DoxyCodeLine{\Hypertarget{geom__vinum__rm_8c_source_l00292}00292                 \}}
\DoxyCodeLine{\Hypertarget{geom__vinum__rm_8c_source_l00293}00293         \}}
\DoxyCodeLine{\Hypertarget{geom__vinum__rm_8c_source_l00294}00294         \textcolor{keywordflow}{if} (s-\/>\mbox{\hyperlink{structgv__sd_a2b31867e2118053e8a27ce048a84335e}{drive\_sc}} \&\& !(s-\/>\mbox{\hyperlink{structgv__sd_a2b31867e2118053e8a27ce048a84335e}{drive\_sc}}-\/>\mbox{\hyperlink{structgv__drive_a9786a03e20a91ab9c73a7aa93b90629a}{flags}} \& \mbox{\hyperlink{geom__vinum__var_8h_a2d0154c5734105d6367843e651300fa5}{GV\_DRIVE\_REFERENCED}}))}
\DoxyCodeLine{\Hypertarget{geom__vinum__rm_8c_source_l00295}00295                 LIST\_REMOVE(s, from\_drive);}
\DoxyCodeLine{\Hypertarget{geom__vinum__rm_8c_source_l00296}00296         LIST\_REMOVE(s, \mbox{\hyperlink{g__raid__md__if_8m_a910062273088d146e8533398780701eb}{sd}});}
\DoxyCodeLine{\Hypertarget{geom__vinum__rm_8c_source_l00297}00297         \mbox{\hyperlink{geom__vinum_8h_ab023e4c23b7d9333ad523ec0021e13cc}{gv\_free\_sd}}(s);}
\DoxyCodeLine{\Hypertarget{geom__vinum__rm_8c_source_l00298}00298         \mbox{\hyperlink{geom_8h_ad9924deb20de7b40cb6cf06e5ae28855}{g\_free}}(s);}
\DoxyCodeLine{\Hypertarget{geom__vinum__rm_8c_source_l00299}00299 \}}
\DoxyCodeLine{\Hypertarget{geom__vinum__rm_8c_source_l00300}00300 }
\DoxyCodeLine{\Hypertarget{geom__vinum__rm_8c_source_l00301}00301 \textcolor{comment}{/* Remove a drive. */}}
\DoxyCodeLine{\Hypertarget{geom__vinum__rm_8c_source_l00302}00302 \textcolor{keywordtype}{void}}
\DoxyCodeLine{\Hypertarget{geom__vinum__rm_8c_source_l00303}\mbox{\hyperlink{geom__vinum_8h_ab74e698f1907ce7a4111739b4567a011}{00303}} \mbox{\hyperlink{geom__vinum__rm_8c_ae24149b4e4657de43605433027b349e7}{gv\_rm\_drive}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structgv__softc}{gv\_softc}} *sc, \textcolor{keyword}{struct} \mbox{\hyperlink{structgv__drive}{gv\_drive}} *d, \textcolor{keywordtype}{int} \mbox{\hyperlink{structgv__volume_a152fb6b79767817e0c97ff08279501be}{flags}})}
\DoxyCodeLine{\Hypertarget{geom__vinum__rm_8c_source_l00304}00304 \{}
\DoxyCodeLine{\Hypertarget{geom__vinum__rm_8c_source_l00305}00305         \textcolor{keyword}{struct }\mbox{\hyperlink{structg__consumer}{g\_consumer}} *\mbox{\hyperlink{g__part__if_8m_a294f18324585ff37641fb8aa1c9ccd82}{cp}};}
\DoxyCodeLine{\Hypertarget{geom__vinum__rm_8c_source_l00306}00306         \textcolor{keyword}{struct }\mbox{\hyperlink{structgv__freelist}{gv\_freelist}} *fl, *fl2;}
\DoxyCodeLine{\Hypertarget{geom__vinum__rm_8c_source_l00307}00307         \textcolor{keyword}{struct }\mbox{\hyperlink{structgv__plex}{gv\_plex}} *p;}
\DoxyCodeLine{\Hypertarget{geom__vinum__rm_8c_source_l00308}00308         \textcolor{keyword}{struct }\mbox{\hyperlink{structgv__sd}{gv\_sd}} *s, *s2;}
\DoxyCodeLine{\Hypertarget{geom__vinum__rm_8c_source_l00309}00309         \textcolor{keyword}{struct }\mbox{\hyperlink{structgv__volume}{gv\_volume}} *v;}
\DoxyCodeLine{\Hypertarget{geom__vinum__rm_8c_source_l00310}00310         \textcolor{keyword}{struct }\mbox{\hyperlink{structgv__drive}{gv\_drive}} *d2;}
\DoxyCodeLine{\Hypertarget{geom__vinum__rm_8c_source_l00311}00311         \textcolor{keywordtype}{int} err;}
\DoxyCodeLine{\Hypertarget{geom__vinum__rm_8c_source_l00312}00312 }
\DoxyCodeLine{\Hypertarget{geom__vinum__rm_8c_source_l00313}00313         KASSERT(d != NULL, (\textcolor{stringliteral}{"{}gv\_rm\_drive: NULL d"{}}));}
\DoxyCodeLine{\Hypertarget{geom__vinum__rm_8c_source_l00314}00314 }
\DoxyCodeLine{\Hypertarget{geom__vinum__rm_8c_source_l00315}00315         \mbox{\hyperlink{g__part__if_8m_a294f18324585ff37641fb8aa1c9ccd82}{cp}} = d-\/>\mbox{\hyperlink{structgv__drive_a69dfc95c0bafb10b4239b5d45059e85d}{consumer}};}
\DoxyCodeLine{\Hypertarget{geom__vinum__rm_8c_source_l00316}00316 }
\DoxyCodeLine{\Hypertarget{geom__vinum__rm_8c_source_l00317}00317         \textcolor{keywordflow}{if} (\mbox{\hyperlink{g__part__if_8m_a294f18324585ff37641fb8aa1c9ccd82}{cp}} != NULL) \{}
\DoxyCodeLine{\Hypertarget{geom__vinum__rm_8c_source_l00318}00318                 \mbox{\hyperlink{geom_8h_a232419d2cfa06ff3f4ff7551041aed31}{g\_topology\_lock}}();}
\DoxyCodeLine{\Hypertarget{geom__vinum__rm_8c_source_l00319}00319                 err = \mbox{\hyperlink{geom_8h_a27b7c72cc3bc5a4d07ce5976e1aa1b58}{g\_access}}(\mbox{\hyperlink{g__part__if_8m_a294f18324585ff37641fb8aa1c9ccd82}{cp}}, 0, 1, 0);}
\DoxyCodeLine{\Hypertarget{geom__vinum__rm_8c_source_l00320}00320                 \mbox{\hyperlink{geom_8h_a4628d4de49ba84e7a6126cc30d23b83a}{g\_topology\_unlock}}();}
\DoxyCodeLine{\Hypertarget{geom__vinum__rm_8c_source_l00321}00321 }
\DoxyCodeLine{\Hypertarget{geom__vinum__rm_8c_source_l00322}00322                 \textcolor{keywordflow}{if} (err) \{}
\DoxyCodeLine{\Hypertarget{geom__vinum__rm_8c_source_l00323}00323                         \mbox{\hyperlink{geom__vinum_8h_a28cdbd7c30e435ff9ec8676f493593a0}{G\_VINUM\_DEBUG}}(0, \textcolor{stringliteral}{"{}\%s: unable to access '\%s', "{}}}
\DoxyCodeLine{\Hypertarget{geom__vinum__rm_8c_source_l00324}00324                             \textcolor{stringliteral}{"{}errno: \%d"{}}, \_\_func\_\_, \mbox{\hyperlink{g__part__if_8m_a294f18324585ff37641fb8aa1c9ccd82}{cp}}-\/>\mbox{\hyperlink{structg__consumer_a6435d5aec0376e995dce3131fd3beb52}{provider}}-\/>\mbox{\hyperlink{structg__provider_a2bffb416ee58cf4df7839c6fd5ec004a}{name}}, err);}
\DoxyCodeLine{\Hypertarget{geom__vinum__rm_8c_source_l00325}00325                         \textcolor{keywordflow}{return};}
\DoxyCodeLine{\Hypertarget{geom__vinum__rm_8c_source_l00326}00326                 \}}
\DoxyCodeLine{\Hypertarget{geom__vinum__rm_8c_source_l00327}00327 }
\DoxyCodeLine{\Hypertarget{geom__vinum__rm_8c_source_l00328}00328                 \textcolor{comment}{/* Clear the Vinum Magic. */}}
\DoxyCodeLine{\Hypertarget{geom__vinum__rm_8c_source_l00329}00329                 d-\/>\mbox{\hyperlink{structgv__drive_a22fd8c09eb90dd896835874d2a0c2601}{hdr}}-\/>\mbox{\hyperlink{structgv__hdr_a959aa1edaed399d2b4ba914ccecad4f4}{magic}} = \mbox{\hyperlink{geom__vinum__var_8h_a440f4f4e9444572bf991be69c1cd543d}{GV\_NOMAGIC}};}
\DoxyCodeLine{\Hypertarget{geom__vinum__rm_8c_source_l00330}00330                 err = \mbox{\hyperlink{geom__vinum_8h_af58328361d459df23c7f699bf193ff7c}{gv\_write\_header}}(\mbox{\hyperlink{g__part__if_8m_a294f18324585ff37641fb8aa1c9ccd82}{cp}}, d-\/>\mbox{\hyperlink{structgv__drive_a22fd8c09eb90dd896835874d2a0c2601}{hdr}});}
\DoxyCodeLine{\Hypertarget{geom__vinum__rm_8c_source_l00331}00331                 \textcolor{keywordflow}{if} (err)}
\DoxyCodeLine{\Hypertarget{geom__vinum__rm_8c_source_l00332}00332                         \mbox{\hyperlink{geom__vinum_8h_a28cdbd7c30e435ff9ec8676f493593a0}{G\_VINUM\_DEBUG}}(0, \textcolor{stringliteral}{"{}gv\_rm\_drive: error writing header to"{}}}
\DoxyCodeLine{\Hypertarget{geom__vinum__rm_8c_source_l00333}00333                             \textcolor{stringliteral}{"{} '\%s', errno: \%d"{}}, \mbox{\hyperlink{g__part__if_8m_a294f18324585ff37641fb8aa1c9ccd82}{cp}}-\/>\mbox{\hyperlink{structg__consumer_a6435d5aec0376e995dce3131fd3beb52}{provider}}-\/>\mbox{\hyperlink{structg__provider_a2bffb416ee58cf4df7839c6fd5ec004a}{name}}, err);}
\DoxyCodeLine{\Hypertarget{geom__vinum__rm_8c_source_l00334}00334 }
\DoxyCodeLine{\Hypertarget{geom__vinum__rm_8c_source_l00335}00335                 \mbox{\hyperlink{geom_8h_a232419d2cfa06ff3f4ff7551041aed31}{g\_topology\_lock}}();}
\DoxyCodeLine{\Hypertarget{geom__vinum__rm_8c_source_l00336}00336                 \mbox{\hyperlink{geom_8h_a27b7c72cc3bc5a4d07ce5976e1aa1b58}{g\_access}}(\mbox{\hyperlink{g__part__if_8m_a294f18324585ff37641fb8aa1c9ccd82}{cp}}, -\/\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__rm_8c_source_l00337}00337                 \mbox{\hyperlink{geom_8h_a037802c2ec5d43fcf1222215f9f8a735}{g\_detach}}(\mbox{\hyperlink{g__part__if_8m_a294f18324585ff37641fb8aa1c9ccd82}{cp}});}
\DoxyCodeLine{\Hypertarget{geom__vinum__rm_8c_source_l00338}00338                 \mbox{\hyperlink{geom_8h_a9f53f6118c5e44ca2bcbd7ae548597b9}{g\_destroy\_consumer}}(\mbox{\hyperlink{g__part__if_8m_a294f18324585ff37641fb8aa1c9ccd82}{cp}});}
\DoxyCodeLine{\Hypertarget{geom__vinum__rm_8c_source_l00339}00339                 \mbox{\hyperlink{geom_8h_a4628d4de49ba84e7a6126cc30d23b83a}{g\_topology\_unlock}}();}
\DoxyCodeLine{\Hypertarget{geom__vinum__rm_8c_source_l00340}00340         \}}
\DoxyCodeLine{\Hypertarget{geom__vinum__rm_8c_source_l00341}00341 }
\DoxyCodeLine{\Hypertarget{geom__vinum__rm_8c_source_l00342}00342         \textcolor{comment}{/* Remove all associated subdisks, plexes, volumes. */}}
\DoxyCodeLine{\Hypertarget{geom__vinum__rm_8c_source_l00343}00343         \textcolor{keywordflow}{if} (\mbox{\hyperlink{structgv__drive_a9786a03e20a91ab9c73a7aa93b90629a}{flags}} \& \mbox{\hyperlink{geom__vinum__var_8h_a99744114a3bac7a8fa5e51db81837c3d}{GV\_FLAG\_R}}) \{}
\DoxyCodeLine{\Hypertarget{geom__vinum__rm_8c_source_l00344}00344                 \textcolor{keywordflow}{if} (!LIST\_EMPTY(\&d-\/>subdisks)) \{}
\DoxyCodeLine{\Hypertarget{geom__vinum__rm_8c_source_l00345}00345                         LIST\_FOREACH\_SAFE(s, \&d-\/>subdisks, from\_drive, s2) \{}
\DoxyCodeLine{\Hypertarget{geom__vinum__rm_8c_source_l00346}00346                                 p = s-\/>\mbox{\hyperlink{structgv__sd_a6894be1eac4716d6eb2bd9e08b9643cf}{plex\_sc}};}
\DoxyCodeLine{\Hypertarget{geom__vinum__rm_8c_source_l00347}00347                                 \textcolor{keywordflow}{if} (p != NULL) \{}
\DoxyCodeLine{\Hypertarget{geom__vinum__rm_8c_source_l00348}00348                                         v = p-\/>\mbox{\hyperlink{structgv__plex_a8e2820d6bd8419d81213f77131d6bd5c}{vol\_sc}};}
\DoxyCodeLine{\Hypertarget{geom__vinum__rm_8c_source_l00349}00349                                         \textcolor{keywordflow}{if} (v != NULL)}
\DoxyCodeLine{\Hypertarget{geom__vinum__rm_8c_source_l00350}00350                                                 \mbox{\hyperlink{geom__vinum__rm_8c_aa9b9b78154dec808ba7968b5644b6adc}{gv\_rm\_vol}}(sc, v);}
\DoxyCodeLine{\Hypertarget{geom__vinum__rm_8c_source_l00351}00351                                 \}}
\DoxyCodeLine{\Hypertarget{geom__vinum__rm_8c_source_l00352}00352                         \}}
\DoxyCodeLine{\Hypertarget{geom__vinum__rm_8c_source_l00353}00353                 \}}
\DoxyCodeLine{\Hypertarget{geom__vinum__rm_8c_source_l00354}00354         \}}
\DoxyCodeLine{\Hypertarget{geom__vinum__rm_8c_source_l00355}00355 }
\DoxyCodeLine{\Hypertarget{geom__vinum__rm_8c_source_l00356}00356         \textcolor{comment}{/* Clean up. */}}
\DoxyCodeLine{\Hypertarget{geom__vinum__rm_8c_source_l00357}00357         LIST\_FOREACH\_SAFE(fl, \&d-\/>freelist, freelist, fl2) \{}
\DoxyCodeLine{\Hypertarget{geom__vinum__rm_8c_source_l00358}00358                 LIST\_REMOVE(fl, freelist);}
\DoxyCodeLine{\Hypertarget{geom__vinum__rm_8c_source_l00359}00359                 \mbox{\hyperlink{geom_8h_ad9924deb20de7b40cb6cf06e5ae28855}{g\_free}}(fl);}
\DoxyCodeLine{\Hypertarget{geom__vinum__rm_8c_source_l00360}00360         \}}
\DoxyCodeLine{\Hypertarget{geom__vinum__rm_8c_source_l00361}00361 }
\DoxyCodeLine{\Hypertarget{geom__vinum__rm_8c_source_l00362}00362         LIST\_REMOVE(d, drive);}
\DoxyCodeLine{\Hypertarget{geom__vinum__rm_8c_source_l00363}00363         \mbox{\hyperlink{geom_8h_ad9924deb20de7b40cb6cf06e5ae28855}{g\_free}}(d-\/>\mbox{\hyperlink{structgv__drive_a22fd8c09eb90dd896835874d2a0c2601}{hdr}});}
\DoxyCodeLine{\Hypertarget{geom__vinum__rm_8c_source_l00364}00364 }
\DoxyCodeLine{\Hypertarget{geom__vinum__rm_8c_source_l00365}00365         \textcolor{comment}{/* Put ourself into referenced state if we have subdisks. */}}
\DoxyCodeLine{\Hypertarget{geom__vinum__rm_8c_source_l00366}00366         \textcolor{keywordflow}{if} (d-\/>\mbox{\hyperlink{structgv__drive_a8a8479a25677d4bf6bb239b9fe906a8f}{sdcount}} > 0) \{}
\DoxyCodeLine{\Hypertarget{geom__vinum__rm_8c_source_l00367}00367                 d-\/>\mbox{\hyperlink{structgv__drive_a69dfc95c0bafb10b4239b5d45059e85d}{consumer}} = NULL;}
\DoxyCodeLine{\Hypertarget{geom__vinum__rm_8c_source_l00368}00368                 d-\/>\mbox{\hyperlink{structgv__drive_a22fd8c09eb90dd896835874d2a0c2601}{hdr}} = NULL;}
\DoxyCodeLine{\Hypertarget{geom__vinum__rm_8c_source_l00369}00369                 d-\/>\mbox{\hyperlink{structgv__drive_a9786a03e20a91ab9c73a7aa93b90629a}{flags}} |= \mbox{\hyperlink{geom__vinum__var_8h_a2d0154c5734105d6367843e651300fa5}{GV\_DRIVE\_REFERENCED}};}
\DoxyCodeLine{\Hypertarget{geom__vinum__rm_8c_source_l00370}00370                 snprintf(d-\/>\mbox{\hyperlink{structgv__drive_a940421a9537b8ce86596e18365122ae6}{device}}, \textcolor{keyword}{sizeof}(d-\/>\mbox{\hyperlink{structgv__drive_a940421a9537b8ce86596e18365122ae6}{device}}), \textcolor{stringliteral}{"{}???"{}});}
\DoxyCodeLine{\Hypertarget{geom__vinum__rm_8c_source_l00371}00371                 d-\/>\mbox{\hyperlink{structgv__drive_ad8cfe06dc5d399ff13ee2037c9731050}{size}} = 0;}
\DoxyCodeLine{\Hypertarget{geom__vinum__rm_8c_source_l00372}00372                 d-\/>\mbox{\hyperlink{structgv__drive_abb6ee3ed5a472c5e12dd25fc9991e5a3}{avail}} = 0;}
\DoxyCodeLine{\Hypertarget{geom__vinum__rm_8c_source_l00373}00373                 d-\/>\mbox{\hyperlink{structgv__drive_a01732fd038eda27dfcc68fd2972bb725}{freelist\_entries}} = 0;}
\DoxyCodeLine{\Hypertarget{geom__vinum__rm_8c_source_l00374}00374                 LIST\_FOREACH(s, \&d-\/>subdisks, from\_drive) \{}
\DoxyCodeLine{\Hypertarget{geom__vinum__rm_8c_source_l00375}00375                         s-\/>\mbox{\hyperlink{structgv__sd_a84a4472842dd92c5ebcf7b103be32c90}{flags}} |= \mbox{\hyperlink{geom__vinum__var_8h_a6afc2a50dc71d53a4aa15f84eac2c254}{GV\_SD\_TASTED}};}
\DoxyCodeLine{\Hypertarget{geom__vinum__rm_8c_source_l00376}00376                         \mbox{\hyperlink{geom__vinum_8h_a2dc4176c195982e77ba79874f999300e}{gv\_set\_sd\_state}}(s, \mbox{\hyperlink{geom__vinum__var_8h_a397e4bbebbaca115ef30ebb13a9d18bf}{GV\_SD\_DOWN}}, \mbox{\hyperlink{geom__vinum__var_8h_aff3aa8190eaa79b37017c0a247c4bfb9}{GV\_SETSTATE\_FORCE}});}
\DoxyCodeLine{\Hypertarget{geom__vinum__rm_8c_source_l00377}00377                 \}}
\DoxyCodeLine{\Hypertarget{geom__vinum__rm_8c_source_l00378}00378                 \textcolor{comment}{/* Shuffle around so we keep gv\_is\_newer happy. */}}
\DoxyCodeLine{\Hypertarget{geom__vinum__rm_8c_source_l00379}00379                 LIST\_REMOVE(d, drive);}
\DoxyCodeLine{\Hypertarget{geom__vinum__rm_8c_source_l00380}00380                 d2 = LIST\_FIRST(\&sc-\/>drives);}
\DoxyCodeLine{\Hypertarget{geom__vinum__rm_8c_source_l00381}00381                 \textcolor{keywordflow}{if} (d2 == NULL)}
\DoxyCodeLine{\Hypertarget{geom__vinum__rm_8c_source_l00382}00382                         LIST\_INSERT\_HEAD(\&sc-\/>drives, d, drive);}
\DoxyCodeLine{\Hypertarget{geom__vinum__rm_8c_source_l00383}00383                 \textcolor{keywordflow}{else}}
\DoxyCodeLine{\Hypertarget{geom__vinum__rm_8c_source_l00384}00384                         LIST\_INSERT\_AFTER(d2, d, drive);}
\DoxyCodeLine{\Hypertarget{geom__vinum__rm_8c_source_l00385}00385                 \textcolor{keywordflow}{return};}
\DoxyCodeLine{\Hypertarget{geom__vinum__rm_8c_source_l00386}00386         \}}
\DoxyCodeLine{\Hypertarget{geom__vinum__rm_8c_source_l00387}00387         \mbox{\hyperlink{geom_8h_ad9924deb20de7b40cb6cf06e5ae28855}{g\_free}}(d);}
\DoxyCodeLine{\Hypertarget{geom__vinum__rm_8c_source_l00388}00388 }
\DoxyCodeLine{\Hypertarget{geom__vinum__rm_8c_source_l00389}00389         \mbox{\hyperlink{geom__vinum_8h_a893e3b157c798b3f925d71151d284dd9}{gv\_save\_config}}(sc);}
\DoxyCodeLine{\Hypertarget{geom__vinum__rm_8c_source_l00390}00390 \}}

\end{DoxyCode}
