\hypertarget{g__gate_8c_source}{}\doxysection{g\+\_\+gate.\+c}
\label{g__gate_8c_source}\index{geom/gate/g\_gate.c@{geom/gate/g\_gate.c}}
\mbox{\hyperlink{g__gate_8c}{Go to the documentation of this file.}}
\begin{DoxyCode}{0}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00001}00001 \textcolor{comment}{/*-\/}}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00002}00002 \textcolor{comment}{ * SPDX-\/License-\/Identifier: BSD-\/2-\/Clause-\/FreeBSD}}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00003}00003 \textcolor{comment}{ *}}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00004}00004 \textcolor{comment}{ * Copyright (c) 2004-\/2006 Pawel Jakub Dawidek <pjd@FreeBSD.org>}}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00005}00005 \textcolor{comment}{ * Copyright (c) 2009-\/2010 The FreeBSD Foundation}}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00006}00006 \textcolor{comment}{ * All rights reserved.}}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00007}00007 \textcolor{comment}{ *}}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00008}00008 \textcolor{comment}{ * Portions of this software were developed by Pawel Jakub Dawidek}}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00009}00009 \textcolor{comment}{ * under sponsorship from the FreeBSD Foundation.}}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00010}00010 \textcolor{comment}{ *}}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00011}00011 \textcolor{comment}{ * Redistribution and use in source and binary forms, with or without}}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00012}00012 \textcolor{comment}{ * modification, are permitted provided that the following conditions}}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00013}00013 \textcolor{comment}{ * are met:}}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00014}00014 \textcolor{comment}{ * 1. Redistributions of source code must retain the above copyright}}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00015}00015 \textcolor{comment}{ *    notice, this list of conditions and the following disclaimer.}}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00016}00016 \textcolor{comment}{ * 2. Redistributions in binary form must reproduce the above copyright}}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00017}00017 \textcolor{comment}{ *    notice, this list of conditions and the following disclaimer in the}}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00018}00018 \textcolor{comment}{ *    documentation and/or other materials provided with the distribution.}}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00019}00019 \textcolor{comment}{ *}}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00020}00020 \textcolor{comment}{ * THIS SOFTWARE IS PROVIDED BY THE AUTHORS AND CONTRIBUTORS ``AS IS'' AND}}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00021}00021 \textcolor{comment}{ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE}}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00022}00022 \textcolor{comment}{ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE}}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00023}00023 \textcolor{comment}{ * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHORS OR CONTRIBUTORS BE LIABLE}}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00024}00024 \textcolor{comment}{ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL}}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00025}00025 \textcolor{comment}{ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS}}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00026}00026 \textcolor{comment}{ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)}}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00027}00027 \textcolor{comment}{ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT}}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00028}00028 \textcolor{comment}{ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY}}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00029}00029 \textcolor{comment}{ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF}}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00030}00030 \textcolor{comment}{ * SUCH DAMAGE.}}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00031}00031 \textcolor{comment}{ */}}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00032}00032 }
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00033}00033 \textcolor{preprocessor}{\#include <sys/cdefs.h>}}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00034}\mbox{\hyperlink{g__gate_8c_a8c3ef283470a68cd30afe9b8a72cb60f}{00034}} \mbox{\hyperlink{g__gate_8c_a8c3ef283470a68cd30afe9b8a72cb60f}{\_\_FBSDID}}(\textcolor{stringliteral}{"{}\$FreeBSD\$"{}});}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00035}00035 }
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00036}00036 \textcolor{preprocessor}{\#include <sys/param.h>}}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00037}00037 \textcolor{preprocessor}{\#include <sys/systm.h>}}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00038}00038 \textcolor{preprocessor}{\#include <sys/bio.h>}}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00039}00039 \textcolor{preprocessor}{\#include <sys/conf.h>}}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00040}00040 \textcolor{preprocessor}{\#include <sys/kernel.h>}}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00041}00041 \textcolor{preprocessor}{\#include <sys/kthread.h>}}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00042}00042 \textcolor{preprocessor}{\#include <sys/fcntl.h>}}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00043}00043 \textcolor{preprocessor}{\#include <sys/linker.h>}}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00044}00044 \textcolor{preprocessor}{\#include <sys/lock.h>}}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00045}00045 \textcolor{preprocessor}{\#include <sys/malloc.h>}}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00046}00046 \textcolor{preprocessor}{\#include <sys/mutex.h>}}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00047}00047 \textcolor{preprocessor}{\#include <sys/proc.h>}}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00048}00048 \textcolor{preprocessor}{\#include <sys/limits.h>}}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00049}00049 \textcolor{preprocessor}{\#include <sys/queue.h>}}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00050}00050 \textcolor{preprocessor}{\#include <sys/sbuf.h>}}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00051}00051 \textcolor{preprocessor}{\#include <sys/sysctl.h>}}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00052}00052 \textcolor{preprocessor}{\#include <sys/signalvar.h>}}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00053}00053 \textcolor{preprocessor}{\#include <sys/time.h>}}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00054}00054 \textcolor{preprocessor}{\#include <machine/atomic.h>}}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00055}00055 }
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00056}00056 \textcolor{preprocessor}{\#include <\mbox{\hyperlink{geom_8h}{geom/geom.h}}>}}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00057}00057 \textcolor{preprocessor}{\#include <\mbox{\hyperlink{geom__dbg_8h}{geom/geom\_dbg.h}}>}}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00058}00058 \textcolor{preprocessor}{\#include <\mbox{\hyperlink{g__gate_8h}{geom/gate/g\_gate.h}}>}}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00059}00059 }
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00060}\mbox{\hyperlink{g__gate_8c_a89aa68d9809dccaeb12e4adda077c4ce}{00060}} \mbox{\hyperlink{g__gate_8c_a89aa68d9809dccaeb12e4adda077c4ce}{FEATURE}}(geom\_gate, \textcolor{stringliteral}{"{}GEOM Gate module"{}});}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00061}00061 }
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00062}\mbox{\hyperlink{g__gate_8c_a7bf63558cb4954788310a710ca5a5d3e}{00062}} \textcolor{keyword}{static} \mbox{\hyperlink{g__gate_8c_a7bf63558cb4954788310a710ca5a5d3e}{MALLOC\_DEFINE}}(M\_GATE, \textcolor{stringliteral}{"{}gg\_data"{}}, \textcolor{stringliteral}{"{}GEOM Gate Data"{}});}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00063}00063 }
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00064}\mbox{\hyperlink{g__gate_8c_a1e69eaa2ef6048550eaeebcf775a3d0f}{00064}} \mbox{\hyperlink{g__gate_8c_a1e69eaa2ef6048550eaeebcf775a3d0f}{SYSCTL\_DECL}}(\_kern\_geom);}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00065}\mbox{\hyperlink{g__gate_8c_ac957dafa8820624dd5a05c26533c933f}{00065}} \textcolor{keyword}{static} \mbox{\hyperlink{g__gate_8c_ac957dafa8820624dd5a05c26533c933f}{SYSCTL\_NODE}}(\_kern\_geom, OID\_AUTO, gate, CTLFLAG\_RW | CTLFLAG\_MPSAFE, 0,}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00066}00066     \textcolor{stringliteral}{"{}GEOM\_GATE configuration"{}});}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00067}\mbox{\hyperlink{g__gate_8c_a406be64517f39823b299fa2a5f023da1}{00067}} \textcolor{keyword}{static} \textcolor{keywordtype}{int} \mbox{\hyperlink{g__gate_8c_a406be64517f39823b299fa2a5f023da1}{g\_gate\_debug}} = 0;}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00068}\mbox{\hyperlink{g__gate_8c_ae0683f4f5222320af5b3803d6f857c5a}{00068}} \mbox{\hyperlink{g__gate_8c_ae0683f4f5222320af5b3803d6f857c5a}{SYSCTL\_INT}}(\_kern\_geom\_gate, OID\_AUTO, debug, CTLFLAG\_RWTUN, \&\mbox{\hyperlink{g__gate_8c_a406be64517f39823b299fa2a5f023da1}{g\_gate\_debug}}, 0,}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00069}00069     \textcolor{stringliteral}{"{}Debug level"{}});}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00070}\mbox{\hyperlink{g__gate_8c_a09f1bed9387fc2ea71c8e4fab67610d6}{00070}} \textcolor{keyword}{static} u\_int \mbox{\hyperlink{g__gate_8c_a09f1bed9387fc2ea71c8e4fab67610d6}{g\_gate\_maxunits}} = 256;}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00071}\mbox{\hyperlink{g__gate_8c_a2ea5a03bdd271c4f659bfdf8fbba640f}{00071}} \mbox{\hyperlink{g__gate_8c_a2ea5a03bdd271c4f659bfdf8fbba640f}{SYSCTL\_UINT}}(\_kern\_geom\_gate, OID\_AUTO, maxunits, CTLFLAG\_RDTUN,}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00072}00072     \&\mbox{\hyperlink{g__gate_8c_a09f1bed9387fc2ea71c8e4fab67610d6}{g\_gate\_maxunits}}, 0, \textcolor{stringliteral}{"{}Maximum number of ggate devices"{}});}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00073}00073 }
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00074}\mbox{\hyperlink{g__gate_8c_a02c65068c489a7a2aef761c0a7348f53}{00074}} \textcolor{keyword}{struct }\mbox{\hyperlink{structg__class}{g\_class}} \mbox{\hyperlink{g__gate_8c_a02c65068c489a7a2aef761c0a7348f53}{g\_gate\_class}} = \{}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00075}00075         .\mbox{\hyperlink{structg__class_a66bf8381cf0afbf7ccdebfa6b90a4a96}{name}} = \mbox{\hyperlink{g__gate_8h_ae0d1441147d554ef22f75c9de3420246}{G\_GATE\_CLASS\_NAME}},}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00076}00076         .version = \mbox{\hyperlink{geom_8h_a33025dbc893de9dc049ba2f30283bc5a}{G\_VERSION}},}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00077}00077 \};}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00078}00078 }
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00079}\mbox{\hyperlink{g__gate_8c_a273ca82c67b1eac9d0e408a86e7be513}{00079}} \textcolor{keyword}{static} \textcolor{keyword}{struct }cdev *\mbox{\hyperlink{g__gate_8c_a273ca82c67b1eac9d0e408a86e7be513}{status\_dev}};}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00080}\mbox{\hyperlink{g__gate_8c_a6f8085f1cb58fbe7b3dcbfca5fda1a67}{00080}} \textcolor{keyword}{static} d\_ioctl\_t \mbox{\hyperlink{g__gate_8c_a6f8085f1cb58fbe7b3dcbfca5fda1a67}{g\_gate\_ioctl}};}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00081}\mbox{\hyperlink{g__gate_8c_a5c99a38ad44a2661824618f347eca16d}{00081}} \textcolor{keyword}{static} \textcolor{keyword}{struct }cdevsw \mbox{\hyperlink{g__gate_8c_a5c99a38ad44a2661824618f347eca16d}{g\_gate\_cdevsw}} = \{}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00082}00082         .d\_version =    D\_VERSION,}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00083}00083         .d\_ioctl =      \mbox{\hyperlink{g__gate_8c_a6f8085f1cb58fbe7b3dcbfca5fda1a67}{g\_gate\_ioctl}},}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00084}00084         .d\_name =       \mbox{\hyperlink{g__gate_8h_a8d44e90241b56894b8dd96fee247ec59}{G\_GATE\_CTL\_NAME}}}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00085}00085 \};}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00086}00086 }
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00087}\mbox{\hyperlink{g__gate_8c_aa33cfbd6b3c123829c1960a42795ca1c}{00087}} \textcolor{keyword}{static} \textcolor{keyword}{struct }\mbox{\hyperlink{structg__gate__softc}{g\_gate\_softc}} **\mbox{\hyperlink{g__gate_8c_aa33cfbd6b3c123829c1960a42795ca1c}{g\_gate\_units}};}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00088}\mbox{\hyperlink{g__gate_8c_aacc39c961f2a966d575f40b6e5d42828}{00088}} \textcolor{keyword}{static} u\_int \mbox{\hyperlink{g__gate_8c_aacc39c961f2a966d575f40b6e5d42828}{g\_gate\_nunits}};}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00089}\mbox{\hyperlink{g__gate_8c_ab431c4c1e9f59db69418e5e79af450f1}{00089}} \textcolor{keyword}{static} \textcolor{keyword}{struct }mtx \mbox{\hyperlink{g__gate_8c_ab431c4c1e9f59db69418e5e79af450f1}{g\_gate\_units\_lock}};}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00090}00090 }
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00091}00091 \textcolor{keyword}{static} \textcolor{keywordtype}{void}}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00092}\mbox{\hyperlink{g__gate_8c_acf08c885a57a0b8d961716f7a8b48fde}{00092}} \mbox{\hyperlink{g__gate_8c_acf08c885a57a0b8d961716f7a8b48fde}{g\_gate\_detach}}(\textcolor{keywordtype}{void} *arg, \textcolor{keywordtype}{int} flags \_\_unused)}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00093}00093 \{}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00094}00094         \textcolor{keyword}{struct }\mbox{\hyperlink{structg__consumer}{g\_consumer}} *\mbox{\hyperlink{g__part__if_8m_a294f18324585ff37641fb8aa1c9ccd82}{cp}} = arg;}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00095}00095 }
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00096}00096         \mbox{\hyperlink{geom_8h_a1898dc8c812faa5de231ab840e8562bf}{g\_topology\_assert}}();}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00097}00097         \mbox{\hyperlink{g__gate_8h_a55f7a3bf1df0cf8bdab9cbcaa02da57a}{G\_GATE\_DEBUG}}(1, \textcolor{stringliteral}{"{}Destroying read consumer on provider \%s orphan."{}},}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00098}00098             \mbox{\hyperlink{g__part__if_8m_a294f18324585ff37641fb8aa1c9ccd82}{cp}}-\/>\mbox{\hyperlink{structg__consumer_a6435d5aec0376e995dce3131fd3beb52}{provider}}-\/>\mbox{\hyperlink{structg__provider_a2bffb416ee58cf4df7839c6fd5ec004a}{name}});}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00099}00099         (void)\mbox{\hyperlink{geom_8h_a27b7c72cc3bc5a4d07ce5976e1aa1b58}{g\_access}}(\mbox{\hyperlink{g__part__if_8m_a294f18324585ff37641fb8aa1c9ccd82}{cp}}, -\/1, 0, 0);}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00100}00100         \mbox{\hyperlink{geom_8h_a037802c2ec5d43fcf1222215f9f8a735}{g\_detach}}(\mbox{\hyperlink{g__part__if_8m_a294f18324585ff37641fb8aa1c9ccd82}{cp}});}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00101}00101         \mbox{\hyperlink{geom_8h_a9f53f6118c5e44ca2bcbd7ae548597b9}{g\_destroy\_consumer}}(\mbox{\hyperlink{g__part__if_8m_a294f18324585ff37641fb8aa1c9ccd82}{cp}});}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00102}00102 \}}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00103}00103 }
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00104}00104 \textcolor{keyword}{static} \textcolor{keywordtype}{int}}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00105}\mbox{\hyperlink{g__gate_8c_a4b6788da99179b09489dd9c6352da7bf}{00105}} \mbox{\hyperlink{g__gate_8c_a4b6788da99179b09489dd9c6352da7bf}{g\_gate\_destroy}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structg__gate__softc}{g\_gate\_softc}} *sc, boolean\_t force)}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00106}00106 \{}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00107}00107         \textcolor{keyword}{struct }bio\_queue\_head queue;}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00108}00108         \textcolor{keyword}{struct }\mbox{\hyperlink{structg__provider}{g\_provider}} *\mbox{\hyperlink{g__part__if_8m_a9bc7638f295763b77465c5ebebbd3442}{pp}};}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00109}00109         \textcolor{keyword}{struct }\mbox{\hyperlink{structg__consumer}{g\_consumer}} *\mbox{\hyperlink{g__part__if_8m_a294f18324585ff37641fb8aa1c9ccd82}{cp}};}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00110}00110         \textcolor{keyword}{struct }\mbox{\hyperlink{structg__geom}{g\_geom}} *\mbox{\hyperlink{g__part__if_8m_abdc908a08b24cd2e589de2f44e40eeb9}{gp}};}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00111}00111         \textcolor{keyword}{struct }bio *\mbox{\hyperlink{g__part__if_8m_a3786db8db96c32f69df9f7cd325a7507}{bp}};}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00112}00112 }
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00113}00113         \mbox{\hyperlink{geom_8h_a1898dc8c812faa5de231ab840e8562bf}{g\_topology\_assert}}();}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00114}00114         mtx\_assert(\&\mbox{\hyperlink{g__gate_8c_ab431c4c1e9f59db69418e5e79af450f1}{g\_gate\_units\_lock}}, MA\_OWNED);}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00115}00115         \mbox{\hyperlink{g__part__if_8m_a9bc7638f295763b77465c5ebebbd3442}{pp}} = sc-\/>\mbox{\hyperlink{structg__gate__softc_a6a4e491f493bf7eaf393dd8ca83f79a8}{sc\_provider}};}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00116}00116         \textcolor{keywordflow}{if} (!force \&\& (\mbox{\hyperlink{g__part__if_8m_a9bc7638f295763b77465c5ebebbd3442}{pp}}-\/>\mbox{\hyperlink{structg__provider_a62d7db6055318331bae725b44d58c140}{acr}} != 0 || \mbox{\hyperlink{g__part__if_8m_a9bc7638f295763b77465c5ebebbd3442}{pp}}-\/>\mbox{\hyperlink{structg__provider_abc6824f999ce8b17107d833c908c83e6}{acw}} != 0 || \mbox{\hyperlink{g__part__if_8m_a9bc7638f295763b77465c5ebebbd3442}{pp}}-\/>\mbox{\hyperlink{structg__provider_ae46b0f6e935dcb33a2a06556dbcbeb4c}{ace}} != 0)) \{}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00117}00117                 mtx\_unlock(\&\mbox{\hyperlink{g__gate_8c_ab431c4c1e9f59db69418e5e79af450f1}{g\_gate\_units\_lock}});}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00118}00118                 \textcolor{keywordflow}{return} (EBUSY);}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00119}00119         \}}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00120}00120         mtx\_unlock(\&\mbox{\hyperlink{g__gate_8c_ab431c4c1e9f59db69418e5e79af450f1}{g\_gate\_units\_lock}});}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00121}00121         mtx\_lock(\&sc-\/>\mbox{\hyperlink{structg__gate__softc_a37af4dfc3b501929eb576f819e4e3385}{sc\_queue\_mtx}});}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00122}00122         \textcolor{keywordflow}{if} ((sc-\/>\mbox{\hyperlink{structg__gate__softc_a84c3b69044ec5f9d855c5372fa2740e7}{sc\_flags}} \& \mbox{\hyperlink{g__gate_8h_a86efdfb48a10788f8fead9dd90b11a40}{G\_GATE\_FLAG\_DESTROY}}) == 0)}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00123}00123                 sc-\/>\mbox{\hyperlink{structg__gate__softc_a84c3b69044ec5f9d855c5372fa2740e7}{sc\_flags}} |= \mbox{\hyperlink{g__gate_8h_a86efdfb48a10788f8fead9dd90b11a40}{G\_GATE\_FLAG\_DESTROY}};}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00124}00124         wakeup(sc);}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00125}00125         mtx\_unlock(\&sc-\/>\mbox{\hyperlink{structg__gate__softc_a37af4dfc3b501929eb576f819e4e3385}{sc\_queue\_mtx}});}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00126}00126         \mbox{\hyperlink{g__part__if_8m_abdc908a08b24cd2e589de2f44e40eeb9}{gp}} = \mbox{\hyperlink{g__part__if_8m_a9bc7638f295763b77465c5ebebbd3442}{pp}}-\/>\mbox{\hyperlink{structg__provider_afe5c92b8a2a9e4cdf1cab6daa96923c1}{geom}};}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00127}00127         \mbox{\hyperlink{geom_8h_a164882713025c4e0cc58b1ac8501bcf0}{g\_wither\_provider}}(\mbox{\hyperlink{g__part__if_8m_a9bc7638f295763b77465c5ebebbd3442}{pp}}, ENXIO);}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00128}00128         callout\_drain(\&sc-\/>\mbox{\hyperlink{structg__gate__softc_a980e77893d181558826fec958e2abf0c}{sc\_callout}});}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00129}00129         bioq\_init(\&queue);}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00130}00130         mtx\_lock(\&sc-\/>\mbox{\hyperlink{structg__gate__softc_a37af4dfc3b501929eb576f819e4e3385}{sc\_queue\_mtx}});}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00131}00131         \textcolor{keywordflow}{while} ((\mbox{\hyperlink{g__part__if_8m_a3786db8db96c32f69df9f7cd325a7507}{bp}} = bioq\_takefirst(\&sc-\/>\mbox{\hyperlink{structg__gate__softc_a35a04b7e6d55d648c67f74c3d7e3c032}{sc\_inqueue}})) != NULL) \{}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00132}00132                 sc-\/>\mbox{\hyperlink{structg__gate__softc_aa4781c44dcd3538a79e199c10339ae38}{sc\_queue\_count}}-\/-\/;}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00133}00133                 bioq\_insert\_tail(\&queue, \mbox{\hyperlink{g__part__if_8m_a3786db8db96c32f69df9f7cd325a7507}{bp}});}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00134}00134         \}}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00135}00135         \textcolor{keywordflow}{while} ((\mbox{\hyperlink{g__part__if_8m_a3786db8db96c32f69df9f7cd325a7507}{bp}} = bioq\_takefirst(\&sc-\/>\mbox{\hyperlink{structg__gate__softc_ac184b57ea659df095b256cec55255763}{sc\_outqueue}})) != NULL) \{}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00136}00136                 sc-\/>\mbox{\hyperlink{structg__gate__softc_aa4781c44dcd3538a79e199c10339ae38}{sc\_queue\_count}}-\/-\/;}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00137}00137                 bioq\_insert\_tail(\&queue, \mbox{\hyperlink{g__part__if_8m_a3786db8db96c32f69df9f7cd325a7507}{bp}});}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00138}00138         \}}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00139}00139         mtx\_unlock(\&sc-\/>\mbox{\hyperlink{structg__gate__softc_a37af4dfc3b501929eb576f819e4e3385}{sc\_queue\_mtx}});}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00140}00140         \mbox{\hyperlink{geom_8h_a4628d4de49ba84e7a6126cc30d23b83a}{g\_topology\_unlock}}();}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00141}00141         \textcolor{keywordflow}{while} ((\mbox{\hyperlink{g__part__if_8m_a3786db8db96c32f69df9f7cd325a7507}{bp}} = bioq\_takefirst(\&queue)) != NULL) \{}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00142}00142                 \mbox{\hyperlink{g__gate_8h_abf8fd7e5cd7d2dfba621abcdff085c59}{G\_GATE\_LOGREQ}}(1, \mbox{\hyperlink{g__part__if_8m_a3786db8db96c32f69df9f7cd325a7507}{bp}}, \textcolor{stringliteral}{"{}Request canceled."{}});}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00143}00143                 \mbox{\hyperlink{geom_8h_a0975be2dcd40a26a56a1a9bfc80433e1}{g\_io\_deliver}}(\mbox{\hyperlink{g__part__if_8m_a3786db8db96c32f69df9f7cd325a7507}{bp}}, ENXIO);}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00144}00144         \}}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00145}00145         mtx\_lock(\&\mbox{\hyperlink{g__gate_8c_ab431c4c1e9f59db69418e5e79af450f1}{g\_gate\_units\_lock}});}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00146}00146         \textcolor{comment}{/* One reference is ours. */}}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00147}00147         sc-\/>\mbox{\hyperlink{structg__gate__softc_ac8ef3ed01c73a4b102d123f36b0f8872}{sc\_ref}}-\/-\/;}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00148}00148         \textcolor{keywordflow}{while} (sc-\/>\mbox{\hyperlink{structg__gate__softc_ac8ef3ed01c73a4b102d123f36b0f8872}{sc\_ref}} > 0)}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00149}00149                 msleep(\&sc-\/>\mbox{\hyperlink{structg__gate__softc_ac8ef3ed01c73a4b102d123f36b0f8872}{sc\_ref}}, \&\mbox{\hyperlink{g__gate_8c_ab431c4c1e9f59db69418e5e79af450f1}{g\_gate\_units\_lock}}, 0, \textcolor{stringliteral}{"{}gg:destroy"{}}, 0);}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00150}00150         \mbox{\hyperlink{g__gate_8c_aa33cfbd6b3c123829c1960a42795ca1c}{g\_gate\_units}}[sc-\/>\mbox{\hyperlink{structg__gate__softc_a73063ecc9b79d8a62099e45e6ce8db51}{sc\_unit}}] = NULL;}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00151}00151         KASSERT(\mbox{\hyperlink{g__gate_8c_aacc39c961f2a966d575f40b6e5d42828}{g\_gate\_nunits}} > 0, (\textcolor{stringliteral}{"{}negative g\_gate\_nunits?"{}}));}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00152}00152         \mbox{\hyperlink{g__gate_8c_aacc39c961f2a966d575f40b6e5d42828}{g\_gate\_nunits}}-\/-\/;}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00153}00153         mtx\_unlock(\&\mbox{\hyperlink{g__gate_8c_ab431c4c1e9f59db69418e5e79af450f1}{g\_gate\_units\_lock}});}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00154}00154         mtx\_destroy(\&sc-\/>\mbox{\hyperlink{structg__gate__softc_a37af4dfc3b501929eb576f819e4e3385}{sc\_queue\_mtx}});}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00155}00155         mtx\_destroy(\&sc-\/>\mbox{\hyperlink{structg__gate__softc_ab348293d423911e51223df8145c69bc0}{sc\_read\_mtx}});}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00156}00156         \mbox{\hyperlink{geom_8h_a232419d2cfa06ff3f4ff7551041aed31}{g\_topology\_lock}}();}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00157}00157         \textcolor{keywordflow}{if} ((\mbox{\hyperlink{g__part__if_8m_a294f18324585ff37641fb8aa1c9ccd82}{cp}} = sc-\/>\mbox{\hyperlink{structg__gate__softc_a64f348a33de8ebe576b7aa7d7fc9bb2e}{sc\_readcons}}) != NULL) \{}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00158}00158                 sc-\/>\mbox{\hyperlink{structg__gate__softc_a64f348a33de8ebe576b7aa7d7fc9bb2e}{sc\_readcons}} = NULL;}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00159}00159                 (void)\mbox{\hyperlink{geom_8h_a27b7c72cc3bc5a4d07ce5976e1aa1b58}{g\_access}}(\mbox{\hyperlink{g__part__if_8m_a294f18324585ff37641fb8aa1c9ccd82}{cp}}, -\/1, 0, 0);}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00160}00160                 \mbox{\hyperlink{geom_8h_a037802c2ec5d43fcf1222215f9f8a735}{g\_detach}}(\mbox{\hyperlink{g__part__if_8m_a294f18324585ff37641fb8aa1c9ccd82}{cp}});}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00161}00161                 \mbox{\hyperlink{geom_8h_a9f53f6118c5e44ca2bcbd7ae548597b9}{g\_destroy\_consumer}}(\mbox{\hyperlink{g__part__if_8m_a294f18324585ff37641fb8aa1c9ccd82}{cp}});}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00162}00162         \}}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00163}00163         \mbox{\hyperlink{g__gate_8h_a55f7a3bf1df0cf8bdab9cbcaa02da57a}{G\_GATE\_DEBUG}}(1, \textcolor{stringliteral}{"{}Device \%s destroyed."{}}, \mbox{\hyperlink{g__part__if_8m_abdc908a08b24cd2e589de2f44e40eeb9}{gp}}-\/>\mbox{\hyperlink{structg__geom_af64450500f1fea18f639b191a5017107}{name}});}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00164}00164         \mbox{\hyperlink{g__part__if_8m_abdc908a08b24cd2e589de2f44e40eeb9}{gp}}-\/>\mbox{\hyperlink{structg__geom_aa83c08c83459420f6cbcfe64c6099466}{softc}} = NULL;}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00165}00165         \mbox{\hyperlink{geom_8h_a87a0eb5de79ed5e49fcfec012f213c9b}{g\_wither\_geom}}(\mbox{\hyperlink{g__part__if_8m_abdc908a08b24cd2e589de2f44e40eeb9}{gp}}, ENXIO);}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00166}00166         sc-\/>\mbox{\hyperlink{structg__gate__softc_a6a4e491f493bf7eaf393dd8ca83f79a8}{sc\_provider}} = NULL;}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00167}00167         \mbox{\hyperlink{g__raid__md__if_8m_a4df9edb2717b3f7e4c3c903878577a54}{free}}(sc, M\_GATE);}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00168}00168         \textcolor{keywordflow}{return} (0);}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00169}00169 \}}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00170}00170 }
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00171}00171 \textcolor{keyword}{static} \textcolor{keywordtype}{int}}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00172}\mbox{\hyperlink{g__gate_8c_adb332ab805afc2b4362cd564787caadc}{00172}} \mbox{\hyperlink{g__gate_8c_adb332ab805afc2b4362cd564787caadc}{g\_gate\_access}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structg__provider}{g\_provider}} *\mbox{\hyperlink{g__part__if_8m_a9bc7638f295763b77465c5ebebbd3442}{pp}}, \textcolor{keywordtype}{int} dr, \textcolor{keywordtype}{int} dw, \textcolor{keywordtype}{int} de)}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00173}00173 \{}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00174}00174         \textcolor{keyword}{struct }\mbox{\hyperlink{structg__gate__softc}{g\_gate\_softc}} *sc;}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00175}00175 }
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00176}00176         \textcolor{keywordflow}{if} (dr <= 0 \&\& dw <= 0 \&\& de <= 0)}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00177}00177                 \textcolor{keywordflow}{return} (0);}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00178}00178         sc = \mbox{\hyperlink{g__part__if_8m_a9bc7638f295763b77465c5ebebbd3442}{pp}}-\/>\mbox{\hyperlink{structg__provider_afe5c92b8a2a9e4cdf1cab6daa96923c1}{geom}}-\/>\mbox{\hyperlink{structg__geom_aa83c08c83459420f6cbcfe64c6099466}{softc}};}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00179}00179         \textcolor{keywordflow}{if} (sc == NULL || (sc-\/>\mbox{\hyperlink{structg__gate__softc_a84c3b69044ec5f9d855c5372fa2740e7}{sc\_flags}} \& \mbox{\hyperlink{g__gate_8h_a86efdfb48a10788f8fead9dd90b11a40}{G\_GATE\_FLAG\_DESTROY}}) != 0)}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00180}00180                 \textcolor{keywordflow}{return} (ENXIO);}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00181}00181         \textcolor{comment}{/* XXX: Hack to allow read-\/only mounts. */}}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00182}00182 \textcolor{preprocessor}{\#if 0}}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00183}00183         \textcolor{keywordflow}{if} ((sc-\/>\mbox{\hyperlink{structg__gate__softc_a84c3b69044ec5f9d855c5372fa2740e7}{sc\_flags}} \& \mbox{\hyperlink{g__gate_8h_ad7296b9d5c5843d3df8d9eb6dc654357}{G\_GATE\_FLAG\_READONLY}}) != 0 \&\& dw > 0)}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00184}00184                 \textcolor{keywordflow}{return} (EPERM);}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00185}00185 \textcolor{preprocessor}{\#endif}}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00186}00186         \textcolor{keywordflow}{if} ((sc-\/>\mbox{\hyperlink{structg__gate__softc_a84c3b69044ec5f9d855c5372fa2740e7}{sc\_flags}} \& \mbox{\hyperlink{g__gate_8h_a413c9d978811465989e7bd8affcdd6a7}{G\_GATE\_FLAG\_WRITEONLY}}) != 0 \&\& dr > 0)}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00187}00187                 \textcolor{keywordflow}{return} (EPERM);}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00188}00188         \textcolor{keywordflow}{return} (0);}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00189}00189 \}}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00190}00190 }
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00191}00191 \textcolor{keyword}{static} \textcolor{keywordtype}{void}}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00192}\mbox{\hyperlink{g__gate_8c_a0c10ba16e5928eb49090527c875748bc}{00192}} \mbox{\hyperlink{g__gate_8c_a0c10ba16e5928eb49090527c875748bc}{g\_gate\_queue\_io}}(\textcolor{keyword}{struct} bio *\mbox{\hyperlink{g__part__if_8m_a3786db8db96c32f69df9f7cd325a7507}{bp}})}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00193}00193 \{}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00194}00194         \textcolor{keyword}{struct }\mbox{\hyperlink{structg__gate__softc}{g\_gate\_softc}} *sc;}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00195}00195 }
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00196}00196         sc = \mbox{\hyperlink{g__part__if_8m_a3786db8db96c32f69df9f7cd325a7507}{bp}}-\/>bio\_to-\/>geom-\/>softc;}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00197}00197         \textcolor{keywordflow}{if} (sc == NULL || (sc-\/>\mbox{\hyperlink{structg__gate__softc_a84c3b69044ec5f9d855c5372fa2740e7}{sc\_flags}} \& \mbox{\hyperlink{g__gate_8h_a86efdfb48a10788f8fead9dd90b11a40}{G\_GATE\_FLAG\_DESTROY}}) != 0) \{}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00198}00198                 \mbox{\hyperlink{geom_8h_a0975be2dcd40a26a56a1a9bfc80433e1}{g\_io\_deliver}}(\mbox{\hyperlink{g__part__if_8m_a3786db8db96c32f69df9f7cd325a7507}{bp}}, ENXIO);}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00199}00199                 \textcolor{keywordflow}{return};}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00200}00200         \}}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00201}00201 }
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00202}00202         mtx\_lock(\&sc-\/>\mbox{\hyperlink{structg__gate__softc_a37af4dfc3b501929eb576f819e4e3385}{sc\_queue\_mtx}});}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00203}00203 }
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00204}00204         \textcolor{keywordflow}{if} (sc-\/>\mbox{\hyperlink{structg__gate__softc_a592299eb252304887a4d1285c9adedd8}{sc\_queue\_size}} > 0 \&\& sc-\/>\mbox{\hyperlink{structg__gate__softc_aa4781c44dcd3538a79e199c10339ae38}{sc\_queue\_count}} > sc-\/>\mbox{\hyperlink{structg__gate__softc_a592299eb252304887a4d1285c9adedd8}{sc\_queue\_size}}) \{}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00205}00205                 mtx\_unlock(\&sc-\/>\mbox{\hyperlink{structg__gate__softc_a37af4dfc3b501929eb576f819e4e3385}{sc\_queue\_mtx}});}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00206}00206                 \mbox{\hyperlink{g__gate_8h_abf8fd7e5cd7d2dfba621abcdff085c59}{G\_GATE\_LOGREQ}}(1, \mbox{\hyperlink{g__part__if_8m_a3786db8db96c32f69df9f7cd325a7507}{bp}}, \textcolor{stringliteral}{"{}Queue full, request canceled."{}});}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00207}00207                 \mbox{\hyperlink{geom_8h_a0975be2dcd40a26a56a1a9bfc80433e1}{g\_io\_deliver}}(\mbox{\hyperlink{g__part__if_8m_a3786db8db96c32f69df9f7cd325a7507}{bp}}, ENOMEM);}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00208}00208                 \textcolor{keywordflow}{return};}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00209}00209         \}}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00210}00210 }
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00211}00211         \mbox{\hyperlink{g__part__if_8m_a3786db8db96c32f69df9f7cd325a7507}{bp}}-\/>bio\_driver1 = (\textcolor{keywordtype}{void} *)sc-\/>\mbox{\hyperlink{structg__gate__softc_a438f6a92a1b279a0bed5eddd5242eb6b}{sc\_seq}};}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00212}00212         sc-\/>\mbox{\hyperlink{structg__gate__softc_a438f6a92a1b279a0bed5eddd5242eb6b}{sc\_seq}}++;}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00213}00213         sc-\/>\mbox{\hyperlink{structg__gate__softc_aa4781c44dcd3538a79e199c10339ae38}{sc\_queue\_count}}++;}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00214}00214 }
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00215}00215         bioq\_insert\_tail(\&sc-\/>\mbox{\hyperlink{structg__gate__softc_a35a04b7e6d55d648c67f74c3d7e3c032}{sc\_inqueue}}, \mbox{\hyperlink{g__part__if_8m_a3786db8db96c32f69df9f7cd325a7507}{bp}});}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00216}00216         wakeup(sc);}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00217}00217 }
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00218}00218         mtx\_unlock(\&sc-\/>\mbox{\hyperlink{structg__gate__softc_a37af4dfc3b501929eb576f819e4e3385}{sc\_queue\_mtx}});}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00219}00219 \}}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00220}00220 }
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00221}00221 \textcolor{keyword}{static} \textcolor{keywordtype}{void}}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00222}\mbox{\hyperlink{g__gate_8c_a3848c287823cfd0cde53480186c2bb2f}{00222}} \mbox{\hyperlink{g__gate_8c_a3848c287823cfd0cde53480186c2bb2f}{g\_gate\_done}}(\textcolor{keyword}{struct} bio *cbp)}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00223}00223 \{}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00224}00224         \textcolor{keyword}{struct }\mbox{\hyperlink{structg__gate__softc}{g\_gate\_softc}} *sc;}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00225}00225         \textcolor{keyword}{struct }bio *pbp;}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00226}00226         \textcolor{keyword}{struct }\mbox{\hyperlink{structg__consumer}{g\_consumer}} *\mbox{\hyperlink{g__part__if_8m_a294f18324585ff37641fb8aa1c9ccd82}{cp}};}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00227}00227 }
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00228}00228         \mbox{\hyperlink{g__part__if_8m_a294f18324585ff37641fb8aa1c9ccd82}{cp}} = cbp-\/>bio\_from;}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00229}00229         pbp = cbp-\/>bio\_parent;}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00230}00230         \textcolor{keywordflow}{if} (cbp-\/>bio\_error == 0) \{}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00231}00231                 pbp-\/>bio\_completed = cbp-\/>bio\_completed;}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00232}00232                 \mbox{\hyperlink{geom_8h_ae3cbea7d4bf48f25bb609df3d3f0bb28}{g\_destroy\_bio}}(cbp);}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00233}00233                 pbp-\/>bio\_inbed++;}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00234}00234                 \mbox{\hyperlink{geom_8h_a0975be2dcd40a26a56a1a9bfc80433e1}{g\_io\_deliver}}(pbp, 0);}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00235}00235         \} \textcolor{keywordflow}{else} \{}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00236}00236                 \textcolor{comment}{/* If direct read failed, pass it through userland daemon. */}}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00237}00237                 \mbox{\hyperlink{geom_8h_ae3cbea7d4bf48f25bb609df3d3f0bb28}{g\_destroy\_bio}}(cbp);}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00238}00238                 pbp-\/>bio\_children-\/-\/;}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00239}00239                 \mbox{\hyperlink{g__gate_8c_a0c10ba16e5928eb49090527c875748bc}{g\_gate\_queue\_io}}(pbp);}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00240}00240         \}}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00241}00241 }
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00242}00242         sc = \mbox{\hyperlink{g__part__if_8m_a294f18324585ff37641fb8aa1c9ccd82}{cp}}-\/>\mbox{\hyperlink{structg__consumer_a75734fc8cd22ffc4209c36cc0a459cba}{geom}}-\/>\mbox{\hyperlink{structg__geom_aa83c08c83459420f6cbcfe64c6099466}{softc}};}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00243}00243         mtx\_lock(\&sc-\/>\mbox{\hyperlink{structg__gate__softc_ab348293d423911e51223df8145c69bc0}{sc\_read\_mtx}});}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00244}00244         \textcolor{keywordflow}{if} (-\/-\/\mbox{\hyperlink{g__part__if_8m_a294f18324585ff37641fb8aa1c9ccd82}{cp}}-\/>\mbox{\hyperlink{structg__consumer_a0bd70ab96dc6a56c4e0db0608af9c9a4}{index}} == 0 \&\& sc-\/>\mbox{\hyperlink{structg__gate__softc_a64f348a33de8ebe576b7aa7d7fc9bb2e}{sc\_readcons}} != \mbox{\hyperlink{g__part__if_8m_a294f18324585ff37641fb8aa1c9ccd82}{cp}})}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00245}00245                 \mbox{\hyperlink{geom_8h_a196998b2923eb556355a617daaef1879}{g\_post\_event}}(\mbox{\hyperlink{g__gate_8c_acf08c885a57a0b8d961716f7a8b48fde}{g\_gate\_detach}}, \mbox{\hyperlink{g__part__if_8m_a294f18324585ff37641fb8aa1c9ccd82}{cp}}, M\_NOWAIT, NULL);}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00246}00246         mtx\_unlock(\&sc-\/>\mbox{\hyperlink{structg__gate__softc_ab348293d423911e51223df8145c69bc0}{sc\_read\_mtx}});}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00247}00247 \}}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00248}00248 }
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00249}00249 \textcolor{keyword}{static} \textcolor{keywordtype}{void}}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00250}\mbox{\hyperlink{g__gate_8c_ab3e63cbba0f759da4baebcf704ec48b8}{00250}} \mbox{\hyperlink{g__gate_8c_ab3e63cbba0f759da4baebcf704ec48b8}{g\_gate\_start}}(\textcolor{keyword}{struct} bio *pbp)}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00251}00251 \{}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00252}00252         \textcolor{keyword}{struct }\mbox{\hyperlink{structg__gate__softc}{g\_gate\_softc}} *sc;}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00253}00253         \textcolor{keyword}{struct }\mbox{\hyperlink{structg__consumer}{g\_consumer}} *\mbox{\hyperlink{g__part__if_8m_a294f18324585ff37641fb8aa1c9ccd82}{cp}};}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00254}00254         \textcolor{keyword}{struct }bio *cbp;}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00255}00255 }
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00256}00256         sc = pbp-\/>bio\_to-\/>geom-\/>softc;}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00257}00257         \textcolor{keywordflow}{if} (sc == NULL || (sc-\/>\mbox{\hyperlink{structg__gate__softc_a84c3b69044ec5f9d855c5372fa2740e7}{sc\_flags}} \& \mbox{\hyperlink{g__gate_8h_a86efdfb48a10788f8fead9dd90b11a40}{G\_GATE\_FLAG\_DESTROY}}) != 0) \{}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00258}00258                 \mbox{\hyperlink{geom_8h_a0975be2dcd40a26a56a1a9bfc80433e1}{g\_io\_deliver}}(pbp, ENXIO);}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00259}00259                 \textcolor{keywordflow}{return};}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00260}00260         \}}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00261}00261         \mbox{\hyperlink{g__gate_8h_abf8fd7e5cd7d2dfba621abcdff085c59}{G\_GATE\_LOGREQ}}(2, pbp, \textcolor{stringliteral}{"{}Request received."{}});}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00262}00262         \textcolor{keywordflow}{switch} (pbp-\/>bio\_cmd) \{}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00263}00263         \textcolor{keywordflow}{case} BIO\_READ:}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00264}00264                 \textcolor{keywordflow}{if} (sc-\/>\mbox{\hyperlink{structg__gate__softc_a64f348a33de8ebe576b7aa7d7fc9bb2e}{sc\_readcons}} == NULL)}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00265}00265                         \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00266}00266                 cbp = \mbox{\hyperlink{geom_8h_a4ef26e4ec68e35e8f892692c524a3d4f}{g\_clone\_bio}}(pbp);}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00267}00267                 \textcolor{keywordflow}{if} (cbp == NULL) \{}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00268}00268                         \mbox{\hyperlink{geom_8h_a0975be2dcd40a26a56a1a9bfc80433e1}{g\_io\_deliver}}(pbp, ENOMEM);}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00269}00269                         \textcolor{keywordflow}{return};}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00270}00270                 \}}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00271}00271                 mtx\_lock(\&sc-\/>\mbox{\hyperlink{structg__gate__softc_ab348293d423911e51223df8145c69bc0}{sc\_read\_mtx}});}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00272}00272                 \textcolor{keywordflow}{if} ((\mbox{\hyperlink{g__part__if_8m_a294f18324585ff37641fb8aa1c9ccd82}{cp}} = sc-\/>\mbox{\hyperlink{structg__gate__softc_a64f348a33de8ebe576b7aa7d7fc9bb2e}{sc\_readcons}}) == NULL) \{}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00273}00273                         mtx\_unlock(\&sc-\/>\mbox{\hyperlink{structg__gate__softc_ab348293d423911e51223df8145c69bc0}{sc\_read\_mtx}});}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00274}00274                         \mbox{\hyperlink{geom_8h_ae3cbea7d4bf48f25bb609df3d3f0bb28}{g\_destroy\_bio}}(cbp);}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00275}00275                         pbp-\/>bio\_children-\/-\/;}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00276}00276                         \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00277}00277                 \}}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00278}00278                 \mbox{\hyperlink{g__part__if_8m_a294f18324585ff37641fb8aa1c9ccd82}{cp}}-\/>\mbox{\hyperlink{structg__consumer_a0bd70ab96dc6a56c4e0db0608af9c9a4}{index}}++;}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00279}00279                 cbp-\/>bio\_offset = pbp-\/>bio\_offset + sc-\/>\mbox{\hyperlink{structg__gate__softc_a4c46733d618bf65ee350dcaa50a98cc0}{sc\_readoffset}};}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00280}00280                 mtx\_unlock(\&sc-\/>\mbox{\hyperlink{structg__gate__softc_ab348293d423911e51223df8145c69bc0}{sc\_read\_mtx}});}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00281}00281                 cbp-\/>bio\_done = \mbox{\hyperlink{g__gate_8c_a3848c287823cfd0cde53480186c2bb2f}{g\_gate\_done}};}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00282}00282                 \mbox{\hyperlink{geom_8h_aa433c0ba9e8cad7c7da1f9e17b46eb7a}{g\_io\_request}}(cbp, \mbox{\hyperlink{g__part__if_8m_a294f18324585ff37641fb8aa1c9ccd82}{cp}});}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00283}00283                 \textcolor{keywordflow}{return};}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00284}00284         \textcolor{keywordflow}{case} BIO\_DELETE:}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00285}00285         \textcolor{keywordflow}{case} BIO\_WRITE:}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00286}00286         \textcolor{keywordflow}{case} BIO\_FLUSH:}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00287}00287         \textcolor{keywordflow}{case} BIO\_SPEEDUP:}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00288}00288                 \textcolor{comment}{/* XXX: Hack to allow read-\/only mounts. */}}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00289}00289                 \textcolor{keywordflow}{if} ((sc-\/>\mbox{\hyperlink{structg__gate__softc_a84c3b69044ec5f9d855c5372fa2740e7}{sc\_flags}} \& \mbox{\hyperlink{g__gate_8h_ad7296b9d5c5843d3df8d9eb6dc654357}{G\_GATE\_FLAG\_READONLY}}) != 0) \{}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00290}00290                         \mbox{\hyperlink{geom_8h_a0975be2dcd40a26a56a1a9bfc80433e1}{g\_io\_deliver}}(pbp, EPERM);}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00291}00291                         \textcolor{keywordflow}{return};}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00292}00292                 \}}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00293}00293                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00294}00294         \textcolor{keywordflow}{case} BIO\_GETATTR:}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00295}00295         \textcolor{keywordflow}{default}:}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00296}00296                 \mbox{\hyperlink{g__gate_8h_abf8fd7e5cd7d2dfba621abcdff085c59}{G\_GATE\_LOGREQ}}(2, pbp, \textcolor{stringliteral}{"{}Ignoring request."{}});}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00297}00297                 \mbox{\hyperlink{geom_8h_a0975be2dcd40a26a56a1a9bfc80433e1}{g\_io\_deliver}}(pbp, EOPNOTSUPP);}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00298}00298                 \textcolor{keywordflow}{return};}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00299}00299         \}}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00300}00300 }
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00301}00301         \mbox{\hyperlink{g__gate_8c_a0c10ba16e5928eb49090527c875748bc}{g\_gate\_queue\_io}}(pbp);}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00302}00302 \}}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00303}00303 }
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00304}00304 \textcolor{keyword}{static} \textcolor{keyword}{struct }\mbox{\hyperlink{structg__gate__softc}{g\_gate\_softc}} *}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00305}\mbox{\hyperlink{g__gate_8c_a2b89931d7ca7196a8911e4b212974dbe}{00305}} \mbox{\hyperlink{g__gate_8c_a2b89931d7ca7196a8911e4b212974dbe}{g\_gate\_hold}}(\textcolor{keywordtype}{int} unit, \textcolor{keyword}{const} \textcolor{keywordtype}{char} *\mbox{\hyperlink{g__part__if_8m_aff5d3acc33944ecb11914d04ef06bb54}{name}})}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00306}00306 \{}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00307}00307         \textcolor{keyword}{struct }\mbox{\hyperlink{structg__gate__softc}{g\_gate\_softc}} *sc = NULL;}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00308}00308 }
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00309}00309         mtx\_lock(\&\mbox{\hyperlink{g__gate_8c_ab431c4c1e9f59db69418e5e79af450f1}{g\_gate\_units\_lock}});}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00310}00310         \textcolor{keywordflow}{if} (unit >= 0 \&\& unit < \mbox{\hyperlink{g__gate_8c_a09f1bed9387fc2ea71c8e4fab67610d6}{g\_gate\_maxunits}})}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00311}00311                 sc = \mbox{\hyperlink{g__gate_8c_aa33cfbd6b3c123829c1960a42795ca1c}{g\_gate\_units}}[unit];}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00312}00312         \textcolor{keywordflow}{else} \textcolor{keywordflow}{if} (unit == \mbox{\hyperlink{g__gate_8h_aadc15f8430ef26acb4f8e76244312221}{G\_GATE\_NAME\_GIVEN}}) \{}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00313}00313                 KASSERT(\mbox{\hyperlink{g__part__if_8m_aff5d3acc33944ecb11914d04ef06bb54}{name}} != NULL, (\textcolor{stringliteral}{"{}name is NULL"{}}));}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00314}00314                 \textcolor{keywordflow}{for} (unit = 0; unit < \mbox{\hyperlink{g__gate_8c_a09f1bed9387fc2ea71c8e4fab67610d6}{g\_gate\_maxunits}}; unit++) \{}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00315}00315                         \textcolor{keywordflow}{if} (\mbox{\hyperlink{g__gate_8c_aa33cfbd6b3c123829c1960a42795ca1c}{g\_gate\_units}}[unit] == NULL)}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00316}00316                                 \textcolor{keywordflow}{continue};}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00317}00317                         \textcolor{keywordflow}{if} (strcmp(\mbox{\hyperlink{g__part__if_8m_aff5d3acc33944ecb11914d04ef06bb54}{name}},}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00318}00318                             \mbox{\hyperlink{g__gate_8c_aa33cfbd6b3c123829c1960a42795ca1c}{g\_gate\_units}}[unit]-\/>\mbox{\hyperlink{structg__gate__softc_a6a4e491f493bf7eaf393dd8ca83f79a8}{sc\_provider}}-\/>\mbox{\hyperlink{structg__provider_a2bffb416ee58cf4df7839c6fd5ec004a}{name}}) != 0) \{}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00319}00319                                 \textcolor{keywordflow}{continue};}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00320}00320                         \}}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00321}00321                         sc = \mbox{\hyperlink{g__gate_8c_aa33cfbd6b3c123829c1960a42795ca1c}{g\_gate\_units}}[unit];}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00322}00322                         \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00323}00323                 \}}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00324}00324         \}}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00325}00325         \textcolor{keywordflow}{if} (sc != NULL)}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00326}00326                 sc-\/>\mbox{\hyperlink{structg__gate__softc_ac8ef3ed01c73a4b102d123f36b0f8872}{sc\_ref}}++;}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00327}00327         mtx\_unlock(\&\mbox{\hyperlink{g__gate_8c_ab431c4c1e9f59db69418e5e79af450f1}{g\_gate\_units\_lock}});}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00328}00328         \textcolor{keywordflow}{return} (sc);}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00329}00329 \}}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00330}00330 }
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00331}00331 \textcolor{keyword}{static} \textcolor{keywordtype}{void}}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00332}\mbox{\hyperlink{g__gate_8c_a19879eef4039ecf02eee6fcc09069009}{00332}} \mbox{\hyperlink{g__gate_8c_a19879eef4039ecf02eee6fcc09069009}{g\_gate\_release}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structg__gate__softc}{g\_gate\_softc}} *sc)}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00333}00333 \{}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00334}00334 }
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00335}00335         \mbox{\hyperlink{geom_8h_a71a3365bd3741226d2c0d1abada9fde7}{g\_topology\_assert\_not}}();}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00336}00336         mtx\_lock(\&\mbox{\hyperlink{g__gate_8c_ab431c4c1e9f59db69418e5e79af450f1}{g\_gate\_units\_lock}});}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00337}00337         sc-\/>\mbox{\hyperlink{structg__gate__softc_ac8ef3ed01c73a4b102d123f36b0f8872}{sc\_ref}}-\/-\/;}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00338}00338         KASSERT(sc-\/>\mbox{\hyperlink{structg__gate__softc_ac8ef3ed01c73a4b102d123f36b0f8872}{sc\_ref}} >= 0, (\textcolor{stringliteral}{"{}Negative sc\_ref for \%s."{}}, sc-\/>\mbox{\hyperlink{structg__gate__softc_a463d10d3a6f716b4d3a8523124316c0f}{sc\_name}}));}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00339}00339         \textcolor{keywordflow}{if} (sc-\/>\mbox{\hyperlink{structg__gate__softc_ac8ef3ed01c73a4b102d123f36b0f8872}{sc\_ref}} == 0 \&\& (sc-\/>\mbox{\hyperlink{structg__gate__softc_a84c3b69044ec5f9d855c5372fa2740e7}{sc\_flags}} \& \mbox{\hyperlink{g__gate_8h_a86efdfb48a10788f8fead9dd90b11a40}{G\_GATE\_FLAG\_DESTROY}}) != 0)}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00340}00340                 wakeup(\&sc-\/>\mbox{\hyperlink{structg__gate__softc_ac8ef3ed01c73a4b102d123f36b0f8872}{sc\_ref}});}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00341}00341         mtx\_unlock(\&\mbox{\hyperlink{g__gate_8c_ab431c4c1e9f59db69418e5e79af450f1}{g\_gate\_units\_lock}});}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00342}00342 \}}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00343}00343 }
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00344}00344 \textcolor{keyword}{static} \textcolor{keywordtype}{int}}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00345}\mbox{\hyperlink{g__gate_8c_aedcbe5bb3bd456f4be9d783dd211c434}{00345}} \mbox{\hyperlink{g__gate_8c_aedcbe5bb3bd456f4be9d783dd211c434}{g\_gate\_getunit}}(\textcolor{keywordtype}{int} unit, \textcolor{keywordtype}{int} *errorp)}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00346}00346 \{}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00347}00347 }
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00348}00348         mtx\_assert(\&\mbox{\hyperlink{g__gate_8c_ab431c4c1e9f59db69418e5e79af450f1}{g\_gate\_units\_lock}}, MA\_OWNED);}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00349}00349         \textcolor{keywordflow}{if} (unit >= 0) \{}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00350}00350                 \textcolor{keywordflow}{if} (unit >= \mbox{\hyperlink{g__gate_8c_a09f1bed9387fc2ea71c8e4fab67610d6}{g\_gate\_maxunits}})}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00351}00351                         *errorp = EINVAL;}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00352}00352                 \textcolor{keywordflow}{else} \textcolor{keywordflow}{if} (\mbox{\hyperlink{g__gate_8c_aa33cfbd6b3c123829c1960a42795ca1c}{g\_gate\_units}}[unit] == NULL)}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00353}00353                         \textcolor{keywordflow}{return} (unit);}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00354}00354                 \textcolor{keywordflow}{else}}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00355}00355                         *errorp = EEXIST;}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00356}00356         \} \textcolor{keywordflow}{else} \{}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00357}00357                 \textcolor{keywordflow}{for} (unit = 0; unit < \mbox{\hyperlink{g__gate_8c_a09f1bed9387fc2ea71c8e4fab67610d6}{g\_gate\_maxunits}}; unit++) \{}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00358}00358                         \textcolor{keywordflow}{if} (\mbox{\hyperlink{g__gate_8c_aa33cfbd6b3c123829c1960a42795ca1c}{g\_gate\_units}}[unit] == NULL)}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00359}00359                                 \textcolor{keywordflow}{return} (unit);}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00360}00360                 \}}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00361}00361                 *errorp = ENFILE;}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00362}00362         \}}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00363}00363         \textcolor{keywordflow}{return} (-\/1);}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00364}00364 \}}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00365}00365 }
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00366}00366 \textcolor{keyword}{static} \textcolor{keywordtype}{void}}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00367}\mbox{\hyperlink{g__gate_8c_a1650ccc3097d9f3f6676b609618e5cfd}{00367}} \mbox{\hyperlink{g__gate_8c_a1650ccc3097d9f3f6676b609618e5cfd}{g\_gate\_guard}}(\textcolor{keywordtype}{void} *arg)}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00368}00368 \{}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00369}00369         \textcolor{keyword}{struct }bio\_queue\_head queue;}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00370}00370         \textcolor{keyword}{struct }\mbox{\hyperlink{structg__gate__softc}{g\_gate\_softc}} *sc;}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00371}00371         \textcolor{keyword}{struct }bintime curtime;}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00372}00372         \textcolor{keyword}{struct }bio *\mbox{\hyperlink{g__part__if_8m_a3786db8db96c32f69df9f7cd325a7507}{bp}}, *bp2;}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00373}00373 }
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00374}00374         sc = arg;}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00375}00375         binuptime(\&curtime);}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00376}00376         \mbox{\hyperlink{g__gate_8c_a2b89931d7ca7196a8911e4b212974dbe}{g\_gate\_hold}}(sc-\/>\mbox{\hyperlink{structg__gate__softc_a73063ecc9b79d8a62099e45e6ce8db51}{sc\_unit}}, NULL);}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00377}00377         bioq\_init(\&queue);}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00378}00378         mtx\_lock(\&sc-\/>\mbox{\hyperlink{structg__gate__softc_a37af4dfc3b501929eb576f819e4e3385}{sc\_queue\_mtx}});}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00379}00379         TAILQ\_FOREACH\_SAFE(\mbox{\hyperlink{g__part__if_8m_a3786db8db96c32f69df9f7cd325a7507}{bp}}, \&sc-\/>\mbox{\hyperlink{structg__gate__softc_a35a04b7e6d55d648c67f74c3d7e3c032}{sc\_inqueue}}.queue, bio\_queue, bp2) \{}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00380}00380                 \textcolor{keywordflow}{if} (curtime.sec -\/ \mbox{\hyperlink{g__part__if_8m_a3786db8db96c32f69df9f7cd325a7507}{bp}}-\/>bio\_t0.sec < 5)}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00381}00381                         \textcolor{keywordflow}{continue};}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00382}00382                 bioq\_remove(\&sc-\/>\mbox{\hyperlink{structg__gate__softc_a35a04b7e6d55d648c67f74c3d7e3c032}{sc\_inqueue}}, \mbox{\hyperlink{g__part__if_8m_a3786db8db96c32f69df9f7cd325a7507}{bp}});}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00383}00383                 sc-\/>\mbox{\hyperlink{structg__gate__softc_aa4781c44dcd3538a79e199c10339ae38}{sc\_queue\_count}}-\/-\/;}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00384}00384                 bioq\_insert\_tail(\&queue, \mbox{\hyperlink{g__part__if_8m_a3786db8db96c32f69df9f7cd325a7507}{bp}});}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00385}00385         \}}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00386}00386         TAILQ\_FOREACH\_SAFE(\mbox{\hyperlink{g__part__if_8m_a3786db8db96c32f69df9f7cd325a7507}{bp}}, \&sc-\/>\mbox{\hyperlink{structg__gate__softc_ac184b57ea659df095b256cec55255763}{sc\_outqueue}}.queue, bio\_queue, bp2) \{}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00387}00387                 \textcolor{keywordflow}{if} (curtime.sec -\/ \mbox{\hyperlink{g__part__if_8m_a3786db8db96c32f69df9f7cd325a7507}{bp}}-\/>bio\_t0.sec < 5)}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00388}00388                         \textcolor{keywordflow}{continue};}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00389}00389                 bioq\_remove(\&sc-\/>\mbox{\hyperlink{structg__gate__softc_ac184b57ea659df095b256cec55255763}{sc\_outqueue}}, \mbox{\hyperlink{g__part__if_8m_a3786db8db96c32f69df9f7cd325a7507}{bp}});}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00390}00390                 sc-\/>\mbox{\hyperlink{structg__gate__softc_aa4781c44dcd3538a79e199c10339ae38}{sc\_queue\_count}}-\/-\/;}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00391}00391                 bioq\_insert\_tail(\&queue, \mbox{\hyperlink{g__part__if_8m_a3786db8db96c32f69df9f7cd325a7507}{bp}});}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00392}00392         \}}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00393}00393         mtx\_unlock(\&sc-\/>\mbox{\hyperlink{structg__gate__softc_a37af4dfc3b501929eb576f819e4e3385}{sc\_queue\_mtx}});}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00394}00394         \textcolor{keywordflow}{while} ((\mbox{\hyperlink{g__part__if_8m_a3786db8db96c32f69df9f7cd325a7507}{bp}} = bioq\_takefirst(\&queue)) != NULL) \{}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00395}00395                 \mbox{\hyperlink{g__gate_8h_abf8fd7e5cd7d2dfba621abcdff085c59}{G\_GATE\_LOGREQ}}(1, \mbox{\hyperlink{g__part__if_8m_a3786db8db96c32f69df9f7cd325a7507}{bp}}, \textcolor{stringliteral}{"{}Request timeout."{}});}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00396}00396                 \mbox{\hyperlink{geom_8h_a0975be2dcd40a26a56a1a9bfc80433e1}{g\_io\_deliver}}(\mbox{\hyperlink{g__part__if_8m_a3786db8db96c32f69df9f7cd325a7507}{bp}}, EIO);}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00397}00397         \}}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00398}00398         \textcolor{keywordflow}{if} ((sc-\/>\mbox{\hyperlink{structg__gate__softc_a84c3b69044ec5f9d855c5372fa2740e7}{sc\_flags}} \& \mbox{\hyperlink{g__gate_8h_a86efdfb48a10788f8fead9dd90b11a40}{G\_GATE\_FLAG\_DESTROY}}) == 0) \{}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00399}00399                 callout\_reset(\&sc-\/>\mbox{\hyperlink{structg__gate__softc_a980e77893d181558826fec958e2abf0c}{sc\_callout}}, sc-\/>\mbox{\hyperlink{structg__gate__softc_af50bc6523e69421b2ddd0efc765d04b7}{sc\_timeout}} * hz,}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00400}00400                     \mbox{\hyperlink{g__gate_8c_a1650ccc3097d9f3f6676b609618e5cfd}{g\_gate\_guard}}, sc);}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00401}00401         \}}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00402}00402         \mbox{\hyperlink{g__gate_8c_a19879eef4039ecf02eee6fcc09069009}{g\_gate\_release}}(sc);}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00403}00403 \}}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00404}00404 }
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00405}00405 \textcolor{keyword}{static} \textcolor{keywordtype}{void}}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00406}\mbox{\hyperlink{g__gate_8c_ae7f5e05199176ace74abca8a2f660e8d}{00406}} \mbox{\hyperlink{g__gate_8c_ae7f5e05199176ace74abca8a2f660e8d}{g\_gate\_orphan}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structg__consumer}{g\_consumer}} *\mbox{\hyperlink{g__part__if_8m_a294f18324585ff37641fb8aa1c9ccd82}{cp}})}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00407}00407 \{}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00408}00408         \textcolor{keyword}{struct }\mbox{\hyperlink{structg__gate__softc}{g\_gate\_softc}} *sc;}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00409}00409         \textcolor{keyword}{struct }\mbox{\hyperlink{structg__geom}{g\_geom}} *\mbox{\hyperlink{g__part__if_8m_abdc908a08b24cd2e589de2f44e40eeb9}{gp}};}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00410}00410         \textcolor{keywordtype}{int} done;}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00411}00411 }
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00412}00412         \mbox{\hyperlink{geom_8h_a1898dc8c812faa5de231ab840e8562bf}{g\_topology\_assert}}();}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00413}00413         \mbox{\hyperlink{g__part__if_8m_abdc908a08b24cd2e589de2f44e40eeb9}{gp}} = \mbox{\hyperlink{g__part__if_8m_a294f18324585ff37641fb8aa1c9ccd82}{cp}}-\/>\mbox{\hyperlink{structg__consumer_a75734fc8cd22ffc4209c36cc0a459cba}{geom}};}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00414}00414         sc = \mbox{\hyperlink{g__part__if_8m_abdc908a08b24cd2e589de2f44e40eeb9}{gp}}-\/>\mbox{\hyperlink{structg__geom_aa83c08c83459420f6cbcfe64c6099466}{softc}};}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00415}00415         mtx\_lock(\&sc-\/>\mbox{\hyperlink{structg__gate__softc_ab348293d423911e51223df8145c69bc0}{sc\_read\_mtx}});}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00416}00416         \textcolor{keywordflow}{if} (sc-\/>\mbox{\hyperlink{structg__gate__softc_a64f348a33de8ebe576b7aa7d7fc9bb2e}{sc\_readcons}} == \mbox{\hyperlink{g__part__if_8m_a294f18324585ff37641fb8aa1c9ccd82}{cp}})}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00417}00417                 sc-\/>\mbox{\hyperlink{structg__gate__softc_a64f348a33de8ebe576b7aa7d7fc9bb2e}{sc\_readcons}} = NULL;}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00418}00418         done = (\mbox{\hyperlink{g__part__if_8m_a294f18324585ff37641fb8aa1c9ccd82}{cp}}-\/>\mbox{\hyperlink{structg__consumer_a0bd70ab96dc6a56c4e0db0608af9c9a4}{index}} == 0);}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00419}00419         mtx\_unlock(\&sc-\/>\mbox{\hyperlink{structg__gate__softc_ab348293d423911e51223df8145c69bc0}{sc\_read\_mtx}});}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00420}00420         \textcolor{keywordflow}{if} (done)}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00421}00421                 \mbox{\hyperlink{g__gate_8c_acf08c885a57a0b8d961716f7a8b48fde}{g\_gate\_detach}}(\mbox{\hyperlink{g__part__if_8m_a294f18324585ff37641fb8aa1c9ccd82}{cp}}, 0);}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00422}00422 \}}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00423}00423 }
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00424}00424 \textcolor{keyword}{static} \textcolor{keywordtype}{void}}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00425}\mbox{\hyperlink{g__gate_8c_a31b026032647ff482c3e1b0e8bc5196b}{00425}} \mbox{\hyperlink{g__gate_8c_a31b026032647ff482c3e1b0e8bc5196b}{g\_gate\_dumpconf}}(\textcolor{keyword}{struct} sbuf *\mbox{\hyperlink{g__part__if_8m_a4c23eb4bab5aa5d69bd84384b94d1f79}{sb}}, \textcolor{keyword}{const} \textcolor{keywordtype}{char} *\mbox{\hyperlink{g__part__if_8m_a9a0d9ba518bc8db9a623d0a6ab81f81c}{indent}}, \textcolor{keyword}{struct} \mbox{\hyperlink{structg__geom}{g\_geom}} *\mbox{\hyperlink{g__part__if_8m_abdc908a08b24cd2e589de2f44e40eeb9}{gp}},}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00426}00426     \textcolor{keyword}{struct} \mbox{\hyperlink{structg__consumer}{g\_consumer}} *\mbox{\hyperlink{g__part__if_8m_a294f18324585ff37641fb8aa1c9ccd82}{cp}}, \textcolor{keyword}{struct} \mbox{\hyperlink{structg__provider}{g\_provider}} *\mbox{\hyperlink{g__part__if_8m_a9bc7638f295763b77465c5ebebbd3442}{pp}})}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00427}00427 \{}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00428}00428         \textcolor{keyword}{struct }\mbox{\hyperlink{structg__gate__softc}{g\_gate\_softc}} *sc;}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00429}00429 }
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00430}00430         sc = \mbox{\hyperlink{g__part__if_8m_abdc908a08b24cd2e589de2f44e40eeb9}{gp}}-\/>\mbox{\hyperlink{structg__geom_aa83c08c83459420f6cbcfe64c6099466}{softc}};}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00431}00431         \textcolor{keywordflow}{if} (sc == NULL || \mbox{\hyperlink{g__part__if_8m_a9bc7638f295763b77465c5ebebbd3442}{pp}} != NULL || \mbox{\hyperlink{g__part__if_8m_a294f18324585ff37641fb8aa1c9ccd82}{cp}} != NULL)}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00432}00432                 \textcolor{keywordflow}{return};}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00433}00433         sc = \mbox{\hyperlink{g__gate_8c_a2b89931d7ca7196a8911e4b212974dbe}{g\_gate\_hold}}(sc-\/>\mbox{\hyperlink{structg__gate__softc_a73063ecc9b79d8a62099e45e6ce8db51}{sc\_unit}}, NULL);}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00434}00434         \textcolor{keywordflow}{if} (sc == NULL)}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00435}00435                 \textcolor{keywordflow}{return};}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00436}00436         \textcolor{keywordflow}{if} ((sc-\/>\mbox{\hyperlink{structg__gate__softc_a84c3b69044ec5f9d855c5372fa2740e7}{sc\_flags}} \& \mbox{\hyperlink{g__gate_8h_ad7296b9d5c5843d3df8d9eb6dc654357}{G\_GATE\_FLAG\_READONLY}}) != 0) \{}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00437}00437                 sbuf\_printf(\mbox{\hyperlink{g__part__if_8m_a4c23eb4bab5aa5d69bd84384b94d1f79}{sb}}, \textcolor{stringliteral}{"{}\%s<access>\%s</access>\(\backslash\)n"{}}, \mbox{\hyperlink{g__part__if_8m_a9a0d9ba518bc8db9a623d0a6ab81f81c}{indent}}, \textcolor{stringliteral}{"{}read-\/only"{}});}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00438}00438         \} \textcolor{keywordflow}{else} \textcolor{keywordflow}{if} ((sc-\/>\mbox{\hyperlink{structg__gate__softc_a84c3b69044ec5f9d855c5372fa2740e7}{sc\_flags}} \& \mbox{\hyperlink{g__gate_8h_a413c9d978811465989e7bd8affcdd6a7}{G\_GATE\_FLAG\_WRITEONLY}}) != 0) \{}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00439}00439                 sbuf\_printf(\mbox{\hyperlink{g__part__if_8m_a4c23eb4bab5aa5d69bd84384b94d1f79}{sb}}, \textcolor{stringliteral}{"{}\%s<access>\%s</access>\(\backslash\)n"{}}, \mbox{\hyperlink{g__part__if_8m_a9a0d9ba518bc8db9a623d0a6ab81f81c}{indent}},}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00440}00440                     \textcolor{stringliteral}{"{}write-\/only"{}});}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00441}00441         \} \textcolor{keywordflow}{else} \{}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00442}00442                 sbuf\_printf(\mbox{\hyperlink{g__part__if_8m_a4c23eb4bab5aa5d69bd84384b94d1f79}{sb}}, \textcolor{stringliteral}{"{}\%s<access>\%s</access>\(\backslash\)n"{}}, \mbox{\hyperlink{g__part__if_8m_a9a0d9ba518bc8db9a623d0a6ab81f81c}{indent}},}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00443}00443                     \textcolor{stringliteral}{"{}read-\/write"{}});}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00444}00444         \}}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00445}00445         \textcolor{keywordflow}{if} (sc-\/>\mbox{\hyperlink{structg__gate__softc_a64f348a33de8ebe576b7aa7d7fc9bb2e}{sc\_readcons}} != NULL) \{}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00446}00446                 sbuf\_printf(\mbox{\hyperlink{g__part__if_8m_a4c23eb4bab5aa5d69bd84384b94d1f79}{sb}}, \textcolor{stringliteral}{"{}\%s<read\_offset>\%jd</read\_offset>\(\backslash\)n"{}},}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00447}00447                     \mbox{\hyperlink{g__part__if_8m_a9a0d9ba518bc8db9a623d0a6ab81f81c}{indent}}, (intmax\_t)sc-\/>\mbox{\hyperlink{structg__gate__softc_a4c46733d618bf65ee350dcaa50a98cc0}{sc\_readoffset}});}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00448}00448                 sbuf\_printf(\mbox{\hyperlink{g__part__if_8m_a4c23eb4bab5aa5d69bd84384b94d1f79}{sb}}, \textcolor{stringliteral}{"{}\%s<read\_provider>\%s</read\_provider>\(\backslash\)n"{}},}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00449}00449                     \mbox{\hyperlink{g__part__if_8m_a9a0d9ba518bc8db9a623d0a6ab81f81c}{indent}}, sc-\/>\mbox{\hyperlink{structg__gate__softc_a64f348a33de8ebe576b7aa7d7fc9bb2e}{sc\_readcons}}-\/>\mbox{\hyperlink{structg__consumer_a6435d5aec0376e995dce3131fd3beb52}{provider}}-\/>\mbox{\hyperlink{structg__provider_a2bffb416ee58cf4df7839c6fd5ec004a}{name}});}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00450}00450         \}}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00451}00451         sbuf\_printf(\mbox{\hyperlink{g__part__if_8m_a4c23eb4bab5aa5d69bd84384b94d1f79}{sb}}, \textcolor{stringliteral}{"{}\%s<timeout>\%u</timeout>\(\backslash\)n"{}}, \mbox{\hyperlink{g__part__if_8m_a9a0d9ba518bc8db9a623d0a6ab81f81c}{indent}}, sc-\/>\mbox{\hyperlink{structg__gate__softc_af50bc6523e69421b2ddd0efc765d04b7}{sc\_timeout}});}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00452}00452         sbuf\_printf(\mbox{\hyperlink{g__part__if_8m_a4c23eb4bab5aa5d69bd84384b94d1f79}{sb}}, \textcolor{stringliteral}{"{}\%s<info>\%s</info>\(\backslash\)n"{}}, \mbox{\hyperlink{g__part__if_8m_a9a0d9ba518bc8db9a623d0a6ab81f81c}{indent}}, sc-\/>\mbox{\hyperlink{structg__gate__softc_a6bb9236bcba1aa870e615590b8edcffa}{sc\_info}});}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00453}00453         sbuf\_printf(\mbox{\hyperlink{g__part__if_8m_a4c23eb4bab5aa5d69bd84384b94d1f79}{sb}}, \textcolor{stringliteral}{"{}\%s<queue\_count>\%u</queue\_count>\(\backslash\)n"{}}, \mbox{\hyperlink{g__part__if_8m_a9a0d9ba518bc8db9a623d0a6ab81f81c}{indent}},}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00454}00454             sc-\/>\mbox{\hyperlink{structg__gate__softc_aa4781c44dcd3538a79e199c10339ae38}{sc\_queue\_count}});}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00455}00455         sbuf\_printf(\mbox{\hyperlink{g__part__if_8m_a4c23eb4bab5aa5d69bd84384b94d1f79}{sb}}, \textcolor{stringliteral}{"{}\%s<queue\_size>\%u</queue\_size>\(\backslash\)n"{}}, \mbox{\hyperlink{g__part__if_8m_a9a0d9ba518bc8db9a623d0a6ab81f81c}{indent}},}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00456}00456             sc-\/>\mbox{\hyperlink{structg__gate__softc_a592299eb252304887a4d1285c9adedd8}{sc\_queue\_size}});}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00457}00457         sbuf\_printf(\mbox{\hyperlink{g__part__if_8m_a4c23eb4bab5aa5d69bd84384b94d1f79}{sb}}, \textcolor{stringliteral}{"{}\%s<ref>\%u</ref>\(\backslash\)n"{}}, \mbox{\hyperlink{g__part__if_8m_a9a0d9ba518bc8db9a623d0a6ab81f81c}{indent}}, sc-\/>\mbox{\hyperlink{structg__gate__softc_ac8ef3ed01c73a4b102d123f36b0f8872}{sc\_ref}});}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00458}00458         sbuf\_printf(\mbox{\hyperlink{g__part__if_8m_a4c23eb4bab5aa5d69bd84384b94d1f79}{sb}}, \textcolor{stringliteral}{"{}\%s<unit>\%d</unit>\(\backslash\)n"{}}, \mbox{\hyperlink{g__part__if_8m_a9a0d9ba518bc8db9a623d0a6ab81f81c}{indent}}, sc-\/>\mbox{\hyperlink{structg__gate__softc_a73063ecc9b79d8a62099e45e6ce8db51}{sc\_unit}});}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00459}00459         \mbox{\hyperlink{geom_8h_a4628d4de49ba84e7a6126cc30d23b83a}{g\_topology\_unlock}}();}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00460}00460         \mbox{\hyperlink{g__gate_8c_a19879eef4039ecf02eee6fcc09069009}{g\_gate\_release}}(sc);}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00461}00461         \mbox{\hyperlink{geom_8h_a232419d2cfa06ff3f4ff7551041aed31}{g\_topology\_lock}}();}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00462}00462 \}}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00463}00463 }
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00464}00464 \textcolor{keyword}{static} \textcolor{keywordtype}{int}}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00465}\mbox{\hyperlink{g__gate_8c_aad2356f60b11242980be38644f873c29}{00465}} \mbox{\hyperlink{g__gate_8c_aad2356f60b11242980be38644f873c29}{g\_gate\_create}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structg__gate__ctl__create}{g\_gate\_ctl\_create}} *ggio)}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00466}00466 \{}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00467}00467         \textcolor{keyword}{struct }\mbox{\hyperlink{structg__gate__softc}{g\_gate\_softc}} *sc;}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00468}00468         \textcolor{keyword}{struct }\mbox{\hyperlink{structg__geom}{g\_geom}} *\mbox{\hyperlink{g__part__if_8m_abdc908a08b24cd2e589de2f44e40eeb9}{gp}};}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00469}00469         \textcolor{keyword}{struct }\mbox{\hyperlink{structg__provider}{g\_provider}} *\mbox{\hyperlink{g__part__if_8m_a9bc7638f295763b77465c5ebebbd3442}{pp}}, *ropp;}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00470}00470         \textcolor{keyword}{struct }\mbox{\hyperlink{structg__consumer}{g\_consumer}} *\mbox{\hyperlink{g__part__if_8m_a294f18324585ff37641fb8aa1c9ccd82}{cp}};}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00471}00471         \textcolor{keywordtype}{char} \mbox{\hyperlink{g__part__if_8m_aff5d3acc33944ecb11914d04ef06bb54}{name}}[NAME\_MAX + 1];}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00472}00472         \textcolor{keywordtype}{char} readprov[NAME\_MAX + 1];}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00473}00473         \textcolor{keywordtype}{int} error = 0, unit;}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00474}00474 }
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00475}00475         \textcolor{keywordflow}{if} (ggio-\/>\mbox{\hyperlink{structg__gate__ctl__create_aab0c7a09583029a1249a532328fa7c70}{gctl\_mediasize}} <= 0) \{}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00476}00476                 \mbox{\hyperlink{g__gate_8h_a55f7a3bf1df0cf8bdab9cbcaa02da57a}{G\_GATE\_DEBUG}}(1, \textcolor{stringliteral}{"{}Invalid media size."{}});}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00477}00477                 \textcolor{keywordflow}{return} (EINVAL);}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00478}00478         \}}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00479}00479         \textcolor{keywordflow}{if} (ggio-\/>\mbox{\hyperlink{structg__gate__ctl__create_a7e5eef8b545c9c0d05ab820388bcc1b8}{gctl\_sectorsize}} <= 0) \{}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00480}00480                 \mbox{\hyperlink{g__gate_8h_a55f7a3bf1df0cf8bdab9cbcaa02da57a}{G\_GATE\_DEBUG}}(1, \textcolor{stringliteral}{"{}Invalid sector size."{}});}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00481}00481                 \textcolor{keywordflow}{return} (EINVAL);}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00482}00482         \}}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00483}00483         \textcolor{keywordflow}{if} (!powerof2(ggio-\/>\mbox{\hyperlink{structg__gate__ctl__create_a7e5eef8b545c9c0d05ab820388bcc1b8}{gctl\_sectorsize}})) \{}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00484}00484                 \mbox{\hyperlink{g__gate_8h_a55f7a3bf1df0cf8bdab9cbcaa02da57a}{G\_GATE\_DEBUG}}(1, \textcolor{stringliteral}{"{}Invalid sector size."{}});}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00485}00485                 \textcolor{keywordflow}{return} (EINVAL);}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00486}00486         \}}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00487}00487         \textcolor{keywordflow}{if} ((ggio-\/>\mbox{\hyperlink{structg__gate__ctl__create_aab0c7a09583029a1249a532328fa7c70}{gctl\_mediasize}} \% ggio-\/>\mbox{\hyperlink{structg__gate__ctl__create_a7e5eef8b545c9c0d05ab820388bcc1b8}{gctl\_sectorsize}}) != 0) \{}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00488}00488                 \mbox{\hyperlink{g__gate_8h_a55f7a3bf1df0cf8bdab9cbcaa02da57a}{G\_GATE\_DEBUG}}(1, \textcolor{stringliteral}{"{}Invalid media size."{}});}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00489}00489                 \textcolor{keywordflow}{return} (EINVAL);}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00490}00490         \}}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00491}00491         \textcolor{keywordflow}{if} ((ggio-\/>\mbox{\hyperlink{structg__gate__ctl__create_a324d0f842dba18463e1333eb6e95c4dc}{gctl\_flags}} \& \mbox{\hyperlink{g__gate_8h_ad7296b9d5c5843d3df8d9eb6dc654357}{G\_GATE\_FLAG\_READONLY}}) != 0 \&\&}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00492}00492             (ggio-\/>\mbox{\hyperlink{structg__gate__ctl__create_a324d0f842dba18463e1333eb6e95c4dc}{gctl\_flags}} \& \mbox{\hyperlink{g__gate_8h_a413c9d978811465989e7bd8affcdd6a7}{G\_GATE\_FLAG\_WRITEONLY}}) != 0) \{}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00493}00493                 \mbox{\hyperlink{g__gate_8h_a55f7a3bf1df0cf8bdab9cbcaa02da57a}{G\_GATE\_DEBUG}}(1, \textcolor{stringliteral}{"{}Invalid flags."{}});}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00494}00494                 \textcolor{keywordflow}{return} (EINVAL);}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00495}00495         \}}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00496}00496         \textcolor{keywordflow}{if} (ggio-\/>\mbox{\hyperlink{structg__gate__ctl__create_a29ec56ca0deba8015743098935e7a683}{gctl\_unit}} != \mbox{\hyperlink{g__gate_8h_a9b264239029a216889ede3277ac01a1d}{G\_GATE\_UNIT\_AUTO}} \&\&}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00497}00497             ggio-\/>\mbox{\hyperlink{structg__gate__ctl__create_a29ec56ca0deba8015743098935e7a683}{gctl\_unit}} != \mbox{\hyperlink{g__gate_8h_aadc15f8430ef26acb4f8e76244312221}{G\_GATE\_NAME\_GIVEN}} \&\&}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00498}00498             ggio-\/>\mbox{\hyperlink{structg__gate__ctl__create_a29ec56ca0deba8015743098935e7a683}{gctl\_unit}} < 0) \{}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00499}00499                 \mbox{\hyperlink{g__gate_8h_a55f7a3bf1df0cf8bdab9cbcaa02da57a}{G\_GATE\_DEBUG}}(1, \textcolor{stringliteral}{"{}Invalid unit number."{}});}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00500}00500                 \textcolor{keywordflow}{return} (EINVAL);}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00501}00501         \}}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00502}00502         \textcolor{keywordflow}{if} (ggio-\/>\mbox{\hyperlink{structg__gate__ctl__create_a29ec56ca0deba8015743098935e7a683}{gctl\_unit}} == \mbox{\hyperlink{g__gate_8h_aadc15f8430ef26acb4f8e76244312221}{G\_GATE\_NAME\_GIVEN}} \&\&}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00503}00503             ggio-\/>\mbox{\hyperlink{structg__gate__ctl__create_a88c119b0b4cf4174f6c59f05cdad0a65}{gctl\_name}}[0] == \textcolor{charliteral}{'\(\backslash\)0'}) \{}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00504}00504                 \mbox{\hyperlink{g__gate_8h_a55f7a3bf1df0cf8bdab9cbcaa02da57a}{G\_GATE\_DEBUG}}(1, \textcolor{stringliteral}{"{}No device name."{}});}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00505}00505                 \textcolor{keywordflow}{return} (EINVAL);}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00506}00506         \}}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00507}00507 }
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00508}00508         sc = malloc(\textcolor{keyword}{sizeof}(*sc), M\_GATE, M\_WAITOK | M\_ZERO);}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00509}00509         sc-\/>\mbox{\hyperlink{structg__gate__softc_a84c3b69044ec5f9d855c5372fa2740e7}{sc\_flags}} = (ggio-\/>\mbox{\hyperlink{structg__gate__ctl__create_a324d0f842dba18463e1333eb6e95c4dc}{gctl\_flags}} \& \mbox{\hyperlink{g__gate_8h_ae9f26cfbb0d69218b55c8af9ddd4a156}{G\_GATE\_USERFLAGS}});}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00510}00510         memset(sc-\/>\mbox{\hyperlink{structg__gate__softc_a6bb9236bcba1aa870e615590b8edcffa}{sc\_info}}, 0, \textcolor{keyword}{sizeof}(sc-\/>\mbox{\hyperlink{structg__gate__softc_a6bb9236bcba1aa870e615590b8edcffa}{sc\_info}}));}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00511}00511         strncpy(sc-\/>\mbox{\hyperlink{structg__gate__softc_a6bb9236bcba1aa870e615590b8edcffa}{sc\_info}}, ggio-\/>\mbox{\hyperlink{structg__gate__ctl__create_a42a91d4a770a442b964594ef5e5ef6be}{gctl\_info}},}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00512}00512             MIN(\textcolor{keyword}{sizeof}(sc-\/>\mbox{\hyperlink{structg__gate__softc_a6bb9236bcba1aa870e615590b8edcffa}{sc\_info}}) -\/ 1, \textcolor{keyword}{sizeof}(ggio-\/>\mbox{\hyperlink{structg__gate__ctl__create_a42a91d4a770a442b964594ef5e5ef6be}{gctl\_info}})));}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00513}00513         sc-\/>\mbox{\hyperlink{structg__gate__softc_a438f6a92a1b279a0bed5eddd5242eb6b}{sc\_seq}} = 1;}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00514}00514         bioq\_init(\&sc-\/>\mbox{\hyperlink{structg__gate__softc_a35a04b7e6d55d648c67f74c3d7e3c032}{sc\_inqueue}});}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00515}00515         bioq\_init(\&sc-\/>\mbox{\hyperlink{structg__gate__softc_ac184b57ea659df095b256cec55255763}{sc\_outqueue}});}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00516}00516         mtx\_init(\&sc-\/>\mbox{\hyperlink{structg__gate__softc_a37af4dfc3b501929eb576f819e4e3385}{sc\_queue\_mtx}}, \textcolor{stringliteral}{"{}gg:queue"{}}, NULL, MTX\_DEF);}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00517}00517         mtx\_init(\&sc-\/>\mbox{\hyperlink{structg__gate__softc_ab348293d423911e51223df8145c69bc0}{sc\_read\_mtx}}, \textcolor{stringliteral}{"{}gg:read"{}}, NULL, MTX\_DEF);}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00518}00518         sc-\/>\mbox{\hyperlink{structg__gate__softc_aa4781c44dcd3538a79e199c10339ae38}{sc\_queue\_count}} = 0;}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00519}00519         sc-\/>\mbox{\hyperlink{structg__gate__softc_a592299eb252304887a4d1285c9adedd8}{sc\_queue\_size}} = ggio-\/>\mbox{\hyperlink{structg__gate__ctl__create_a0b8bb15fcfdef6567e3d8e578cc3d26e}{gctl\_maxcount}};}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00520}00520         \textcolor{keywordflow}{if} (sc-\/>\mbox{\hyperlink{structg__gate__softc_a592299eb252304887a4d1285c9adedd8}{sc\_queue\_size}} > \mbox{\hyperlink{g__gate_8h_a431e11fe8db539bbe713315f34237e18}{G\_GATE\_MAX\_QUEUE\_SIZE}})}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00521}00521                 sc-\/>\mbox{\hyperlink{structg__gate__softc_a592299eb252304887a4d1285c9adedd8}{sc\_queue\_size}} = \mbox{\hyperlink{g__gate_8h_a431e11fe8db539bbe713315f34237e18}{G\_GATE\_MAX\_QUEUE\_SIZE}};}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00522}00522         sc-\/>\mbox{\hyperlink{structg__gate__softc_af50bc6523e69421b2ddd0efc765d04b7}{sc\_timeout}} = ggio-\/>\mbox{\hyperlink{structg__gate__ctl__create_ae9a080387a57955d380682a5ef29a469}{gctl\_timeout}};}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00523}00523         callout\_init(\&sc-\/>\mbox{\hyperlink{structg__gate__softc_a980e77893d181558826fec958e2abf0c}{sc\_callout}}, 1);}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00524}00524 }
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00525}00525         mtx\_lock(\&\mbox{\hyperlink{g__gate_8c_ab431c4c1e9f59db69418e5e79af450f1}{g\_gate\_units\_lock}});}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00526}00526         sc-\/>\mbox{\hyperlink{structg__gate__softc_a73063ecc9b79d8a62099e45e6ce8db51}{sc\_unit}} = \mbox{\hyperlink{g__gate_8c_aedcbe5bb3bd456f4be9d783dd211c434}{g\_gate\_getunit}}(ggio-\/>\mbox{\hyperlink{structg__gate__ctl__create_a29ec56ca0deba8015743098935e7a683}{gctl\_unit}}, \&error);}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00527}00527         \textcolor{keywordflow}{if} (sc-\/>\mbox{\hyperlink{structg__gate__softc_a73063ecc9b79d8a62099e45e6ce8db51}{sc\_unit}} < 0)}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00528}00528                 \textcolor{keywordflow}{goto} fail1;}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00529}00529         \textcolor{keywordflow}{if} (ggio-\/>\mbox{\hyperlink{structg__gate__ctl__create_a29ec56ca0deba8015743098935e7a683}{gctl\_unit}} == \mbox{\hyperlink{g__gate_8h_aadc15f8430ef26acb4f8e76244312221}{G\_GATE\_NAME\_GIVEN}}) \{}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00530}00530                 memset(\mbox{\hyperlink{g__part__if_8m_aff5d3acc33944ecb11914d04ef06bb54}{name}}, 0, \textcolor{keyword}{sizeof}(\mbox{\hyperlink{g__part__if_8m_aff5d3acc33944ecb11914d04ef06bb54}{name}}));}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00531}00531                 strncpy(\mbox{\hyperlink{g__part__if_8m_aff5d3acc33944ecb11914d04ef06bb54}{name}}, ggio-\/>\mbox{\hyperlink{structg__gate__ctl__create_a88c119b0b4cf4174f6c59f05cdad0a65}{gctl\_name}},}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00532}00532                     MIN(\textcolor{keyword}{sizeof}(\mbox{\hyperlink{g__part__if_8m_aff5d3acc33944ecb11914d04ef06bb54}{name}}) -\/ 1, \textcolor{keyword}{sizeof}(ggio-\/>\mbox{\hyperlink{structg__gate__ctl__create_a88c119b0b4cf4174f6c59f05cdad0a65}{gctl\_name}})));}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00533}00533         \} \textcolor{keywordflow}{else} \{}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00534}00534                 snprintf(\mbox{\hyperlink{g__part__if_8m_aff5d3acc33944ecb11914d04ef06bb54}{name}}, \textcolor{keyword}{sizeof}(\mbox{\hyperlink{g__part__if_8m_aff5d3acc33944ecb11914d04ef06bb54}{name}}), \textcolor{stringliteral}{"{}\%s\%d"{}}, \mbox{\hyperlink{g__gate_8h_a33eb0e46925a86ad7c1541a4ef1a544c}{G\_GATE\_PROVIDER\_NAME}},}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00535}00535                     sc-\/>\mbox{\hyperlink{structg__gate__softc_a73063ecc9b79d8a62099e45e6ce8db51}{sc\_unit}});}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00536}00536         \}}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00537}00537         \textcolor{comment}{/* Check for name collision. */}}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00538}00538         \textcolor{keywordflow}{for} (unit = 0; unit < \mbox{\hyperlink{g__gate_8c_a09f1bed9387fc2ea71c8e4fab67610d6}{g\_gate\_maxunits}}; unit++) \{}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00539}00539                 \textcolor{keywordflow}{if} (\mbox{\hyperlink{g__gate_8c_aa33cfbd6b3c123829c1960a42795ca1c}{g\_gate\_units}}[unit] == NULL)}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00540}00540                         \textcolor{keywordflow}{continue};}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00541}00541                 \textcolor{keywordflow}{if} (strcmp(\mbox{\hyperlink{g__part__if_8m_aff5d3acc33944ecb11914d04ef06bb54}{name}}, \mbox{\hyperlink{g__gate_8c_aa33cfbd6b3c123829c1960a42795ca1c}{g\_gate\_units}}[unit]-\/>\mbox{\hyperlink{g__cache_8h_ab047d2e3041c744656fa453cd79df3e5}{sc\_name}}) != 0)}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00542}00542                         \textcolor{keywordflow}{continue};}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00543}00543                 error = EEXIST;}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00544}00544                 \textcolor{keywordflow}{goto} fail1;}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00545}00545         \}}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00546}00546         \textcolor{comment}{// local stack buffer 'name' assigned here temporarily only.}}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00547}00547         \textcolor{comment}{// the real provider name is assigned below.}}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00548}00548         sc-\/>\mbox{\hyperlink{structg__gate__softc_a463d10d3a6f716b4d3a8523124316c0f}{sc\_name}} = \mbox{\hyperlink{g__part__if_8m_aff5d3acc33944ecb11914d04ef06bb54}{name}};}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00549}00549         \mbox{\hyperlink{g__gate_8c_aa33cfbd6b3c123829c1960a42795ca1c}{g\_gate\_units}}[sc-\/>\mbox{\hyperlink{structg__gate__softc_a73063ecc9b79d8a62099e45e6ce8db51}{sc\_unit}}] = sc;}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00550}00550         \mbox{\hyperlink{g__gate_8c_aacc39c961f2a966d575f40b6e5d42828}{g\_gate\_nunits}}++;}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00551}00551         mtx\_unlock(\&\mbox{\hyperlink{g__gate_8c_ab431c4c1e9f59db69418e5e79af450f1}{g\_gate\_units\_lock}});}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00552}00552 }
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00553}00553         \mbox{\hyperlink{geom_8h_a232419d2cfa06ff3f4ff7551041aed31}{g\_topology\_lock}}();}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00554}00554 }
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00555}00555         \textcolor{keywordflow}{if} (ggio-\/>\mbox{\hyperlink{structg__gate__ctl__create_acc681099273ff38d410a4ef15e84dbdb}{gctl\_readprov}}[0] == \textcolor{charliteral}{'\(\backslash\)0'}) \{}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00556}00556                 ropp = NULL;}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00557}00557         \} \textcolor{keywordflow}{else} \{}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00558}00558                 memset(readprov, 0, \textcolor{keyword}{sizeof}(readprov));}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00559}00559                 strncpy(readprov, ggio-\/>\mbox{\hyperlink{structg__gate__ctl__create_acc681099273ff38d410a4ef15e84dbdb}{gctl\_readprov}},}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00560}00560                     MIN(\textcolor{keyword}{sizeof}(readprov) -\/ 1, \textcolor{keyword}{sizeof}(ggio-\/>\mbox{\hyperlink{structg__gate__ctl__create_acc681099273ff38d410a4ef15e84dbdb}{gctl\_readprov}})));}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00561}00561                 ropp = \mbox{\hyperlink{geom_8h_ad022ef529cc86a6c4ea72564de2e9ca2}{g\_provider\_by\_name}}(readprov);}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00562}00562                 \textcolor{keywordflow}{if} (ropp == NULL) \{}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00563}00563                         \mbox{\hyperlink{g__gate_8h_a55f7a3bf1df0cf8bdab9cbcaa02da57a}{G\_GATE\_DEBUG}}(1, \textcolor{stringliteral}{"{}Provider \%s doesn't exist."{}}, readprov);}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00564}00564                         error = EINVAL;}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00565}00565                         \textcolor{keywordflow}{goto} fail2;}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00566}00566                 \}}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00567}00567                 \textcolor{keywordflow}{if} ((ggio-\/>\mbox{\hyperlink{structg__gate__ctl__create_adc4488eb9445aed809971c8a6eb31715}{gctl\_readoffset}} \% ggio-\/>\mbox{\hyperlink{structg__gate__ctl__create_a7e5eef8b545c9c0d05ab820388bcc1b8}{gctl\_sectorsize}}) != 0) \{}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00568}00568                         \mbox{\hyperlink{g__gate_8h_a55f7a3bf1df0cf8bdab9cbcaa02da57a}{G\_GATE\_DEBUG}}(1, \textcolor{stringliteral}{"{}Invalid read offset."{}});}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00569}00569                         error = EINVAL;}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00570}00570                         \textcolor{keywordflow}{goto} fail2;}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00571}00571                 \}}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00572}00572                 \textcolor{keywordflow}{if} (ggio-\/>\mbox{\hyperlink{structg__gate__ctl__create_aab0c7a09583029a1249a532328fa7c70}{gctl\_mediasize}} + ggio-\/>\mbox{\hyperlink{structg__gate__ctl__create_adc4488eb9445aed809971c8a6eb31715}{gctl\_readoffset}} >}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00573}00573                     ropp-\/>\mbox{\hyperlink{structg__provider_a8f47c464c78aa91fa4ca5143ed3cd15e}{mediasize}}) \{}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00574}00574                         \mbox{\hyperlink{g__gate_8h_a55f7a3bf1df0cf8bdab9cbcaa02da57a}{G\_GATE\_DEBUG}}(1, \textcolor{stringliteral}{"{}Invalid read offset or media size."{}});}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00575}00575                         error = EINVAL;}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00576}00576                         \textcolor{keywordflow}{goto} fail2;}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00577}00577                 \}}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00578}00578         \}}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00579}00579 }
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00580}00580         \mbox{\hyperlink{g__part__if_8m_abdc908a08b24cd2e589de2f44e40eeb9}{gp}} = \mbox{\hyperlink{geom_8h_a4000befe2ff4b405b8333ccc5b0fdb41}{g\_new\_geomf}}(\&\mbox{\hyperlink{g__gate_8c_a02c65068c489a7a2aef761c0a7348f53}{g\_gate\_class}}, \textcolor{stringliteral}{"{}\%s"{}}, \mbox{\hyperlink{g__part__if_8m_aff5d3acc33944ecb11914d04ef06bb54}{name}});}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00581}00581         \mbox{\hyperlink{g__part__if_8m_abdc908a08b24cd2e589de2f44e40eeb9}{gp}}-\/>\mbox{\hyperlink{structg__geom_a160a0c74f128936d97064e56052dc2ef}{start}} = \mbox{\hyperlink{g__gate_8c_ab3e63cbba0f759da4baebcf704ec48b8}{g\_gate\_start}};}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00582}00582         \mbox{\hyperlink{g__part__if_8m_abdc908a08b24cd2e589de2f44e40eeb9}{gp}}-\/>\mbox{\hyperlink{structg__geom_aea05083928dcabdb4d343c6b9ee71cbd}{access}} = \mbox{\hyperlink{g__gate_8c_adb332ab805afc2b4362cd564787caadc}{g\_gate\_access}};}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00583}00583         \mbox{\hyperlink{g__part__if_8m_abdc908a08b24cd2e589de2f44e40eeb9}{gp}}-\/>\mbox{\hyperlink{structg__geom_a67386b3b9a49233eca9f73d28bc70325}{orphan}} = \mbox{\hyperlink{g__gate_8c_ae7f5e05199176ace74abca8a2f660e8d}{g\_gate\_orphan}};}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00584}00584         \mbox{\hyperlink{g__part__if_8m_abdc908a08b24cd2e589de2f44e40eeb9}{gp}}-\/>\mbox{\hyperlink{structg__geom_a5944d44b6aba36f1a37c67f020b5588b}{dumpconf}} = \mbox{\hyperlink{g__gate_8c_a31b026032647ff482c3e1b0e8bc5196b}{g\_gate\_dumpconf}};}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00585}00585         \mbox{\hyperlink{g__part__if_8m_abdc908a08b24cd2e589de2f44e40eeb9}{gp}}-\/>\mbox{\hyperlink{structg__geom_aa83c08c83459420f6cbcfe64c6099466}{softc}} = sc;}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00586}00586 }
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00587}00587         \textcolor{keywordflow}{if} (ropp != NULL) \{}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00588}00588                 \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__gate_8c_source_l00589}00589                 \mbox{\hyperlink{g__part__if_8m_a294f18324585ff37641fb8aa1c9ccd82}{cp}}-\/>\mbox{\hyperlink{structg__consumer_acf792357913c0445233b71f8259764d9}{flags}} |= \mbox{\hyperlink{geom_8h_a712586d00e1fe2a8069adfc048fee210}{G\_CF\_DIRECT\_SEND}} | \mbox{\hyperlink{geom_8h_a2184f2512ddb7a67ddbb71409cdd953f}{G\_CF\_DIRECT\_RECEIVE}};}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00590}00590                 error = \mbox{\hyperlink{geom_8h_a7f6ee69db47bae6ff5284f6a9cfceb91}{g\_attach}}(\mbox{\hyperlink{g__part__if_8m_a294f18324585ff37641fb8aa1c9ccd82}{cp}}, ropp);}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00591}00591                 \textcolor{keywordflow}{if} (error != 0) \{}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00592}00592                         \mbox{\hyperlink{g__gate_8h_a55f7a3bf1df0cf8bdab9cbcaa02da57a}{G\_GATE\_DEBUG}}(1, \textcolor{stringliteral}{"{}Unable to attach to \%s."{}}, ropp-\/>\mbox{\hyperlink{structg__provider_a2bffb416ee58cf4df7839c6fd5ec004a}{name}});}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00593}00593                         \textcolor{keywordflow}{goto} fail3;}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00594}00594                 \}}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00595}00595                 error = \mbox{\hyperlink{geom_8h_a27b7c72cc3bc5a4d07ce5976e1aa1b58}{g\_access}}(\mbox{\hyperlink{g__part__if_8m_a294f18324585ff37641fb8aa1c9ccd82}{cp}}, 1, 0, 0);}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00596}00596                 \textcolor{keywordflow}{if} (error != 0) \{}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00597}00597                         \mbox{\hyperlink{g__gate_8h_a55f7a3bf1df0cf8bdab9cbcaa02da57a}{G\_GATE\_DEBUG}}(1, \textcolor{stringliteral}{"{}Unable to access \%s."{}}, ropp-\/>\mbox{\hyperlink{structg__provider_a2bffb416ee58cf4df7839c6fd5ec004a}{name}});}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00598}00598                         \mbox{\hyperlink{geom_8h_a037802c2ec5d43fcf1222215f9f8a735}{g\_detach}}(\mbox{\hyperlink{g__part__if_8m_a294f18324585ff37641fb8aa1c9ccd82}{cp}});}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00599}00599                         \textcolor{keywordflow}{goto} fail3;}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00600}00600                 \}}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00601}00601                 sc-\/>\mbox{\hyperlink{structg__gate__softc_a64f348a33de8ebe576b7aa7d7fc9bb2e}{sc\_readcons}} = \mbox{\hyperlink{g__part__if_8m_a294f18324585ff37641fb8aa1c9ccd82}{cp}};}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00602}00602                 sc-\/>\mbox{\hyperlink{structg__gate__softc_a4c46733d618bf65ee350dcaa50a98cc0}{sc\_readoffset}} = ggio-\/>\mbox{\hyperlink{structg__gate__ctl__create_adc4488eb9445aed809971c8a6eb31715}{gctl\_readoffset}};}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00603}00603         \}}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00604}00604 }
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00605}00605         ggio-\/>\mbox{\hyperlink{structg__gate__ctl__create_a29ec56ca0deba8015743098935e7a683}{gctl\_unit}} = sc-\/>\mbox{\hyperlink{structg__gate__softc_a73063ecc9b79d8a62099e45e6ce8db51}{sc\_unit}};}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00606}00606 }
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00607}00607         \mbox{\hyperlink{g__part__if_8m_a9bc7638f295763b77465c5ebebbd3442}{pp}} = \mbox{\hyperlink{geom_8h_a79a5fe6e79cbc1a257454a3554fa11ef}{g\_new\_providerf}}(\mbox{\hyperlink{g__part__if_8m_abdc908a08b24cd2e589de2f44e40eeb9}{gp}}, \textcolor{stringliteral}{"{}\%s"{}}, \mbox{\hyperlink{g__part__if_8m_aff5d3acc33944ecb11914d04ef06bb54}{name}});}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00608}00608         \mbox{\hyperlink{g__part__if_8m_a9bc7638f295763b77465c5ebebbd3442}{pp}}-\/>\mbox{\hyperlink{structg__provider_a2d2060ee918007b601780f93a39c30de}{flags}} |= \mbox{\hyperlink{geom_8h_a486656f757680c7ff0c7ca06b643eb2d}{G\_PF\_DIRECT\_SEND}} | \mbox{\hyperlink{geom_8h_a36e660dabad70e0fd2439be3ddca8d47}{G\_PF\_DIRECT\_RECEIVE}};}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00609}00609         \mbox{\hyperlink{g__part__if_8m_a9bc7638f295763b77465c5ebebbd3442}{pp}}-\/>\mbox{\hyperlink{structg__provider_a8f47c464c78aa91fa4ca5143ed3cd15e}{mediasize}} = ggio-\/>\mbox{\hyperlink{structg__gate__ctl__create_aab0c7a09583029a1249a532328fa7c70}{gctl\_mediasize}};}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00610}00610         \mbox{\hyperlink{g__part__if_8m_a9bc7638f295763b77465c5ebebbd3442}{pp}}-\/>\mbox{\hyperlink{structg__provider_aea3cd43d41461790b8d0afcd8c49a355}{sectorsize}} = ggio-\/>\mbox{\hyperlink{structg__gate__ctl__create_a7e5eef8b545c9c0d05ab820388bcc1b8}{gctl\_sectorsize}};}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00611}00611         sc-\/>\mbox{\hyperlink{structg__gate__softc_a6a4e491f493bf7eaf393dd8ca83f79a8}{sc\_provider}} = \mbox{\hyperlink{g__part__if_8m_a9bc7638f295763b77465c5ebebbd3442}{pp}};}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00612}00612         \mbox{\hyperlink{geom_8h_a7a46b49361266e9bb4b1441aade2c48f}{g\_error\_provider}}(\mbox{\hyperlink{g__part__if_8m_a9bc7638f295763b77465c5ebebbd3442}{pp}}, 0);}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00613}00613 }
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00614}00614         \mbox{\hyperlink{geom_8h_a4628d4de49ba84e7a6126cc30d23b83a}{g\_topology\_unlock}}();}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00615}00615         mtx\_lock(\&\mbox{\hyperlink{g__gate_8c_ab431c4c1e9f59db69418e5e79af450f1}{g\_gate\_units\_lock}});}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00616}00616         sc-\/>\mbox{\hyperlink{structg__gate__softc_a463d10d3a6f716b4d3a8523124316c0f}{sc\_name}} = sc-\/>\mbox{\hyperlink{structg__gate__softc_a6a4e491f493bf7eaf393dd8ca83f79a8}{sc\_provider}}-\/>\mbox{\hyperlink{structg__provider_a2bffb416ee58cf4df7839c6fd5ec004a}{name}};}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00617}00617         mtx\_unlock(\&\mbox{\hyperlink{g__gate_8c_ab431c4c1e9f59db69418e5e79af450f1}{g\_gate\_units\_lock}});}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00618}00618         \mbox{\hyperlink{g__gate_8h_a55f7a3bf1df0cf8bdab9cbcaa02da57a}{G\_GATE\_DEBUG}}(1, \textcolor{stringliteral}{"{}Device \%s created."{}}, \mbox{\hyperlink{g__part__if_8m_abdc908a08b24cd2e589de2f44e40eeb9}{gp}}-\/>\mbox{\hyperlink{structg__geom_af64450500f1fea18f639b191a5017107}{name}});}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00619}00619 }
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00620}00620         \textcolor{keywordflow}{if} (sc-\/>\mbox{\hyperlink{structg__gate__softc_af50bc6523e69421b2ddd0efc765d04b7}{sc\_timeout}} > 0) \{}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00621}00621                 callout\_reset(\&sc-\/>\mbox{\hyperlink{structg__gate__softc_a980e77893d181558826fec958e2abf0c}{sc\_callout}}, sc-\/>\mbox{\hyperlink{structg__gate__softc_af50bc6523e69421b2ddd0efc765d04b7}{sc\_timeout}} * hz,}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00622}00622                     \mbox{\hyperlink{g__gate_8c_a1650ccc3097d9f3f6676b609618e5cfd}{g\_gate\_guard}}, sc);}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00623}00623         \}}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00624}00624         \textcolor{keywordflow}{return} (0);}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00625}00625 fail3:}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00626}00626         \mbox{\hyperlink{geom_8h_a9f53f6118c5e44ca2bcbd7ae548597b9}{g\_destroy\_consumer}}(\mbox{\hyperlink{g__part__if_8m_a294f18324585ff37641fb8aa1c9ccd82}{cp}});}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00627}00627         \mbox{\hyperlink{geom_8h_ac8307c99785f672632d3cf33134211ea}{g\_destroy\_geom}}(\mbox{\hyperlink{g__part__if_8m_abdc908a08b24cd2e589de2f44e40eeb9}{gp}});}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00628}00628 fail2:}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00629}00629         \mbox{\hyperlink{geom_8h_a4628d4de49ba84e7a6126cc30d23b83a}{g\_topology\_unlock}}();}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00630}00630         mtx\_lock(\&\mbox{\hyperlink{g__gate_8c_ab431c4c1e9f59db69418e5e79af450f1}{g\_gate\_units\_lock}});}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00631}00631         \mbox{\hyperlink{g__gate_8c_aa33cfbd6b3c123829c1960a42795ca1c}{g\_gate\_units}}[sc-\/>\mbox{\hyperlink{structg__gate__softc_a73063ecc9b79d8a62099e45e6ce8db51}{sc\_unit}}] = NULL;}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00632}00632         KASSERT(\mbox{\hyperlink{g__gate_8c_aacc39c961f2a966d575f40b6e5d42828}{g\_gate\_nunits}} > 0, (\textcolor{stringliteral}{"{}negative g\_gate\_nunits?"{}}));}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00633}00633         \mbox{\hyperlink{g__gate_8c_aacc39c961f2a966d575f40b6e5d42828}{g\_gate\_nunits}}-\/-\/;}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00634}00634 fail1:}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00635}00635         mtx\_unlock(\&\mbox{\hyperlink{g__gate_8c_ab431c4c1e9f59db69418e5e79af450f1}{g\_gate\_units\_lock}});}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00636}00636         mtx\_destroy(\&sc-\/>\mbox{\hyperlink{structg__gate__softc_a37af4dfc3b501929eb576f819e4e3385}{sc\_queue\_mtx}});}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00637}00637         mtx\_destroy(\&sc-\/>\mbox{\hyperlink{structg__gate__softc_ab348293d423911e51223df8145c69bc0}{sc\_read\_mtx}});}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00638}00638         \mbox{\hyperlink{g__raid__md__if_8m_a4df9edb2717b3f7e4c3c903878577a54}{free}}(sc, M\_GATE);}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00639}00639         \textcolor{keywordflow}{return} (error);}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00640}00640 \}}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00641}00641 }
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00642}00642 \textcolor{keyword}{static} \textcolor{keywordtype}{int}}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00643}\mbox{\hyperlink{g__gate_8c_a92f46978a5fa059415ce60b91f8dfee9}{00643}} \mbox{\hyperlink{g__gate_8c_a92f46978a5fa059415ce60b91f8dfee9}{g\_gate\_modify}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structg__gate__softc}{g\_gate\_softc}} *sc, \textcolor{keyword}{struct} \mbox{\hyperlink{structg__gate__ctl__modify}{g\_gate\_ctl\_modify}} *ggio)}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00644}00644 \{}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00645}00645         \textcolor{keywordtype}{char} readprov[NAME\_MAX + 1];}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00646}00646         \textcolor{keyword}{struct }\mbox{\hyperlink{structg__provider}{g\_provider}} *\mbox{\hyperlink{g__part__if_8m_a9bc7638f295763b77465c5ebebbd3442}{pp}};}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00647}00647         \textcolor{keyword}{struct }\mbox{\hyperlink{structg__consumer}{g\_consumer}} *\mbox{\hyperlink{g__part__if_8m_a294f18324585ff37641fb8aa1c9ccd82}{cp}};}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00648}00648         \textcolor{keywordtype}{int} done, error;}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00649}00649 }
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00650}00650         \textcolor{keywordflow}{if} ((ggio-\/>\mbox{\hyperlink{structg__gate__ctl__modify_ad818238263fa19a951787110b08dc029}{gctl\_modify}} \& \mbox{\hyperlink{g__gate_8h_a2ee2f2db6cfda4a9266acc233364c450}{GG\_MODIFY\_MEDIASIZE}}) != 0) \{}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00651}00651                 \textcolor{keywordflow}{if} (ggio-\/>\mbox{\hyperlink{structg__gate__ctl__modify_af75b91641c5a7aaa2db2fe2c81588595}{gctl\_mediasize}} <= 0) \{}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00652}00652                         \mbox{\hyperlink{g__gate_8h_a55f7a3bf1df0cf8bdab9cbcaa02da57a}{G\_GATE\_DEBUG}}(1, \textcolor{stringliteral}{"{}Invalid media size."{}});}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00653}00653                         \textcolor{keywordflow}{return} (EINVAL);}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00654}00654                 \}}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00655}00655                 \mbox{\hyperlink{g__part__if_8m_a9bc7638f295763b77465c5ebebbd3442}{pp}} = sc-\/>\mbox{\hyperlink{structg__gate__softc_a6a4e491f493bf7eaf393dd8ca83f79a8}{sc\_provider}};}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00656}00656                 \textcolor{keywordflow}{if} ((ggio-\/>\mbox{\hyperlink{structg__gate__ctl__modify_af75b91641c5a7aaa2db2fe2c81588595}{gctl\_mediasize}} \% \mbox{\hyperlink{g__part__if_8m_a9bc7638f295763b77465c5ebebbd3442}{pp}}-\/>\mbox{\hyperlink{structg__provider_aea3cd43d41461790b8d0afcd8c49a355}{sectorsize}}) != 0) \{}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00657}00657                         \mbox{\hyperlink{g__gate_8h_a55f7a3bf1df0cf8bdab9cbcaa02da57a}{G\_GATE\_DEBUG}}(1, \textcolor{stringliteral}{"{}Invalid media size."{}});}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00658}00658                         \textcolor{keywordflow}{return} (EINVAL);}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00659}00659                 \}}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00660}00660                 \mbox{\hyperlink{geom_8h_a72d479d3ccd8dec427b97c90557f3a4f}{g\_resize\_provider}}(\mbox{\hyperlink{g__part__if_8m_a9bc7638f295763b77465c5ebebbd3442}{pp}}, ggio-\/>\mbox{\hyperlink{structg__gate__ctl__modify_af75b91641c5a7aaa2db2fe2c81588595}{gctl\_mediasize}});}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00661}00661                 \textcolor{keywordflow}{return} (0);}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00662}00662         \}}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00663}00663 }
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00664}00664         \textcolor{keywordflow}{if} ((ggio-\/>\mbox{\hyperlink{structg__gate__ctl__modify_ad818238263fa19a951787110b08dc029}{gctl\_modify}} \& \mbox{\hyperlink{g__gate_8h_a5ce7c599ee6c89d80ee3eaf8827f6ed7}{GG\_MODIFY\_INFO}}) != 0) \{}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00665}00665                 memset(sc-\/>\mbox{\hyperlink{structg__gate__softc_a6bb9236bcba1aa870e615590b8edcffa}{sc\_info}}, 0, \textcolor{keyword}{sizeof}(sc-\/>\mbox{\hyperlink{structg__gate__softc_a6bb9236bcba1aa870e615590b8edcffa}{sc\_info}}));}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00666}00666                 strncpy(sc-\/>\mbox{\hyperlink{structg__gate__softc_a6bb9236bcba1aa870e615590b8edcffa}{sc\_info}}, ggio-\/>\mbox{\hyperlink{structg__gate__ctl__modify_a9c6a907e09bbf66801de7c85d82afc3e}{gctl\_info}},}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00667}00667                     MIN(\textcolor{keyword}{sizeof}(sc-\/>\mbox{\hyperlink{structg__gate__softc_a6bb9236bcba1aa870e615590b8edcffa}{sc\_info}}) -\/ 1, \textcolor{keyword}{sizeof}(ggio-\/>\mbox{\hyperlink{structg__gate__ctl__modify_a9c6a907e09bbf66801de7c85d82afc3e}{gctl\_info}})));}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00668}00668         \}}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00669}00669         \mbox{\hyperlink{g__part__if_8m_a294f18324585ff37641fb8aa1c9ccd82}{cp}} = NULL;}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00670}00670 }
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00671}00671         \textcolor{keywordflow}{if} ((ggio-\/>\mbox{\hyperlink{structg__gate__ctl__modify_ad818238263fa19a951787110b08dc029}{gctl\_modify}} \& \mbox{\hyperlink{g__gate_8h_a3c50177c3d254b10a8110b509d8a321f}{GG\_MODIFY\_READPROV}}) != 0) \{}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00672}00672                 \mbox{\hyperlink{geom_8h_a232419d2cfa06ff3f4ff7551041aed31}{g\_topology\_lock}}();}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00673}00673                 mtx\_lock(\&sc-\/>\mbox{\hyperlink{structg__gate__softc_ab348293d423911e51223df8145c69bc0}{sc\_read\_mtx}});}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00674}00674                 \textcolor{keywordflow}{if} ((\mbox{\hyperlink{g__part__if_8m_a294f18324585ff37641fb8aa1c9ccd82}{cp}} = sc-\/>\mbox{\hyperlink{structg__gate__softc_a64f348a33de8ebe576b7aa7d7fc9bb2e}{sc\_readcons}}) != NULL) \{}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00675}00675                         sc-\/>\mbox{\hyperlink{structg__gate__softc_a64f348a33de8ebe576b7aa7d7fc9bb2e}{sc\_readcons}} = NULL;}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00676}00676                         done = (\mbox{\hyperlink{g__part__if_8m_a294f18324585ff37641fb8aa1c9ccd82}{cp}}-\/>\mbox{\hyperlink{structg__consumer_a0bd70ab96dc6a56c4e0db0608af9c9a4}{index}} == 0);}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00677}00677                         mtx\_unlock(\&sc-\/>\mbox{\hyperlink{structg__gate__softc_ab348293d423911e51223df8145c69bc0}{sc\_read\_mtx}});}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00678}00678                         \textcolor{keywordflow}{if} (done)}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00679}00679                                 \mbox{\hyperlink{g__gate_8c_acf08c885a57a0b8d961716f7a8b48fde}{g\_gate\_detach}}(\mbox{\hyperlink{g__part__if_8m_a294f18324585ff37641fb8aa1c9ccd82}{cp}}, 0);}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00680}00680                 \} \textcolor{keywordflow}{else}}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00681}00681                         mtx\_unlock(\&sc-\/>\mbox{\hyperlink{structg__gate__softc_ab348293d423911e51223df8145c69bc0}{sc\_read\_mtx}});}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00682}00682                 \textcolor{keywordflow}{if} (ggio-\/>\mbox{\hyperlink{structg__gate__ctl__modify_a6758a0ab7caccf43282f4a249d9cf8c2}{gctl\_readprov}}[0] != \textcolor{charliteral}{'\(\backslash\)0'}) \{}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00683}00683                         memset(readprov, 0, \textcolor{keyword}{sizeof}(readprov));}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00684}00684                         strncpy(readprov, ggio-\/>\mbox{\hyperlink{structg__gate__ctl__modify_a6758a0ab7caccf43282f4a249d9cf8c2}{gctl\_readprov}},}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00685}00685                             MIN(\textcolor{keyword}{sizeof}(readprov) -\/ 1,}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00686}00686                             \textcolor{keyword}{sizeof}(ggio-\/>\mbox{\hyperlink{structg__gate__ctl__modify_a6758a0ab7caccf43282f4a249d9cf8c2}{gctl\_readprov}})));}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00687}00687                         \mbox{\hyperlink{g__part__if_8m_a9bc7638f295763b77465c5ebebbd3442}{pp}} = \mbox{\hyperlink{geom_8h_ad022ef529cc86a6c4ea72564de2e9ca2}{g\_provider\_by\_name}}(readprov);}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00688}00688                         \textcolor{keywordflow}{if} (\mbox{\hyperlink{g__part__if_8m_a9bc7638f295763b77465c5ebebbd3442}{pp}} == NULL) \{}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00689}00689                                 \mbox{\hyperlink{geom_8h_a4628d4de49ba84e7a6126cc30d23b83a}{g\_topology\_unlock}}();}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00690}00690                                 \mbox{\hyperlink{g__gate_8h_a55f7a3bf1df0cf8bdab9cbcaa02da57a}{G\_GATE\_DEBUG}}(1, \textcolor{stringliteral}{"{}Provider \%s doesn't exist."{}},}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00691}00691                                     readprov);}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00692}00692                                 \textcolor{keywordflow}{return} (EINVAL);}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00693}00693                         \}}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00694}00694                         \mbox{\hyperlink{g__part__if_8m_a294f18324585ff37641fb8aa1c9ccd82}{cp}} = \mbox{\hyperlink{geom_8h_aef9ca3f0eecc1b245c3c9cd0bac1cdc4}{g\_new\_consumer}}(sc-\/>\mbox{\hyperlink{structg__gate__softc_a6a4e491f493bf7eaf393dd8ca83f79a8}{sc\_provider}}-\/>\mbox{\hyperlink{structg__provider_afe5c92b8a2a9e4cdf1cab6daa96923c1}{geom}});}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00695}00695                         \mbox{\hyperlink{g__part__if_8m_a294f18324585ff37641fb8aa1c9ccd82}{cp}}-\/>\mbox{\hyperlink{structg__consumer_acf792357913c0445233b71f8259764d9}{flags}} |= \mbox{\hyperlink{geom_8h_a712586d00e1fe2a8069adfc048fee210}{G\_CF\_DIRECT\_SEND}} | \mbox{\hyperlink{geom_8h_a2184f2512ddb7a67ddbb71409cdd953f}{G\_CF\_DIRECT\_RECEIVE}};}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00696}00696                         error = \mbox{\hyperlink{geom_8h_a7f6ee69db47bae6ff5284f6a9cfceb91}{g\_attach}}(\mbox{\hyperlink{g__part__if_8m_a294f18324585ff37641fb8aa1c9ccd82}{cp}}, \mbox{\hyperlink{g__part__if_8m_a9bc7638f295763b77465c5ebebbd3442}{pp}});}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00697}00697                         \textcolor{keywordflow}{if} (error != 0) \{}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00698}00698                                 \mbox{\hyperlink{g__gate_8h_a55f7a3bf1df0cf8bdab9cbcaa02da57a}{G\_GATE\_DEBUG}}(1, \textcolor{stringliteral}{"{}Unable to attach to \%s."{}},}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00699}00699                                     \mbox{\hyperlink{g__part__if_8m_a9bc7638f295763b77465c5ebebbd3442}{pp}}-\/>\mbox{\hyperlink{structg__provider_a2bffb416ee58cf4df7839c6fd5ec004a}{name}});}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00700}00700                         \} \textcolor{keywordflow}{else} \{}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00701}00701                                 error = \mbox{\hyperlink{geom_8h_a27b7c72cc3bc5a4d07ce5976e1aa1b58}{g\_access}}(\mbox{\hyperlink{g__part__if_8m_a294f18324585ff37641fb8aa1c9ccd82}{cp}}, 1, 0, 0);}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00702}00702                                 \textcolor{keywordflow}{if} (error != 0) \{}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00703}00703                                         \mbox{\hyperlink{g__gate_8h_a55f7a3bf1df0cf8bdab9cbcaa02da57a}{G\_GATE\_DEBUG}}(1, \textcolor{stringliteral}{"{}Unable to access \%s."{}},}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00704}00704                                             \mbox{\hyperlink{g__part__if_8m_a9bc7638f295763b77465c5ebebbd3442}{pp}}-\/>\mbox{\hyperlink{structg__provider_a2bffb416ee58cf4df7839c6fd5ec004a}{name}});}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00705}00705                                         \mbox{\hyperlink{geom_8h_a037802c2ec5d43fcf1222215f9f8a735}{g\_detach}}(\mbox{\hyperlink{g__part__if_8m_a294f18324585ff37641fb8aa1c9ccd82}{cp}});}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00706}00706                                 \}}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00707}00707                         \}}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00708}00708                         \textcolor{keywordflow}{if} (error != 0) \{}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00709}00709                                 \mbox{\hyperlink{geom_8h_a9f53f6118c5e44ca2bcbd7ae548597b9}{g\_destroy\_consumer}}(\mbox{\hyperlink{g__part__if_8m_a294f18324585ff37641fb8aa1c9ccd82}{cp}});}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00710}00710                                 \mbox{\hyperlink{geom_8h_a4628d4de49ba84e7a6126cc30d23b83a}{g\_topology\_unlock}}();}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00711}00711                                 \textcolor{keywordflow}{return} (error);}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00712}00712                         \}}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00713}00713                 \}}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00714}00714         \} \textcolor{keywordflow}{else} \{}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00715}00715                 \mbox{\hyperlink{g__part__if_8m_a294f18324585ff37641fb8aa1c9ccd82}{cp}} = sc-\/>\mbox{\hyperlink{structg__gate__softc_a64f348a33de8ebe576b7aa7d7fc9bb2e}{sc\_readcons}};}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00716}00716         \}}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00717}00717 }
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00718}00718         \textcolor{keywordflow}{if} ((ggio-\/>\mbox{\hyperlink{structg__gate__ctl__modify_ad818238263fa19a951787110b08dc029}{gctl\_modify}} \& \mbox{\hyperlink{g__gate_8h_a3a8ab43868fb1208a9821a53b9e6ee4b}{GG\_MODIFY\_READOFFSET}}) != 0) \{}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00719}00719                 \textcolor{keywordflow}{if} (\mbox{\hyperlink{g__part__if_8m_a294f18324585ff37641fb8aa1c9ccd82}{cp}} == NULL) \{}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00720}00720                         \mbox{\hyperlink{g__gate_8h_a55f7a3bf1df0cf8bdab9cbcaa02da57a}{G\_GATE\_DEBUG}}(1, \textcolor{stringliteral}{"{}No read provider."{}});}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00721}00721                         \textcolor{keywordflow}{return} (EINVAL);}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00722}00722                 \}}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00723}00723                 \mbox{\hyperlink{g__part__if_8m_a9bc7638f295763b77465c5ebebbd3442}{pp}} = sc-\/>\mbox{\hyperlink{structg__gate__softc_a6a4e491f493bf7eaf393dd8ca83f79a8}{sc\_provider}};}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00724}00724                 \textcolor{keywordflow}{if} ((ggio-\/>\mbox{\hyperlink{structg__gate__ctl__modify_a781abc48f8e1a1a12d0bb209ae0ec25b}{gctl\_readoffset}} \% \mbox{\hyperlink{g__part__if_8m_a9bc7638f295763b77465c5ebebbd3442}{pp}}-\/>\mbox{\hyperlink{structg__provider_aea3cd43d41461790b8d0afcd8c49a355}{sectorsize}}) != 0) \{}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00725}00725                         \mbox{\hyperlink{g__gate_8h_a55f7a3bf1df0cf8bdab9cbcaa02da57a}{G\_GATE\_DEBUG}}(1, \textcolor{stringliteral}{"{}Invalid read offset."{}});}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00726}00726                         \textcolor{keywordflow}{return} (EINVAL);}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00727}00727                 \}}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00728}00728                 \textcolor{keywordflow}{if} (\mbox{\hyperlink{g__part__if_8m_a9bc7638f295763b77465c5ebebbd3442}{pp}}-\/>\mbox{\hyperlink{structg__provider_a8f47c464c78aa91fa4ca5143ed3cd15e}{mediasize}} + ggio-\/>\mbox{\hyperlink{structg__gate__ctl__modify_a781abc48f8e1a1a12d0bb209ae0ec25b}{gctl\_readoffset}} >}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00729}00729                     \mbox{\hyperlink{g__part__if_8m_a294f18324585ff37641fb8aa1c9ccd82}{cp}}-\/>\mbox{\hyperlink{structg__consumer_a6435d5aec0376e995dce3131fd3beb52}{provider}}-\/>\mbox{\hyperlink{structg__provider_a8f47c464c78aa91fa4ca5143ed3cd15e}{mediasize}}) \{}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00730}00730                         \mbox{\hyperlink{g__gate_8h_a55f7a3bf1df0cf8bdab9cbcaa02da57a}{G\_GATE\_DEBUG}}(1, \textcolor{stringliteral}{"{}Invalid read offset or media size."{}});}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00731}00731                         \textcolor{keywordflow}{return} (EINVAL);}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00732}00732                 \}}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00733}00733                 sc-\/>\mbox{\hyperlink{structg__gate__softc_a4c46733d618bf65ee350dcaa50a98cc0}{sc\_readoffset}} = ggio-\/>\mbox{\hyperlink{structg__gate__ctl__modify_a781abc48f8e1a1a12d0bb209ae0ec25b}{gctl\_readoffset}};}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00734}00734         \}}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00735}00735 }
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00736}00736         \textcolor{keywordflow}{if} ((ggio-\/>\mbox{\hyperlink{structg__gate__ctl__modify_ad818238263fa19a951787110b08dc029}{gctl\_modify}} \& \mbox{\hyperlink{g__gate_8h_a3c50177c3d254b10a8110b509d8a321f}{GG\_MODIFY\_READPROV}}) != 0) \{}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00737}00737                 sc-\/>\mbox{\hyperlink{structg__gate__softc_a64f348a33de8ebe576b7aa7d7fc9bb2e}{sc\_readcons}} = \mbox{\hyperlink{g__part__if_8m_a294f18324585ff37641fb8aa1c9ccd82}{cp}};}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00738}00738                 \mbox{\hyperlink{geom_8h_a4628d4de49ba84e7a6126cc30d23b83a}{g\_topology\_unlock}}();}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00739}00739         \}}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00740}00740 }
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00741}00741         \textcolor{keywordflow}{return} (0);}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00742}00742 \}}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00743}00743 }
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00744}\mbox{\hyperlink{g__gate_8c_a48970dee9191bd47f6088dad29e93ae3}{00744}} \textcolor{preprocessor}{\#define G\_GATE\_CHECK\_VERSION(ggio)      do \{                            \(\backslash\)}}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00745}00745 \textcolor{preprocessor}{        if ((ggio)-\/>gctl\_version != G\_GATE\_VERSION) \{                   \(\backslash\)}}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00746}00746 \textcolor{preprocessor}{                printf("{}Version mismatch \%d != \%d.\(\backslash\)n"{}},                  \(\backslash\)}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00747}00747                     ggio-\/>gctl\_version, G\_GATE\_VERSION);                \(\backslash\)}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00748}00748                 return (EINVAL);                                        \(\backslash\)}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00749}00749         \}                                                               \(\backslash\)}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00750}00750 \} while (0)}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00751}00751 \textcolor{keyword}{static} \textcolor{keywordtype}{int}}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00752}\mbox{\hyperlink{g__gate_8c_a5d20e5f77892cd26defa0d5dc107bcf2}{00752}} \mbox{\hyperlink{g__gate_8c_a6f8085f1cb58fbe7b3dcbfca5fda1a67}{g\_gate\_ioctl}}(\textcolor{keyword}{struct} cdev *dev, u\_long \mbox{\hyperlink{g__part__if_8m_ab932f62e09484cd3ce109f3db9d8f3ce}{cmd}}, caddr\_t addr, \textcolor{keywordtype}{int} \mbox{\hyperlink{structg__consumer_acf792357913c0445233b71f8259764d9}{flags}}, \textcolor{keyword}{struct} thread *\mbox{\hyperlink{g__part__if_8m_aaf840c84d139bb8ad4b3e668c92b3c30}{td}})}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00753}00753 \{}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00754}00754         \textcolor{keyword}{struct }\mbox{\hyperlink{structg__gate__softc}{g\_gate\_softc}} *sc;}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00755}00755         \textcolor{keyword}{struct }bio *\mbox{\hyperlink{g__part__if_8m_a3786db8db96c32f69df9f7cd325a7507}{bp}};}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00756}00756         \textcolor{keywordtype}{int} error = 0;}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00757}00757 }
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00758}00758         \mbox{\hyperlink{g__gate_8h_a55f7a3bf1df0cf8bdab9cbcaa02da57a}{G\_GATE\_DEBUG}}(4, \textcolor{stringliteral}{"{}ioctl(\%s, \%lx, \%p, \%x, \%p)"{}}, devtoname(dev), \mbox{\hyperlink{g__part__if_8m_ab932f62e09484cd3ce109f3db9d8f3ce}{cmd}}, addr,}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00759}00759             flags, \mbox{\hyperlink{g__part__if_8m_aaf840c84d139bb8ad4b3e668c92b3c30}{td}});}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00760}00760 }
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00761}00761         \textcolor{keywordflow}{switch} (\mbox{\hyperlink{g__part__if_8m_ab932f62e09484cd3ce109f3db9d8f3ce}{cmd}}) \{}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00762}00762         \textcolor{keywordflow}{case} \mbox{\hyperlink{g__gate_8h_ab18bf0e2c7103ca729b3f73c1798746b}{G\_GATE\_CMD\_CREATE}}:}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00763}00763             \{}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00764}00764                 \textcolor{keyword}{struct }\mbox{\hyperlink{structg__gate__ctl__create}{g\_gate\_ctl\_create}} *ggio = (\textcolor{keywordtype}{void} *)addr;}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00765}00765 }
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00766}00766                 \mbox{\hyperlink{g__gate_8c_a48970dee9191bd47f6088dad29e93ae3}{G\_GATE\_CHECK\_VERSION}}(ggio);}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00767}00767                 error = \mbox{\hyperlink{g__gate_8c_aad2356f60b11242980be38644f873c29}{g\_gate\_create}}(ggio);}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00768}00768                 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00769}00769 \textcolor{comment}{                 * Reset TDP\_GEOM flag.}}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00770}00770 \textcolor{comment}{                 * There are pending events for sure, because we just created}}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00771}00771 \textcolor{comment}{                 * new provider and other classes want to taste it, but we}}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00772}00772 \textcolor{comment}{                 * cannot answer on I/O requests until we're here.}}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00773}00773 \textcolor{comment}{                 */}}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00774}00774                 \mbox{\hyperlink{g__part__if_8m_aaf840c84d139bb8ad4b3e668c92b3c30}{td}}-\/>td\_pflags \&= \string~TDP\_GEOM;}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00775}00775                 \textcolor{keywordflow}{return} (error);}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00776}00776             \}}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00777}00777         \textcolor{keywordflow}{case} \mbox{\hyperlink{g__gate_8h_a61394cda092fc55ac750215ede8347f9}{G\_GATE\_CMD\_MODIFY}}:}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00778}00778             \{}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00779}00779                 \textcolor{keyword}{struct }\mbox{\hyperlink{structg__gate__ctl__modify}{g\_gate\_ctl\_modify}} *ggio = (\textcolor{keywordtype}{void} *)addr;}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00780}00780 }
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00781}00781                 \mbox{\hyperlink{g__gate_8c_a48970dee9191bd47f6088dad29e93ae3}{G\_GATE\_CHECK\_VERSION}}(ggio);}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00782}00782                 sc = \mbox{\hyperlink{g__gate_8c_a2b89931d7ca7196a8911e4b212974dbe}{g\_gate\_hold}}(ggio-\/>\mbox{\hyperlink{structg__gate__ctl__modify_ac064a4690c4b723e4cfe6c4bd5b32ce6}{gctl\_unit}}, NULL);}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00783}00783                 \textcolor{keywordflow}{if} (sc == NULL)}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00784}00784                         \textcolor{keywordflow}{return} (ENXIO);}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00785}00785                 error = \mbox{\hyperlink{g__gate_8c_a92f46978a5fa059415ce60b91f8dfee9}{g\_gate\_modify}}(sc, ggio);}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00786}00786                 \mbox{\hyperlink{g__gate_8c_a19879eef4039ecf02eee6fcc09069009}{g\_gate\_release}}(sc);}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00787}00787                 \textcolor{keywordflow}{return} (error);}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00788}00788             \}}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00789}00789         \textcolor{keywordflow}{case} \mbox{\hyperlink{g__gate_8h_a1e04b142c359d5a1732e9267426f0095}{G\_GATE\_CMD\_DESTROY}}:}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00790}00790             \{}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00791}00791                 \textcolor{keyword}{struct }\mbox{\hyperlink{structg__gate__ctl__destroy}{g\_gate\_ctl\_destroy}} *ggio = (\textcolor{keywordtype}{void} *)addr;}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00792}00792 }
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00793}00793                 \mbox{\hyperlink{g__gate_8c_a48970dee9191bd47f6088dad29e93ae3}{G\_GATE\_CHECK\_VERSION}}(ggio);}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00794}00794                 sc = \mbox{\hyperlink{g__gate_8c_a2b89931d7ca7196a8911e4b212974dbe}{g\_gate\_hold}}(ggio-\/>\mbox{\hyperlink{structg__gate__ctl__destroy_a002e1258396848f577eb98792994e610}{gctl\_unit}}, ggio-\/>\mbox{\hyperlink{structg__gate__ctl__destroy_ab1383c351a856352ede36c8d33de29a0}{gctl\_name}});}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00795}00795                 \textcolor{keywordflow}{if} (sc == NULL)}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00796}00796                         \textcolor{keywordflow}{return} (ENXIO);}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00797}00797                 \mbox{\hyperlink{geom_8h_a232419d2cfa06ff3f4ff7551041aed31}{g\_topology\_lock}}();}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00798}00798                 mtx\_lock(\&\mbox{\hyperlink{g__gate_8c_ab431c4c1e9f59db69418e5e79af450f1}{g\_gate\_units\_lock}});}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00799}00799                 error = \mbox{\hyperlink{g__gate_8c_a4b6788da99179b09489dd9c6352da7bf}{g\_gate\_destroy}}(sc, ggio-\/>\mbox{\hyperlink{structg__gate__ctl__destroy_a895c294204a381c1ca24af1e21afc9dc}{gctl\_force}});}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00800}00800                 \mbox{\hyperlink{geom_8h_a4628d4de49ba84e7a6126cc30d23b83a}{g\_topology\_unlock}}();}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00801}00801                 \textcolor{keywordflow}{if} (error != 0)}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00802}00802                         \mbox{\hyperlink{g__gate_8c_a19879eef4039ecf02eee6fcc09069009}{g\_gate\_release}}(sc);}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00803}00803                 \textcolor{keywordflow}{return} (error);}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00804}00804             \}}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00805}00805         \textcolor{keywordflow}{case} \mbox{\hyperlink{g__gate_8h_af5a9b3b3f303412e2dcc07fae87e178e}{G\_GATE\_CMD\_CANCEL}}:}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00806}00806             \{}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00807}00807                 \textcolor{keyword}{struct }\mbox{\hyperlink{structg__gate__ctl__cancel}{g\_gate\_ctl\_cancel}} *ggio = (\textcolor{keywordtype}{void} *)addr;}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00808}00808                 \textcolor{keyword}{struct }bio *tbp, *lbp;}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00809}00809 }
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00810}00810                 \mbox{\hyperlink{g__gate_8c_a48970dee9191bd47f6088dad29e93ae3}{G\_GATE\_CHECK\_VERSION}}(ggio);}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00811}00811                 sc = \mbox{\hyperlink{g__gate_8c_a2b89931d7ca7196a8911e4b212974dbe}{g\_gate\_hold}}(ggio-\/>\mbox{\hyperlink{structg__gate__ctl__cancel_a1c2631fcd6e6af3a51b02e91dbc40a15}{gctl\_unit}}, ggio-\/>\mbox{\hyperlink{structg__gate__ctl__cancel_abef98d6f1c6a25844ccde668850f7ac1}{gctl\_name}});}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00812}00812                 \textcolor{keywordflow}{if} (sc == NULL)}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00813}00813                         \textcolor{keywordflow}{return} (ENXIO);}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00814}00814                 lbp = NULL;}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00815}00815                 mtx\_lock(\&sc-\/>\mbox{\hyperlink{structg__gate__softc_a37af4dfc3b501929eb576f819e4e3385}{sc\_queue\_mtx}});}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00816}00816                 TAILQ\_FOREACH\_SAFE(\mbox{\hyperlink{g__part__if_8m_a3786db8db96c32f69df9f7cd325a7507}{bp}}, \&sc-\/>\mbox{\hyperlink{structg__gate__softc_ac184b57ea659df095b256cec55255763}{sc\_outqueue}}.queue, bio\_queue, tbp) \{}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00817}00817                         \textcolor{keywordflow}{if} (ggio-\/>\mbox{\hyperlink{structg__gate__ctl__cancel_aa0f54bde4b46bd10da2f9bc2b0a35491}{gctl\_seq}} == 0 ||}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00818}00818                             ggio-\/>\mbox{\hyperlink{structg__gate__ctl__cancel_aa0f54bde4b46bd10da2f9bc2b0a35491}{gctl\_seq}} == (uintptr\_t)\mbox{\hyperlink{g__part__if_8m_a3786db8db96c32f69df9f7cd325a7507}{bp}}-\/>bio\_driver1) \{}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00819}00819                                 \mbox{\hyperlink{g__gate_8h_abf8fd7e5cd7d2dfba621abcdff085c59}{G\_GATE\_LOGREQ}}(1, \mbox{\hyperlink{g__part__if_8m_a3786db8db96c32f69df9f7cd325a7507}{bp}}, \textcolor{stringliteral}{"{}Request canceled."{}});}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00820}00820                                 bioq\_remove(\&sc-\/>\mbox{\hyperlink{structg__gate__softc_ac184b57ea659df095b256cec55255763}{sc\_outqueue}}, \mbox{\hyperlink{g__part__if_8m_a3786db8db96c32f69df9f7cd325a7507}{bp}});}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00821}00821                                 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00822}00822 \textcolor{comment}{                                 * Be sure to put requests back onto incoming}}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00823}00823 \textcolor{comment}{                                 * queue in the proper order.}}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00824}00824 \textcolor{comment}{                                 */}}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00825}00825                                 \textcolor{keywordflow}{if} (lbp == NULL)}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00826}00826                                         bioq\_insert\_head(\&sc-\/>\mbox{\hyperlink{structg__gate__softc_a35a04b7e6d55d648c67f74c3d7e3c032}{sc\_inqueue}}, \mbox{\hyperlink{g__part__if_8m_a3786db8db96c32f69df9f7cd325a7507}{bp}});}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00827}00827                                 \textcolor{keywordflow}{else} \{}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00828}00828                                         TAILQ\_INSERT\_AFTER(\&sc-\/>\mbox{\hyperlink{structg__gate__softc_a35a04b7e6d55d648c67f74c3d7e3c032}{sc\_inqueue}}.queue,}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00829}00829                                             lbp, \mbox{\hyperlink{g__part__if_8m_a3786db8db96c32f69df9f7cd325a7507}{bp}}, bio\_queue);}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00830}00830                                 \}}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00831}00831                                 lbp = \mbox{\hyperlink{g__part__if_8m_a3786db8db96c32f69df9f7cd325a7507}{bp}};}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00832}00832                                 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00833}00833 \textcolor{comment}{                                 * If only one request was canceled, leave now.}}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00834}00834 \textcolor{comment}{                                 */}}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00835}00835                                 \textcolor{keywordflow}{if} (ggio-\/>\mbox{\hyperlink{structg__gate__ctl__cancel_aa0f54bde4b46bd10da2f9bc2b0a35491}{gctl\_seq}} != 0)}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00836}00836                                         \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00837}00837                         \}}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00838}00838                 \}}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00839}00839                 \textcolor{keywordflow}{if} (ggio-\/>\mbox{\hyperlink{structg__gate__ctl__cancel_a1c2631fcd6e6af3a51b02e91dbc40a15}{gctl\_unit}} == \mbox{\hyperlink{g__gate_8h_aadc15f8430ef26acb4f8e76244312221}{G\_GATE\_NAME\_GIVEN}})}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00840}00840                         ggio-\/>\mbox{\hyperlink{structg__gate__ctl__cancel_a1c2631fcd6e6af3a51b02e91dbc40a15}{gctl\_unit}} = sc-\/>\mbox{\hyperlink{structg__gate__softc_a73063ecc9b79d8a62099e45e6ce8db51}{sc\_unit}};}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00841}00841                 mtx\_unlock(\&sc-\/>\mbox{\hyperlink{structg__gate__softc_a37af4dfc3b501929eb576f819e4e3385}{sc\_queue\_mtx}});}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00842}00842                 \mbox{\hyperlink{g__gate_8c_a19879eef4039ecf02eee6fcc09069009}{g\_gate\_release}}(sc);}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00843}00843                 \textcolor{keywordflow}{return} (error);}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00844}00844             \}}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00845}00845         \textcolor{keywordflow}{case} \mbox{\hyperlink{g__gate_8h_a8c8c2b656ac391021f4770d88e1daf73}{G\_GATE\_CMD\_START}}:}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00846}00846             \{}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00847}00847                 \textcolor{keyword}{struct }\mbox{\hyperlink{structg__gate__ctl__io}{g\_gate\_ctl\_io}} *ggio = (\textcolor{keywordtype}{void} *)addr;}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00848}00848 }
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00849}00849                 \mbox{\hyperlink{g__gate_8c_a48970dee9191bd47f6088dad29e93ae3}{G\_GATE\_CHECK\_VERSION}}(ggio);}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00850}00850                 sc = \mbox{\hyperlink{g__gate_8c_a2b89931d7ca7196a8911e4b212974dbe}{g\_gate\_hold}}(ggio-\/>\mbox{\hyperlink{structg__gate__ctl__io_aafbf4e5035a5a8b3b2564d7b23c1ab58}{gctl\_unit}}, NULL);}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00851}00851                 \textcolor{keywordflow}{if} (sc == NULL)}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00852}00852                         \textcolor{keywordflow}{return} (ENXIO);}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00853}00853                 error = 0;}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00854}00854                 \textcolor{keywordflow}{for} (;;) \{}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00855}00855                         mtx\_lock(\&sc-\/>\mbox{\hyperlink{structg__gate__softc_a37af4dfc3b501929eb576f819e4e3385}{sc\_queue\_mtx}});}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00856}00856                         \mbox{\hyperlink{g__part__if_8m_a3786db8db96c32f69df9f7cd325a7507}{bp}} = bioq\_first(\&sc-\/>\mbox{\hyperlink{structg__gate__softc_a35a04b7e6d55d648c67f74c3d7e3c032}{sc\_inqueue}});}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00857}00857                         \textcolor{keywordflow}{if} (\mbox{\hyperlink{g__part__if_8m_a3786db8db96c32f69df9f7cd325a7507}{bp}} != NULL)}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00858}00858                                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00859}00859                         \textcolor{keywordflow}{if} ((sc-\/>\mbox{\hyperlink{structg__gate__softc_a84c3b69044ec5f9d855c5372fa2740e7}{sc\_flags}} \& \mbox{\hyperlink{g__gate_8h_a86efdfb48a10788f8fead9dd90b11a40}{G\_GATE\_FLAG\_DESTROY}}) != 0) \{}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00860}00860                                 ggio-\/>\mbox{\hyperlink{structg__gate__ctl__io_aea790d186d898a65a96a82e31cc208c6}{gctl\_error}} = ECANCELED;}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00861}00861                                 mtx\_unlock(\&sc-\/>\mbox{\hyperlink{structg__gate__softc_a37af4dfc3b501929eb576f819e4e3385}{sc\_queue\_mtx}});}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00862}00862                                 \textcolor{keywordflow}{goto} start\_end;}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00863}00863                         \}}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00864}00864                         error = msleep(sc, \&sc-\/>\mbox{\hyperlink{structg__gate__softc_a37af4dfc3b501929eb576f819e4e3385}{sc\_queue\_mtx}},}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00865}00865                                 PPAUSE | PDROP | PCATCH, \textcolor{stringliteral}{"{}ggwait"{}}, 0);}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00866}00866                         \textcolor{keywordflow}{if} (error != 0)}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00867}00867                                 \textcolor{keywordflow}{goto} start\_end;}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00868}00868                 \}}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00869}00869                 ggio-\/>\mbox{\hyperlink{structg__gate__ctl__io_a458b1ea925dc6a556541c5e8ceb0e1f0}{gctl\_cmd}} = \mbox{\hyperlink{g__part__if_8m_a3786db8db96c32f69df9f7cd325a7507}{bp}}-\/>bio\_cmd;}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00870}00870                 \textcolor{keywordflow}{if} (\mbox{\hyperlink{g__part__if_8m_a3786db8db96c32f69df9f7cd325a7507}{bp}}-\/>bio\_cmd == BIO\_WRITE \&\&}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00871}00871                     \mbox{\hyperlink{g__part__if_8m_a3786db8db96c32f69df9f7cd325a7507}{bp}}-\/>bio\_length > ggio-\/>\mbox{\hyperlink{structg__gate__ctl__io_ad76c9796dd9bef7fe62b6ca08d1c6aa1}{gctl\_length}}) \{}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00872}00872                         mtx\_unlock(\&sc-\/>\mbox{\hyperlink{structg__gate__softc_a37af4dfc3b501929eb576f819e4e3385}{sc\_queue\_mtx}});}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00873}00873                         ggio-\/>\mbox{\hyperlink{structg__gate__ctl__io_ad76c9796dd9bef7fe62b6ca08d1c6aa1}{gctl\_length}} = \mbox{\hyperlink{g__part__if_8m_a3786db8db96c32f69df9f7cd325a7507}{bp}}-\/>bio\_length;}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00874}00874                         ggio-\/>\mbox{\hyperlink{structg__gate__ctl__io_aea790d186d898a65a96a82e31cc208c6}{gctl\_error}} = ENOMEM;}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00875}00875                         \textcolor{keywordflow}{goto} start\_end;}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00876}00876                 \}}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00877}00877                 bioq\_remove(\&sc-\/>\mbox{\hyperlink{structg__gate__softc_a35a04b7e6d55d648c67f74c3d7e3c032}{sc\_inqueue}}, \mbox{\hyperlink{g__part__if_8m_a3786db8db96c32f69df9f7cd325a7507}{bp}});}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00878}00878                 bioq\_insert\_tail(\&sc-\/>\mbox{\hyperlink{structg__gate__softc_ac184b57ea659df095b256cec55255763}{sc\_outqueue}}, \mbox{\hyperlink{g__part__if_8m_a3786db8db96c32f69df9f7cd325a7507}{bp}});}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00879}00879                 mtx\_unlock(\&sc-\/>\mbox{\hyperlink{structg__gate__softc_a37af4dfc3b501929eb576f819e4e3385}{sc\_queue\_mtx}});}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00880}00880 }
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00881}00881                 ggio-\/>\mbox{\hyperlink{structg__gate__ctl__io_addbcda9b137abbc54b6a0341663942a7}{gctl\_seq}} = (uintptr\_t)\mbox{\hyperlink{g__part__if_8m_a3786db8db96c32f69df9f7cd325a7507}{bp}}-\/>bio\_driver1;}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00882}00882                 ggio-\/>\mbox{\hyperlink{structg__gate__ctl__io_aa9fec89a48dcf340c24e42682524eb5c}{gctl\_offset}} = \mbox{\hyperlink{g__part__if_8m_a3786db8db96c32f69df9f7cd325a7507}{bp}}-\/>bio\_offset;}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00883}00883                 ggio-\/>\mbox{\hyperlink{structg__gate__ctl__io_ad76c9796dd9bef7fe62b6ca08d1c6aa1}{gctl\_length}} = \mbox{\hyperlink{g__part__if_8m_a3786db8db96c32f69df9f7cd325a7507}{bp}}-\/>bio\_length;}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00884}00884 }
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00885}00885                 switch (\mbox{\hyperlink{g__part__if_8m_a3786db8db96c32f69df9f7cd325a7507}{bp}}-\/>bio\_cmd) \{}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00886}00886                 \textcolor{keywordflow}{case} BIO\_READ:}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00887}00887                 \textcolor{keywordflow}{case} BIO\_DELETE:}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00888}00888                 \textcolor{keywordflow}{case} BIO\_FLUSH:}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00889}00889                 \textcolor{keywordflow}{case} BIO\_SPEEDUP:}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00890}00890                         \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00891}00891                 \textcolor{keywordflow}{case} BIO\_WRITE:}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00892}00892                         error = copyout(\mbox{\hyperlink{g__part__if_8m_a3786db8db96c32f69df9f7cd325a7507}{bp}}-\/>bio\_data, ggio-\/>\mbox{\hyperlink{structg__gate__ctl__io_a046d37d24daa3663fa706fa5c5eb0340}{gctl\_data}},}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00893}00893                             \mbox{\hyperlink{g__part__if_8m_a3786db8db96c32f69df9f7cd325a7507}{bp}}-\/>bio\_length);}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00894}00894                         \textcolor{keywordflow}{if} (error != 0) \{}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00895}00895                                 mtx\_lock(\&sc-\/>\mbox{\hyperlink{structg__gate__softc_a37af4dfc3b501929eb576f819e4e3385}{sc\_queue\_mtx}});}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00896}00896                                 bioq\_remove(\&sc-\/>\mbox{\hyperlink{structg__gate__softc_ac184b57ea659df095b256cec55255763}{sc\_outqueue}}, \mbox{\hyperlink{g__part__if_8m_a3786db8db96c32f69df9f7cd325a7507}{bp}});}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00897}00897                                 bioq\_insert\_head(\&sc-\/>\mbox{\hyperlink{structg__gate__softc_a35a04b7e6d55d648c67f74c3d7e3c032}{sc\_inqueue}}, \mbox{\hyperlink{g__part__if_8m_a3786db8db96c32f69df9f7cd325a7507}{bp}});}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00898}00898                                 mtx\_unlock(\&sc-\/>\mbox{\hyperlink{structg__gate__softc_a37af4dfc3b501929eb576f819e4e3385}{sc\_queue\_mtx}});}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00899}00899                                 \textcolor{keywordflow}{goto} start\_end;}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00900}00900                         \}}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00901}00901                         \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00902}00902                 \}}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00903}00903 start\_end:}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00904}00904                 \mbox{\hyperlink{g__gate_8c_a19879eef4039ecf02eee6fcc09069009}{g\_gate\_release}}(sc);}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00905}00905                 \textcolor{keywordflow}{return} (error);}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00906}00906             \}}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00907}00907         \textcolor{keywordflow}{case} \mbox{\hyperlink{g__gate_8h_a64005b162a13744dcf049159f36c3a6d}{G\_GATE\_CMD\_DONE}}:}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00908}00908             \{}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00909}00909                 \textcolor{keyword}{struct }\mbox{\hyperlink{structg__gate__ctl__io}{g\_gate\_ctl\_io}} *ggio = (\textcolor{keywordtype}{void} *)addr;}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00910}00910 }
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00911}00911                 \mbox{\hyperlink{g__gate_8c_a48970dee9191bd47f6088dad29e93ae3}{G\_GATE\_CHECK\_VERSION}}(ggio);}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00912}00912                 sc = \mbox{\hyperlink{g__gate_8c_a2b89931d7ca7196a8911e4b212974dbe}{g\_gate\_hold}}(ggio-\/>\mbox{\hyperlink{structg__gate__ctl__io_aafbf4e5035a5a8b3b2564d7b23c1ab58}{gctl\_unit}}, NULL);}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00913}00913                 \textcolor{keywordflow}{if} (sc == NULL)}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00914}00914                         \textcolor{keywordflow}{return} (ENOENT);}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00915}00915                 error = 0;}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00916}00916                 mtx\_lock(\&sc-\/>\mbox{\hyperlink{structg__gate__softc_a37af4dfc3b501929eb576f819e4e3385}{sc\_queue\_mtx}});}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00917}00917                 TAILQ\_FOREACH(\mbox{\hyperlink{g__part__if_8m_a3786db8db96c32f69df9f7cd325a7507}{bp}}, \&sc-\/>\mbox{\hyperlink{structg__gate__softc_ac184b57ea659df095b256cec55255763}{sc\_outqueue}}.queue, bio\_queue) \{}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00918}00918                         \textcolor{keywordflow}{if} (ggio-\/>\mbox{\hyperlink{structg__gate__ctl__io_addbcda9b137abbc54b6a0341663942a7}{gctl\_seq}} == (uintptr\_t)\mbox{\hyperlink{g__part__if_8m_a3786db8db96c32f69df9f7cd325a7507}{bp}}-\/>bio\_driver1)}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00919}00919                                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00920}00920                 \}}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00921}00921                 \textcolor{keywordflow}{if} (\mbox{\hyperlink{g__part__if_8m_a3786db8db96c32f69df9f7cd325a7507}{bp}} != NULL) \{}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00922}00922                         bioq\_remove(\&sc-\/>\mbox{\hyperlink{structg__gate__softc_ac184b57ea659df095b256cec55255763}{sc\_outqueue}}, \mbox{\hyperlink{g__part__if_8m_a3786db8db96c32f69df9f7cd325a7507}{bp}});}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00923}00923                         sc-\/>\mbox{\hyperlink{structg__gate__softc_aa4781c44dcd3538a79e199c10339ae38}{sc\_queue\_count}}-\/-\/;}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00924}00924                 \}}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00925}00925                 mtx\_unlock(\&sc-\/>\mbox{\hyperlink{structg__gate__softc_a37af4dfc3b501929eb576f819e4e3385}{sc\_queue\_mtx}});}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00926}00926                 \textcolor{keywordflow}{if} (\mbox{\hyperlink{g__part__if_8m_a3786db8db96c32f69df9f7cd325a7507}{bp}} == NULL) \{}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00927}00927                         \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00928}00928 \textcolor{comment}{                         * Request was probably canceled.}}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00929}00929 \textcolor{comment}{                         */}}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00930}00930                         \textcolor{keywordflow}{goto} done\_end;}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00931}00931                 \}}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00932}00932                 \textcolor{keywordflow}{if} (ggio-\/>\mbox{\hyperlink{structg__gate__ctl__io_aea790d186d898a65a96a82e31cc208c6}{gctl\_error}} == EAGAIN) \{}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00933}00933                         \mbox{\hyperlink{g__part__if_8m_a3786db8db96c32f69df9f7cd325a7507}{bp}}-\/>bio\_error = 0;}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00934}00934                         \mbox{\hyperlink{g__gate_8h_abf8fd7e5cd7d2dfba621abcdff085c59}{G\_GATE\_LOGREQ}}(1, \mbox{\hyperlink{g__part__if_8m_a3786db8db96c32f69df9f7cd325a7507}{bp}}, \textcolor{stringliteral}{"{}Request desisted."{}});}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00935}00935                         mtx\_lock(\&sc-\/>\mbox{\hyperlink{structg__gate__softc_a37af4dfc3b501929eb576f819e4e3385}{sc\_queue\_mtx}});}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00936}00936                         sc-\/>\mbox{\hyperlink{structg__gate__softc_aa4781c44dcd3538a79e199c10339ae38}{sc\_queue\_count}}++;}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00937}00937                         bioq\_insert\_head(\&sc-\/>\mbox{\hyperlink{structg__gate__softc_a35a04b7e6d55d648c67f74c3d7e3c032}{sc\_inqueue}}, \mbox{\hyperlink{g__part__if_8m_a3786db8db96c32f69df9f7cd325a7507}{bp}});}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00938}00938                         wakeup(sc);}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00939}00939                         mtx\_unlock(\&sc-\/>\mbox{\hyperlink{structg__gate__softc_a37af4dfc3b501929eb576f819e4e3385}{sc\_queue\_mtx}});}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00940}00940                 \} \textcolor{keywordflow}{else} \{}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00941}00941                         \mbox{\hyperlink{g__part__if_8m_a3786db8db96c32f69df9f7cd325a7507}{bp}}-\/>bio\_error = ggio-\/>\mbox{\hyperlink{structg__gate__ctl__io_aea790d186d898a65a96a82e31cc208c6}{gctl\_error}};}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00942}00942                         \textcolor{keywordflow}{if} (\mbox{\hyperlink{g__part__if_8m_a3786db8db96c32f69df9f7cd325a7507}{bp}}-\/>bio\_error == 0) \{}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00943}00943                                 \mbox{\hyperlink{g__part__if_8m_a3786db8db96c32f69df9f7cd325a7507}{bp}}-\/>bio\_completed = \mbox{\hyperlink{g__part__if_8m_a3786db8db96c32f69df9f7cd325a7507}{bp}}-\/>bio\_length;}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00944}00944                                 \textcolor{keywordflow}{switch} (\mbox{\hyperlink{g__part__if_8m_a3786db8db96c32f69df9f7cd325a7507}{bp}}-\/>bio\_cmd) \{}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00945}00945                                 \textcolor{keywordflow}{case} BIO\_READ:}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00946}00946                                         error = copyin(ggio-\/>\mbox{\hyperlink{structg__gate__ctl__io_a046d37d24daa3663fa706fa5c5eb0340}{gctl\_data}},}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00947}00947                                             \mbox{\hyperlink{g__part__if_8m_a3786db8db96c32f69df9f7cd325a7507}{bp}}-\/>bio\_data, \mbox{\hyperlink{g__part__if_8m_a3786db8db96c32f69df9f7cd325a7507}{bp}}-\/>bio\_length);}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00948}00948                                         \textcolor{keywordflow}{if} (error != 0)}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00949}00949                                                 \mbox{\hyperlink{g__part__if_8m_a3786db8db96c32f69df9f7cd325a7507}{bp}}-\/>bio\_error = error;}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00950}00950                                         \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00951}00951                                 \textcolor{keywordflow}{case} BIO\_DELETE:}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00952}00952                                 \textcolor{keywordflow}{case} BIO\_WRITE:}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00953}00953                                 \textcolor{keywordflow}{case} BIO\_FLUSH:}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00954}00954                                 \textcolor{keywordflow}{case} BIO\_SPEEDUP:}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00955}00955                                         \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00956}00956                                 \}}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00957}00957                         \}}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00958}00958                         \mbox{\hyperlink{g__gate_8h_abf8fd7e5cd7d2dfba621abcdff085c59}{G\_GATE\_LOGREQ}}(2, \mbox{\hyperlink{g__part__if_8m_a3786db8db96c32f69df9f7cd325a7507}{bp}}, \textcolor{stringliteral}{"{}Request done."{}});}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00959}00959                         \mbox{\hyperlink{geom_8h_a0975be2dcd40a26a56a1a9bfc80433e1}{g\_io\_deliver}}(\mbox{\hyperlink{g__part__if_8m_a3786db8db96c32f69df9f7cd325a7507}{bp}}, \mbox{\hyperlink{g__part__if_8m_a3786db8db96c32f69df9f7cd325a7507}{bp}}-\/>bio\_error);}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00960}00960                 \}}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00961}00961 done\_end:}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00962}00962                 \mbox{\hyperlink{g__gate_8c_a19879eef4039ecf02eee6fcc09069009}{g\_gate\_release}}(sc);}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00963}00963                 \textcolor{keywordflow}{return} (error);}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00964}00964             \}}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00965}00965         \}}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00966}00966         \textcolor{keywordflow}{return} (ENOIOCTL);}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00967}00967 \}}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00968}00968 }
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00969}00969 \textcolor{keyword}{static} \textcolor{keywordtype}{void}}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00970}\mbox{\hyperlink{g__gate_8c_adc9356a755f3699b1dc1b5cb8119f102}{00970}} \mbox{\hyperlink{g__gate_8c_adc9356a755f3699b1dc1b5cb8119f102}{g\_gate\_device}}(\textcolor{keywordtype}{void})}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00971}00971 \{}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00972}00972 }
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00973}00973         \mbox{\hyperlink{g__gate_8c_a273ca82c67b1eac9d0e408a86e7be513}{status\_dev}} = make\_dev(\&\mbox{\hyperlink{g__gate_8c_a5c99a38ad44a2661824618f347eca16d}{g\_gate\_cdevsw}}, 0x0, UID\_ROOT, GID\_WHEEL, 0600,}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00974}00974             \mbox{\hyperlink{g__gate_8h_a8d44e90241b56894b8dd96fee247ec59}{G\_GATE\_CTL\_NAME}});}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00975}00975 \}}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00976}00976 }
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00977}00977 \textcolor{keyword}{static} \textcolor{keywordtype}{int}}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00978}\mbox{\hyperlink{g__gate_8c_afd34d2425882319a5fda41159db9c48f}{00978}} \mbox{\hyperlink{g__gate_8c_afd34d2425882319a5fda41159db9c48f}{g\_gate\_modevent}}(module\_t mod, \textcolor{keywordtype}{int} \mbox{\hyperlink{geom__flashmap_8c_a763fd8db6bba8fbbbc113ca0d61c47c2}{type}}, \textcolor{keywordtype}{void} *\mbox{\hyperlink{g__part__if_8m_a735984d41155bc1032e09bece8f8d66d}{data}})}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00979}00979 \{}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00980}00980         \textcolor{keywordtype}{int} error = 0;}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00981}00981 }
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00982}00982         \textcolor{keywordflow}{switch} (\mbox{\hyperlink{geom__flashmap_8c_a763fd8db6bba8fbbbc113ca0d61c47c2}{type}}) \{}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00983}00983         \textcolor{keywordflow}{case} MOD\_LOAD:}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00984}00984                 mtx\_init(\&\mbox{\hyperlink{g__gate_8c_ab431c4c1e9f59db69418e5e79af450f1}{g\_gate\_units\_lock}}, \textcolor{stringliteral}{"{}gg\_units\_lock"{}}, NULL, MTX\_DEF);}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00985}00985                 \mbox{\hyperlink{g__gate_8c_aa33cfbd6b3c123829c1960a42795ca1c}{g\_gate\_units}} = malloc(\mbox{\hyperlink{g__gate_8c_a09f1bed9387fc2ea71c8e4fab67610d6}{g\_gate\_maxunits}} * \textcolor{keyword}{sizeof}(\mbox{\hyperlink{g__gate_8c_aa33cfbd6b3c123829c1960a42795ca1c}{g\_gate\_units}}[0]),}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00986}00986                     M\_GATE, M\_WAITOK | M\_ZERO);}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00987}00987                 \mbox{\hyperlink{g__gate_8c_aacc39c961f2a966d575f40b6e5d42828}{g\_gate\_nunits}} = 0;}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00988}00988                 \mbox{\hyperlink{g__gate_8c_adc9356a755f3699b1dc1b5cb8119f102}{g\_gate\_device}}();}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00989}00989                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00990}00990         \textcolor{keywordflow}{case} MOD\_UNLOAD:}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00991}00991                 mtx\_lock(\&\mbox{\hyperlink{g__gate_8c_ab431c4c1e9f59db69418e5e79af450f1}{g\_gate\_units\_lock}});}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00992}00992                 \textcolor{keywordflow}{if} (\mbox{\hyperlink{g__gate_8c_aacc39c961f2a966d575f40b6e5d42828}{g\_gate\_nunits}} > 0) \{}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00993}00993                         mtx\_unlock(\&\mbox{\hyperlink{g__gate_8c_ab431c4c1e9f59db69418e5e79af450f1}{g\_gate\_units\_lock}});}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00994}00994                         error = EBUSY;}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00995}00995                         \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00996}00996                 \}}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00997}00997                 mtx\_unlock(\&\mbox{\hyperlink{g__gate_8c_ab431c4c1e9f59db69418e5e79af450f1}{g\_gate\_units\_lock}});}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00998}00998                 mtx\_destroy(\&\mbox{\hyperlink{g__gate_8c_ab431c4c1e9f59db69418e5e79af450f1}{g\_gate\_units\_lock}});}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l00999}00999                 \textcolor{keywordflow}{if} (\mbox{\hyperlink{g__gate_8c_a273ca82c67b1eac9d0e408a86e7be513}{status\_dev}} != NULL)}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l01000}01000                         destroy\_dev(\mbox{\hyperlink{g__gate_8c_a273ca82c67b1eac9d0e408a86e7be513}{status\_dev}});}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l01001}01001                 \mbox{\hyperlink{g__raid__md__if_8m_a4df9edb2717b3f7e4c3c903878577a54}{free}}(\mbox{\hyperlink{g__gate_8c_aa33cfbd6b3c123829c1960a42795ca1c}{g\_gate\_units}}, M\_GATE);}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l01002}01002                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l01003}01003         \textcolor{keywordflow}{default}:}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l01004}01004                 \textcolor{keywordflow}{return} (EOPNOTSUPP);}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l01005}01005                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l01006}01006         \}}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l01007}01007 }
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l01008}01008         \textcolor{keywordflow}{return} (error);}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l01009}01009 \}}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l01010}\mbox{\hyperlink{g__gate_8c_a93424233c82550a6d7194dff6838bb3d}{01010}} \textcolor{keyword}{static} moduledata\_t \mbox{\hyperlink{g__gate_8c_a93424233c82550a6d7194dff6838bb3d}{g\_gate\_module}} = \{}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l01011}01011         \mbox{\hyperlink{g__gate_8h_a30a7cfcbc73978c054409a0cd9bc4c3a}{G\_GATE\_MOD\_NAME}},}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l01012}01012         \mbox{\hyperlink{g__gate_8c_afd34d2425882319a5fda41159db9c48f}{g\_gate\_modevent}},}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l01013}01013         NULL}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l01014}01014 \};}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l01015}\mbox{\hyperlink{g__gate_8c_ad6ae3c54f96ecaec765ff517e2700e76}{01015}} \mbox{\hyperlink{g__gate_8c_ad6ae3c54f96ecaec765ff517e2700e76}{DECLARE\_MODULE}}(geom\_gate, \mbox{\hyperlink{g__gate_8c_a93424233c82550a6d7194dff6838bb3d}{g\_gate\_module}}, SI\_SUB\_DRIVERS, SI\_ORDER\_MIDDLE);}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l01016}\mbox{\hyperlink{g__gate_8c_afe8a301b76427389a8e5dba0fc193900}{01016}} \mbox{\hyperlink{g__gate_8c_afe8a301b76427389a8e5dba0fc193900}{DECLARE\_GEOM\_CLASS}}(\mbox{\hyperlink{g__gate_8c_a02c65068c489a7a2aef761c0a7348f53}{g\_gate\_class}}, g\_gate);}
\DoxyCodeLine{\Hypertarget{g__gate_8c_source_l01017}\mbox{\hyperlink{g__gate_8c_a56c1b789e0d37cc7b89aaa8bef038f5a}{01017}} \mbox{\hyperlink{g__gate_8c_a56c1b789e0d37cc7b89aaa8bef038f5a}{MODULE\_VERSION}}(geom\_gate, 0);}

\end{DoxyCode}
