\hypertarget{g__mirror__ctl_8c_source}{}\doxysection{g\+\_\+mirror\+\_\+ctl.\+c}
\label{g__mirror__ctl_8c_source}\index{geom/mirror/g\_mirror\_ctl.c@{geom/mirror/g\_mirror\_ctl.c}}
\mbox{\hyperlink{g__mirror__ctl_8c}{Go to the documentation of this file.}}
\begin{DoxyCode}{0}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00001}00001 \textcolor{comment}{/*-\/}}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00002}00002 \textcolor{comment}{ * SPDX-\/License-\/Identifier: BSD-\/2-\/Clause-\/FreeBSD}}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00003}00003 \textcolor{comment}{ *}}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00004}00004 \textcolor{comment}{ * Copyright (c) 2004-\/2009 Pawel Jakub Dawidek <pjd@FreeBSD.org>}}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00005}00005 \textcolor{comment}{ * All rights reserved.}}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00006}00006 \textcolor{comment}{ *}}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00007}00007 \textcolor{comment}{ * Redistribution and use in source and binary forms, with or without}}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00008}00008 \textcolor{comment}{ * modification, are permitted provided that the following conditions}}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00009}00009 \textcolor{comment}{ * are met:}}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00010}00010 \textcolor{comment}{ * 1. Redistributions of source code must retain the above copyright}}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00011}00011 \textcolor{comment}{ *    notice, this list of conditions and the following disclaimer.}}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00012}00012 \textcolor{comment}{ * 2. Redistributions in binary form must reproduce the above copyright}}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00013}00013 \textcolor{comment}{ *    notice, this list of conditions and the following disclaimer in the}}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00014}00014 \textcolor{comment}{ *    documentation and/or other materials provided with the distribution.}}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00015}00015 \textcolor{comment}{ *}}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00016}00016 \textcolor{comment}{ * THIS SOFTWARE IS PROVIDED BY THE AUTHORS AND CONTRIBUTORS ``AS IS'' AND}}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00017}00017 \textcolor{comment}{ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE}}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00018}00018 \textcolor{comment}{ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE}}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00019}00019 \textcolor{comment}{ * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHORS OR CONTRIBUTORS BE LIABLE}}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00020}00020 \textcolor{comment}{ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL}}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00021}00021 \textcolor{comment}{ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS}}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00022}00022 \textcolor{comment}{ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)}}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00023}00023 \textcolor{comment}{ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT}}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00024}00024 \textcolor{comment}{ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY}}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00025}00025 \textcolor{comment}{ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF}}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00026}00026 \textcolor{comment}{ * SUCH DAMAGE.}}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00027}00027 \textcolor{comment}{ */}}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00028}00028 }
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00029}00029 \textcolor{preprocessor}{\#include <sys/cdefs.h>}}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00030}\mbox{\hyperlink{g__mirror__ctl_8c_a8c3ef283470a68cd30afe9b8a72cb60f}{00030}} \mbox{\hyperlink{g__mirror__ctl_8c_a8c3ef283470a68cd30afe9b8a72cb60f}{\_\_FBSDID}}(\textcolor{stringliteral}{"{}\$FreeBSD\$"{}});}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00031}00031 }
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00032}00032 \textcolor{preprocessor}{\#include <sys/param.h>}}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00033}00033 \textcolor{preprocessor}{\#include <sys/systm.h>}}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00034}00034 \textcolor{preprocessor}{\#include <sys/bio.h>}}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00035}00035 \textcolor{preprocessor}{\#include <sys/kernel.h>}}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00036}00036 \textcolor{preprocessor}{\#include <sys/limits.h>}}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00037}00037 \textcolor{preprocessor}{\#include <sys/lock.h>}}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00038}00038 \textcolor{preprocessor}{\#include <sys/malloc.h>}}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00039}00039 \textcolor{preprocessor}{\#include <sys/sbuf.h>}}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00040}00040 \textcolor{preprocessor}{\#include <sys/sx.h>}}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00041}00041 }
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00042}00042 \textcolor{preprocessor}{\#include <\mbox{\hyperlink{geom_8h}{geom/geom.h}}>}}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00043}00043 \textcolor{preprocessor}{\#include <\mbox{\hyperlink{geom__dbg_8h}{geom/geom\_dbg.h}}>}}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00044}00044 \textcolor{preprocessor}{\#include <\mbox{\hyperlink{geom__int_8h}{geom/geom\_int.h}}>}}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00045}00045 \textcolor{preprocessor}{\#include <\mbox{\hyperlink{g__mirror_8h}{geom/mirror/g\_mirror.h}}>}}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00046}00046 }
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00047}00047 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00048}00048 \textcolor{comment}{ * Configure, Rebuild, Remove, Deactivate, Forget, and Stop operations do not}}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00049}00049 \textcolor{comment}{ * seem to depend on any particular g\_mirror initialization state.}}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00050}00050 \textcolor{comment}{ */}}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00051}00051 \textcolor{keyword}{static} \textcolor{keyword}{struct }\mbox{\hyperlink{structg__mirror__softc}{g\_mirror\_softc}} *}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00052}\mbox{\hyperlink{g__mirror__ctl_8c_aa3363d3c57f61394b21d8bb4bab23f2d}{00052}} \mbox{\hyperlink{g__mirror__ctl_8c_aa3363d3c57f61394b21d8bb4bab23f2d}{g\_mirror\_find\_device}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structg__class}{g\_class}} *\mbox{\hyperlink{g__raid__md__if_8m_a4f7502795edfd2493d3d223d0df33e1d}{mp}}, \textcolor{keyword}{const} \textcolor{keywordtype}{char} *\mbox{\hyperlink{g__part__if_8m_aff5d3acc33944ecb11914d04ef06bb54}{name}})}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00053}00053 \{}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00054}00054         \textcolor{keyword}{struct }\mbox{\hyperlink{structg__mirror__softc}{g\_mirror\_softc}} *sc;}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00055}00055         \textcolor{keyword}{struct }\mbox{\hyperlink{structg__geom}{g\_geom}} *\mbox{\hyperlink{g__part__if_8m_abdc908a08b24cd2e589de2f44e40eeb9}{gp}};}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00056}00056 }
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00057}00057         \mbox{\hyperlink{geom_8h_a232419d2cfa06ff3f4ff7551041aed31}{g\_topology\_lock}}();}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00058}00058         LIST\_FOREACH(\mbox{\hyperlink{g__part__if_8m_abdc908a08b24cd2e589de2f44e40eeb9}{gp}}, \&\mbox{\hyperlink{g__raid__md__if_8m_a4f7502795edfd2493d3d223d0df33e1d}{mp}}-\/>geom, geom) \{}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00059}00059                 sc = \mbox{\hyperlink{g__part__if_8m_abdc908a08b24cd2e589de2f44e40eeb9}{gp}}-\/>\mbox{\hyperlink{structg__geom_aa83c08c83459420f6cbcfe64c6099466}{softc}};}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00060}00060                 \textcolor{keywordflow}{if} (sc == NULL)}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00061}00061                         \textcolor{keywordflow}{continue};}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00062}00062                 \textcolor{keywordflow}{if} ((sc-\/>\mbox{\hyperlink{structg__mirror__softc_a6410883ee8eaf5dd18800e30710173a7}{sc\_flags}} \& \mbox{\hyperlink{g__mirror_8h_ab35b7bf2d1f11b2d5bf05eeae5a11638}{G\_MIRROR\_DEVICE\_FLAG\_DESTROY}}) != 0)}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00063}00063                         \textcolor{keywordflow}{continue};}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00064}00064                 \textcolor{keywordflow}{if} (strcmp(\mbox{\hyperlink{g__part__if_8m_abdc908a08b24cd2e589de2f44e40eeb9}{gp}}-\/>\mbox{\hyperlink{structg__geom_af64450500f1fea18f639b191a5017107}{name}}, \mbox{\hyperlink{g__part__if_8m_aff5d3acc33944ecb11914d04ef06bb54}{name}}) == 0 ||}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00065}00065                     strcmp(sc-\/>sc\_name, \mbox{\hyperlink{g__part__if_8m_aff5d3acc33944ecb11914d04ef06bb54}{name}}) == 0) \{}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00066}00066                         \mbox{\hyperlink{geom_8h_a4628d4de49ba84e7a6126cc30d23b83a}{g\_topology\_unlock}}();}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00067}00067                         sx\_xlock(\&sc-\/>\mbox{\hyperlink{structg__mirror__softc_a98662cf0fd52070bda584f4fa296b1cb}{sc\_lock}});}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00068}00068                         \textcolor{keywordflow}{if} ((sc-\/>\mbox{\hyperlink{structg__mirror__softc_a6410883ee8eaf5dd18800e30710173a7}{sc\_flags}} \& \mbox{\hyperlink{g__mirror_8h_ab35b7bf2d1f11b2d5bf05eeae5a11638}{G\_MIRROR\_DEVICE\_FLAG\_DESTROY}}) != 0) \{}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00069}00069                                 sx\_xunlock(\&sc-\/>\mbox{\hyperlink{structg__mirror__softc_a98662cf0fd52070bda584f4fa296b1cb}{sc\_lock}});}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00070}00070                                 \textcolor{keywordflow}{return} (NULL);}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00071}00071                         \}}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00072}00072                         \textcolor{keywordflow}{return} (sc);}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00073}00073                 \}}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00074}00074         \}}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00075}00075         \mbox{\hyperlink{geom_8h_a4628d4de49ba84e7a6126cc30d23b83a}{g\_topology\_unlock}}();}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00076}00076         \textcolor{keywordflow}{return} (NULL);}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00077}00077 \}}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00078}00078 }
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00079}00079 \textcolor{comment}{/* Insert and Resize operations depend on a launched GEOM (sc\_provider). */}}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00080}\mbox{\hyperlink{g__mirror__ctl_8c_a8e3ec8d8607d523537855c85d87a4c61}{00080}} \textcolor{preprocessor}{\#define GMFL\_VALID\_FLAGS        (M\_WAITOK | M\_NOWAIT)}}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00081}00081 \textcolor{keyword}{static} \textcolor{keyword}{struct }\mbox{\hyperlink{structg__mirror__softc}{g\_mirror\_softc}} *}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00082}\mbox{\hyperlink{g__mirror__ctl_8c_a739b03f28bf90ca61c27b6f056725d91}{00082}} \mbox{\hyperlink{g__mirror__ctl_8c_a739b03f28bf90ca61c27b6f056725d91}{g\_mirror\_find\_launched\_device}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structg__class}{g\_class}} *\mbox{\hyperlink{g__raid__md__if_8m_a4f7502795edfd2493d3d223d0df33e1d}{mp}}, \textcolor{keyword}{const} \textcolor{keywordtype}{char} *\mbox{\hyperlink{g__part__if_8m_aff5d3acc33944ecb11914d04ef06bb54}{name}}, \textcolor{keywordtype}{int} flags)}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00083}00083 \{}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00084}00084         \textcolor{keyword}{struct }\mbox{\hyperlink{structg__mirror__softc}{g\_mirror\_softc}} *sc;}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00085}00085         \textcolor{keywordtype}{int} error;}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00086}00086 }
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00087}00087         KASSERT((flags \& \string~\mbox{\hyperlink{g__mirror__ctl_8c_a8e3ec8d8607d523537855c85d87a4c61}{GMFL\_VALID\_FLAGS}}) == 0 \&\&}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00088}00088             flags != \mbox{\hyperlink{g__mirror__ctl_8c_a8e3ec8d8607d523537855c85d87a4c61}{GMFL\_VALID\_FLAGS}} \&\& flags != 0,}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00089}00089             (\textcolor{stringliteral}{"{}\%s: Invalid flags \%x\(\backslash\)n"{}}, \_\_func\_\_, (\textcolor{keywordtype}{unsigned})flags));}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00090}00090 \textcolor{preprocessor}{\#undef  GMFL\_VALID\_FLAGS}}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00091}00091 }
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00092}00092         \textcolor{keywordflow}{while} (\textcolor{keyword}{true}) \{}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00093}00093                 sc = \mbox{\hyperlink{g__mirror__ctl_8c_aa3363d3c57f61394b21d8bb4bab23f2d}{g\_mirror\_find\_device}}(\mbox{\hyperlink{g__raid__md__if_8m_a4f7502795edfd2493d3d223d0df33e1d}{mp}}, \mbox{\hyperlink{g__part__if_8m_aff5d3acc33944ecb11914d04ef06bb54}{name}});}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00094}00094                 \textcolor{keywordflow}{if} (sc == NULL)}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00095}00095                         \textcolor{keywordflow}{return} (NULL);}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00096}00096                 \textcolor{keywordflow}{if} (sc-\/>\mbox{\hyperlink{structg__mirror__softc_a724ce95b57685af7d1dc8d810c5ed256}{sc\_provider}} != NULL)}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00097}00097                         \textcolor{keywordflow}{return} (sc);}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00098}00098                 \textcolor{keywordflow}{if} (flags \& M\_NOWAIT) \{}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00099}00099                         sx\_xunlock(\&sc-\/>\mbox{\hyperlink{structg__mirror__softc_a98662cf0fd52070bda584f4fa296b1cb}{sc\_lock}});}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00100}00100                         \textcolor{keywordflow}{return} (NULL);}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00101}00101                 \}}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00102}00102 }
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00103}00103                 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00104}00104 \textcolor{comment}{                 * This is a dumb hack.  G\_mirror does not expose any real}}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00105}00105 \textcolor{comment}{                 * wakeup API for observing state changes, and even if it did,}}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00106}00106 \textcolor{comment}{                 * its "{}RUNNING"{} state does not actually reflect all softc}}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00107}00107 \textcolor{comment}{                 * elements being initialized.}}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00108}00108 \textcolor{comment}{                 *}}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00109}00109 \textcolor{comment}{                 * Revamping g\_mirror to have a 3rd, ACTUALLY\_RUNNING state and}}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00110}00110 \textcolor{comment}{                 * updating all assertions and sc\_state checks is a large work}}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00111}00111 \textcolor{comment}{                 * and would be easy to introduce regressions.}}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00112}00112 \textcolor{comment}{                 *}}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00113}00113 \textcolor{comment}{                 * Revamping g\_mirror to have a wakeup for state changes would}}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00114}00114 \textcolor{comment}{                 * be difficult if one wanted to capture more than just}}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00115}00115 \textcolor{comment}{                 * sc\_state and sc\_provider.}}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00116}00116 \textcolor{comment}{                 *}}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00117}00117 \textcolor{comment}{                 * For now, just dummy sleep-\/poll until sc\_provider shows up,}}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00118}00118 \textcolor{comment}{                 * the user cancels, or the g\_mirror is destroyed.}}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00119}00119 \textcolor{comment}{                 */}}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00120}00120                 error = sx\_sleep(\&sc, \&sc-\/>\mbox{\hyperlink{structg__mirror__softc_a98662cf0fd52070bda584f4fa296b1cb}{sc\_lock}}, PRIBIO | PCATCH | PDROP,}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00121}00121                     \textcolor{stringliteral}{"{}GM:launched"{}}, 1);}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00122}00122                 \textcolor{keywordflow}{if} (error != 0 \&\& error != EWOULDBLOCK)}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00123}00123                         \textcolor{keywordflow}{return} (NULL);}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00124}00124         \}}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00125}00125         \_\_unreachable();}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00126}00126 \}}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00127}00127 }
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00128}00128 \textcolor{keyword}{static} \textcolor{keyword}{struct }\mbox{\hyperlink{structg__mirror__disk}{g\_mirror\_disk}} *}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00129}\mbox{\hyperlink{g__mirror__ctl_8c_a48ca9cc413729437685bdc5bf1f589fe}{00129}} \mbox{\hyperlink{g__mirror__ctl_8c_a48ca9cc413729437685bdc5bf1f589fe}{g\_mirror\_find\_disk}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structg__mirror__softc}{g\_mirror\_softc}} *sc, \textcolor{keyword}{const} \textcolor{keywordtype}{char} *\mbox{\hyperlink{g__part__if_8m_aff5d3acc33944ecb11914d04ef06bb54}{name}})}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00130}00130 \{}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00131}00131         \textcolor{keyword}{struct }\mbox{\hyperlink{structg__mirror__disk}{g\_mirror\_disk}} *\mbox{\hyperlink{g__raid__md__if_8m_a9508e997a57ea259d6ecc0e563261993}{disk}};}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00132}00132 }
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00133}00133         sx\_assert(\&sc-\/>\mbox{\hyperlink{structg__mirror__softc_a98662cf0fd52070bda584f4fa296b1cb}{sc\_lock}}, SX\_XLOCKED);}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00134}00134         \textcolor{keywordflow}{if} (strncmp(\mbox{\hyperlink{g__part__if_8m_aff5d3acc33944ecb11914d04ef06bb54}{name}}, \mbox{\hyperlink{geom_8h_a9e429780e6e3bb32284b54630bc60a0d}{\_PATH\_DEV}}, 5) == 0)}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00135}00135                 \mbox{\hyperlink{g__part__if_8m_aff5d3acc33944ecb11914d04ef06bb54}{name}} += 5;}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00136}00136         LIST\_FOREACH(\mbox{\hyperlink{structdisk}{disk}}, \&sc-\/>sc\_disks, d\_next) \{}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00137}00137                 \textcolor{keywordflow}{if} (\mbox{\hyperlink{structdisk}{disk}}-\/>d\_consumer == NULL)}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00138}00138                         \textcolor{keywordflow}{continue};}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00139}00139                 \textcolor{keywordflow}{if} (\mbox{\hyperlink{structdisk}{disk}}-\/>d\_consumer-\/>provider == NULL)}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00140}00140                         \textcolor{keywordflow}{continue};}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00141}00141                 \textcolor{keywordflow}{if} (strcmp(\mbox{\hyperlink{structdisk}{disk}}-\/>d\_consumer-\/>provider-\/>name, \mbox{\hyperlink{g__part__if_8m_aff5d3acc33944ecb11914d04ef06bb54}{name}}) == 0)}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00142}00142                         \textcolor{keywordflow}{return} (\mbox{\hyperlink{structdisk}{disk}});}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00143}00143         \}}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00144}00144         \textcolor{keywordflow}{return} (NULL);}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00145}00145 \}}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00146}00146 }
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00147}00147 \textcolor{keyword}{static} \textcolor{keywordtype}{void}}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00148}\mbox{\hyperlink{g__mirror__ctl_8c_a912fb4413b910780230b849d0507a46f}{00148}} \mbox{\hyperlink{g__mirror__ctl_8c_a912fb4413b910780230b849d0507a46f}{g\_mirror\_ctl\_configure}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structgctl__req}{gctl\_req}} *\mbox{\hyperlink{g__part__if_8m_a7a9f20c97e75f805eb506910bd3e70d3}{req}}, \textcolor{keyword}{struct} \mbox{\hyperlink{structg__class}{g\_class}} *\mbox{\hyperlink{g__raid__md__if_8m_a4f7502795edfd2493d3d223d0df33e1d}{mp}})}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00149}00149 \{}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00150}00150         \textcolor{keyword}{struct }\mbox{\hyperlink{structg__mirror__softc}{g\_mirror\_softc}} *sc;}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00151}00151         \textcolor{keyword}{struct }\mbox{\hyperlink{structg__mirror__disk}{g\_mirror\_disk}} *\mbox{\hyperlink{g__raid__md__if_8m_a9508e997a57ea259d6ecc0e563261993}{disk}};}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00152}00152         \textcolor{keyword}{const} \textcolor{keywordtype}{char} *\mbox{\hyperlink{g__part__if_8m_aff5d3acc33944ecb11914d04ef06bb54}{name}}, *balancep, *prov;}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00153}00153         intmax\_t *slicep, *priority;}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00154}00154         uint32\_t slice;}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00155}00155         \mbox{\hyperlink{binstream_8h_ab077fa1127453be2bd9d4c3c8a768fa7}{uint8\_t}} balance;}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00156}00156         \textcolor{keywordtype}{int} *autosync, *noautosync, *failsync, *nofailsync, *hardcode, *dynamic;}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00157}00157         \textcolor{keywordtype}{int} *nargs, do\_sync = 0, dirty = 1, do\_priority = 0;}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00158}00158 }
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00159}00159         nargs = \mbox{\hyperlink{geom_8h_ab762d12640f528d8f1f60eee92bf5f3b}{gctl\_get\_paraml}}(\mbox{\hyperlink{g__part__if_8m_a7a9f20c97e75f805eb506910bd3e70d3}{req}}, \textcolor{stringliteral}{"{}nargs"{}}, \textcolor{keyword}{sizeof}(*nargs));}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00160}00160         \textcolor{keywordflow}{if} (nargs == NULL) \{}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00161}00161                 \mbox{\hyperlink{geom_8h_a1d51201471b52be7e19a98b0fcb144de}{gctl\_error}}(\mbox{\hyperlink{g__part__if_8m_a7a9f20c97e75f805eb506910bd3e70d3}{req}}, \textcolor{stringliteral}{"{}No '\%s' argument."{}}, \textcolor{stringliteral}{"{}nargs"{}});}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00162}00162                 \textcolor{keywordflow}{return};}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00163}00163         \}}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00164}00164         \textcolor{keywordflow}{if} (*nargs != 1 \&\& *nargs != 2) \{}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00165}00165                 \mbox{\hyperlink{geom_8h_a1d51201471b52be7e19a98b0fcb144de}{gctl\_error}}(\mbox{\hyperlink{g__part__if_8m_a7a9f20c97e75f805eb506910bd3e70d3}{req}}, \textcolor{stringliteral}{"{}Invalid number of arguments."{}});}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00166}00166                 \textcolor{keywordflow}{return};}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00167}00167         \}}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00168}00168         \mbox{\hyperlink{g__part__if_8m_aff5d3acc33944ecb11914d04ef06bb54}{name}} = \mbox{\hyperlink{geom_8h_ada33526012aac8ee446617bb3749a07c}{gctl\_get\_asciiparam}}(\mbox{\hyperlink{g__part__if_8m_a7a9f20c97e75f805eb506910bd3e70d3}{req}}, \textcolor{stringliteral}{"{}arg0"{}});}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00169}00169         \textcolor{keywordflow}{if} (\mbox{\hyperlink{g__part__if_8m_aff5d3acc33944ecb11914d04ef06bb54}{name}} == NULL) \{}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00170}00170                 \mbox{\hyperlink{geom_8h_a1d51201471b52be7e19a98b0fcb144de}{gctl\_error}}(\mbox{\hyperlink{g__part__if_8m_a7a9f20c97e75f805eb506910bd3e70d3}{req}}, \textcolor{stringliteral}{"{}No 'arg\%u' argument."{}}, 0);}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00171}00171                 \textcolor{keywordflow}{return};}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00172}00172         \}}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00173}00173         balancep = \mbox{\hyperlink{geom_8h_ada33526012aac8ee446617bb3749a07c}{gctl\_get\_asciiparam}}(\mbox{\hyperlink{g__part__if_8m_a7a9f20c97e75f805eb506910bd3e70d3}{req}}, \textcolor{stringliteral}{"{}balance"{}});}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00174}00174         \textcolor{keywordflow}{if} (balancep == NULL) \{}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00175}00175                 \mbox{\hyperlink{geom_8h_a1d51201471b52be7e19a98b0fcb144de}{gctl\_error}}(\mbox{\hyperlink{g__part__if_8m_a7a9f20c97e75f805eb506910bd3e70d3}{req}}, \textcolor{stringliteral}{"{}No '\%s' argument."{}}, \textcolor{stringliteral}{"{}balance"{}});}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00176}00176                 \textcolor{keywordflow}{return};}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00177}00177         \}}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00178}00178         autosync = \mbox{\hyperlink{geom_8h_ab762d12640f528d8f1f60eee92bf5f3b}{gctl\_get\_paraml}}(\mbox{\hyperlink{g__part__if_8m_a7a9f20c97e75f805eb506910bd3e70d3}{req}}, \textcolor{stringliteral}{"{}autosync"{}}, \textcolor{keyword}{sizeof}(*autosync));}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00179}00179         \textcolor{keywordflow}{if} (autosync == NULL) \{}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00180}00180                 \mbox{\hyperlink{geom_8h_a1d51201471b52be7e19a98b0fcb144de}{gctl\_error}}(\mbox{\hyperlink{g__part__if_8m_a7a9f20c97e75f805eb506910bd3e70d3}{req}}, \textcolor{stringliteral}{"{}No '\%s' argument."{}}, \textcolor{stringliteral}{"{}autosync"{}});}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00181}00181                 \textcolor{keywordflow}{return};}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00182}00182         \}}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00183}00183         noautosync = \mbox{\hyperlink{geom_8h_ab762d12640f528d8f1f60eee92bf5f3b}{gctl\_get\_paraml}}(\mbox{\hyperlink{g__part__if_8m_a7a9f20c97e75f805eb506910bd3e70d3}{req}}, \textcolor{stringliteral}{"{}noautosync"{}}, \textcolor{keyword}{sizeof}(*noautosync));}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00184}00184         \textcolor{keywordflow}{if} (noautosync == NULL) \{}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00185}00185                 \mbox{\hyperlink{geom_8h_a1d51201471b52be7e19a98b0fcb144de}{gctl\_error}}(\mbox{\hyperlink{g__part__if_8m_a7a9f20c97e75f805eb506910bd3e70d3}{req}}, \textcolor{stringliteral}{"{}No '\%s' argument."{}}, \textcolor{stringliteral}{"{}noautosync"{}});}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00186}00186                 \textcolor{keywordflow}{return};}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00187}00187         \}}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00188}00188         failsync = \mbox{\hyperlink{geom_8h_ab762d12640f528d8f1f60eee92bf5f3b}{gctl\_get\_paraml}}(\mbox{\hyperlink{g__part__if_8m_a7a9f20c97e75f805eb506910bd3e70d3}{req}}, \textcolor{stringliteral}{"{}failsync"{}}, \textcolor{keyword}{sizeof}(*failsync));}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00189}00189         \textcolor{keywordflow}{if} (failsync == NULL) \{}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00190}00190                 \mbox{\hyperlink{geom_8h_a1d51201471b52be7e19a98b0fcb144de}{gctl\_error}}(\mbox{\hyperlink{g__part__if_8m_a7a9f20c97e75f805eb506910bd3e70d3}{req}}, \textcolor{stringliteral}{"{}No '\%s' argument."{}}, \textcolor{stringliteral}{"{}failsync"{}});}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00191}00191                 \textcolor{keywordflow}{return};}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00192}00192         \}}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00193}00193         nofailsync = \mbox{\hyperlink{geom_8h_ab762d12640f528d8f1f60eee92bf5f3b}{gctl\_get\_paraml}}(\mbox{\hyperlink{g__part__if_8m_a7a9f20c97e75f805eb506910bd3e70d3}{req}}, \textcolor{stringliteral}{"{}nofailsync"{}}, \textcolor{keyword}{sizeof}(*nofailsync));}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00194}00194         \textcolor{keywordflow}{if} (nofailsync == NULL) \{}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00195}00195                 \mbox{\hyperlink{geom_8h_a1d51201471b52be7e19a98b0fcb144de}{gctl\_error}}(\mbox{\hyperlink{g__part__if_8m_a7a9f20c97e75f805eb506910bd3e70d3}{req}}, \textcolor{stringliteral}{"{}No '\%s' argument."{}}, \textcolor{stringliteral}{"{}nofailsync"{}});}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00196}00196                 \textcolor{keywordflow}{return};}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00197}00197         \}}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00198}00198         hardcode = \mbox{\hyperlink{geom_8h_ab762d12640f528d8f1f60eee92bf5f3b}{gctl\_get\_paraml}}(\mbox{\hyperlink{g__part__if_8m_a7a9f20c97e75f805eb506910bd3e70d3}{req}}, \textcolor{stringliteral}{"{}hardcode"{}}, \textcolor{keyword}{sizeof}(*hardcode));}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00199}00199         \textcolor{keywordflow}{if} (hardcode == NULL) \{}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00200}00200                 \mbox{\hyperlink{geom_8h_a1d51201471b52be7e19a98b0fcb144de}{gctl\_error}}(\mbox{\hyperlink{g__part__if_8m_a7a9f20c97e75f805eb506910bd3e70d3}{req}}, \textcolor{stringliteral}{"{}No '\%s' argument."{}}, \textcolor{stringliteral}{"{}hardcode"{}});}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00201}00201                 \textcolor{keywordflow}{return};}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00202}00202         \}}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00203}00203         dynamic = \mbox{\hyperlink{geom_8h_ab762d12640f528d8f1f60eee92bf5f3b}{gctl\_get\_paraml}}(\mbox{\hyperlink{g__part__if_8m_a7a9f20c97e75f805eb506910bd3e70d3}{req}}, \textcolor{stringliteral}{"{}dynamic"{}}, \textcolor{keyword}{sizeof}(*dynamic));}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00204}00204         \textcolor{keywordflow}{if} (dynamic == NULL) \{}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00205}00205                 \mbox{\hyperlink{geom_8h_a1d51201471b52be7e19a98b0fcb144de}{gctl\_error}}(\mbox{\hyperlink{g__part__if_8m_a7a9f20c97e75f805eb506910bd3e70d3}{req}}, \textcolor{stringliteral}{"{}No '\%s' argument."{}}, \textcolor{stringliteral}{"{}dynamic"{}});}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00206}00206                 \textcolor{keywordflow}{return};}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00207}00207         \}}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00208}00208         priority = \mbox{\hyperlink{geom_8h_ab762d12640f528d8f1f60eee92bf5f3b}{gctl\_get\_paraml}}(\mbox{\hyperlink{g__part__if_8m_a7a9f20c97e75f805eb506910bd3e70d3}{req}}, \textcolor{stringliteral}{"{}priority"{}}, \textcolor{keyword}{sizeof}(*priority));}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00209}00209         \textcolor{keywordflow}{if} (priority == NULL) \{}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00210}00210                 \mbox{\hyperlink{geom_8h_a1d51201471b52be7e19a98b0fcb144de}{gctl\_error}}(\mbox{\hyperlink{g__part__if_8m_a7a9f20c97e75f805eb506910bd3e70d3}{req}}, \textcolor{stringliteral}{"{}No '\%s' argument."{}}, \textcolor{stringliteral}{"{}priority"{}});}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00211}00211                 \textcolor{keywordflow}{return};}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00212}00212         \}}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00213}00213         \textcolor{keywordflow}{if} (*priority < -\/1 || *priority > 255) \{}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00214}00214                 \mbox{\hyperlink{geom_8h_a1d51201471b52be7e19a98b0fcb144de}{gctl\_error}}(\mbox{\hyperlink{g__part__if_8m_a7a9f20c97e75f805eb506910bd3e70d3}{req}}, \textcolor{stringliteral}{"{}Priority range is 0 to 255, \%jd given"{}},}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00215}00215                     *priority);}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00216}00216                 \textcolor{keywordflow}{return};}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00217}00217         \}}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00218}00218         \textcolor{comment}{/* }}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00219}00219 \textcolor{comment}{         * Since we have a priority, we also need a provider now.}}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00220}00220 \textcolor{comment}{         * Note: be WARNS safe, by always assigning prov and only throw an}}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00221}00221 \textcolor{comment}{         * error if *priority != -\/1.}}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00222}00222 \textcolor{comment}{         */}}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00223}00223         prov = \mbox{\hyperlink{geom_8h_ada33526012aac8ee446617bb3749a07c}{gctl\_get\_asciiparam}}(\mbox{\hyperlink{g__part__if_8m_a7a9f20c97e75f805eb506910bd3e70d3}{req}}, \textcolor{stringliteral}{"{}arg1"{}});}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00224}00224         \textcolor{keywordflow}{if} (*priority > -\/1) \{}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00225}00225                 \textcolor{keywordflow}{if} (prov == NULL) \{}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00226}00226                         \mbox{\hyperlink{geom_8h_a1d51201471b52be7e19a98b0fcb144de}{gctl\_error}}(\mbox{\hyperlink{g__part__if_8m_a7a9f20c97e75f805eb506910bd3e70d3}{req}}, \textcolor{stringliteral}{"{}Priority needs a disk name"{}});}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00227}00227                         \textcolor{keywordflow}{return};}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00228}00228                 \}}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00229}00229                 do\_priority = 1;}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00230}00230         \}}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00231}00231         \textcolor{keywordflow}{if} (*autosync \&\& *noautosync) \{}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00232}00232                 \mbox{\hyperlink{geom_8h_a1d51201471b52be7e19a98b0fcb144de}{gctl\_error}}(\mbox{\hyperlink{g__part__if_8m_a7a9f20c97e75f805eb506910bd3e70d3}{req}}, \textcolor{stringliteral}{"{}'\%s' and '\%s' specified."{}}, \textcolor{stringliteral}{"{}autosync"{}},}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00233}00233                     \textcolor{stringliteral}{"{}noautosync"{}});}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00234}00234                 \textcolor{keywordflow}{return};}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00235}00235         \}}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00236}00236         \textcolor{keywordflow}{if} (*failsync \&\& *nofailsync) \{}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00237}00237                 \mbox{\hyperlink{geom_8h_a1d51201471b52be7e19a98b0fcb144de}{gctl\_error}}(\mbox{\hyperlink{g__part__if_8m_a7a9f20c97e75f805eb506910bd3e70d3}{req}}, \textcolor{stringliteral}{"{}'\%s' and '\%s' specified."{}}, \textcolor{stringliteral}{"{}failsync"{}},}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00238}00238                     \textcolor{stringliteral}{"{}nofailsync"{}});}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00239}00239                 \textcolor{keywordflow}{return};}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00240}00240         \}}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00241}00241         \textcolor{keywordflow}{if} (*hardcode \&\& *dynamic) \{}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00242}00242                 \mbox{\hyperlink{geom_8h_a1d51201471b52be7e19a98b0fcb144de}{gctl\_error}}(\mbox{\hyperlink{g__part__if_8m_a7a9f20c97e75f805eb506910bd3e70d3}{req}}, \textcolor{stringliteral}{"{}'\%s' and '\%s' specified."{}}, \textcolor{stringliteral}{"{}hardcode"{}},}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00243}00243                     \textcolor{stringliteral}{"{}dynamic"{}});}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00244}00244                 \textcolor{keywordflow}{return};}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00245}00245         \}}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00246}00246         sc = \mbox{\hyperlink{g__mirror__ctl_8c_aa3363d3c57f61394b21d8bb4bab23f2d}{g\_mirror\_find\_device}}(\mbox{\hyperlink{g__raid__md__if_8m_a4f7502795edfd2493d3d223d0df33e1d}{mp}}, \mbox{\hyperlink{g__part__if_8m_aff5d3acc33944ecb11914d04ef06bb54}{name}});}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00247}00247         \textcolor{keywordflow}{if} (sc == NULL) \{}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00248}00248                 \mbox{\hyperlink{geom_8h_a1d51201471b52be7e19a98b0fcb144de}{gctl\_error}}(\mbox{\hyperlink{g__part__if_8m_a7a9f20c97e75f805eb506910bd3e70d3}{req}}, \textcolor{stringliteral}{"{}No such device: \%s."{}}, \mbox{\hyperlink{g__part__if_8m_aff5d3acc33944ecb11914d04ef06bb54}{name}});}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00249}00249                 \textcolor{keywordflow}{return};}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00250}00250         \}}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00251}00251         \textcolor{keywordflow}{if} (*balancep == \textcolor{charliteral}{'\(\backslash\)0'})}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00252}00252                 balance = sc-\/>\mbox{\hyperlink{structg__mirror__softc_a89921fff714fe6ab0292301e2055e338}{sc\_balance}};}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00253}00253         \textcolor{keywordflow}{else} \{}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00254}00254                 \textcolor{keywordflow}{if} (\mbox{\hyperlink{g__mirror_8h_abb70d1a51f4b8fbb8b0de6b9af431caf}{balance\_id}}(balancep) == -\/1) \{}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00255}00255                         \mbox{\hyperlink{geom_8h_a1d51201471b52be7e19a98b0fcb144de}{gctl\_error}}(\mbox{\hyperlink{g__part__if_8m_a7a9f20c97e75f805eb506910bd3e70d3}{req}}, \textcolor{stringliteral}{"{}Invalid balance algorithm."{}});}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00256}00256                         sx\_xunlock(\&sc-\/>\mbox{\hyperlink{structg__mirror__softc_a98662cf0fd52070bda584f4fa296b1cb}{sc\_lock}});}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00257}00257                         \textcolor{keywordflow}{return};}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00258}00258                 \}}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00259}00259                 balance = \mbox{\hyperlink{g__mirror_8h_abb70d1a51f4b8fbb8b0de6b9af431caf}{balance\_id}}(balancep);}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00260}00260         \}}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00261}00261         slicep = \mbox{\hyperlink{geom_8h_ab762d12640f528d8f1f60eee92bf5f3b}{gctl\_get\_paraml}}(\mbox{\hyperlink{g__part__if_8m_a7a9f20c97e75f805eb506910bd3e70d3}{req}}, \textcolor{stringliteral}{"{}slice"{}}, \textcolor{keyword}{sizeof}(*slicep));}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00262}00262         \textcolor{keywordflow}{if} (slicep == NULL) \{}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00263}00263                 \mbox{\hyperlink{geom_8h_a1d51201471b52be7e19a98b0fcb144de}{gctl\_error}}(\mbox{\hyperlink{g__part__if_8m_a7a9f20c97e75f805eb506910bd3e70d3}{req}}, \textcolor{stringliteral}{"{}No '\%s' argument."{}}, \textcolor{stringliteral}{"{}slice"{}});}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00264}00264                 sx\_xunlock(\&sc-\/>\mbox{\hyperlink{structg__mirror__softc_a98662cf0fd52070bda584f4fa296b1cb}{sc\_lock}});}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00265}00265                 \textcolor{keywordflow}{return};}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00266}00266         \}}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00267}00267         \textcolor{keywordflow}{if} (*slicep == -\/1)}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00268}00268                 slice = sc-\/>\mbox{\hyperlink{structg__mirror__softc_a18ffcd43b9eddde09a0eec64bab81409}{sc\_slice}};}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00269}00269         \textcolor{keywordflow}{else}}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00270}00270                 slice = *slicep;}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00271}00271         \textcolor{comment}{/* Enforce usage() of -\/p not allowing any other options. */}}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00272}00272         \textcolor{keywordflow}{if} (do\_priority \&\& (*autosync || *noautosync || *failsync ||}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00273}00273             *nofailsync || *hardcode || *dynamic || *slicep != -\/1 ||}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00274}00274             *balancep != \textcolor{charliteral}{'\(\backslash\)0'})) \{}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00275}00275                 sx\_xunlock(\&sc-\/>\mbox{\hyperlink{structg__mirror__softc_a98662cf0fd52070bda584f4fa296b1cb}{sc\_lock}});}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00276}00276                 \mbox{\hyperlink{geom_8h_a1d51201471b52be7e19a98b0fcb144de}{gctl\_error}}(\mbox{\hyperlink{g__part__if_8m_a7a9f20c97e75f805eb506910bd3e70d3}{req}}, \textcolor{stringliteral}{"{}only -\/p accepted when setting priority"{}});}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00277}00277                 \textcolor{keywordflow}{return};}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00278}00278         \}}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00279}00279         \textcolor{keywordflow}{if} (sc-\/>\mbox{\hyperlink{structg__mirror__softc_a89921fff714fe6ab0292301e2055e338}{sc\_balance}} == balance \&\& sc-\/>\mbox{\hyperlink{structg__mirror__softc_a18ffcd43b9eddde09a0eec64bab81409}{sc\_slice}} == slice \&\& !*autosync \&\&}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00280}00280             !*noautosync \&\& !*failsync \&\& !*nofailsync \&\& !*hardcode \&\&}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00281}00281             !*dynamic \&\& !do\_priority) \{}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00282}00282                 sx\_xunlock(\&sc-\/>\mbox{\hyperlink{structg__mirror__softc_a98662cf0fd52070bda584f4fa296b1cb}{sc\_lock}});}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00283}00283                 \mbox{\hyperlink{geom_8h_a1d51201471b52be7e19a98b0fcb144de}{gctl\_error}}(\mbox{\hyperlink{g__part__if_8m_a7a9f20c97e75f805eb506910bd3e70d3}{req}}, \textcolor{stringliteral}{"{}Nothing has changed."{}});}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00284}00284                 \textcolor{keywordflow}{return};}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00285}00285         \}}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00286}00286         \textcolor{keywordflow}{if} ((!do\_priority \&\& *nargs != 1) || (do\_priority \&\& *nargs != 2)) \{}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00287}00287                 sx\_xunlock(\&sc-\/>\mbox{\hyperlink{structg__mirror__softc_a98662cf0fd52070bda584f4fa296b1cb}{sc\_lock}});}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00288}00288                 \mbox{\hyperlink{geom_8h_a1d51201471b52be7e19a98b0fcb144de}{gctl\_error}}(\mbox{\hyperlink{g__part__if_8m_a7a9f20c97e75f805eb506910bd3e70d3}{req}}, \textcolor{stringliteral}{"{}Invalid number of arguments."{}});}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00289}00289                 \textcolor{keywordflow}{return};}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00290}00290         \}}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00291}00291         \textcolor{keywordflow}{if} (\mbox{\hyperlink{g__mirror_8c_a76f0c9eed85d72267388c8094bce23dc}{g\_mirror\_ndisks}}(sc, -\/1) < sc-\/>\mbox{\hyperlink{structg__mirror__softc_a8302ed5b2d64f8d387be03bb5ab514c1}{sc\_ndisks}}) \{}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00292}00292                 sx\_xunlock(\&sc-\/>\mbox{\hyperlink{structg__mirror__softc_a98662cf0fd52070bda584f4fa296b1cb}{sc\_lock}});}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00293}00293                 \mbox{\hyperlink{geom_8h_a1d51201471b52be7e19a98b0fcb144de}{gctl\_error}}(\mbox{\hyperlink{g__part__if_8m_a7a9f20c97e75f805eb506910bd3e70d3}{req}}, \textcolor{stringliteral}{"{}Not all disks connected. Try 'forget' command "{}}}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00294}00294                     \textcolor{stringliteral}{"{}first."{}});}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00295}00295                 \textcolor{keywordflow}{return};}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00296}00296         \}}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00297}00297         sc-\/>\mbox{\hyperlink{structg__mirror__softc_a89921fff714fe6ab0292301e2055e338}{sc\_balance}} = balance;}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00298}00298         sc-\/>\mbox{\hyperlink{structg__mirror__softc_a18ffcd43b9eddde09a0eec64bab81409}{sc\_slice}} = slice;}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00299}00299         \textcolor{keywordflow}{if} ((sc-\/>\mbox{\hyperlink{structg__mirror__softc_a6410883ee8eaf5dd18800e30710173a7}{sc\_flags}} \& \mbox{\hyperlink{g__mirror_8h_a34fb387bb53e645bcaab374a86c40da5}{G\_MIRROR\_DEVICE\_FLAG\_NOAUTOSYNC}}) != 0) \{}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00300}00300                 \textcolor{keywordflow}{if} (*autosync) \{}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00301}00301                         sc-\/>\mbox{\hyperlink{structg__mirror__softc_a6410883ee8eaf5dd18800e30710173a7}{sc\_flags}} \&= \string~G\_MIRROR\_DEVICE\_FLAG\_NOAUTOSYNC;}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00302}00302                         do\_sync = 1;}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00303}00303                 \}}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00304}00304         \} \textcolor{keywordflow}{else} \{}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00305}00305                 \textcolor{keywordflow}{if} (*noautosync)}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00306}00306                         sc-\/>\mbox{\hyperlink{structg__mirror__softc_a6410883ee8eaf5dd18800e30710173a7}{sc\_flags}} |= \mbox{\hyperlink{g__mirror_8h_a34fb387bb53e645bcaab374a86c40da5}{G\_MIRROR\_DEVICE\_FLAG\_NOAUTOSYNC}};}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00307}00307         \}}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00308}00308         \textcolor{keywordflow}{if} ((sc-\/>\mbox{\hyperlink{structg__mirror__softc_a6410883ee8eaf5dd18800e30710173a7}{sc\_flags}} \& \mbox{\hyperlink{g__mirror_8h_ac4b8311e61d6b585aab4f0bd5062e5c7}{G\_MIRROR\_DEVICE\_FLAG\_NOFAILSYNC}}) != 0) \{}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00309}00309                 \textcolor{keywordflow}{if} (*failsync)}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00310}00310                         sc-\/>\mbox{\hyperlink{structg__mirror__softc_a6410883ee8eaf5dd18800e30710173a7}{sc\_flags}} \&= \string~G\_MIRROR\_DEVICE\_FLAG\_NOFAILSYNC;}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00311}00311         \} \textcolor{keywordflow}{else} \{}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00312}00312                 \textcolor{keywordflow}{if} (*nofailsync) \{}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00313}00313                         sc-\/>\mbox{\hyperlink{structg__mirror__softc_a6410883ee8eaf5dd18800e30710173a7}{sc\_flags}} |= \mbox{\hyperlink{g__mirror_8h_ac4b8311e61d6b585aab4f0bd5062e5c7}{G\_MIRROR\_DEVICE\_FLAG\_NOFAILSYNC}};}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00314}00314                         dirty = 0;}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00315}00315                 \}}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00316}00316         \}}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00317}00317         LIST\_FOREACH(\mbox{\hyperlink{structdisk}{disk}}, \&sc-\/>sc\_disks, d\_next) \{}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00318}00318                 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00319}00319 \textcolor{comment}{                 * Handle priority first, since we only need one disk, do one}}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00320}00320 \textcolor{comment}{                 * operation on it and then we're done. No need to check other}}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00321}00321 \textcolor{comment}{                 * flags, as usage doesn't allow it.}}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00322}00322 \textcolor{comment}{                 */}}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00323}00323                 \textcolor{keywordflow}{if} (do\_priority) \{}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00324}00324                         \textcolor{keywordflow}{if} (strcmp(\mbox{\hyperlink{structdisk}{disk}}-\/>\mbox{\hyperlink{structdisk_a72ebb3eb591e2022e6989e2189d2a4b0}{d\_name}}, prov) == 0) \{}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00325}00325                                 \textcolor{keywordflow}{if} (\mbox{\hyperlink{structdisk}{disk}}-\/>d\_priority == *priority)}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00326}00326                                         \mbox{\hyperlink{geom_8h_a1d51201471b52be7e19a98b0fcb144de}{gctl\_error}}(\mbox{\hyperlink{g__part__if_8m_a7a9f20c97e75f805eb506910bd3e70d3}{req}}, \textcolor{stringliteral}{"{}Nothing has changed."{}});}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00327}00327                                 \textcolor{keywordflow}{else} \{}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00328}00328                                         \mbox{\hyperlink{structdisk}{disk}}-\/>d\_priority = *priority;}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00329}00329                                         \mbox{\hyperlink{g__mirror_8c_aae3b509a195824dad058cd9156eccbb7}{g\_mirror\_update\_metadata}}(\mbox{\hyperlink{structdisk}{disk}});}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00330}00330                                 \}}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00331}00331                                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00332}00332                         \}}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00333}00333                         \textcolor{keywordflow}{continue};}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00334}00334                 \}}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00335}00335                 \textcolor{keywordflow}{if} (do\_sync) \{}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00336}00336                         \textcolor{keywordflow}{if} (\mbox{\hyperlink{structdisk}{disk}}-\/>d\_state == \mbox{\hyperlink{g__mirror_8h_adc7524e3b8d552627069a8e3c2a597bc}{G\_MIRROR\_DISK\_STATE\_SYNCHRONIZING}})}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00337}00337                                 \mbox{\hyperlink{structdisk}{disk}}-\/>\mbox{\hyperlink{structdisk_a047cc933120f77168c337ca109105f55}{d\_flags}} \&= \string~G\_MIRROR\_DISK\_FLAG\_FORCE\_SYNC;}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00338}00338                 \}}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00339}00339                 \textcolor{keywordflow}{if} (*hardcode)}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00340}00340                         \mbox{\hyperlink{structdisk}{disk}}-\/>\mbox{\hyperlink{structdisk_a047cc933120f77168c337ca109105f55}{d\_flags}} |= \mbox{\hyperlink{g__mirror_8h_ae2f683859196b160347b893618e99316}{G\_MIRROR\_DISK\_FLAG\_HARDCODED}};}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00341}00341                 \textcolor{keywordflow}{else} \textcolor{keywordflow}{if} (*dynamic)}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00342}00342                         \mbox{\hyperlink{structdisk}{disk}}-\/>\mbox{\hyperlink{structdisk_a047cc933120f77168c337ca109105f55}{d\_flags}} \&= \string~G\_MIRROR\_DISK\_FLAG\_HARDCODED;}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00343}00343                 \textcolor{keywordflow}{if} (!dirty)}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00344}00344                         \mbox{\hyperlink{structdisk}{disk}}-\/>\mbox{\hyperlink{structdisk_a047cc933120f77168c337ca109105f55}{d\_flags}} \&= \string~G\_MIRROR\_DISK\_FLAG\_DIRTY;}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00345}00345                 \mbox{\hyperlink{g__mirror_8c_aae3b509a195824dad058cd9156eccbb7}{g\_mirror\_update\_metadata}}(\mbox{\hyperlink{structdisk}{disk}});}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00346}00346                 \textcolor{keywordflow}{if} (do\_sync) \{}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00347}00347                         \textcolor{keywordflow}{if} (\mbox{\hyperlink{structdisk}{disk}}-\/>d\_state == \mbox{\hyperlink{g__mirror_8h_a9a54abda5f4ddafdda99b86d5cf3942c}{G\_MIRROR\_DISK\_STATE\_STALE}}) \{}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00348}00348                                 \mbox{\hyperlink{g__mirror_8c_acb3acdbd049684b07266d3f405fa712b}{g\_mirror\_event\_send}}(\mbox{\hyperlink{structdisk}{disk}},}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00349}00349                                     \mbox{\hyperlink{g__mirror_8h_ada570d4226b4591fff4a46f97a2af9c8}{G\_MIRROR\_DISK\_STATE\_DISCONNECTED}},}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00350}00350                                     \mbox{\hyperlink{g__mirror_8h_ab767cbba6414114682f0119cabbeff11}{G\_MIRROR\_EVENT\_DONTWAIT}});}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00351}00351                         \}}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00352}00352                 \}}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00353}00353         \}}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00354}00354         sx\_xunlock(\&sc-\/>\mbox{\hyperlink{structg__mirror__softc_a98662cf0fd52070bda584f4fa296b1cb}{sc\_lock}});}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00355}00355 \}}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00356}00356 }
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00357}00357 \textcolor{keyword}{static} \textcolor{keywordtype}{void}}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00358}\mbox{\hyperlink{g__mirror__ctl_8c_a9397ceb00219e998977fecea30bee78d}{00358}} \mbox{\hyperlink{g__mirror__ctl_8c_a9397ceb00219e998977fecea30bee78d}{g\_mirror\_create\_orphan}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structg__consumer}{g\_consumer}} *\mbox{\hyperlink{g__part__if_8m_a294f18324585ff37641fb8aa1c9ccd82}{cp}})}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00359}00359 \{}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00360}00360 }
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00361}00361         KASSERT(1 == 0, (\textcolor{stringliteral}{"{}\%s called while creating \%s."{}}, \_\_func\_\_,}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00362}00362             \mbox{\hyperlink{g__part__if_8m_a294f18324585ff37641fb8aa1c9ccd82}{cp}}-\/>\mbox{\hyperlink{structg__consumer_a6435d5aec0376e995dce3131fd3beb52}{provider}}-\/>\mbox{\hyperlink{structg__provider_a2bffb416ee58cf4df7839c6fd5ec004a}{name}}));}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00363}00363 \}}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00364}00364 }
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00365}00365 \textcolor{keyword}{static} \textcolor{keywordtype}{void}}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00366}\mbox{\hyperlink{g__mirror__ctl_8c_a23ef4824508fcbc0609d79e464673883}{00366}} \mbox{\hyperlink{g__mirror__ctl_8c_a23ef4824508fcbc0609d79e464673883}{g\_mirror\_ctl\_create}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structgctl__req}{gctl\_req}} *\mbox{\hyperlink{g__part__if_8m_a7a9f20c97e75f805eb506910bd3e70d3}{req}}, \textcolor{keyword}{struct} \mbox{\hyperlink{structg__class}{g\_class}} *\mbox{\hyperlink{g__raid__md__if_8m_a4f7502795edfd2493d3d223d0df33e1d}{mp}})}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00367}00367 \{}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00368}00368         \textcolor{keyword}{struct }\mbox{\hyperlink{structg__mirror__metadata}{g\_mirror\_metadata}} md;}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00369}00369         \textcolor{keyword}{struct }\mbox{\hyperlink{structg__geom}{g\_geom}} *\mbox{\hyperlink{g__part__if_8m_abdc908a08b24cd2e589de2f44e40eeb9}{gp}};}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00370}00370         \textcolor{keyword}{struct }\mbox{\hyperlink{structg__consumer}{g\_consumer}} *\mbox{\hyperlink{g__part__if_8m_a294f18324585ff37641fb8aa1c9ccd82}{cp}};}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00371}00371         \textcolor{keyword}{struct }\mbox{\hyperlink{structg__provider}{g\_provider}} *\mbox{\hyperlink{g__part__if_8m_a9bc7638f295763b77465c5ebebbd3442}{pp}};}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00372}00372         \textcolor{keyword}{struct }\mbox{\hyperlink{structg__mirror__softc}{g\_mirror\_softc}} *sc;}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00373}00373         \textcolor{keyword}{struct }sbuf *\mbox{\hyperlink{g__part__if_8m_a4c23eb4bab5aa5d69bd84384b94d1f79}{sb}};}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00374}00374         \textcolor{keyword}{const} \textcolor{keywordtype}{char} *\mbox{\hyperlink{g__part__if_8m_aff5d3acc33944ecb11914d04ef06bb54}{name}};}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00375}00375         \textcolor{keywordtype}{char} param[16];}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00376}00376         \textcolor{keywordtype}{int} *nargs;}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00377}00377         intmax\_t *val;}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00378}00378         \textcolor{keywordtype}{int} *ival;}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00379}00379         \textcolor{keyword}{const} \textcolor{keywordtype}{char} *sval;}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00380}00380         \textcolor{keywordtype}{int} bal;}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00381}00381         \textcolor{keywordtype}{unsigned} attached, no, sectorsize;}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00382}00382         off\_t mediasize;}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00383}00383 }
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00384}00384         nargs = \mbox{\hyperlink{geom_8h_ab762d12640f528d8f1f60eee92bf5f3b}{gctl\_get\_paraml}}(\mbox{\hyperlink{g__part__if_8m_a7a9f20c97e75f805eb506910bd3e70d3}{req}}, \textcolor{stringliteral}{"{}nargs"{}}, \textcolor{keyword}{sizeof}(*nargs));}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00385}00385         \textcolor{keywordflow}{if} (nargs == NULL) \{}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00386}00386                 \mbox{\hyperlink{geom_8h_a1d51201471b52be7e19a98b0fcb144de}{gctl\_error}}(\mbox{\hyperlink{g__part__if_8m_a7a9f20c97e75f805eb506910bd3e70d3}{req}}, \textcolor{stringliteral}{"{}No '\%s' argument."{}}, \textcolor{stringliteral}{"{}nargs"{}});}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00387}00387                 \textcolor{keywordflow}{return};}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00388}00388         \}}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00389}00389         \textcolor{keywordflow}{if} (*nargs <= 2) \{}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00390}00390                 \mbox{\hyperlink{geom_8h_a1d51201471b52be7e19a98b0fcb144de}{gctl\_error}}(\mbox{\hyperlink{g__part__if_8m_a7a9f20c97e75f805eb506910bd3e70d3}{req}}, \textcolor{stringliteral}{"{}Too few arguments."{}});}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00391}00391                 \textcolor{keywordflow}{return};}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00392}00392         \}}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00393}00393 }
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00394}00394         strlcpy(md.\mbox{\hyperlink{structg__mirror__metadata_aeb9e323ae665b5c611ae4440b7f2c6ab}{md\_magic}}, \mbox{\hyperlink{g__mirror_8h_a91189c74dfc7c44226d0d3de15d45723}{G\_MIRROR\_MAGIC}}, \textcolor{keyword}{sizeof}(md.\mbox{\hyperlink{structg__mirror__metadata_aeb9e323ae665b5c611ae4440b7f2c6ab}{md\_magic}}));}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00395}00395         md.\mbox{\hyperlink{structg__mirror__metadata_a81e4eb0e4d0ea5eeedce5eb92c26519f}{md\_version}} = \mbox{\hyperlink{g__mirror_8h_a5906745ac7488343f84f37c7f864e459}{G\_MIRROR\_VERSION}};}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00396}00396         \mbox{\hyperlink{g__part__if_8m_aff5d3acc33944ecb11914d04ef06bb54}{name}} = \mbox{\hyperlink{geom_8h_ada33526012aac8ee446617bb3749a07c}{gctl\_get\_asciiparam}}(\mbox{\hyperlink{g__part__if_8m_a7a9f20c97e75f805eb506910bd3e70d3}{req}}, \textcolor{stringliteral}{"{}arg0"{}});}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00397}00397         \textcolor{keywordflow}{if} (\mbox{\hyperlink{g__part__if_8m_aff5d3acc33944ecb11914d04ef06bb54}{name}} == NULL) \{}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00398}00398                 \mbox{\hyperlink{geom_8h_a1d51201471b52be7e19a98b0fcb144de}{gctl\_error}}(\mbox{\hyperlink{g__part__if_8m_a7a9f20c97e75f805eb506910bd3e70d3}{req}}, \textcolor{stringliteral}{"{}No 'arg\%u' argument."{}}, 0);}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00399}00399                 \textcolor{keywordflow}{return};}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00400}00400         \}}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00401}00401         strlcpy(md.\mbox{\hyperlink{structg__mirror__metadata_a82885fc33c8a54c4a8dbf2b7256a0d67}{md\_name}}, \mbox{\hyperlink{g__part__if_8m_aff5d3acc33944ecb11914d04ef06bb54}{name}}, \textcolor{keyword}{sizeof}(md.\mbox{\hyperlink{structg__mirror__metadata_a82885fc33c8a54c4a8dbf2b7256a0d67}{md\_name}}));}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00402}00402         md.\mbox{\hyperlink{structg__mirror__metadata_ab7fab58697ae3591ed9eadbf0738585e}{md\_mid}} = arc4random();}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00403}00403         md.\mbox{\hyperlink{structg__mirror__metadata_a83415b70cff0e8c4f1ec942183bb5657}{md\_all}} = *nargs -\/ 1;}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00404}00404         md.\mbox{\hyperlink{structg__mirror__metadata_a82af61e9ea3dd0fb8af01be43ef9805f}{md\_genid}} = 0;}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00405}00405         md.\mbox{\hyperlink{structg__mirror__metadata_a5a3a019671c914a5835b6773539372f8}{md\_syncid}} = 1;}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00406}00406         md.\mbox{\hyperlink{structg__mirror__metadata_aedc2684aa0cd216f5f4d97420abcbe68}{md\_sync\_offset}} = 0;}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00407}00407         val = \mbox{\hyperlink{geom_8h_ab762d12640f528d8f1f60eee92bf5f3b}{gctl\_get\_paraml}}(\mbox{\hyperlink{g__part__if_8m_a7a9f20c97e75f805eb506910bd3e70d3}{req}}, \textcolor{stringliteral}{"{}slice"{}}, \textcolor{keyword}{sizeof}(*val));}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00408}00408         \textcolor{keywordflow}{if} (val == NULL) \{}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00409}00409                 \mbox{\hyperlink{geom_8h_a1d51201471b52be7e19a98b0fcb144de}{gctl\_error}}(\mbox{\hyperlink{g__part__if_8m_a7a9f20c97e75f805eb506910bd3e70d3}{req}}, \textcolor{stringliteral}{"{}No slice argument."{}});}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00410}00410                 \textcolor{keywordflow}{return};}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00411}00411         \}}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00412}00412         md.\mbox{\hyperlink{structg__mirror__metadata_a95fa4374041abd89684361116d66adeb}{md\_slice}} = *val;}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00413}00413         sval = \mbox{\hyperlink{geom_8h_ada33526012aac8ee446617bb3749a07c}{gctl\_get\_asciiparam}}(\mbox{\hyperlink{g__part__if_8m_a7a9f20c97e75f805eb506910bd3e70d3}{req}}, \textcolor{stringliteral}{"{}balance"{}});}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00414}00414         \textcolor{keywordflow}{if} (sval == NULL) \{}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00415}00415                 \mbox{\hyperlink{geom_8h_a1d51201471b52be7e19a98b0fcb144de}{gctl\_error}}(\mbox{\hyperlink{g__part__if_8m_a7a9f20c97e75f805eb506910bd3e70d3}{req}}, \textcolor{stringliteral}{"{}No balance argument."{}});}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00416}00416                 \textcolor{keywordflow}{return};}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00417}00417         \}}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00418}00418         bal = \mbox{\hyperlink{g__mirror_8h_abb70d1a51f4b8fbb8b0de6b9af431caf}{balance\_id}}(sval);}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00419}00419         \textcolor{keywordflow}{if} (bal < 0) \{}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00420}00420                 \mbox{\hyperlink{geom_8h_a1d51201471b52be7e19a98b0fcb144de}{gctl\_error}}(\mbox{\hyperlink{g__part__if_8m_a7a9f20c97e75f805eb506910bd3e70d3}{req}}, \textcolor{stringliteral}{"{}Invalid balance algorithm."{}});}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00421}00421                 \textcolor{keywordflow}{return};}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00422}00422         \}}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00423}00423         md.\mbox{\hyperlink{structg__mirror__metadata_a6e1d0cdbf2da95a11ed6215758040c2f}{md\_balance}} = bal;}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00424}00424         md.\mbox{\hyperlink{structg__mirror__metadata_a4f369a63c1808b30231a526b814b3fd4}{md\_mflags}} = 0;}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00425}00425         md.\mbox{\hyperlink{structg__mirror__metadata_a8fc45162278cb5a1477a90195caac417}{md\_dflags}} = 0;}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00426}00426         ival = \mbox{\hyperlink{geom_8h_ab762d12640f528d8f1f60eee92bf5f3b}{gctl\_get\_paraml}}(\mbox{\hyperlink{g__part__if_8m_a7a9f20c97e75f805eb506910bd3e70d3}{req}}, \textcolor{stringliteral}{"{}noautosync"{}}, \textcolor{keyword}{sizeof}(*ival));}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00427}00427         \textcolor{keywordflow}{if} (ival != NULL \&\& *ival)}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00428}00428                 md.\mbox{\hyperlink{structg__mirror__metadata_a4f369a63c1808b30231a526b814b3fd4}{md\_mflags}} |= \mbox{\hyperlink{g__mirror_8h_a34fb387bb53e645bcaab374a86c40da5}{G\_MIRROR\_DEVICE\_FLAG\_NOAUTOSYNC}};}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00429}00429         ival = \mbox{\hyperlink{geom_8h_ab762d12640f528d8f1f60eee92bf5f3b}{gctl\_get\_paraml}}(\mbox{\hyperlink{g__part__if_8m_a7a9f20c97e75f805eb506910bd3e70d3}{req}}, \textcolor{stringliteral}{"{}nofailsync"{}}, \textcolor{keyword}{sizeof}(*ival));}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00430}00430         \textcolor{keywordflow}{if} (ival != NULL \&\& *ival)}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00431}00431                 md.\mbox{\hyperlink{structg__mirror__metadata_a4f369a63c1808b30231a526b814b3fd4}{md\_mflags}} |= \mbox{\hyperlink{g__mirror_8h_ac4b8311e61d6b585aab4f0bd5062e5c7}{G\_MIRROR\_DEVICE\_FLAG\_NOFAILSYNC}};}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00432}00432         \textcolor{comment}{/* These fields not used in manual mode. */}}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00433}00433         bzero(md.\mbox{\hyperlink{structg__mirror__metadata_a9ac9aa3e99a7d4ec2910c9411853b02c}{md\_provider}}, \textcolor{keyword}{sizeof}(md.\mbox{\hyperlink{structg__mirror__metadata_a9ac9aa3e99a7d4ec2910c9411853b02c}{md\_provider}}));}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00434}00434         md.\mbox{\hyperlink{structg__mirror__metadata_a8d5546582f6ed51f35f9f70f305a2b64}{md\_provsize}} = 0;}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00435}00435 }
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00436}00436         \mbox{\hyperlink{geom_8h_a232419d2cfa06ff3f4ff7551041aed31}{g\_topology\_lock}}();}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00437}00437         mediasize = OFF\_MAX;}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00438}00438         sectorsize = 0;}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00439}00439         \mbox{\hyperlink{g__part__if_8m_abdc908a08b24cd2e589de2f44e40eeb9}{gp}} = \mbox{\hyperlink{geom_8h_a4000befe2ff4b405b8333ccc5b0fdb41}{g\_new\_geomf}}(\mbox{\hyperlink{g__raid__md__if_8m_a4f7502795edfd2493d3d223d0df33e1d}{mp}}, \textcolor{stringliteral}{"{}\%s"{}}, md.\mbox{\hyperlink{structg__mirror__metadata_a82885fc33c8a54c4a8dbf2b7256a0d67}{md\_name}});}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00440}00440         \mbox{\hyperlink{g__part__if_8m_abdc908a08b24cd2e589de2f44e40eeb9}{gp}}-\/>\mbox{\hyperlink{structg__geom_a67386b3b9a49233eca9f73d28bc70325}{orphan}} = \mbox{\hyperlink{g__mirror__ctl_8c_a9397ceb00219e998977fecea30bee78d}{g\_mirror\_create\_orphan}};}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00441}00441         \mbox{\hyperlink{g__part__if_8m_a294f18324585ff37641fb8aa1c9ccd82}{cp}} = \mbox{\hyperlink{geom_8h_aef9ca3f0eecc1b245c3c9cd0bac1cdc4}{g\_new\_consumer}}(\mbox{\hyperlink{g__part__if_8m_abdc908a08b24cd2e589de2f44e40eeb9}{gp}});}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00442}00442         \textcolor{keywordflow}{for} (no = 1; no < *nargs; no++) \{}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00443}00443                 snprintf(param, \textcolor{keyword}{sizeof}(param), \textcolor{stringliteral}{"{}arg\%u"{}}, no);}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00444}00444                 \mbox{\hyperlink{g__part__if_8m_a9bc7638f295763b77465c5ebebbd3442}{pp}} = \mbox{\hyperlink{geom_8h_a02d62eea445edba7982f681b41c6c307}{gctl\_get\_provider}}(\mbox{\hyperlink{g__part__if_8m_a7a9f20c97e75f805eb506910bd3e70d3}{req}}, param);}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00445}00445                 \textcolor{keywordflow}{if} (\mbox{\hyperlink{g__part__if_8m_a9bc7638f295763b77465c5ebebbd3442}{pp}} == NULL) \{}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00446}00446 err:}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00447}00447                         \mbox{\hyperlink{geom_8h_a9f53f6118c5e44ca2bcbd7ae548597b9}{g\_destroy\_consumer}}(\mbox{\hyperlink{g__part__if_8m_a294f18324585ff37641fb8aa1c9ccd82}{cp}});}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00448}00448                         \mbox{\hyperlink{geom_8h_ac8307c99785f672632d3cf33134211ea}{g\_destroy\_geom}}(\mbox{\hyperlink{g__part__if_8m_abdc908a08b24cd2e589de2f44e40eeb9}{gp}});}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00449}00449                         \mbox{\hyperlink{geom_8h_a4628d4de49ba84e7a6126cc30d23b83a}{g\_topology\_unlock}}();}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00450}00450                         \textcolor{keywordflow}{return};}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00451}00451                 \}}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00452}00452                 \textcolor{keywordflow}{if} (\mbox{\hyperlink{geom_8h_a7f6ee69db47bae6ff5284f6a9cfceb91}{g\_attach}}(\mbox{\hyperlink{g__part__if_8m_a294f18324585ff37641fb8aa1c9ccd82}{cp}}, \mbox{\hyperlink{g__part__if_8m_a9bc7638f295763b77465c5ebebbd3442}{pp}}) != 0) \{}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00453}00453                         \mbox{\hyperlink{g__mirror_8h_aeab3bb1005df2baf93da35993058a14b}{G\_MIRROR\_DEBUG}}(1, \textcolor{stringliteral}{"{}Can't attach disk \%s."{}}, \mbox{\hyperlink{g__part__if_8m_a9bc7638f295763b77465c5ebebbd3442}{pp}}-\/>\mbox{\hyperlink{structg__provider_a2bffb416ee58cf4df7839c6fd5ec004a}{name}});}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00454}00454                         \mbox{\hyperlink{geom_8h_a1d51201471b52be7e19a98b0fcb144de}{gctl\_error}}(\mbox{\hyperlink{g__part__if_8m_a7a9f20c97e75f805eb506910bd3e70d3}{req}}, \textcolor{stringliteral}{"{}Can't attach disk \%s."{}}, \mbox{\hyperlink{g__part__if_8m_a9bc7638f295763b77465c5ebebbd3442}{pp}}-\/>\mbox{\hyperlink{structg__provider_a2bffb416ee58cf4df7839c6fd5ec004a}{name}});}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00455}00455                         \textcolor{keywordflow}{goto} err;}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00456}00456                 \}}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00457}00457                 \textcolor{keywordflow}{if} (\mbox{\hyperlink{geom_8h_a27b7c72cc3bc5a4d07ce5976e1aa1b58}{g\_access}}(\mbox{\hyperlink{g__part__if_8m_a294f18324585ff37641fb8aa1c9ccd82}{cp}}, 1, 0, 0) != 0) \{}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00458}00458                         \mbox{\hyperlink{g__mirror_8h_aeab3bb1005df2baf93da35993058a14b}{G\_MIRROR\_DEBUG}}(1, \textcolor{stringliteral}{"{}Can't open disk \%s."{}}, \mbox{\hyperlink{g__part__if_8m_a9bc7638f295763b77465c5ebebbd3442}{pp}}-\/>\mbox{\hyperlink{structg__provider_a2bffb416ee58cf4df7839c6fd5ec004a}{name}});}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00459}00459                         \mbox{\hyperlink{geom_8h_a1d51201471b52be7e19a98b0fcb144de}{gctl\_error}}(\mbox{\hyperlink{g__part__if_8m_a7a9f20c97e75f805eb506910bd3e70d3}{req}}, \textcolor{stringliteral}{"{}Can't open disk \%s."{}}, \mbox{\hyperlink{g__part__if_8m_a9bc7638f295763b77465c5ebebbd3442}{pp}}-\/>\mbox{\hyperlink{structg__provider_a2bffb416ee58cf4df7839c6fd5ec004a}{name}});}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00460}00460 err2:}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00461}00461                         \mbox{\hyperlink{geom_8h_a037802c2ec5d43fcf1222215f9f8a735}{g\_detach}}(\mbox{\hyperlink{g__part__if_8m_a294f18324585ff37641fb8aa1c9ccd82}{cp}});}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00462}00462                         \textcolor{keywordflow}{goto} err;}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00463}00463                 \}}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00464}00464                 \textcolor{keywordflow}{if} (\mbox{\hyperlink{g__part__if_8m_a9bc7638f295763b77465c5ebebbd3442}{pp}}-\/>\mbox{\hyperlink{structg__provider_a8f47c464c78aa91fa4ca5143ed3cd15e}{mediasize}} == 0 || \mbox{\hyperlink{g__part__if_8m_a9bc7638f295763b77465c5ebebbd3442}{pp}}-\/>\mbox{\hyperlink{structg__provider_aea3cd43d41461790b8d0afcd8c49a355}{sectorsize}} == 0) \{}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00465}00465                         \mbox{\hyperlink{g__mirror_8h_aeab3bb1005df2baf93da35993058a14b}{G\_MIRROR\_DEBUG}}(1, \textcolor{stringliteral}{"{}Disk \%s has no media."{}}, \mbox{\hyperlink{g__part__if_8m_a9bc7638f295763b77465c5ebebbd3442}{pp}}-\/>\mbox{\hyperlink{structg__provider_a2bffb416ee58cf4df7839c6fd5ec004a}{name}});}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00466}00466                         \mbox{\hyperlink{geom_8h_a1d51201471b52be7e19a98b0fcb144de}{gctl\_error}}(\mbox{\hyperlink{g__part__if_8m_a7a9f20c97e75f805eb506910bd3e70d3}{req}}, \textcolor{stringliteral}{"{}Disk \%s has no media."{}}, \mbox{\hyperlink{g__part__if_8m_a9bc7638f295763b77465c5ebebbd3442}{pp}}-\/>\mbox{\hyperlink{structg__provider_a2bffb416ee58cf4df7839c6fd5ec004a}{name}});}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00467}00467                         \mbox{\hyperlink{geom_8h_a27b7c72cc3bc5a4d07ce5976e1aa1b58}{g\_access}}(\mbox{\hyperlink{g__part__if_8m_a294f18324585ff37641fb8aa1c9ccd82}{cp}}, -\/1, 0, 0);}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00468}00468                         \textcolor{keywordflow}{goto} err2;}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00469}00469                 \}}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00470}00470                 \textcolor{keywordflow}{if} (\mbox{\hyperlink{g__part__if_8m_a9bc7638f295763b77465c5ebebbd3442}{pp}}-\/>\mbox{\hyperlink{structg__provider_a8f47c464c78aa91fa4ca5143ed3cd15e}{mediasize}} < mediasize)}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00471}00471                         mediasize = \mbox{\hyperlink{g__part__if_8m_a9bc7638f295763b77465c5ebebbd3442}{pp}}-\/>\mbox{\hyperlink{structg__provider_a8f47c464c78aa91fa4ca5143ed3cd15e}{mediasize}};}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00472}00472                 \textcolor{keywordflow}{if} (\mbox{\hyperlink{g__part__if_8m_a9bc7638f295763b77465c5ebebbd3442}{pp}}-\/>\mbox{\hyperlink{structg__provider_aea3cd43d41461790b8d0afcd8c49a355}{sectorsize}} > sectorsize)}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00473}00473                         sectorsize = \mbox{\hyperlink{g__part__if_8m_a9bc7638f295763b77465c5ebebbd3442}{pp}}-\/>\mbox{\hyperlink{structg__provider_aea3cd43d41461790b8d0afcd8c49a355}{sectorsize}};}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00474}00474                 \mbox{\hyperlink{geom_8h_a27b7c72cc3bc5a4d07ce5976e1aa1b58}{g\_access}}(\mbox{\hyperlink{g__part__if_8m_a294f18324585ff37641fb8aa1c9ccd82}{cp}}, -\/1, 0, 0);}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00475}00475                 \mbox{\hyperlink{geom_8h_a037802c2ec5d43fcf1222215f9f8a735}{g\_detach}}(\mbox{\hyperlink{g__part__if_8m_a294f18324585ff37641fb8aa1c9ccd82}{cp}});}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00476}00476         \}}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00477}00477         \mbox{\hyperlink{geom_8h_a9f53f6118c5e44ca2bcbd7ae548597b9}{g\_destroy\_consumer}}(\mbox{\hyperlink{g__part__if_8m_a294f18324585ff37641fb8aa1c9ccd82}{cp}});}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00478}00478         \mbox{\hyperlink{geom_8h_ac8307c99785f672632d3cf33134211ea}{g\_destroy\_geom}}(\mbox{\hyperlink{g__part__if_8m_abdc908a08b24cd2e589de2f44e40eeb9}{gp}});}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00479}00479         md.\mbox{\hyperlink{structg__mirror__metadata_affa1b02e438fdd8978d5ee1d28b6380a}{md\_mediasize}} = mediasize;}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00480}00480         md.\mbox{\hyperlink{structg__mirror__metadata_a7c530bfc78eea3f8c747a16efff466d4}{md\_sectorsize}} = sectorsize;}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00481}00481         md.\mbox{\hyperlink{structg__mirror__metadata_affa1b02e438fdd8978d5ee1d28b6380a}{md\_mediasize}} -\/= (md.\mbox{\hyperlink{structg__mirror__metadata_affa1b02e438fdd8978d5ee1d28b6380a}{md\_mediasize}} \% md.\mbox{\hyperlink{structg__mirror__metadata_a7c530bfc78eea3f8c747a16efff466d4}{md\_sectorsize}});}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00482}00482 }
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00483}00483         \mbox{\hyperlink{g__part__if_8m_abdc908a08b24cd2e589de2f44e40eeb9}{gp}} = \mbox{\hyperlink{g__mirror_8c_a26eb3fa06cb7fc48c3c56d511e0587e8}{g\_mirror\_create}}(\mbox{\hyperlink{g__raid__md__if_8m_a4f7502795edfd2493d3d223d0df33e1d}{mp}}, \&md, \mbox{\hyperlink{g__mirror_8h_a7964829397c185205685fd852d3eaf71}{G\_MIRROR\_TYPE\_MANUAL}});}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00484}00484         \textcolor{keywordflow}{if} (\mbox{\hyperlink{g__part__if_8m_abdc908a08b24cd2e589de2f44e40eeb9}{gp}} == NULL) \{}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00485}00485                 \mbox{\hyperlink{geom_8h_a1d51201471b52be7e19a98b0fcb144de}{gctl\_error}}(\mbox{\hyperlink{g__part__if_8m_a7a9f20c97e75f805eb506910bd3e70d3}{req}}, \textcolor{stringliteral}{"{}Can't create \%s."{}}, md.\mbox{\hyperlink{structg__mirror__metadata_a82885fc33c8a54c4a8dbf2b7256a0d67}{md\_name}});}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00486}00486                 \mbox{\hyperlink{geom_8h_a4628d4de49ba84e7a6126cc30d23b83a}{g\_topology\_unlock}}();}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00487}00487                 \textcolor{keywordflow}{return};}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00488}00488         \}}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00489}00489 }
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00490}00490         sc = \mbox{\hyperlink{g__part__if_8m_abdc908a08b24cd2e589de2f44e40eeb9}{gp}}-\/>\mbox{\hyperlink{structg__geom_aa83c08c83459420f6cbcfe64c6099466}{softc}};}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00491}00491         \mbox{\hyperlink{geom_8h_a4628d4de49ba84e7a6126cc30d23b83a}{g\_topology\_unlock}}();}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00492}00492         sx\_xlock(\&sc-\/>\mbox{\hyperlink{structg__mirror__softc_a98662cf0fd52070bda584f4fa296b1cb}{sc\_lock}});}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00493}00493         sc-\/>\mbox{\hyperlink{structg__mirror__softc_a6410883ee8eaf5dd18800e30710173a7}{sc\_flags}} |= \mbox{\hyperlink{g__mirror_8h_a4fd7748114bc62fa0b4658b8635055e6}{G\_MIRROR\_DEVICE\_FLAG\_TASTING}};}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00494}00494         \mbox{\hyperlink{g__part__if_8m_a4c23eb4bab5aa5d69bd84384b94d1f79}{sb}} = sbuf\_new\_auto();}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00495}00495         sbuf\_printf(\mbox{\hyperlink{g__part__if_8m_a4c23eb4bab5aa5d69bd84384b94d1f79}{sb}}, \textcolor{stringliteral}{"{}Can't attach disk(s) to \%s:"{}}, \mbox{\hyperlink{g__part__if_8m_abdc908a08b24cd2e589de2f44e40eeb9}{gp}}-\/>\mbox{\hyperlink{structg__geom_af64450500f1fea18f639b191a5017107}{name}});}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00496}00496         \textcolor{keywordflow}{for} (attached = 0, no = 1; no < *nargs; no++) \{}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00497}00497                 snprintf(param, \textcolor{keyword}{sizeof}(param), \textcolor{stringliteral}{"{}arg\%u"{}}, no);}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00498}00498                 \mbox{\hyperlink{g__part__if_8m_a9bc7638f295763b77465c5ebebbd3442}{pp}} = \mbox{\hyperlink{geom_8h_a02d62eea445edba7982f681b41c6c307}{gctl\_get\_provider}}(\mbox{\hyperlink{g__part__if_8m_a7a9f20c97e75f805eb506910bd3e70d3}{req}}, param);}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00499}00499                 \textcolor{keywordflow}{if} (\mbox{\hyperlink{g__part__if_8m_a9bc7638f295763b77465c5ebebbd3442}{pp}} == NULL) \{}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00500}00500                         \mbox{\hyperlink{g__part__if_8m_aff5d3acc33944ecb11914d04ef06bb54}{name}} = \mbox{\hyperlink{geom_8h_ada33526012aac8ee446617bb3749a07c}{gctl\_get\_asciiparam}}(\mbox{\hyperlink{g__part__if_8m_a7a9f20c97e75f805eb506910bd3e70d3}{req}}, param);}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00501}00501                         MPASS(\mbox{\hyperlink{g__part__if_8m_aff5d3acc33944ecb11914d04ef06bb54}{name}} != NULL);}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00502}00502                         sbuf\_printf(\mbox{\hyperlink{g__part__if_8m_a4c23eb4bab5aa5d69bd84384b94d1f79}{sb}}, \textcolor{stringliteral}{"{} \%s"{}}, \mbox{\hyperlink{g__part__if_8m_aff5d3acc33944ecb11914d04ef06bb54}{name}});}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00503}00503                         \textcolor{keywordflow}{continue};}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00504}00504                 \}}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00505}00505                 md.\mbox{\hyperlink{structg__mirror__metadata_a4c67036eb010fe00f15a47f42b3347a8}{md\_did}} = arc4random();}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00506}00506                 md.\mbox{\hyperlink{structg__mirror__metadata_aaff9c297fafc6e7ae8436fa6944f3391}{md\_priority}} = no -\/ 1;}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00507}00507                 \textcolor{keywordflow}{if} (\mbox{\hyperlink{g__mirror_8c_a15bc4a2aee9cedc80c3f0477933968b4}{g\_mirror\_add\_disk}}(sc, \mbox{\hyperlink{g__part__if_8m_a9bc7638f295763b77465c5ebebbd3442}{pp}}, \&md) != 0) \{}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00508}00508                         \mbox{\hyperlink{g__mirror_8h_aeab3bb1005df2baf93da35993058a14b}{G\_MIRROR\_DEBUG}}(1, \textcolor{stringliteral}{"{}Disk \%u (\%s) not attached to \%s."{}},}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00509}00509                             no, \mbox{\hyperlink{g__part__if_8m_a9bc7638f295763b77465c5ebebbd3442}{pp}}-\/>\mbox{\hyperlink{structg__provider_a2bffb416ee58cf4df7839c6fd5ec004a}{name}}, \mbox{\hyperlink{g__part__if_8m_abdc908a08b24cd2e589de2f44e40eeb9}{gp}}-\/>\mbox{\hyperlink{structg__geom_af64450500f1fea18f639b191a5017107}{name}});}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00510}00510                         sbuf\_printf(\mbox{\hyperlink{g__part__if_8m_a4c23eb4bab5aa5d69bd84384b94d1f79}{sb}}, \textcolor{stringliteral}{"{} \%s"{}}, \mbox{\hyperlink{g__part__if_8m_a9bc7638f295763b77465c5ebebbd3442}{pp}}-\/>\mbox{\hyperlink{structg__provider_a2bffb416ee58cf4df7839c6fd5ec004a}{name}});}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00511}00511                         \textcolor{keywordflow}{continue};}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00512}00512                 \}}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00513}00513                 attached++;}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00514}00514         \}}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00515}00515         sbuf\_finish(\mbox{\hyperlink{g__part__if_8m_a4c23eb4bab5aa5d69bd84384b94d1f79}{sb}});}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00516}00516         sc-\/>\mbox{\hyperlink{structg__mirror__softc_a6410883ee8eaf5dd18800e30710173a7}{sc\_flags}} \&= \string~G\_MIRROR\_DEVICE\_FLAG\_TASTING;}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00517}00517         \textcolor{keywordflow}{if} (md.\mbox{\hyperlink{structg__mirror__metadata_a83415b70cff0e8c4f1ec942183bb5657}{md\_all}} != attached ||}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00518}00518             (sc-\/>\mbox{\hyperlink{structg__mirror__softc_a6410883ee8eaf5dd18800e30710173a7}{sc\_flags}} \& \mbox{\hyperlink{g__mirror_8h_ab35b7bf2d1f11b2d5bf05eeae5a11638}{G\_MIRROR\_DEVICE\_FLAG\_DESTROY}}) != 0) \{}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00519}00519                 \mbox{\hyperlink{g__mirror_8c_a332e8f4ffc886e61f8d41e2a425e181b}{g\_mirror\_destroy}}(\mbox{\hyperlink{g__part__if_8m_abdc908a08b24cd2e589de2f44e40eeb9}{gp}}-\/>\mbox{\hyperlink{structg__geom_aa83c08c83459420f6cbcfe64c6099466}{softc}}, \mbox{\hyperlink{g__mirror_8h_a563b40b6a3bdd2b1b6a496fb001031f6}{G\_MIRROR\_DESTROY\_HARD}});}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00520}00520                 \mbox{\hyperlink{geom_8h_a1d51201471b52be7e19a98b0fcb144de}{gctl\_error}}(\mbox{\hyperlink{g__part__if_8m_a7a9f20c97e75f805eb506910bd3e70d3}{req}}, \textcolor{stringliteral}{"{}\%s"{}}, sbuf\_data(\mbox{\hyperlink{g__part__if_8m_a4c23eb4bab5aa5d69bd84384b94d1f79}{sb}}));}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00521}00521         \} \textcolor{keywordflow}{else}}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00522}00522                 sx\_xunlock(\&sc-\/>\mbox{\hyperlink{structg__mirror__softc_a98662cf0fd52070bda584f4fa296b1cb}{sc\_lock}});}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00523}00523         sbuf\_delete(\mbox{\hyperlink{g__part__if_8m_a4c23eb4bab5aa5d69bd84384b94d1f79}{sb}});}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00524}00524 \}}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00525}00525 }
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00526}00526 \textcolor{keyword}{static} \textcolor{keywordtype}{void}}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00527}\mbox{\hyperlink{g__mirror__ctl_8c_ac1efae0631dc27832d4aff97c3f06396}{00527}} \mbox{\hyperlink{g__mirror__ctl_8c_ac1efae0631dc27832d4aff97c3f06396}{g\_mirror\_ctl\_rebuild}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structgctl__req}{gctl\_req}} *\mbox{\hyperlink{g__part__if_8m_a7a9f20c97e75f805eb506910bd3e70d3}{req}}, \textcolor{keyword}{struct} \mbox{\hyperlink{structg__class}{g\_class}} *\mbox{\hyperlink{g__raid__md__if_8m_a4f7502795edfd2493d3d223d0df33e1d}{mp}})}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00528}00528 \{}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00529}00529         \textcolor{keyword}{struct }\mbox{\hyperlink{structg__mirror__metadata}{g\_mirror\_metadata}} md;}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00530}00530         \textcolor{keyword}{struct }\mbox{\hyperlink{structg__mirror__softc}{g\_mirror\_softc}} *sc;}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00531}00531         \textcolor{keyword}{struct }\mbox{\hyperlink{structg__mirror__disk}{g\_mirror\_disk}} *\mbox{\hyperlink{g__raid__md__if_8m_a9508e997a57ea259d6ecc0e563261993}{disk}};}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00532}00532         \textcolor{keyword}{struct }\mbox{\hyperlink{structg__provider}{g\_provider}} *\mbox{\hyperlink{g__part__if_8m_a9bc7638f295763b77465c5ebebbd3442}{pp}};}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00533}00533         \textcolor{keyword}{const} \textcolor{keywordtype}{char} *\mbox{\hyperlink{g__part__if_8m_aff5d3acc33944ecb11914d04ef06bb54}{name}};}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00534}00534         \textcolor{keywordtype}{char} param[16];}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00535}00535         \textcolor{keywordtype}{int} \mbox{\hyperlink{structg__provider_acacf1ee18cb6edbcfedc185846696e7f}{error}}, *nargs;}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00536}00536         u\_int i;}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00537}00537 }
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00538}00538         nargs = \mbox{\hyperlink{geom_8h_ab762d12640f528d8f1f60eee92bf5f3b}{gctl\_get\_paraml}}(\mbox{\hyperlink{g__part__if_8m_a7a9f20c97e75f805eb506910bd3e70d3}{req}}, \textcolor{stringliteral}{"{}nargs"{}}, \textcolor{keyword}{sizeof}(*nargs));}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00539}00539         \textcolor{keywordflow}{if} (nargs == NULL) \{}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00540}00540                 \mbox{\hyperlink{geom_8h_a1d51201471b52be7e19a98b0fcb144de}{gctl\_error}}(\mbox{\hyperlink{g__part__if_8m_a7a9f20c97e75f805eb506910bd3e70d3}{req}}, \textcolor{stringliteral}{"{}No '\%s' argument."{}}, \textcolor{stringliteral}{"{}nargs"{}});}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00541}00541                 \textcolor{keywordflow}{return};}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00542}00542         \}}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00543}00543         \textcolor{keywordflow}{if} (*nargs < 2) \{}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00544}00544                 \mbox{\hyperlink{geom_8h_a1d51201471b52be7e19a98b0fcb144de}{gctl\_error}}(\mbox{\hyperlink{g__part__if_8m_a7a9f20c97e75f805eb506910bd3e70d3}{req}}, \textcolor{stringliteral}{"{}Too few arguments."{}});}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00545}00545                 \textcolor{keywordflow}{return};}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00546}00546         \}}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00547}00547         \mbox{\hyperlink{g__part__if_8m_aff5d3acc33944ecb11914d04ef06bb54}{name}} = \mbox{\hyperlink{geom_8h_ada33526012aac8ee446617bb3749a07c}{gctl\_get\_asciiparam}}(\mbox{\hyperlink{g__part__if_8m_a7a9f20c97e75f805eb506910bd3e70d3}{req}}, \textcolor{stringliteral}{"{}arg0"{}});}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00548}00548         \textcolor{keywordflow}{if} (\mbox{\hyperlink{g__part__if_8m_aff5d3acc33944ecb11914d04ef06bb54}{name}} == NULL) \{}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00549}00549                 \mbox{\hyperlink{geom_8h_a1d51201471b52be7e19a98b0fcb144de}{gctl\_error}}(\mbox{\hyperlink{g__part__if_8m_a7a9f20c97e75f805eb506910bd3e70d3}{req}}, \textcolor{stringliteral}{"{}No 'arg\%u' argument."{}}, 0);}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00550}00550                 \textcolor{keywordflow}{return};}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00551}00551         \}}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00552}00552         sc = \mbox{\hyperlink{g__mirror__ctl_8c_aa3363d3c57f61394b21d8bb4bab23f2d}{g\_mirror\_find\_device}}(\mbox{\hyperlink{g__raid__md__if_8m_a4f7502795edfd2493d3d223d0df33e1d}{mp}}, \mbox{\hyperlink{g__part__if_8m_aff5d3acc33944ecb11914d04ef06bb54}{name}});}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00553}00553         \textcolor{keywordflow}{if} (sc == NULL) \{}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00554}00554                 \mbox{\hyperlink{geom_8h_a1d51201471b52be7e19a98b0fcb144de}{gctl\_error}}(\mbox{\hyperlink{g__part__if_8m_a7a9f20c97e75f805eb506910bd3e70d3}{req}}, \textcolor{stringliteral}{"{}No such device: \%s."{}}, \mbox{\hyperlink{g__part__if_8m_aff5d3acc33944ecb11914d04ef06bb54}{name}});}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00555}00555                 \textcolor{keywordflow}{return};}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00556}00556         \}}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00557}00557         \textcolor{keywordflow}{for} (i = 1; i < (u\_int)*nargs; i++) \{}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00558}00558                 snprintf(param, \textcolor{keyword}{sizeof}(param), \textcolor{stringliteral}{"{}arg\%u"{}}, i);}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00559}00559                 \mbox{\hyperlink{g__part__if_8m_aff5d3acc33944ecb11914d04ef06bb54}{name}} = \mbox{\hyperlink{geom_8h_ada33526012aac8ee446617bb3749a07c}{gctl\_get\_asciiparam}}(\mbox{\hyperlink{g__part__if_8m_a7a9f20c97e75f805eb506910bd3e70d3}{req}}, param);}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00560}00560                 \textcolor{keywordflow}{if} (\mbox{\hyperlink{g__part__if_8m_aff5d3acc33944ecb11914d04ef06bb54}{name}} == NULL) \{}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00561}00561                         \mbox{\hyperlink{geom_8h_a1d51201471b52be7e19a98b0fcb144de}{gctl\_error}}(\mbox{\hyperlink{g__part__if_8m_a7a9f20c97e75f805eb506910bd3e70d3}{req}}, \textcolor{stringliteral}{"{}No 'arg\%u' argument."{}}, i);}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00562}00562                         \textcolor{keywordflow}{continue};}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00563}00563                 \}}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00564}00564                 \mbox{\hyperlink{structdisk}{disk}} = \mbox{\hyperlink{g__mirror__ctl_8c_a48ca9cc413729437685bdc5bf1f589fe}{g\_mirror\_find\_disk}}(sc, \mbox{\hyperlink{g__part__if_8m_aff5d3acc33944ecb11914d04ef06bb54}{name}});}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00565}00565                 \textcolor{keywordflow}{if} (\mbox{\hyperlink{structdisk}{disk}} == NULL) \{}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00566}00566                         \mbox{\hyperlink{geom_8h_a1d51201471b52be7e19a98b0fcb144de}{gctl\_error}}(\mbox{\hyperlink{g__part__if_8m_a7a9f20c97e75f805eb506910bd3e70d3}{req}}, \textcolor{stringliteral}{"{}No such provider: \%s."{}}, \mbox{\hyperlink{g__part__if_8m_aff5d3acc33944ecb11914d04ef06bb54}{name}});}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00567}00567                         \textcolor{keywordflow}{continue};}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00568}00568                 \}}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00569}00569                 \textcolor{keywordflow}{if} (\mbox{\hyperlink{g__mirror_8c_a76f0c9eed85d72267388c8094bce23dc}{g\_mirror\_ndisks}}(sc, \mbox{\hyperlink{g__mirror_8h_aa88d381f7d55ce32d3dc797d0967a4c9}{G\_MIRROR\_DISK\_STATE\_ACTIVE}}) == 1 \&\&}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00570}00570                     \mbox{\hyperlink{structdisk}{disk}}-\/>d\_state == \mbox{\hyperlink{g__mirror_8h_aa88d381f7d55ce32d3dc797d0967a4c9}{G\_MIRROR\_DISK\_STATE\_ACTIVE}}) \{}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00571}00571                         \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00572}00572 \textcolor{comment}{                         * This is the last active disk. There will be nothing}}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00573}00573 \textcolor{comment}{                         * to rebuild it from, so deny this request.}}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00574}00574 \textcolor{comment}{                         */}}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00575}00575                         \mbox{\hyperlink{geom_8h_a1d51201471b52be7e19a98b0fcb144de}{gctl\_error}}(\mbox{\hyperlink{g__part__if_8m_a7a9f20c97e75f805eb506910bd3e70d3}{req}},}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00576}00576                             \textcolor{stringliteral}{"{}Provider \%s is the last active provider in \%s."{}},}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00577}00577                             \mbox{\hyperlink{g__part__if_8m_aff5d3acc33944ecb11914d04ef06bb54}{name}}, sc-\/>\mbox{\hyperlink{structg__mirror__softc_a8bc6474081935f9897bb9bbbe425c0d4}{sc\_geom}}-\/>\mbox{\hyperlink{structg__geom_af64450500f1fea18f639b191a5017107}{name}});}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00578}00578                         \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00579}00579                 \}}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00580}00580                 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00581}00581 \textcolor{comment}{                 * Do rebuild by resetting syncid, disconnecting the disk and}}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00582}00582 \textcolor{comment}{                 * connecting it again.}}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00583}00583 \textcolor{comment}{                 */}}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00584}00584                 \mbox{\hyperlink{structdisk}{disk}}-\/>d\_sync.ds\_syncid = 0;}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00585}00585                 \textcolor{keywordflow}{if} ((sc-\/>\mbox{\hyperlink{structg__mirror__softc_a6410883ee8eaf5dd18800e30710173a7}{sc\_flags}} \& \mbox{\hyperlink{g__mirror_8h_a34fb387bb53e645bcaab374a86c40da5}{G\_MIRROR\_DEVICE\_FLAG\_NOAUTOSYNC}}) != 0)}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00586}00586                         \mbox{\hyperlink{structdisk}{disk}}-\/>\mbox{\hyperlink{structdisk_a047cc933120f77168c337ca109105f55}{d\_flags}} |= \mbox{\hyperlink{g__mirror_8h_a78ea37872700c06dd12940ee9e280964}{G\_MIRROR\_DISK\_FLAG\_FORCE\_SYNC}};}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00587}00587                 \mbox{\hyperlink{g__mirror_8c_aae3b509a195824dad058cd9156eccbb7}{g\_mirror\_update\_metadata}}(\mbox{\hyperlink{structdisk}{disk}});}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00588}00588                 \mbox{\hyperlink{g__part__if_8m_a9bc7638f295763b77465c5ebebbd3442}{pp}} = \mbox{\hyperlink{structdisk}{disk}}-\/>d\_consumer-\/>provider;}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00589}00589                 \mbox{\hyperlink{geom_8h_a232419d2cfa06ff3f4ff7551041aed31}{g\_topology\_lock}}();}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00590}00590                 \mbox{\hyperlink{structg__provider_acacf1ee18cb6edbcfedc185846696e7f}{error}} = \mbox{\hyperlink{g__mirror_8c_aa74dc8fdd253568e06b104c4ebec14a4}{g\_mirror\_read\_metadata}}(\mbox{\hyperlink{structdisk}{disk}}-\/>d\_consumer, \&md);}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00591}00591                 \mbox{\hyperlink{geom_8h_a4628d4de49ba84e7a6126cc30d23b83a}{g\_topology\_unlock}}();}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00592}00592                 \mbox{\hyperlink{g__mirror_8c_acb3acdbd049684b07266d3f405fa712b}{g\_mirror\_event\_send}}(\mbox{\hyperlink{structdisk}{disk}}, \mbox{\hyperlink{g__mirror_8h_ada570d4226b4591fff4a46f97a2af9c8}{G\_MIRROR\_DISK\_STATE\_DISCONNECTED}},}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00593}00593                     \mbox{\hyperlink{g__mirror_8h_a7f556c20f5f5dc23624c842740d23f41}{G\_MIRROR\_EVENT\_WAIT}});}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00594}00594                 \textcolor{keywordflow}{if} (\mbox{\hyperlink{structg__provider_acacf1ee18cb6edbcfedc185846696e7f}{error}} != 0) \{}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00595}00595                         \mbox{\hyperlink{geom_8h_a1d51201471b52be7e19a98b0fcb144de}{gctl\_error}}(\mbox{\hyperlink{g__part__if_8m_a7a9f20c97e75f805eb506910bd3e70d3}{req}}, \textcolor{stringliteral}{"{}Cannot read metadata from \%s."{}},}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00596}00596                             \mbox{\hyperlink{g__part__if_8m_a9bc7638f295763b77465c5ebebbd3442}{pp}}-\/>\mbox{\hyperlink{structg__provider_a2bffb416ee58cf4df7839c6fd5ec004a}{name}});}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00597}00597                         \textcolor{keywordflow}{continue};}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00598}00598                 \}}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00599}00599                 \mbox{\hyperlink{structg__provider_acacf1ee18cb6edbcfedc185846696e7f}{error}} = \mbox{\hyperlink{g__mirror_8c_a15bc4a2aee9cedc80c3f0477933968b4}{g\_mirror\_add\_disk}}(sc, \mbox{\hyperlink{g__part__if_8m_a9bc7638f295763b77465c5ebebbd3442}{pp}}, \&md);}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00600}00600                 \textcolor{keywordflow}{if} (\mbox{\hyperlink{structg__provider_acacf1ee18cb6edbcfedc185846696e7f}{error}} != 0) \{}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00601}00601                         \mbox{\hyperlink{geom_8h_a1d51201471b52be7e19a98b0fcb144de}{gctl\_error}}(\mbox{\hyperlink{g__part__if_8m_a7a9f20c97e75f805eb506910bd3e70d3}{req}}, \textcolor{stringliteral}{"{}Cannot reconnect component \%s."{}},}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00602}00602                             \mbox{\hyperlink{g__part__if_8m_a9bc7638f295763b77465c5ebebbd3442}{pp}}-\/>\mbox{\hyperlink{structg__provider_a2bffb416ee58cf4df7839c6fd5ec004a}{name}});}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00603}00603                         \textcolor{keywordflow}{continue};}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00604}00604                 \}}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00605}00605         \}}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00606}00606         sx\_xunlock(\&sc-\/>\mbox{\hyperlink{structg__mirror__softc_a98662cf0fd52070bda584f4fa296b1cb}{sc\_lock}});}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00607}00607 \}}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00608}00608 }
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00609}00609 \textcolor{keyword}{static} \textcolor{keywordtype}{void}}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00610}\mbox{\hyperlink{g__mirror__ctl_8c_a86996475b64c21bff7f37b45111f3f69}{00610}} \mbox{\hyperlink{g__mirror__ctl_8c_a86996475b64c21bff7f37b45111f3f69}{g\_mirror\_ctl\_insert}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structgctl__req}{gctl\_req}} *\mbox{\hyperlink{g__part__if_8m_a7a9f20c97e75f805eb506910bd3e70d3}{req}}, \textcolor{keyword}{struct} \mbox{\hyperlink{structg__class}{g\_class}} *\mbox{\hyperlink{g__raid__md__if_8m_a4f7502795edfd2493d3d223d0df33e1d}{mp}})}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00611}00611 \{}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00612}00612         \textcolor{keyword}{struct }\mbox{\hyperlink{structg__mirror__softc}{g\_mirror\_softc}} *sc;}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00613}00613         \textcolor{keyword}{struct }\mbox{\hyperlink{structg__mirror__disk}{g\_mirror\_disk}} *\mbox{\hyperlink{g__raid__md__if_8m_a9508e997a57ea259d6ecc0e563261993}{disk}};}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00614}00614         \textcolor{keyword}{struct }\mbox{\hyperlink{structg__mirror__metadata}{g\_mirror\_metadata}} md;}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00615}00615         \textcolor{keyword}{struct }\mbox{\hyperlink{structg__provider}{g\_provider}} *\mbox{\hyperlink{g__part__if_8m_a9bc7638f295763b77465c5ebebbd3442}{pp}};}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00616}00616         \textcolor{keyword}{struct }\mbox{\hyperlink{structg__consumer}{g\_consumer}} *\mbox{\hyperlink{g__part__if_8m_a294f18324585ff37641fb8aa1c9ccd82}{cp}};}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00617}00617         intmax\_t *priority;}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00618}00618         \textcolor{keyword}{const} \textcolor{keywordtype}{char} *\mbox{\hyperlink{g__part__if_8m_aff5d3acc33944ecb11914d04ef06bb54}{name}};}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00619}00619         \textcolor{keywordtype}{char} param[16];}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00620}00620         u\_char *sector;}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00621}00621         u\_int i, n;}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00622}00622         \textcolor{keywordtype}{int} error, *nargs, *hardcode, *inactive;}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00623}00623         \textcolor{keyword}{struct }\{}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00624}00624                 \textcolor{keyword}{struct }\mbox{\hyperlink{structg__provider}{g\_provider}}     *\mbox{\hyperlink{structg__consumer_a6435d5aec0376e995dce3131fd3beb52}{provider}};}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00625}00625                 \textcolor{keyword}{struct }\mbox{\hyperlink{structg__consumer}{g\_consumer}}     *consumer;}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00626}00626         \} *disks;}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00627}00627         off\_t mdsize;}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00628}00628 }
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00629}00629         nargs = \mbox{\hyperlink{geom_8h_ab762d12640f528d8f1f60eee92bf5f3b}{gctl\_get\_paraml}}(\mbox{\hyperlink{g__part__if_8m_a7a9f20c97e75f805eb506910bd3e70d3}{req}}, \textcolor{stringliteral}{"{}nargs"{}}, \textcolor{keyword}{sizeof}(*nargs));}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00630}00630         \textcolor{keywordflow}{if} (nargs == NULL) \{}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00631}00631                 \mbox{\hyperlink{geom_8h_a1d51201471b52be7e19a98b0fcb144de}{gctl\_error}}(\mbox{\hyperlink{g__part__if_8m_a7a9f20c97e75f805eb506910bd3e70d3}{req}}, \textcolor{stringliteral}{"{}No '\%s' argument."{}}, \textcolor{stringliteral}{"{}nargs"{}});}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00632}00632                 \textcolor{keywordflow}{return};}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00633}00633         \}}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00634}00634         \textcolor{keywordflow}{if} (*nargs < 2) \{}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00635}00635                 \mbox{\hyperlink{geom_8h_a1d51201471b52be7e19a98b0fcb144de}{gctl\_error}}(\mbox{\hyperlink{g__part__if_8m_a7a9f20c97e75f805eb506910bd3e70d3}{req}}, \textcolor{stringliteral}{"{}Too few arguments."{}});}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00636}00636                 \textcolor{keywordflow}{return};}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00637}00637         \}}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00638}00638         priority = \mbox{\hyperlink{geom_8h_ab762d12640f528d8f1f60eee92bf5f3b}{gctl\_get\_paraml}}(\mbox{\hyperlink{g__part__if_8m_a7a9f20c97e75f805eb506910bd3e70d3}{req}}, \textcolor{stringliteral}{"{}priority"{}}, \textcolor{keyword}{sizeof}(*priority));}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00639}00639         \textcolor{keywordflow}{if} (priority == NULL) \{}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00640}00640                 \mbox{\hyperlink{geom_8h_a1d51201471b52be7e19a98b0fcb144de}{gctl\_error}}(\mbox{\hyperlink{g__part__if_8m_a7a9f20c97e75f805eb506910bd3e70d3}{req}}, \textcolor{stringliteral}{"{}No '\%s' argument."{}}, \textcolor{stringliteral}{"{}priority"{}});}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00641}00641                 \textcolor{keywordflow}{return};}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00642}00642         \}}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00643}00643         inactive = \mbox{\hyperlink{geom_8h_ab762d12640f528d8f1f60eee92bf5f3b}{gctl\_get\_paraml}}(\mbox{\hyperlink{g__part__if_8m_a7a9f20c97e75f805eb506910bd3e70d3}{req}}, \textcolor{stringliteral}{"{}inactive"{}}, \textcolor{keyword}{sizeof}(*inactive));}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00644}00644         \textcolor{keywordflow}{if} (inactive == NULL) \{}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00645}00645                 \mbox{\hyperlink{geom_8h_a1d51201471b52be7e19a98b0fcb144de}{gctl\_error}}(\mbox{\hyperlink{g__part__if_8m_a7a9f20c97e75f805eb506910bd3e70d3}{req}}, \textcolor{stringliteral}{"{}No '\%s' argument."{}}, \textcolor{stringliteral}{"{}inactive"{}});}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00646}00646                 \textcolor{keywordflow}{return};}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00647}00647         \}}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00648}00648         hardcode = \mbox{\hyperlink{geom_8h_ab762d12640f528d8f1f60eee92bf5f3b}{gctl\_get\_paraml}}(\mbox{\hyperlink{g__part__if_8m_a7a9f20c97e75f805eb506910bd3e70d3}{req}}, \textcolor{stringliteral}{"{}hardcode"{}}, \textcolor{keyword}{sizeof}(*hardcode));}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00649}00649         \textcolor{keywordflow}{if} (hardcode == NULL) \{}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00650}00650                 \mbox{\hyperlink{geom_8h_a1d51201471b52be7e19a98b0fcb144de}{gctl\_error}}(\mbox{\hyperlink{g__part__if_8m_a7a9f20c97e75f805eb506910bd3e70d3}{req}}, \textcolor{stringliteral}{"{}No '\%s' argument."{}}, \textcolor{stringliteral}{"{}hardcode"{}});}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00651}00651                 \textcolor{keywordflow}{return};}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00652}00652         \}}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00653}00653         \mbox{\hyperlink{g__part__if_8m_aff5d3acc33944ecb11914d04ef06bb54}{name}} = \mbox{\hyperlink{geom_8h_ada33526012aac8ee446617bb3749a07c}{gctl\_get\_asciiparam}}(\mbox{\hyperlink{g__part__if_8m_a7a9f20c97e75f805eb506910bd3e70d3}{req}}, \textcolor{stringliteral}{"{}arg0"{}});}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00654}00654         \textcolor{keywordflow}{if} (\mbox{\hyperlink{g__part__if_8m_aff5d3acc33944ecb11914d04ef06bb54}{name}} == NULL) \{}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00655}00655                 \mbox{\hyperlink{geom_8h_a1d51201471b52be7e19a98b0fcb144de}{gctl\_error}}(\mbox{\hyperlink{g__part__if_8m_a7a9f20c97e75f805eb506910bd3e70d3}{req}}, \textcolor{stringliteral}{"{}No 'arg\%u' argument."{}}, 0);}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00656}00656                 \textcolor{keywordflow}{return};}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00657}00657         \}}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00658}00658         sc = \mbox{\hyperlink{g__mirror__ctl_8c_a739b03f28bf90ca61c27b6f056725d91}{g\_mirror\_find\_launched\_device}}(\mbox{\hyperlink{g__raid__md__if_8m_a4f7502795edfd2493d3d223d0df33e1d}{mp}}, \mbox{\hyperlink{g__part__if_8m_aff5d3acc33944ecb11914d04ef06bb54}{name}}, M\_WAITOK);}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00659}00659         \textcolor{keywordflow}{if} (sc == NULL) \{}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00660}00660                 \mbox{\hyperlink{geom_8h_a1d51201471b52be7e19a98b0fcb144de}{gctl\_error}}(\mbox{\hyperlink{g__part__if_8m_a7a9f20c97e75f805eb506910bd3e70d3}{req}}, \textcolor{stringliteral}{"{}No such device: \%s."{}}, \mbox{\hyperlink{g__part__if_8m_aff5d3acc33944ecb11914d04ef06bb54}{name}});}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00661}00661                 \textcolor{keywordflow}{return};}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00662}00662         \}}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00663}00663         \textcolor{keywordflow}{if} (\mbox{\hyperlink{g__mirror_8c_a76f0c9eed85d72267388c8094bce23dc}{g\_mirror\_ndisks}}(sc, -\/1) < sc-\/>\mbox{\hyperlink{structg__mirror__softc_a8302ed5b2d64f8d387be03bb5ab514c1}{sc\_ndisks}}) \{}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00664}00664                 \mbox{\hyperlink{geom_8h_a1d51201471b52be7e19a98b0fcb144de}{gctl\_error}}(\mbox{\hyperlink{g__part__if_8m_a7a9f20c97e75f805eb506910bd3e70d3}{req}}, \textcolor{stringliteral}{"{}Not all disks connected."{}});}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00665}00665                 sx\_xunlock(\&sc-\/>\mbox{\hyperlink{structg__mirror__softc_a98662cf0fd52070bda584f4fa296b1cb}{sc\_lock}});}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00666}00666                 \textcolor{keywordflow}{return};}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00667}00667         \}}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00668}00668 }
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00669}00669         disks = \mbox{\hyperlink{geom_8h_a0f190247baa73dc863a79fea9d5f6b4f}{g\_malloc}}(\textcolor{keyword}{sizeof}(*disks) * (*nargs), M\_WAITOK | M\_ZERO);}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00670}00670         \mbox{\hyperlink{geom_8h_a232419d2cfa06ff3f4ff7551041aed31}{g\_topology\_lock}}();}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00671}00671         \textcolor{keywordflow}{for} (i = 1, n = 0; i < (u\_int)*nargs; i++) \{}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00672}00672                 snprintf(param, \textcolor{keyword}{sizeof}(param), \textcolor{stringliteral}{"{}arg\%u"{}}, i);}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00673}00673                 \mbox{\hyperlink{g__part__if_8m_a9bc7638f295763b77465c5ebebbd3442}{pp}} = \mbox{\hyperlink{geom_8h_a02d62eea445edba7982f681b41c6c307}{gctl\_get\_provider}}(\mbox{\hyperlink{g__part__if_8m_a7a9f20c97e75f805eb506910bd3e70d3}{req}}, param);}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00674}00674                 \textcolor{keywordflow}{if} (\mbox{\hyperlink{g__part__if_8m_a9bc7638f295763b77465c5ebebbd3442}{pp}} == NULL)}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00675}00675                         \textcolor{keywordflow}{continue};}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00676}00676                 \textcolor{keywordflow}{if} (\mbox{\hyperlink{g__mirror__ctl_8c_a48ca9cc413729437685bdc5bf1f589fe}{g\_mirror\_find\_disk}}(sc, \mbox{\hyperlink{g__part__if_8m_a9bc7638f295763b77465c5ebebbd3442}{pp}}-\/>\mbox{\hyperlink{structg__provider_a2bffb416ee58cf4df7839c6fd5ec004a}{name}}) != NULL) \{}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00677}00677                         \mbox{\hyperlink{geom_8h_a1d51201471b52be7e19a98b0fcb144de}{gctl\_error}}(\mbox{\hyperlink{g__part__if_8m_a7a9f20c97e75f805eb506910bd3e70d3}{req}}, \textcolor{stringliteral}{"{}Provider \%s already inserted."{}}, \mbox{\hyperlink{g__part__if_8m_a9bc7638f295763b77465c5ebebbd3442}{pp}}-\/>\mbox{\hyperlink{structg__provider_a2bffb416ee58cf4df7839c6fd5ec004a}{name}});}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00678}00678                         \textcolor{keywordflow}{continue};}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00679}00679                 \}}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00680}00680                 \mbox{\hyperlink{g__part__if_8m_a294f18324585ff37641fb8aa1c9ccd82}{cp}} = \mbox{\hyperlink{geom_8h_aef9ca3f0eecc1b245c3c9cd0bac1cdc4}{g\_new\_consumer}}(sc-\/>\mbox{\hyperlink{structg__mirror__softc_a8bc6474081935f9897bb9bbbe425c0d4}{sc\_geom}});}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00681}00681                 \textcolor{keywordflow}{if} (\mbox{\hyperlink{geom_8h_a7f6ee69db47bae6ff5284f6a9cfceb91}{g\_attach}}(\mbox{\hyperlink{g__part__if_8m_a294f18324585ff37641fb8aa1c9ccd82}{cp}}, \mbox{\hyperlink{g__part__if_8m_a9bc7638f295763b77465c5ebebbd3442}{pp}}) != 0) \{}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00682}00682                         \mbox{\hyperlink{geom_8h_a9f53f6118c5e44ca2bcbd7ae548597b9}{g\_destroy\_consumer}}(\mbox{\hyperlink{g__part__if_8m_a294f18324585ff37641fb8aa1c9ccd82}{cp}});}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00683}00683                         \mbox{\hyperlink{geom_8h_a1d51201471b52be7e19a98b0fcb144de}{gctl\_error}}(\mbox{\hyperlink{g__part__if_8m_a7a9f20c97e75f805eb506910bd3e70d3}{req}}, \textcolor{stringliteral}{"{}Cannot attach to provider \%s."{}}, \mbox{\hyperlink{g__part__if_8m_a9bc7638f295763b77465c5ebebbd3442}{pp}}-\/>\mbox{\hyperlink{structg__provider_a2bffb416ee58cf4df7839c6fd5ec004a}{name}});}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00684}00684                         \textcolor{keywordflow}{continue};}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00685}00685                 \}}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00686}00686                 \textcolor{keywordflow}{if} (\mbox{\hyperlink{geom_8h_a27b7c72cc3bc5a4d07ce5976e1aa1b58}{g\_access}}(\mbox{\hyperlink{g__part__if_8m_a294f18324585ff37641fb8aa1c9ccd82}{cp}}, 0, 1, 1) != 0) \{}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00687}00687                         \mbox{\hyperlink{geom_8h_a1d51201471b52be7e19a98b0fcb144de}{gctl\_error}}(\mbox{\hyperlink{g__part__if_8m_a7a9f20c97e75f805eb506910bd3e70d3}{req}}, \textcolor{stringliteral}{"{}Cannot access provider \%s."{}}, \mbox{\hyperlink{g__part__if_8m_a9bc7638f295763b77465c5ebebbd3442}{pp}}-\/>\mbox{\hyperlink{structg__provider_a2bffb416ee58cf4df7839c6fd5ec004a}{name}});}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00688}00688 err:}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00689}00689                         \mbox{\hyperlink{geom_8h_a037802c2ec5d43fcf1222215f9f8a735}{g\_detach}}(\mbox{\hyperlink{g__part__if_8m_a294f18324585ff37641fb8aa1c9ccd82}{cp}});}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00690}00690                         \mbox{\hyperlink{geom_8h_a9f53f6118c5e44ca2bcbd7ae548597b9}{g\_destroy\_consumer}}(\mbox{\hyperlink{g__part__if_8m_a294f18324585ff37641fb8aa1c9ccd82}{cp}});}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00691}00691                         \textcolor{keywordflow}{continue};}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00692}00692                 \}}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00693}00693                 mdsize = (sc-\/>\mbox{\hyperlink{structg__mirror__softc_a28e0d87a0e1cd099daa1e813f9655ad0}{sc\_type}} == \mbox{\hyperlink{g__mirror_8h_a84e6f46b4d70ce3159c5f85ba91b33c0}{G\_MIRROR\_TYPE\_AUTOMATIC}}) ?}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00694}00694                     \mbox{\hyperlink{g__part__if_8m_a9bc7638f295763b77465c5ebebbd3442}{pp}}-\/>\mbox{\hyperlink{structg__provider_aea3cd43d41461790b8d0afcd8c49a355}{sectorsize}} : 0;}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00695}00695                 if (sc-\/>\mbox{\hyperlink{structg__mirror__softc_a724ce95b57685af7d1dc8d810c5ed256}{sc\_provider}}-\/>\mbox{\hyperlink{structg__provider_a8f47c464c78aa91fa4ca5143ed3cd15e}{mediasize}} > \mbox{\hyperlink{g__part__if_8m_a9bc7638f295763b77465c5ebebbd3442}{pp}}-\/>\mbox{\hyperlink{structg__provider_a8f47c464c78aa91fa4ca5143ed3cd15e}{mediasize}} -\/ mdsize) \{}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00696}00696                         \mbox{\hyperlink{geom_8h_a1d51201471b52be7e19a98b0fcb144de}{gctl\_error}}(\mbox{\hyperlink{g__part__if_8m_a7a9f20c97e75f805eb506910bd3e70d3}{req}}, \textcolor{stringliteral}{"{}Provider \%s too small."{}}, \mbox{\hyperlink{g__part__if_8m_a9bc7638f295763b77465c5ebebbd3442}{pp}}-\/>\mbox{\hyperlink{structg__provider_a2bffb416ee58cf4df7839c6fd5ec004a}{name}});}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00697}00697 err2:}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00698}00698                         \mbox{\hyperlink{geom_8h_a27b7c72cc3bc5a4d07ce5976e1aa1b58}{g\_access}}(\mbox{\hyperlink{g__part__if_8m_a294f18324585ff37641fb8aa1c9ccd82}{cp}}, 0, -\/1, -\/1);}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00699}00699                         \textcolor{keywordflow}{goto} err;}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00700}00700                 \}}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00701}00701                 \textcolor{keywordflow}{if} ((sc-\/>\mbox{\hyperlink{structg__mirror__softc_a724ce95b57685af7d1dc8d810c5ed256}{sc\_provider}}-\/>\mbox{\hyperlink{structg__provider_aea3cd43d41461790b8d0afcd8c49a355}{sectorsize}} \% \mbox{\hyperlink{g__part__if_8m_a9bc7638f295763b77465c5ebebbd3442}{pp}}-\/>\mbox{\hyperlink{structg__provider_aea3cd43d41461790b8d0afcd8c49a355}{sectorsize}}) != 0) \{}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00702}00702                         \mbox{\hyperlink{geom_8h_a1d51201471b52be7e19a98b0fcb144de}{gctl\_error}}(\mbox{\hyperlink{g__part__if_8m_a7a9f20c97e75f805eb506910bd3e70d3}{req}}, \textcolor{stringliteral}{"{}Invalid sectorsize of provider \%s."{}},}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00703}00703                             \mbox{\hyperlink{g__part__if_8m_a9bc7638f295763b77465c5ebebbd3442}{pp}}-\/>\mbox{\hyperlink{structg__provider_a2bffb416ee58cf4df7839c6fd5ec004a}{name}});}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00704}00704                         \textcolor{keywordflow}{goto} err2;}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00705}00705                 \}}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00706}00706                 \textcolor{keywordflow}{if} (sc-\/>\mbox{\hyperlink{structg__mirror__softc_a28e0d87a0e1cd099daa1e813f9655ad0}{sc\_type}} != \mbox{\hyperlink{g__mirror_8h_a84e6f46b4d70ce3159c5f85ba91b33c0}{G\_MIRROR\_TYPE\_AUTOMATIC}}) \{}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00707}00707                         \mbox{\hyperlink{geom_8h_a27b7c72cc3bc5a4d07ce5976e1aa1b58}{g\_access}}(\mbox{\hyperlink{g__part__if_8m_a294f18324585ff37641fb8aa1c9ccd82}{cp}}, 0, -\/1, -\/1);}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00708}00708                         \mbox{\hyperlink{geom_8h_a037802c2ec5d43fcf1222215f9f8a735}{g\_detach}}(\mbox{\hyperlink{g__part__if_8m_a294f18324585ff37641fb8aa1c9ccd82}{cp}});}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00709}00709                         \mbox{\hyperlink{geom_8h_a9f53f6118c5e44ca2bcbd7ae548597b9}{g\_destroy\_consumer}}(\mbox{\hyperlink{g__part__if_8m_a294f18324585ff37641fb8aa1c9ccd82}{cp}});}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00710}00710                         \mbox{\hyperlink{geom_8h_a4628d4de49ba84e7a6126cc30d23b83a}{g\_topology\_unlock}}();}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00711}00711                         sc-\/>\mbox{\hyperlink{structg__mirror__softc_a8302ed5b2d64f8d387be03bb5ab514c1}{sc\_ndisks}}++;}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00712}00712                         \mbox{\hyperlink{g__mirror_8c_aee010060884f6b22e9d2721f174bf00f}{g\_mirror\_fill\_metadata}}(sc, NULL, \&md);}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00713}00713                         md.\mbox{\hyperlink{structg__mirror__metadata_aaff9c297fafc6e7ae8436fa6944f3391}{md\_priority}} = *priority;}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00714}00714                         \textcolor{keywordflow}{if} (*inactive)}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00715}00715                                 md.\mbox{\hyperlink{structg__mirror__metadata_a8fc45162278cb5a1477a90195caac417}{md\_dflags}} |= \mbox{\hyperlink{g__mirror_8h_a8c828752a3d9e0f880cbc23b2c952047}{G\_MIRROR\_DISK\_FLAG\_INACTIVE}};}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00716}00716                         \textcolor{keywordflow}{if} (\mbox{\hyperlink{g__mirror_8c_a15bc4a2aee9cedc80c3f0477933968b4}{g\_mirror\_add\_disk}}(sc, \mbox{\hyperlink{g__part__if_8m_a9bc7638f295763b77465c5ebebbd3442}{pp}}, \&md) != 0) \{}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00717}00717                                 sc-\/>\mbox{\hyperlink{structg__mirror__softc_a8302ed5b2d64f8d387be03bb5ab514c1}{sc\_ndisks}}-\/-\/;}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00718}00718                                 \mbox{\hyperlink{geom_8h_a1d51201471b52be7e19a98b0fcb144de}{gctl\_error}}(\mbox{\hyperlink{g__part__if_8m_a7a9f20c97e75f805eb506910bd3e70d3}{req}}, \textcolor{stringliteral}{"{}Disk \%s not inserted."{}}, \mbox{\hyperlink{g__part__if_8m_a9bc7638f295763b77465c5ebebbd3442}{pp}}-\/>\mbox{\hyperlink{structg__provider_a2bffb416ee58cf4df7839c6fd5ec004a}{name}});}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00719}00719                         \}}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00720}00720                         \mbox{\hyperlink{geom_8h_a232419d2cfa06ff3f4ff7551041aed31}{g\_topology\_lock}}();}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00721}00721                         \textcolor{keywordflow}{continue};}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00722}00722                 \}}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00723}00723                 disks[n].provider = \mbox{\hyperlink{g__part__if_8m_a9bc7638f295763b77465c5ebebbd3442}{pp}};}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00724}00724                 disks[n].consumer = \mbox{\hyperlink{g__part__if_8m_a294f18324585ff37641fb8aa1c9ccd82}{cp}};}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00725}00725                 n++;}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00726}00726         \}}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00727}00727         \textcolor{keywordflow}{if} (n == 0) \{}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00728}00728                 \mbox{\hyperlink{geom_8h_a4628d4de49ba84e7a6126cc30d23b83a}{g\_topology\_unlock}}();}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00729}00729                 sx\_xunlock(\&sc-\/>\mbox{\hyperlink{structg__mirror__softc_a98662cf0fd52070bda584f4fa296b1cb}{sc\_lock}});}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00730}00730                 \mbox{\hyperlink{geom_8h_ad9924deb20de7b40cb6cf06e5ae28855}{g\_free}}(disks);}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00731}00731                 \textcolor{keywordflow}{return};}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00732}00732         \}}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00733}00733         sc-\/>\mbox{\hyperlink{structg__mirror__softc_a8302ed5b2d64f8d387be03bb5ab514c1}{sc\_ndisks}} += n;}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00734}00734 again:}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00735}00735         \textcolor{keywordflow}{for} (i = 0; i < n; i++) \{}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00736}00736                 \textcolor{keywordflow}{if} (disks[i].consumer == NULL)}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00737}00737                         \textcolor{keywordflow}{continue};}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00738}00738                 \mbox{\hyperlink{g__mirror_8c_aee010060884f6b22e9d2721f174bf00f}{g\_mirror\_fill\_metadata}}(sc, NULL, \&md);}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00739}00739                 md.\mbox{\hyperlink{structg__mirror__metadata_aaff9c297fafc6e7ae8436fa6944f3391}{md\_priority}} = *priority;}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00740}00740                 \textcolor{keywordflow}{if} (*inactive)}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00741}00741                         md.\mbox{\hyperlink{structg__mirror__metadata_a8fc45162278cb5a1477a90195caac417}{md\_dflags}} |= \mbox{\hyperlink{g__mirror_8h_a8c828752a3d9e0f880cbc23b2c952047}{G\_MIRROR\_DISK\_FLAG\_INACTIVE}};}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00742}00742                 \mbox{\hyperlink{g__part__if_8m_a9bc7638f295763b77465c5ebebbd3442}{pp}} = disks[i].provider;}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00743}00743                 \textcolor{keywordflow}{if} (*hardcode) \{}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00744}00744                         strlcpy(md.\mbox{\hyperlink{structg__mirror__metadata_a9ac9aa3e99a7d4ec2910c9411853b02c}{md\_provider}}, \mbox{\hyperlink{g__part__if_8m_a9bc7638f295763b77465c5ebebbd3442}{pp}}-\/>\mbox{\hyperlink{structg__provider_a2bffb416ee58cf4df7839c6fd5ec004a}{name}},}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00745}00745                             \textcolor{keyword}{sizeof}(md.\mbox{\hyperlink{structg__mirror__metadata_a9ac9aa3e99a7d4ec2910c9411853b02c}{md\_provider}}));}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00746}00746                 \} \textcolor{keywordflow}{else} \{}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00747}00747                         bzero(md.\mbox{\hyperlink{structg__mirror__metadata_a9ac9aa3e99a7d4ec2910c9411853b02c}{md\_provider}}, \textcolor{keyword}{sizeof}(md.\mbox{\hyperlink{structg__mirror__metadata_a9ac9aa3e99a7d4ec2910c9411853b02c}{md\_provider}}));}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00748}00748                 \}}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00749}00749                 md.\mbox{\hyperlink{structg__mirror__metadata_a8d5546582f6ed51f35f9f70f305a2b64}{md\_provsize}} = \mbox{\hyperlink{g__part__if_8m_a9bc7638f295763b77465c5ebebbd3442}{pp}}-\/>\mbox{\hyperlink{structg__provider_a8f47c464c78aa91fa4ca5143ed3cd15e}{mediasize}};}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00750}00750                 sector = \mbox{\hyperlink{geom_8h_a0f190247baa73dc863a79fea9d5f6b4f}{g\_malloc}}(\mbox{\hyperlink{g__part__if_8m_a9bc7638f295763b77465c5ebebbd3442}{pp}}-\/>\mbox{\hyperlink{structg__provider_aea3cd43d41461790b8d0afcd8c49a355}{sectorsize}}, M\_WAITOK | M\_ZERO);}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00751}00751                 \mbox{\hyperlink{g__mirror_8h_a880e9957ab1c3aa57d5865320703235f}{mirror\_metadata\_encode}}(\&md, sector);}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00752}00752                 error = \mbox{\hyperlink{geom_8h_a9b87ecbd812c109546b077da483baada}{g\_write\_data}}(disks[i].consumer,}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00753}00753                     \mbox{\hyperlink{g__part__if_8m_a9bc7638f295763b77465c5ebebbd3442}{pp}}-\/>\mbox{\hyperlink{structg__provider_a8f47c464c78aa91fa4ca5143ed3cd15e}{mediasize}} -\/ \mbox{\hyperlink{g__part__if_8m_a9bc7638f295763b77465c5ebebbd3442}{pp}}-\/>\mbox{\hyperlink{structg__provider_aea3cd43d41461790b8d0afcd8c49a355}{sectorsize}}, sector, \mbox{\hyperlink{g__part__if_8m_a9bc7638f295763b77465c5ebebbd3442}{pp}}-\/>\mbox{\hyperlink{structg__provider_aea3cd43d41461790b8d0afcd8c49a355}{sectorsize}});}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00754}00754                 \mbox{\hyperlink{geom_8h_ad9924deb20de7b40cb6cf06e5ae28855}{g\_free}}(sector);}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00755}00755                 \textcolor{keywordflow}{if} (error != 0) \{}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00756}00756                         \mbox{\hyperlink{geom_8h_a1d51201471b52be7e19a98b0fcb144de}{gctl\_error}}(\mbox{\hyperlink{g__part__if_8m_a7a9f20c97e75f805eb506910bd3e70d3}{req}}, \textcolor{stringliteral}{"{}Cannot store metadata on \%s."{}},}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00757}00757                             \mbox{\hyperlink{g__part__if_8m_a9bc7638f295763b77465c5ebebbd3442}{pp}}-\/>\mbox{\hyperlink{structg__provider_a2bffb416ee58cf4df7839c6fd5ec004a}{name}});}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00758}00758                         \mbox{\hyperlink{geom_8h_a27b7c72cc3bc5a4d07ce5976e1aa1b58}{g\_access}}(disks[i].consumer, 0, -\/1, -\/1);}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00759}00759                         \mbox{\hyperlink{geom_8h_a037802c2ec5d43fcf1222215f9f8a735}{g\_detach}}(disks[i].consumer);}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00760}00760                         \mbox{\hyperlink{geom_8h_a9f53f6118c5e44ca2bcbd7ae548597b9}{g\_destroy\_consumer}}(disks[i].consumer);}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00761}00761                         disks[i].consumer = NULL;}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00762}00762                         disks[i].provider = NULL;}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00763}00763                         sc-\/>\mbox{\hyperlink{structg__mirror__softc_a8302ed5b2d64f8d387be03bb5ab514c1}{sc\_ndisks}}-\/-\/;}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00764}00764                         \textcolor{keywordflow}{goto} again;}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00765}00765                 \}}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00766}00766         \}}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00767}00767         \mbox{\hyperlink{geom_8h_a4628d4de49ba84e7a6126cc30d23b83a}{g\_topology\_unlock}}();}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00768}00768         \textcolor{keywordflow}{if} (i == 0) \{}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00769}00769                 \textcolor{comment}{/* All writes failed. */}}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00770}00770                 sx\_xunlock(\&sc-\/>\mbox{\hyperlink{structg__mirror__softc_a98662cf0fd52070bda584f4fa296b1cb}{sc\_lock}});}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00771}00771                 \mbox{\hyperlink{geom_8h_ad9924deb20de7b40cb6cf06e5ae28855}{g\_free}}(disks);}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00772}00772                 \textcolor{keywordflow}{return};}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00773}00773         \}}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00774}00774         LIST\_FOREACH(\mbox{\hyperlink{structdisk}{disk}}, \&sc-\/>sc\_disks, d\_next) \{}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00775}00775                 \mbox{\hyperlink{g__mirror_8c_aae3b509a195824dad058cd9156eccbb7}{g\_mirror\_update\_metadata}}(\mbox{\hyperlink{structdisk}{disk}});}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00776}00776         \}}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00777}00777         \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00778}00778 \textcolor{comment}{         * Release provider and wait for retaste.}}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00779}00779 \textcolor{comment}{         */}}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00780}00780         \mbox{\hyperlink{geom_8h_a232419d2cfa06ff3f4ff7551041aed31}{g\_topology\_lock}}();}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00781}00781         \textcolor{keywordflow}{for} (i = 0; i < n; i++) \{}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00782}00782                 \textcolor{keywordflow}{if} (disks[i].consumer == NULL)}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00783}00783                         \textcolor{keywordflow}{continue};}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00784}00784                 \mbox{\hyperlink{geom_8h_a27b7c72cc3bc5a4d07ce5976e1aa1b58}{g\_access}}(disks[i].consumer, 0, -\/1, -\/1);}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00785}00785                 \mbox{\hyperlink{geom_8h_a037802c2ec5d43fcf1222215f9f8a735}{g\_detach}}(disks[i].consumer);}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00786}00786                 \mbox{\hyperlink{geom_8h_a9f53f6118c5e44ca2bcbd7ae548597b9}{g\_destroy\_consumer}}(disks[i].consumer);}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00787}00787         \}}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00788}00788         \mbox{\hyperlink{geom_8h_a4628d4de49ba84e7a6126cc30d23b83a}{g\_topology\_unlock}}();}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00789}00789         sx\_xunlock(\&sc-\/>\mbox{\hyperlink{structg__mirror__softc_a98662cf0fd52070bda584f4fa296b1cb}{sc\_lock}});}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00790}00790         \mbox{\hyperlink{geom_8h_ad9924deb20de7b40cb6cf06e5ae28855}{g\_free}}(disks);}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00791}00791 \}}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00792}00792 }
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00793}00793 \textcolor{keyword}{static} \textcolor{keywordtype}{void}}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00794}\mbox{\hyperlink{g__mirror__ctl_8c_a3939d0d42f7801b9b4774cc444a9ecb9}{00794}} \mbox{\hyperlink{g__mirror__ctl_8c_a3939d0d42f7801b9b4774cc444a9ecb9}{g\_mirror\_ctl\_remove}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structgctl__req}{gctl\_req}} *\mbox{\hyperlink{g__part__if_8m_a7a9f20c97e75f805eb506910bd3e70d3}{req}}, \textcolor{keyword}{struct} \mbox{\hyperlink{structg__class}{g\_class}} *\mbox{\hyperlink{g__raid__md__if_8m_a4f7502795edfd2493d3d223d0df33e1d}{mp}})}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00795}00795 \{}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00796}00796         \textcolor{keyword}{struct }\mbox{\hyperlink{structg__mirror__softc}{g\_mirror\_softc}} *sc;}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00797}00797         \textcolor{keyword}{struct }\mbox{\hyperlink{structg__mirror__disk}{g\_mirror\_disk}} *\mbox{\hyperlink{g__raid__md__if_8m_a9508e997a57ea259d6ecc0e563261993}{disk}};}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00798}00798         \textcolor{keyword}{const} \textcolor{keywordtype}{char} *\mbox{\hyperlink{g__part__if_8m_aff5d3acc33944ecb11914d04ef06bb54}{name}};}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00799}00799         \textcolor{keywordtype}{char} param[16];}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00800}00800         \textcolor{keywordtype}{int} *nargs;}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00801}00801         u\_int i, active;}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00802}00802 }
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00803}00803         nargs = \mbox{\hyperlink{geom_8h_ab762d12640f528d8f1f60eee92bf5f3b}{gctl\_get\_paraml}}(\mbox{\hyperlink{g__part__if_8m_a7a9f20c97e75f805eb506910bd3e70d3}{req}}, \textcolor{stringliteral}{"{}nargs"{}}, \textcolor{keyword}{sizeof}(*nargs));}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00804}00804         \textcolor{keywordflow}{if} (nargs == NULL) \{}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00805}00805                 \mbox{\hyperlink{geom_8h_a1d51201471b52be7e19a98b0fcb144de}{gctl\_error}}(\mbox{\hyperlink{g__part__if_8m_a7a9f20c97e75f805eb506910bd3e70d3}{req}}, \textcolor{stringliteral}{"{}No '\%s' argument."{}}, \textcolor{stringliteral}{"{}nargs"{}});}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00806}00806                 \textcolor{keywordflow}{return};}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00807}00807         \}}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00808}00808         \textcolor{keywordflow}{if} (*nargs < 2) \{}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00809}00809                 \mbox{\hyperlink{geom_8h_a1d51201471b52be7e19a98b0fcb144de}{gctl\_error}}(\mbox{\hyperlink{g__part__if_8m_a7a9f20c97e75f805eb506910bd3e70d3}{req}}, \textcolor{stringliteral}{"{}Too few arguments."{}});}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00810}00810                 \textcolor{keywordflow}{return};}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00811}00811         \}}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00812}00812         \mbox{\hyperlink{g__part__if_8m_aff5d3acc33944ecb11914d04ef06bb54}{name}} = \mbox{\hyperlink{geom_8h_ada33526012aac8ee446617bb3749a07c}{gctl\_get\_asciiparam}}(\mbox{\hyperlink{g__part__if_8m_a7a9f20c97e75f805eb506910bd3e70d3}{req}}, \textcolor{stringliteral}{"{}arg0"{}});}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00813}00813         \textcolor{keywordflow}{if} (\mbox{\hyperlink{g__part__if_8m_aff5d3acc33944ecb11914d04ef06bb54}{name}} == NULL) \{}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00814}00814                 \mbox{\hyperlink{geom_8h_a1d51201471b52be7e19a98b0fcb144de}{gctl\_error}}(\mbox{\hyperlink{g__part__if_8m_a7a9f20c97e75f805eb506910bd3e70d3}{req}}, \textcolor{stringliteral}{"{}No 'arg\%u' argument."{}}, 0);}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00815}00815                 \textcolor{keywordflow}{return};}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00816}00816         \}}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00817}00817         sc = \mbox{\hyperlink{g__mirror__ctl_8c_aa3363d3c57f61394b21d8bb4bab23f2d}{g\_mirror\_find\_device}}(\mbox{\hyperlink{g__raid__md__if_8m_a4f7502795edfd2493d3d223d0df33e1d}{mp}}, \mbox{\hyperlink{g__part__if_8m_aff5d3acc33944ecb11914d04ef06bb54}{name}});}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00818}00818         \textcolor{keywordflow}{if} (sc == NULL) \{}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00819}00819                 \mbox{\hyperlink{geom_8h_a1d51201471b52be7e19a98b0fcb144de}{gctl\_error}}(\mbox{\hyperlink{g__part__if_8m_a7a9f20c97e75f805eb506910bd3e70d3}{req}}, \textcolor{stringliteral}{"{}No such device: \%s."{}}, \mbox{\hyperlink{g__part__if_8m_aff5d3acc33944ecb11914d04ef06bb54}{name}});}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00820}00820                 \textcolor{keywordflow}{return};}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00821}00821         \}}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00822}00822         \textcolor{keywordflow}{if} (\mbox{\hyperlink{g__mirror_8c_a76f0c9eed85d72267388c8094bce23dc}{g\_mirror\_ndisks}}(sc, -\/1) < sc-\/>\mbox{\hyperlink{structg__mirror__softc_a8302ed5b2d64f8d387be03bb5ab514c1}{sc\_ndisks}}) \{}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00823}00823                 sx\_xunlock(\&sc-\/>\mbox{\hyperlink{structg__mirror__softc_a98662cf0fd52070bda584f4fa296b1cb}{sc\_lock}});}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00824}00824                 \mbox{\hyperlink{geom_8h_a1d51201471b52be7e19a98b0fcb144de}{gctl\_error}}(\mbox{\hyperlink{g__part__if_8m_a7a9f20c97e75f805eb506910bd3e70d3}{req}}, \textcolor{stringliteral}{"{}Not all disks connected. Try 'forget' command "{}}}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00825}00825                     \textcolor{stringliteral}{"{}first."{}});}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00826}00826                 \textcolor{keywordflow}{return};}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00827}00827         \}}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00828}00828         active = \mbox{\hyperlink{g__mirror_8c_a76f0c9eed85d72267388c8094bce23dc}{g\_mirror\_ndisks}}(sc, \mbox{\hyperlink{g__mirror_8h_aa88d381f7d55ce32d3dc797d0967a4c9}{G\_MIRROR\_DISK\_STATE\_ACTIVE}});}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00829}00829         \textcolor{keywordflow}{for} (i = 1; i < (u\_int)*nargs; i++) \{}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00830}00830                 snprintf(param, \textcolor{keyword}{sizeof}(param), \textcolor{stringliteral}{"{}arg\%u"{}}, i);}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00831}00831                 \mbox{\hyperlink{g__part__if_8m_aff5d3acc33944ecb11914d04ef06bb54}{name}} = \mbox{\hyperlink{geom_8h_ada33526012aac8ee446617bb3749a07c}{gctl\_get\_asciiparam}}(\mbox{\hyperlink{g__part__if_8m_a7a9f20c97e75f805eb506910bd3e70d3}{req}}, param);}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00832}00832                 \textcolor{keywordflow}{if} (\mbox{\hyperlink{g__part__if_8m_aff5d3acc33944ecb11914d04ef06bb54}{name}} == NULL) \{}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00833}00833                         \mbox{\hyperlink{geom_8h_a1d51201471b52be7e19a98b0fcb144de}{gctl\_error}}(\mbox{\hyperlink{g__part__if_8m_a7a9f20c97e75f805eb506910bd3e70d3}{req}}, \textcolor{stringliteral}{"{}No 'arg\%u' argument."{}}, i);}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00834}00834                         \textcolor{keywordflow}{continue};}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00835}00835                 \}}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00836}00836                 \mbox{\hyperlink{structdisk}{disk}} = \mbox{\hyperlink{g__mirror__ctl_8c_a48ca9cc413729437685bdc5bf1f589fe}{g\_mirror\_find\_disk}}(sc, \mbox{\hyperlink{g__part__if_8m_aff5d3acc33944ecb11914d04ef06bb54}{name}});}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00837}00837                 \textcolor{keywordflow}{if} (\mbox{\hyperlink{structdisk}{disk}} == NULL) \{}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00838}00838                         \mbox{\hyperlink{geom_8h_a1d51201471b52be7e19a98b0fcb144de}{gctl\_error}}(\mbox{\hyperlink{g__part__if_8m_a7a9f20c97e75f805eb506910bd3e70d3}{req}}, \textcolor{stringliteral}{"{}No such provider: \%s."{}}, \mbox{\hyperlink{g__part__if_8m_aff5d3acc33944ecb11914d04ef06bb54}{name}});}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00839}00839                         \textcolor{keywordflow}{continue};}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00840}00840                 \}}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00841}00841                 \textcolor{keywordflow}{if} (\mbox{\hyperlink{structdisk}{disk}}-\/>d\_state == \mbox{\hyperlink{g__mirror_8h_aa88d381f7d55ce32d3dc797d0967a4c9}{G\_MIRROR\_DISK\_STATE\_ACTIVE}}) \{}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00842}00842                         \textcolor{keywordflow}{if} (active > 1)}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00843}00843                                 active-\/-\/;}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00844}00844                         \textcolor{keywordflow}{else} \{}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00845}00845                                 \mbox{\hyperlink{geom_8h_a1d51201471b52be7e19a98b0fcb144de}{gctl\_error}}(\mbox{\hyperlink{g__part__if_8m_a7a9f20c97e75f805eb506910bd3e70d3}{req}}, \textcolor{stringliteral}{"{}\%s: Can't remove the last "{}}}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00846}00846                                     \textcolor{stringliteral}{"{}ACTIVE component \%s."{}}, sc-\/>\mbox{\hyperlink{structg__mirror__softc_a8bc6474081935f9897bb9bbbe425c0d4}{sc\_geom}}-\/>\mbox{\hyperlink{structg__geom_af64450500f1fea18f639b191a5017107}{name}},}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00847}00847                                     \mbox{\hyperlink{g__part__if_8m_aff5d3acc33944ecb11914d04ef06bb54}{name}});}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00848}00848                                 \textcolor{keywordflow}{continue};}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00849}00849                         \}}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00850}00850                 \}}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00851}00851                 \mbox{\hyperlink{g__mirror_8c_acb3acdbd049684b07266d3f405fa712b}{g\_mirror\_event\_send}}(\mbox{\hyperlink{structdisk}{disk}}, \mbox{\hyperlink{g__mirror_8h_aa3fd7895419b89f229cfcd517e878636}{G\_MIRROR\_DISK\_STATE\_DESTROY}},}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00852}00852                     \mbox{\hyperlink{g__mirror_8h_ab767cbba6414114682f0119cabbeff11}{G\_MIRROR\_EVENT\_DONTWAIT}});}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00853}00853         \}}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00854}00854         sx\_xunlock(\&sc-\/>\mbox{\hyperlink{structg__mirror__softc_a98662cf0fd52070bda584f4fa296b1cb}{sc\_lock}});}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00855}00855 \}}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00856}00856 }
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00857}00857 \textcolor{keyword}{static} \textcolor{keywordtype}{void}}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00858}\mbox{\hyperlink{g__mirror__ctl_8c_a4eeafc536ffb5a7b1ef34cf992c53265}{00858}} \mbox{\hyperlink{g__mirror__ctl_8c_a4eeafc536ffb5a7b1ef34cf992c53265}{g\_mirror\_ctl\_resize}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structgctl__req}{gctl\_req}} *\mbox{\hyperlink{g__part__if_8m_a7a9f20c97e75f805eb506910bd3e70d3}{req}}, \textcolor{keyword}{struct} \mbox{\hyperlink{structg__class}{g\_class}} *\mbox{\hyperlink{g__raid__md__if_8m_a4f7502795edfd2493d3d223d0df33e1d}{mp}})}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00859}00859 \{}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00860}00860         \textcolor{keyword}{struct }\mbox{\hyperlink{structg__mirror__softc}{g\_mirror\_softc}} *sc;}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00861}00861         \textcolor{keyword}{struct }\mbox{\hyperlink{structg__mirror__disk}{g\_mirror\_disk}} *\mbox{\hyperlink{g__raid__md__if_8m_a9508e997a57ea259d6ecc0e563261993}{disk}};}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00862}00862         uint64\_t mediasize;}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00863}00863         \textcolor{keyword}{const} \textcolor{keywordtype}{char} *\mbox{\hyperlink{g__part__if_8m_aff5d3acc33944ecb11914d04ef06bb54}{name}}, *s;}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00864}00864         \textcolor{keywordtype}{char} *x;}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00865}00865         \textcolor{keywordtype}{int} *nargs;}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00866}00866 }
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00867}00867         nargs = \mbox{\hyperlink{geom_8h_ab762d12640f528d8f1f60eee92bf5f3b}{gctl\_get\_paraml}}(\mbox{\hyperlink{g__part__if_8m_a7a9f20c97e75f805eb506910bd3e70d3}{req}}, \textcolor{stringliteral}{"{}nargs"{}}, \textcolor{keyword}{sizeof}(*nargs));}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00868}00868         \textcolor{keywordflow}{if} (nargs == NULL) \{}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00869}00869                 \mbox{\hyperlink{geom_8h_a1d51201471b52be7e19a98b0fcb144de}{gctl\_error}}(\mbox{\hyperlink{g__part__if_8m_a7a9f20c97e75f805eb506910bd3e70d3}{req}}, \textcolor{stringliteral}{"{}No '\%s' argument."{}}, \textcolor{stringliteral}{"{}nargs"{}});}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00870}00870                 \textcolor{keywordflow}{return};}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00871}00871         \}}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00872}00872         \textcolor{keywordflow}{if} (*nargs != 1) \{}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00873}00873                 \mbox{\hyperlink{geom_8h_a1d51201471b52be7e19a98b0fcb144de}{gctl\_error}}(\mbox{\hyperlink{g__part__if_8m_a7a9f20c97e75f805eb506910bd3e70d3}{req}}, \textcolor{stringliteral}{"{}Missing device."{}});}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00874}00874                 \textcolor{keywordflow}{return};}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00875}00875         \}}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00876}00876         \mbox{\hyperlink{g__part__if_8m_aff5d3acc33944ecb11914d04ef06bb54}{name}} = \mbox{\hyperlink{geom_8h_ada33526012aac8ee446617bb3749a07c}{gctl\_get\_asciiparam}}(\mbox{\hyperlink{g__part__if_8m_a7a9f20c97e75f805eb506910bd3e70d3}{req}}, \textcolor{stringliteral}{"{}arg0"{}});}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00877}00877         \textcolor{keywordflow}{if} (\mbox{\hyperlink{g__part__if_8m_aff5d3acc33944ecb11914d04ef06bb54}{name}} == NULL) \{}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00878}00878                 \mbox{\hyperlink{geom_8h_a1d51201471b52be7e19a98b0fcb144de}{gctl\_error}}(\mbox{\hyperlink{g__part__if_8m_a7a9f20c97e75f805eb506910bd3e70d3}{req}}, \textcolor{stringliteral}{"{}No 'arg\%u' argument."{}}, 0);}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00879}00879                 \textcolor{keywordflow}{return};}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00880}00880         \}}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00881}00881         s = \mbox{\hyperlink{geom_8h_ada33526012aac8ee446617bb3749a07c}{gctl\_get\_asciiparam}}(\mbox{\hyperlink{g__part__if_8m_a7a9f20c97e75f805eb506910bd3e70d3}{req}}, \textcolor{stringliteral}{"{}size"{}});}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00882}00882         \textcolor{keywordflow}{if} (s == NULL) \{}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00883}00883                 \mbox{\hyperlink{geom_8h_a1d51201471b52be7e19a98b0fcb144de}{gctl\_error}}(\mbox{\hyperlink{g__part__if_8m_a7a9f20c97e75f805eb506910bd3e70d3}{req}}, \textcolor{stringliteral}{"{}No '\%s' argument."{}}, \textcolor{stringliteral}{"{}size"{}});}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00884}00884                 \textcolor{keywordflow}{return};}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00885}00885         \}}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00886}00886         mediasize = strtouq(s, \&x, 0);}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00887}00887         \textcolor{keywordflow}{if} (*x != \textcolor{charliteral}{'\(\backslash\)0'} || mediasize == 0) \{}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00888}00888                 \mbox{\hyperlink{geom_8h_a1d51201471b52be7e19a98b0fcb144de}{gctl\_error}}(\mbox{\hyperlink{g__part__if_8m_a7a9f20c97e75f805eb506910bd3e70d3}{req}}, \textcolor{stringliteral}{"{}Invalid '\%s' argument."{}}, \textcolor{stringliteral}{"{}size"{}});}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00889}00889                 \textcolor{keywordflow}{return};}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00890}00890         \}}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00891}00891         sc = \mbox{\hyperlink{g__mirror__ctl_8c_a739b03f28bf90ca61c27b6f056725d91}{g\_mirror\_find\_launched\_device}}(\mbox{\hyperlink{g__raid__md__if_8m_a4f7502795edfd2493d3d223d0df33e1d}{mp}}, \mbox{\hyperlink{g__part__if_8m_aff5d3acc33944ecb11914d04ef06bb54}{name}}, M\_WAITOK);}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00892}00892         \textcolor{keywordflow}{if} (sc == NULL) \{}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00893}00893                 \mbox{\hyperlink{geom_8h_a1d51201471b52be7e19a98b0fcb144de}{gctl\_error}}(\mbox{\hyperlink{g__part__if_8m_a7a9f20c97e75f805eb506910bd3e70d3}{req}}, \textcolor{stringliteral}{"{}No such device: \%s."{}}, \mbox{\hyperlink{g__part__if_8m_aff5d3acc33944ecb11914d04ef06bb54}{name}});}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00894}00894                 \textcolor{keywordflow}{return};}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00895}00895         \}}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00896}00896         \textcolor{comment}{/* Deny shrinking of an opened provider */}}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00897}00897         \textcolor{keywordflow}{if} ((\mbox{\hyperlink{geom_8h_aca9e9300747035c84977158ea1fe1d38}{g\_debugflags}} \& \mbox{\hyperlink{geom_8h_ac5335e69a9ab03862196e80d4e2c5af8}{G\_F\_FOOTSHOOTING}}) == 0 \&\& sc-\/>\mbox{\hyperlink{structg__mirror__softc_a40ef618243fb8bce5d7d34903ef67f1a}{sc\_provider\_open}} > 0) \{}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00898}00898                 \textcolor{keywordflow}{if} (sc-\/>\mbox{\hyperlink{structg__mirror__softc_a362f5a8aad72856f637a89871862e82f}{sc\_mediasize}} > mediasize) \{}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00899}00899                         \mbox{\hyperlink{geom_8h_a1d51201471b52be7e19a98b0fcb144de}{gctl\_error}}(\mbox{\hyperlink{g__part__if_8m_a7a9f20c97e75f805eb506910bd3e70d3}{req}}, \textcolor{stringliteral}{"{}Device \%s is busy."{}},}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00900}00900                             sc-\/>\mbox{\hyperlink{structg__mirror__softc_a724ce95b57685af7d1dc8d810c5ed256}{sc\_provider}}-\/>\mbox{\hyperlink{structg__provider_a2bffb416ee58cf4df7839c6fd5ec004a}{name}});}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00901}00901                         sx\_xunlock(\&sc-\/>\mbox{\hyperlink{structg__mirror__softc_a98662cf0fd52070bda584f4fa296b1cb}{sc\_lock}});}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00902}00902                         \textcolor{keywordflow}{return};}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00903}00903                 \}}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00904}00904         \}}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00905}00905         LIST\_FOREACH(\mbox{\hyperlink{structdisk}{disk}}, \&sc-\/>sc\_disks, d\_next) \{}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00906}00906                 \textcolor{keywordflow}{if} (mediasize > \mbox{\hyperlink{structdisk}{disk}}-\/>d\_consumer-\/>provider-\/>mediasize -\/}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00907}00907                     \mbox{\hyperlink{structdisk}{disk}}-\/>d\_consumer-\/>provider-\/>sectorsize) \{}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00908}00908                         \mbox{\hyperlink{geom_8h_a1d51201471b52be7e19a98b0fcb144de}{gctl\_error}}(\mbox{\hyperlink{g__part__if_8m_a7a9f20c97e75f805eb506910bd3e70d3}{req}}, \textcolor{stringliteral}{"{}Provider \%s is too small."{}},}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00909}00909                             \mbox{\hyperlink{structdisk}{disk}}-\/>\mbox{\hyperlink{structdisk_a72ebb3eb591e2022e6989e2189d2a4b0}{d\_name}});}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00910}00910                         sx\_xunlock(\&sc-\/>\mbox{\hyperlink{structg__mirror__softc_a98662cf0fd52070bda584f4fa296b1cb}{sc\_lock}});}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00911}00911                         \textcolor{keywordflow}{return};}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00912}00912                 \}}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00913}00913         \}}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00914}00914         \textcolor{comment}{/* Update the size. */}}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00915}00915         sc-\/>\mbox{\hyperlink{structg__mirror__softc_a362f5a8aad72856f637a89871862e82f}{sc\_mediasize}} = mediasize;}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00916}00916         LIST\_FOREACH(\mbox{\hyperlink{structdisk}{disk}}, \&sc-\/>sc\_disks, d\_next) \{}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00917}00917                 \mbox{\hyperlink{g__mirror_8c_aae3b509a195824dad058cd9156eccbb7}{g\_mirror\_update\_metadata}}(\mbox{\hyperlink{structdisk}{disk}});}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00918}00918         \}}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00919}00919         \mbox{\hyperlink{geom_8h_a232419d2cfa06ff3f4ff7551041aed31}{g\_topology\_lock}}();}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00920}00920         \mbox{\hyperlink{geom_8h_a72d479d3ccd8dec427b97c90557f3a4f}{g\_resize\_provider}}(sc-\/>\mbox{\hyperlink{structg__mirror__softc_a724ce95b57685af7d1dc8d810c5ed256}{sc\_provider}}, mediasize);}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00921}00921         \mbox{\hyperlink{geom_8h_a4628d4de49ba84e7a6126cc30d23b83a}{g\_topology\_unlock}}();}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00922}00922         sx\_xunlock(\&sc-\/>\mbox{\hyperlink{structg__mirror__softc_a98662cf0fd52070bda584f4fa296b1cb}{sc\_lock}});}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00923}00923 \}}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00924}00924 }
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00925}00925 \textcolor{keyword}{static} \textcolor{keywordtype}{void}}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00926}\mbox{\hyperlink{g__mirror__ctl_8c_a2f6892ad4d7a95b13cb689e0bd06acaf}{00926}} \mbox{\hyperlink{g__mirror__ctl_8c_a2f6892ad4d7a95b13cb689e0bd06acaf}{g\_mirror\_ctl\_deactivate}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structgctl__req}{gctl\_req}} *\mbox{\hyperlink{g__part__if_8m_a7a9f20c97e75f805eb506910bd3e70d3}{req}}, \textcolor{keyword}{struct} \mbox{\hyperlink{structg__class}{g\_class}} *\mbox{\hyperlink{g__raid__md__if_8m_a4f7502795edfd2493d3d223d0df33e1d}{mp}})}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00927}00927 \{}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00928}00928         \textcolor{keyword}{struct }\mbox{\hyperlink{structg__mirror__softc}{g\_mirror\_softc}} *sc;}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00929}00929         \textcolor{keyword}{struct }\mbox{\hyperlink{structg__mirror__disk}{g\_mirror\_disk}} *\mbox{\hyperlink{g__raid__md__if_8m_a9508e997a57ea259d6ecc0e563261993}{disk}};}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00930}00930         \textcolor{keyword}{const} \textcolor{keywordtype}{char} *\mbox{\hyperlink{g__part__if_8m_aff5d3acc33944ecb11914d04ef06bb54}{name}};}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00931}00931         \textcolor{keywordtype}{char} param[16];}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00932}00932         \textcolor{keywordtype}{int} *nargs;}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00933}00933         u\_int i, active;}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00934}00934 }
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00935}00935         nargs = \mbox{\hyperlink{geom_8h_ab762d12640f528d8f1f60eee92bf5f3b}{gctl\_get\_paraml}}(\mbox{\hyperlink{g__part__if_8m_a7a9f20c97e75f805eb506910bd3e70d3}{req}}, \textcolor{stringliteral}{"{}nargs"{}}, \textcolor{keyword}{sizeof}(*nargs));}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00936}00936         \textcolor{keywordflow}{if} (nargs == NULL) \{}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00937}00937                 \mbox{\hyperlink{geom_8h_a1d51201471b52be7e19a98b0fcb144de}{gctl\_error}}(\mbox{\hyperlink{g__part__if_8m_a7a9f20c97e75f805eb506910bd3e70d3}{req}}, \textcolor{stringliteral}{"{}No '\%s' argument."{}}, \textcolor{stringliteral}{"{}nargs"{}});}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00938}00938                 \textcolor{keywordflow}{return};}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00939}00939         \}}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00940}00940         \textcolor{keywordflow}{if} (*nargs < 2) \{}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00941}00941                 \mbox{\hyperlink{geom_8h_a1d51201471b52be7e19a98b0fcb144de}{gctl\_error}}(\mbox{\hyperlink{g__part__if_8m_a7a9f20c97e75f805eb506910bd3e70d3}{req}}, \textcolor{stringliteral}{"{}Too few arguments."{}});}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00942}00942                 \textcolor{keywordflow}{return};}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00943}00943         \}}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00944}00944         \mbox{\hyperlink{g__part__if_8m_aff5d3acc33944ecb11914d04ef06bb54}{name}} = \mbox{\hyperlink{geom_8h_ada33526012aac8ee446617bb3749a07c}{gctl\_get\_asciiparam}}(\mbox{\hyperlink{g__part__if_8m_a7a9f20c97e75f805eb506910bd3e70d3}{req}}, \textcolor{stringliteral}{"{}arg0"{}});}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00945}00945         \textcolor{keywordflow}{if} (\mbox{\hyperlink{g__part__if_8m_aff5d3acc33944ecb11914d04ef06bb54}{name}} == NULL) \{}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00946}00946                 \mbox{\hyperlink{geom_8h_a1d51201471b52be7e19a98b0fcb144de}{gctl\_error}}(\mbox{\hyperlink{g__part__if_8m_a7a9f20c97e75f805eb506910bd3e70d3}{req}}, \textcolor{stringliteral}{"{}No 'arg\%u' argument."{}}, 0);}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00947}00947                 \textcolor{keywordflow}{return};}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00948}00948         \}}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00949}00949         sc = \mbox{\hyperlink{g__mirror__ctl_8c_aa3363d3c57f61394b21d8bb4bab23f2d}{g\_mirror\_find\_device}}(\mbox{\hyperlink{g__raid__md__if_8m_a4f7502795edfd2493d3d223d0df33e1d}{mp}}, \mbox{\hyperlink{g__part__if_8m_aff5d3acc33944ecb11914d04ef06bb54}{name}});}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00950}00950         \textcolor{keywordflow}{if} (sc == NULL) \{}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00951}00951                 \mbox{\hyperlink{geom_8h_a1d51201471b52be7e19a98b0fcb144de}{gctl\_error}}(\mbox{\hyperlink{g__part__if_8m_a7a9f20c97e75f805eb506910bd3e70d3}{req}}, \textcolor{stringliteral}{"{}No such device: \%s."{}}, \mbox{\hyperlink{g__part__if_8m_aff5d3acc33944ecb11914d04ef06bb54}{name}});}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00952}00952                 \textcolor{keywordflow}{return};}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00953}00953         \}}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00954}00954         active = \mbox{\hyperlink{g__mirror_8c_a76f0c9eed85d72267388c8094bce23dc}{g\_mirror\_ndisks}}(sc, \mbox{\hyperlink{g__mirror_8h_aa88d381f7d55ce32d3dc797d0967a4c9}{G\_MIRROR\_DISK\_STATE\_ACTIVE}});}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00955}00955         \textcolor{keywordflow}{for} (i = 1; i < (u\_int)*nargs; i++) \{}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00956}00956                 snprintf(param, \textcolor{keyword}{sizeof}(param), \textcolor{stringliteral}{"{}arg\%u"{}}, i);}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00957}00957                 \mbox{\hyperlink{g__part__if_8m_aff5d3acc33944ecb11914d04ef06bb54}{name}} = \mbox{\hyperlink{geom_8h_ada33526012aac8ee446617bb3749a07c}{gctl\_get\_asciiparam}}(\mbox{\hyperlink{g__part__if_8m_a7a9f20c97e75f805eb506910bd3e70d3}{req}}, param);}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00958}00958                 \textcolor{keywordflow}{if} (\mbox{\hyperlink{g__part__if_8m_aff5d3acc33944ecb11914d04ef06bb54}{name}} == NULL) \{}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00959}00959                         \mbox{\hyperlink{geom_8h_a1d51201471b52be7e19a98b0fcb144de}{gctl\_error}}(\mbox{\hyperlink{g__part__if_8m_a7a9f20c97e75f805eb506910bd3e70d3}{req}}, \textcolor{stringliteral}{"{}No 'arg\%u' argument."{}}, i);}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00960}00960                         \textcolor{keywordflow}{continue};}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00961}00961                 \}}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00962}00962                 \mbox{\hyperlink{structdisk}{disk}} = \mbox{\hyperlink{g__mirror__ctl_8c_a48ca9cc413729437685bdc5bf1f589fe}{g\_mirror\_find\_disk}}(sc, \mbox{\hyperlink{g__part__if_8m_aff5d3acc33944ecb11914d04ef06bb54}{name}});}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00963}00963                 \textcolor{keywordflow}{if} (\mbox{\hyperlink{structdisk}{disk}} == NULL) \{}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00964}00964                         \mbox{\hyperlink{geom_8h_a1d51201471b52be7e19a98b0fcb144de}{gctl\_error}}(\mbox{\hyperlink{g__part__if_8m_a7a9f20c97e75f805eb506910bd3e70d3}{req}}, \textcolor{stringliteral}{"{}No such provider: \%s."{}}, \mbox{\hyperlink{g__part__if_8m_aff5d3acc33944ecb11914d04ef06bb54}{name}});}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00965}00965                         \textcolor{keywordflow}{continue};}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00966}00966                 \}}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00967}00967                 \textcolor{keywordflow}{if} (\mbox{\hyperlink{structdisk}{disk}}-\/>d\_state == \mbox{\hyperlink{g__mirror_8h_aa88d381f7d55ce32d3dc797d0967a4c9}{G\_MIRROR\_DISK\_STATE\_ACTIVE}}) \{}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00968}00968                         \textcolor{keywordflow}{if} (active > 1)}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00969}00969                                 active-\/-\/;}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00970}00970                         \textcolor{keywordflow}{else} \{}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00971}00971                                 \mbox{\hyperlink{geom_8h_a1d51201471b52be7e19a98b0fcb144de}{gctl\_error}}(\mbox{\hyperlink{g__part__if_8m_a7a9f20c97e75f805eb506910bd3e70d3}{req}}, \textcolor{stringliteral}{"{}\%s: Can't deactivate the "{}}}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00972}00972                                     \textcolor{stringliteral}{"{}last ACTIVE component \%s."{}},}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00973}00973                                     sc-\/>\mbox{\hyperlink{structg__mirror__softc_a8bc6474081935f9897bb9bbbe425c0d4}{sc\_geom}}-\/>\mbox{\hyperlink{structg__geom_af64450500f1fea18f639b191a5017107}{name}}, \mbox{\hyperlink{g__part__if_8m_aff5d3acc33944ecb11914d04ef06bb54}{name}});}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00974}00974                                 \textcolor{keywordflow}{continue};}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00975}00975                         \}}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00976}00976                 \}}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00977}00977                 \mbox{\hyperlink{structdisk}{disk}}-\/>\mbox{\hyperlink{structdisk_a047cc933120f77168c337ca109105f55}{d\_flags}} |= \mbox{\hyperlink{g__mirror_8h_a8c828752a3d9e0f880cbc23b2c952047}{G\_MIRROR\_DISK\_FLAG\_INACTIVE}};}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00978}00978                 \mbox{\hyperlink{structdisk}{disk}}-\/>\mbox{\hyperlink{structdisk_a047cc933120f77168c337ca109105f55}{d\_flags}} \&= \string~G\_MIRROR\_DISK\_FLAG\_FORCE\_SYNC;}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00979}00979                 \mbox{\hyperlink{g__mirror_8c_aae3b509a195824dad058cd9156eccbb7}{g\_mirror\_update\_metadata}}(\mbox{\hyperlink{structdisk}{disk}});}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00980}00980                 sc-\/>\mbox{\hyperlink{structg__mirror__softc_acc13b6d691150405b7b03b1c94f067eb}{sc\_bump\_id}} |= \mbox{\hyperlink{g__mirror_8h_a06c0546341c1650fbfb01e925ce81524}{G\_MIRROR\_BUMP\_SYNCID}};}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00981}00981                 \mbox{\hyperlink{g__mirror_8c_acb3acdbd049684b07266d3f405fa712b}{g\_mirror\_event\_send}}(\mbox{\hyperlink{structdisk}{disk}}, \mbox{\hyperlink{g__mirror_8h_ada570d4226b4591fff4a46f97a2af9c8}{G\_MIRROR\_DISK\_STATE\_DISCONNECTED}},}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00982}00982                     \mbox{\hyperlink{g__mirror_8h_ab767cbba6414114682f0119cabbeff11}{G\_MIRROR\_EVENT\_DONTWAIT}});}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00983}00983         \}}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00984}00984         sx\_xunlock(\&sc-\/>\mbox{\hyperlink{structg__mirror__softc_a98662cf0fd52070bda584f4fa296b1cb}{sc\_lock}});}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00985}00985 \}}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00986}00986 }
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00987}00987 \textcolor{keyword}{static} \textcolor{keywordtype}{void}}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00988}\mbox{\hyperlink{g__mirror__ctl_8c_a2ec5141dd044727baa532db8ec06d636}{00988}} \mbox{\hyperlink{g__mirror__ctl_8c_a2ec5141dd044727baa532db8ec06d636}{g\_mirror\_ctl\_forget}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structgctl__req}{gctl\_req}} *\mbox{\hyperlink{g__part__if_8m_a7a9f20c97e75f805eb506910bd3e70d3}{req}}, \textcolor{keyword}{struct} \mbox{\hyperlink{structg__class}{g\_class}} *\mbox{\hyperlink{g__raid__md__if_8m_a4f7502795edfd2493d3d223d0df33e1d}{mp}})}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00989}00989 \{}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00990}00990         \textcolor{keyword}{struct }\mbox{\hyperlink{structg__mirror__softc}{g\_mirror\_softc}} *sc;}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00991}00991         \textcolor{keyword}{struct }\mbox{\hyperlink{structg__mirror__disk}{g\_mirror\_disk}} *\mbox{\hyperlink{g__raid__md__if_8m_a9508e997a57ea259d6ecc0e563261993}{disk}};}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00992}00992         \textcolor{keyword}{const} \textcolor{keywordtype}{char} *\mbox{\hyperlink{g__part__if_8m_aff5d3acc33944ecb11914d04ef06bb54}{name}};}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00993}00993         \textcolor{keywordtype}{char} param[16];}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00994}00994         \textcolor{keywordtype}{int} *nargs;}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00995}00995         u\_int i;}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00996}00996 }
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00997}00997         nargs = \mbox{\hyperlink{geom_8h_ab762d12640f528d8f1f60eee92bf5f3b}{gctl\_get\_paraml}}(\mbox{\hyperlink{g__part__if_8m_a7a9f20c97e75f805eb506910bd3e70d3}{req}}, \textcolor{stringliteral}{"{}nargs"{}}, \textcolor{keyword}{sizeof}(*nargs));}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00998}00998         \textcolor{keywordflow}{if} (nargs == NULL) \{}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l00999}00999                 \mbox{\hyperlink{geom_8h_a1d51201471b52be7e19a98b0fcb144de}{gctl\_error}}(\mbox{\hyperlink{g__part__if_8m_a7a9f20c97e75f805eb506910bd3e70d3}{req}}, \textcolor{stringliteral}{"{}No '\%s' argument."{}}, \textcolor{stringliteral}{"{}nargs"{}});}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l01000}01000                 \textcolor{keywordflow}{return};}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l01001}01001         \}}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l01002}01002         \textcolor{keywordflow}{if} (*nargs < 1) \{}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l01003}01003                 \mbox{\hyperlink{geom_8h_a1d51201471b52be7e19a98b0fcb144de}{gctl\_error}}(\mbox{\hyperlink{g__part__if_8m_a7a9f20c97e75f805eb506910bd3e70d3}{req}}, \textcolor{stringliteral}{"{}Missing device(s)."{}});}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l01004}01004                 \textcolor{keywordflow}{return};}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l01005}01005         \}}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l01006}01006 }
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l01007}01007         \textcolor{keywordflow}{for} (i = 0; i < (u\_int)*nargs; i++) \{}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l01008}01008                 snprintf(param, \textcolor{keyword}{sizeof}(param), \textcolor{stringliteral}{"{}arg\%u"{}}, i);}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l01009}01009                 \mbox{\hyperlink{g__part__if_8m_aff5d3acc33944ecb11914d04ef06bb54}{name}} = \mbox{\hyperlink{geom_8h_ada33526012aac8ee446617bb3749a07c}{gctl\_get\_asciiparam}}(\mbox{\hyperlink{g__part__if_8m_a7a9f20c97e75f805eb506910bd3e70d3}{req}}, param);}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l01010}01010                 \textcolor{keywordflow}{if} (\mbox{\hyperlink{g__part__if_8m_aff5d3acc33944ecb11914d04ef06bb54}{name}} == NULL) \{}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l01011}01011                         \mbox{\hyperlink{geom_8h_a1d51201471b52be7e19a98b0fcb144de}{gctl\_error}}(\mbox{\hyperlink{g__part__if_8m_a7a9f20c97e75f805eb506910bd3e70d3}{req}}, \textcolor{stringliteral}{"{}No 'arg\%u' argument."{}}, i);}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l01012}01012                         \textcolor{keywordflow}{return};}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l01013}01013                 \}}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l01014}01014                 sc = \mbox{\hyperlink{g__mirror__ctl_8c_aa3363d3c57f61394b21d8bb4bab23f2d}{g\_mirror\_find\_device}}(\mbox{\hyperlink{g__raid__md__if_8m_a4f7502795edfd2493d3d223d0df33e1d}{mp}}, \mbox{\hyperlink{g__part__if_8m_aff5d3acc33944ecb11914d04ef06bb54}{name}});}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l01015}01015                 \textcolor{keywordflow}{if} (sc == NULL) \{}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l01016}01016                         \mbox{\hyperlink{geom_8h_a1d51201471b52be7e19a98b0fcb144de}{gctl\_error}}(\mbox{\hyperlink{g__part__if_8m_a7a9f20c97e75f805eb506910bd3e70d3}{req}}, \textcolor{stringliteral}{"{}No such device: \%s."{}}, \mbox{\hyperlink{g__part__if_8m_aff5d3acc33944ecb11914d04ef06bb54}{name}});}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l01017}01017                         \textcolor{keywordflow}{return};}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l01018}01018                 \}}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l01019}01019                 \textcolor{keywordflow}{if} (\mbox{\hyperlink{g__mirror_8c_a76f0c9eed85d72267388c8094bce23dc}{g\_mirror\_ndisks}}(sc, -\/1) == sc-\/>\mbox{\hyperlink{structg__mirror__softc_a8302ed5b2d64f8d387be03bb5ab514c1}{sc\_ndisks}}) \{}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l01020}01020                         sx\_xunlock(\&sc-\/>\mbox{\hyperlink{structg__mirror__softc_a98662cf0fd52070bda584f4fa296b1cb}{sc\_lock}});}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l01021}01021                         \mbox{\hyperlink{g__mirror_8h_aeab3bb1005df2baf93da35993058a14b}{G\_MIRROR\_DEBUG}}(1,}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l01022}01022                             \textcolor{stringliteral}{"{}All disks connected in \%s, skipping."{}},}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l01023}01023                             sc-\/>sc\_name);}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l01024}01024                         \textcolor{keywordflow}{continue};}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l01025}01025                 \}}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l01026}01026                 sc-\/>\mbox{\hyperlink{structg__mirror__softc_a8302ed5b2d64f8d387be03bb5ab514c1}{sc\_ndisks}} = \mbox{\hyperlink{g__mirror_8c_a76f0c9eed85d72267388c8094bce23dc}{g\_mirror\_ndisks}}(sc, -\/1);}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l01027}01027                 LIST\_FOREACH(\mbox{\hyperlink{structdisk}{disk}}, \&sc-\/>sc\_disks, d\_next) \{}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l01028}01028                         \mbox{\hyperlink{g__mirror_8c_aae3b509a195824dad058cd9156eccbb7}{g\_mirror\_update\_metadata}}(\mbox{\hyperlink{structdisk}{disk}});}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l01029}01029                 \}}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l01030}01030                 sx\_xunlock(\&sc-\/>\mbox{\hyperlink{structg__mirror__softc_a98662cf0fd52070bda584f4fa296b1cb}{sc\_lock}});}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l01031}01031         \}}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l01032}01032 \}}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l01033}01033 }
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l01034}01034 \textcolor{keyword}{static} \textcolor{keywordtype}{void}}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l01035}\mbox{\hyperlink{g__mirror__ctl_8c_a74354d64c1f4b3516faffb195b2f7abf}{01035}} \mbox{\hyperlink{g__mirror__ctl_8c_a74354d64c1f4b3516faffb195b2f7abf}{g\_mirror\_ctl\_stop}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structgctl__req}{gctl\_req}} *\mbox{\hyperlink{g__part__if_8m_a7a9f20c97e75f805eb506910bd3e70d3}{req}}, \textcolor{keyword}{struct} \mbox{\hyperlink{structg__class}{g\_class}} *\mbox{\hyperlink{g__raid__md__if_8m_a4f7502795edfd2493d3d223d0df33e1d}{mp}}, \textcolor{keywordtype}{int} wipe)}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l01036}01036 \{}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l01037}01037         \textcolor{keyword}{struct }\mbox{\hyperlink{structg__mirror__softc}{g\_mirror\_softc}} *sc;}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l01038}01038         \textcolor{keywordtype}{int} *force, *nargs, error;}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l01039}01039         \textcolor{keyword}{const} \textcolor{keywordtype}{char} *\mbox{\hyperlink{g__part__if_8m_aff5d3acc33944ecb11914d04ef06bb54}{name}};}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l01040}01040         \textcolor{keywordtype}{char} param[16];}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l01041}01041         u\_int i;}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l01042}01042         \textcolor{keywordtype}{int} how;}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l01043}01043 }
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l01044}01044         nargs = \mbox{\hyperlink{geom_8h_ab762d12640f528d8f1f60eee92bf5f3b}{gctl\_get\_paraml}}(\mbox{\hyperlink{g__part__if_8m_a7a9f20c97e75f805eb506910bd3e70d3}{req}}, \textcolor{stringliteral}{"{}nargs"{}}, \textcolor{keyword}{sizeof}(*nargs));}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l01045}01045         \textcolor{keywordflow}{if} (nargs == NULL) \{}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l01046}01046                 \mbox{\hyperlink{geom_8h_a1d51201471b52be7e19a98b0fcb144de}{gctl\_error}}(\mbox{\hyperlink{g__part__if_8m_a7a9f20c97e75f805eb506910bd3e70d3}{req}}, \textcolor{stringliteral}{"{}No '\%s' argument."{}}, \textcolor{stringliteral}{"{}nargs"{}});}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l01047}01047                 \textcolor{keywordflow}{return};}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l01048}01048         \}}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l01049}01049         \textcolor{keywordflow}{if} (*nargs < 1) \{}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l01050}01050                 \mbox{\hyperlink{geom_8h_a1d51201471b52be7e19a98b0fcb144de}{gctl\_error}}(\mbox{\hyperlink{g__part__if_8m_a7a9f20c97e75f805eb506910bd3e70d3}{req}}, \textcolor{stringliteral}{"{}Missing device(s)."{}});}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l01051}01051                 \textcolor{keywordflow}{return};}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l01052}01052         \}}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l01053}01053         force = \mbox{\hyperlink{geom_8h_ab762d12640f528d8f1f60eee92bf5f3b}{gctl\_get\_paraml}}(\mbox{\hyperlink{g__part__if_8m_a7a9f20c97e75f805eb506910bd3e70d3}{req}}, \textcolor{stringliteral}{"{}force"{}}, \textcolor{keyword}{sizeof}(*force));}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l01054}01054         \textcolor{keywordflow}{if} (force == NULL) \{}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l01055}01055                 \mbox{\hyperlink{geom_8h_a1d51201471b52be7e19a98b0fcb144de}{gctl\_error}}(\mbox{\hyperlink{g__part__if_8m_a7a9f20c97e75f805eb506910bd3e70d3}{req}}, \textcolor{stringliteral}{"{}No '\%s' argument."{}}, \textcolor{stringliteral}{"{}force"{}});}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l01056}01056                 \textcolor{keywordflow}{return};}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l01057}01057         \}}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l01058}01058         \textcolor{keywordflow}{if} (*force)}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l01059}01059                 how = \mbox{\hyperlink{g__mirror_8h_a563b40b6a3bdd2b1b6a496fb001031f6}{G\_MIRROR\_DESTROY\_HARD}};}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l01060}01060         \textcolor{keywordflow}{else}}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l01061}01061                 how = \mbox{\hyperlink{g__mirror_8h_a9ccc786054a553f198c025367f75dd42}{G\_MIRROR\_DESTROY\_SOFT}};}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l01062}01062 }
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l01063}01063         \textcolor{keywordflow}{for} (i = 0; i < (u\_int)*nargs; i++) \{}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l01064}01064                 snprintf(param, \textcolor{keyword}{sizeof}(param), \textcolor{stringliteral}{"{}arg\%u"{}}, i);}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l01065}01065                 \mbox{\hyperlink{g__part__if_8m_aff5d3acc33944ecb11914d04ef06bb54}{name}} = \mbox{\hyperlink{geom_8h_ada33526012aac8ee446617bb3749a07c}{gctl\_get\_asciiparam}}(\mbox{\hyperlink{g__part__if_8m_a7a9f20c97e75f805eb506910bd3e70d3}{req}}, param);}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l01066}01066                 \textcolor{keywordflow}{if} (\mbox{\hyperlink{g__part__if_8m_aff5d3acc33944ecb11914d04ef06bb54}{name}} == NULL) \{}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l01067}01067                         \mbox{\hyperlink{geom_8h_a1d51201471b52be7e19a98b0fcb144de}{gctl\_error}}(\mbox{\hyperlink{g__part__if_8m_a7a9f20c97e75f805eb506910bd3e70d3}{req}}, \textcolor{stringliteral}{"{}No 'arg\%u' argument."{}}, i);}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l01068}01068                         \textcolor{keywordflow}{return};}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l01069}01069                 \}}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l01070}01070                 sc = \mbox{\hyperlink{g__mirror__ctl_8c_aa3363d3c57f61394b21d8bb4bab23f2d}{g\_mirror\_find\_device}}(\mbox{\hyperlink{g__raid__md__if_8m_a4f7502795edfd2493d3d223d0df33e1d}{mp}}, \mbox{\hyperlink{g__part__if_8m_aff5d3acc33944ecb11914d04ef06bb54}{name}});}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l01071}01071                 \textcolor{keywordflow}{if} (sc == NULL) \{}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l01072}01072                         \mbox{\hyperlink{geom_8h_a1d51201471b52be7e19a98b0fcb144de}{gctl\_error}}(\mbox{\hyperlink{g__part__if_8m_a7a9f20c97e75f805eb506910bd3e70d3}{req}}, \textcolor{stringliteral}{"{}No such device: \%s."{}}, \mbox{\hyperlink{g__part__if_8m_aff5d3acc33944ecb11914d04ef06bb54}{name}});}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l01073}01073                         \textcolor{keywordflow}{return};}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l01074}01074                 \}}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l01075}01075                 \mbox{\hyperlink{geom_8h_a3671f3c7fc5dbdd70514c2e2ad07feda}{g\_cancel\_event}}(sc);}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l01076}01076                 \textcolor{keywordflow}{if} (wipe)}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l01077}01077                         sc-\/>\mbox{\hyperlink{structg__mirror__softc_a6410883ee8eaf5dd18800e30710173a7}{sc\_flags}} |= \mbox{\hyperlink{g__mirror_8h_a32b858831e82a12182ea59b52d1029da}{G\_MIRROR\_DEVICE\_FLAG\_WIPE}};}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l01078}01078                 error = \mbox{\hyperlink{g__mirror_8c_a332e8f4ffc886e61f8d41e2a425e181b}{g\_mirror\_destroy}}(sc, how);}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l01079}01079                 \textcolor{keywordflow}{if} (error != 0) \{}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l01080}01080                         \mbox{\hyperlink{geom_8h_a1d51201471b52be7e19a98b0fcb144de}{gctl\_error}}(\mbox{\hyperlink{g__part__if_8m_a7a9f20c97e75f805eb506910bd3e70d3}{req}}, \textcolor{stringliteral}{"{}Cannot destroy device \%s (error=\%d)."{}},}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l01081}01081                             sc-\/>\mbox{\hyperlink{structg__mirror__softc_a8bc6474081935f9897bb9bbbe425c0d4}{sc\_geom}}-\/>\mbox{\hyperlink{structg__geom_af64450500f1fea18f639b191a5017107}{name}}, error);}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l01082}01082                         \textcolor{keywordflow}{if} (wipe)}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l01083}01083                                 sc-\/>\mbox{\hyperlink{structg__mirror__softc_a6410883ee8eaf5dd18800e30710173a7}{sc\_flags}} \&= \string~G\_MIRROR\_DEVICE\_FLAG\_WIPE;}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l01084}01084                         sx\_xunlock(\&sc-\/>\mbox{\hyperlink{structg__mirror__softc_a98662cf0fd52070bda584f4fa296b1cb}{sc\_lock}});}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l01085}01085                         \textcolor{keywordflow}{return};}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l01086}01086                 \}}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l01087}01087                 \textcolor{comment}{/* No need to unlock, because lock is already dead. */}}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l01088}01088         \}}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l01089}01089 \}}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l01090}01090 }
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l01091}01091 \textcolor{keywordtype}{void}}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l01092}\mbox{\hyperlink{g__mirror__ctl_8c_aa3a0b65a634514f968f67ef7caaae12b}{01092}} \mbox{\hyperlink{g__mirror__ctl_8c_aa3a0b65a634514f968f67ef7caaae12b}{g\_mirror\_config}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structgctl__req}{gctl\_req}} *\mbox{\hyperlink{g__part__if_8m_a7a9f20c97e75f805eb506910bd3e70d3}{req}}, \textcolor{keyword}{struct} \mbox{\hyperlink{structg__class}{g\_class}} *\mbox{\hyperlink{g__raid__md__if_8m_a4f7502795edfd2493d3d223d0df33e1d}{mp}}, \textcolor{keyword}{const} \textcolor{keywordtype}{char} *verb)}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l01093}01093 \{}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l01094}01094         uint32\_t *version;}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l01095}01095 }
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l01096}01096         \mbox{\hyperlink{geom_8h_a1898dc8c812faa5de231ab840e8562bf}{g\_topology\_assert}}();}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l01097}01097 }
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l01098}01098         version = \mbox{\hyperlink{geom_8h_ab762d12640f528d8f1f60eee92bf5f3b}{gctl\_get\_paraml}}(\mbox{\hyperlink{g__part__if_8m_a7a9f20c97e75f805eb506910bd3e70d3}{req}}, \textcolor{stringliteral}{"{}version"{}}, \textcolor{keyword}{sizeof}(*version));}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l01099}01099         \textcolor{keywordflow}{if} (version == NULL) \{}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l01100}01100                 \mbox{\hyperlink{geom_8h_a1d51201471b52be7e19a98b0fcb144de}{gctl\_error}}(\mbox{\hyperlink{g__part__if_8m_a7a9f20c97e75f805eb506910bd3e70d3}{req}}, \textcolor{stringliteral}{"{}No '\%s' argument."{}}, \textcolor{stringliteral}{"{}version"{}});}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l01101}01101                 \textcolor{keywordflow}{return};}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l01102}01102         \}}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l01103}01103         \textcolor{keywordflow}{if} (*version != \mbox{\hyperlink{g__mirror_8h_a5906745ac7488343f84f37c7f864e459}{G\_MIRROR\_VERSION}}) \{}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l01104}01104                 \mbox{\hyperlink{geom_8h_a1d51201471b52be7e19a98b0fcb144de}{gctl\_error}}(\mbox{\hyperlink{g__part__if_8m_a7a9f20c97e75f805eb506910bd3e70d3}{req}}, \textcolor{stringliteral}{"{}Userland and kernel parts are out of sync."{}});}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l01105}01105                 \textcolor{keywordflow}{return};}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l01106}01106         \}}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l01107}01107 }
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l01108}01108         \mbox{\hyperlink{geom_8h_a4628d4de49ba84e7a6126cc30d23b83a}{g\_topology\_unlock}}();}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l01109}01109         \textcolor{keywordflow}{if} (strcmp(verb, \textcolor{stringliteral}{"{}configure"{}}) == 0)}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l01110}01110                 \mbox{\hyperlink{g__mirror__ctl_8c_a912fb4413b910780230b849d0507a46f}{g\_mirror\_ctl\_configure}}(\mbox{\hyperlink{g__part__if_8m_a7a9f20c97e75f805eb506910bd3e70d3}{req}}, \mbox{\hyperlink{g__raid__md__if_8m_a4f7502795edfd2493d3d223d0df33e1d}{mp}});}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l01111}01111         \textcolor{keywordflow}{else} \textcolor{keywordflow}{if} (strcmp(verb, \textcolor{stringliteral}{"{}create"{}}) == 0)}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l01112}01112                 \mbox{\hyperlink{g__mirror__ctl_8c_a23ef4824508fcbc0609d79e464673883}{g\_mirror\_ctl\_create}}(\mbox{\hyperlink{g__part__if_8m_a7a9f20c97e75f805eb506910bd3e70d3}{req}}, \mbox{\hyperlink{g__raid__md__if_8m_a4f7502795edfd2493d3d223d0df33e1d}{mp}});}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l01113}01113         \textcolor{keywordflow}{else} \textcolor{keywordflow}{if} (strcmp(verb, \textcolor{stringliteral}{"{}rebuild"{}}) == 0)}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l01114}01114                 \mbox{\hyperlink{g__mirror__ctl_8c_ac1efae0631dc27832d4aff97c3f06396}{g\_mirror\_ctl\_rebuild}}(\mbox{\hyperlink{g__part__if_8m_a7a9f20c97e75f805eb506910bd3e70d3}{req}}, \mbox{\hyperlink{g__raid__md__if_8m_a4f7502795edfd2493d3d223d0df33e1d}{mp}});}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l01115}01115         \textcolor{keywordflow}{else} \textcolor{keywordflow}{if} (strcmp(verb, \textcolor{stringliteral}{"{}insert"{}}) == 0)}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l01116}01116                 \mbox{\hyperlink{g__mirror__ctl_8c_a86996475b64c21bff7f37b45111f3f69}{g\_mirror\_ctl\_insert}}(\mbox{\hyperlink{g__part__if_8m_a7a9f20c97e75f805eb506910bd3e70d3}{req}}, \mbox{\hyperlink{g__raid__md__if_8m_a4f7502795edfd2493d3d223d0df33e1d}{mp}});}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l01117}01117         \textcolor{keywordflow}{else} \textcolor{keywordflow}{if} (strcmp(verb, \textcolor{stringliteral}{"{}remove"{}}) == 0)}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l01118}01118                 \mbox{\hyperlink{g__mirror__ctl_8c_a3939d0d42f7801b9b4774cc444a9ecb9}{g\_mirror\_ctl\_remove}}(\mbox{\hyperlink{g__part__if_8m_a7a9f20c97e75f805eb506910bd3e70d3}{req}}, \mbox{\hyperlink{g__raid__md__if_8m_a4f7502795edfd2493d3d223d0df33e1d}{mp}});}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l01119}01119         \textcolor{keywordflow}{else} \textcolor{keywordflow}{if} (strcmp(verb, \textcolor{stringliteral}{"{}resize"{}}) == 0)}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l01120}01120                 \mbox{\hyperlink{g__mirror__ctl_8c_a4eeafc536ffb5a7b1ef34cf992c53265}{g\_mirror\_ctl\_resize}}(\mbox{\hyperlink{g__part__if_8m_a7a9f20c97e75f805eb506910bd3e70d3}{req}}, \mbox{\hyperlink{g__raid__md__if_8m_a4f7502795edfd2493d3d223d0df33e1d}{mp}});}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l01121}01121         \textcolor{keywordflow}{else} \textcolor{keywordflow}{if} (strcmp(verb, \textcolor{stringliteral}{"{}deactivate"{}}) == 0)}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l01122}01122                 \mbox{\hyperlink{g__mirror__ctl_8c_a2f6892ad4d7a95b13cb689e0bd06acaf}{g\_mirror\_ctl\_deactivate}}(\mbox{\hyperlink{g__part__if_8m_a7a9f20c97e75f805eb506910bd3e70d3}{req}}, \mbox{\hyperlink{g__raid__md__if_8m_a4f7502795edfd2493d3d223d0df33e1d}{mp}});}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l01123}01123         \textcolor{keywordflow}{else} \textcolor{keywordflow}{if} (strcmp(verb, \textcolor{stringliteral}{"{}forget"{}}) == 0)}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l01124}01124                 \mbox{\hyperlink{g__mirror__ctl_8c_a2ec5141dd044727baa532db8ec06d636}{g\_mirror\_ctl\_forget}}(\mbox{\hyperlink{g__part__if_8m_a7a9f20c97e75f805eb506910bd3e70d3}{req}}, \mbox{\hyperlink{g__raid__md__if_8m_a4f7502795edfd2493d3d223d0df33e1d}{mp}});}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l01125}01125         \textcolor{keywordflow}{else} \textcolor{keywordflow}{if} (strcmp(verb, \textcolor{stringliteral}{"{}stop"{}}) == 0)}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l01126}01126                 \mbox{\hyperlink{g__mirror__ctl_8c_a74354d64c1f4b3516faffb195b2f7abf}{g\_mirror\_ctl\_stop}}(\mbox{\hyperlink{g__part__if_8m_a7a9f20c97e75f805eb506910bd3e70d3}{req}}, \mbox{\hyperlink{g__raid__md__if_8m_a4f7502795edfd2493d3d223d0df33e1d}{mp}}, 0);}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l01127}01127         \textcolor{keywordflow}{else} \textcolor{keywordflow}{if} (strcmp(verb, \textcolor{stringliteral}{"{}destroy"{}}) == 0)}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l01128}01128                 \mbox{\hyperlink{g__mirror__ctl_8c_a74354d64c1f4b3516faffb195b2f7abf}{g\_mirror\_ctl\_stop}}(\mbox{\hyperlink{g__part__if_8m_a7a9f20c97e75f805eb506910bd3e70d3}{req}}, \mbox{\hyperlink{g__raid__md__if_8m_a4f7502795edfd2493d3d223d0df33e1d}{mp}}, 1);}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l01129}01129         \textcolor{keywordflow}{else}}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l01130}01130                 \mbox{\hyperlink{geom_8h_a1d51201471b52be7e19a98b0fcb144de}{gctl\_error}}(\mbox{\hyperlink{g__part__if_8m_a7a9f20c97e75f805eb506910bd3e70d3}{req}}, \textcolor{stringliteral}{"{}Unknown verb."{}});}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l01131}01131         \mbox{\hyperlink{geom_8h_a232419d2cfa06ff3f4ff7551041aed31}{g\_topology\_lock}}();}
\DoxyCodeLine{\Hypertarget{g__mirror__ctl_8c_source_l01132}01132 \}}

\end{DoxyCode}
