\hypertarget{g__bde__work_8c_source}{}\doxysection{g\+\_\+bde\+\_\+work.\+c}
\label{g__bde__work_8c_source}\index{geom/bde/g\_bde\_work.c@{geom/bde/g\_bde\_work.c}}
\mbox{\hyperlink{g__bde__work_8c}{Go to the documentation of this file.}}
\begin{DoxyCode}{0}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00001}00001 \textcolor{comment}{/*-\/}}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00002}00002 \textcolor{comment}{ * SPDX-\/License-\/Identifier: BSD-\/2-\/Clause-\/FreeBSD}}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00003}00003 \textcolor{comment}{ *}}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00004}00004 \textcolor{comment}{ * Copyright (c) 2002 Poul-\/Henning Kamp}}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00005}00005 \textcolor{comment}{ * Copyright (c) 2002 Networks Associates Technology, Inc.}}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00006}00006 \textcolor{comment}{ * All rights reserved.}}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00007}00007 \textcolor{comment}{ *}}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00008}00008 \textcolor{comment}{ * This software was developed for the FreeBSD Project by Poul-\/Henning Kamp}}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00009}00009 \textcolor{comment}{ * and NAI Labs, the Security Research Division of Network Associates, Inc.}}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00010}00010 \textcolor{comment}{ * under DARPA/SPAWAR contract N66001-\/01-\/C-\/8035 ("{}CBOSS"{}), as part of the}}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00011}00011 \textcolor{comment}{ * DARPA CHATS research program.}}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00012}00012 \textcolor{comment}{ *}}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00013}00013 \textcolor{comment}{ * Redistribution and use in source and binary forms, with or without}}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00014}00014 \textcolor{comment}{ * modification, are permitted provided that the following conditions}}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00015}00015 \textcolor{comment}{ * are met:}}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00016}00016 \textcolor{comment}{ * 1. Redistributions of source code must retain the above copyright}}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00017}00017 \textcolor{comment}{ *    notice, this list of conditions and the following disclaimer.}}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00018}00018 \textcolor{comment}{ * 2. Redistributions in binary form must reproduce the above copyright}}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00019}00019 \textcolor{comment}{ *    notice, this list of conditions and the following disclaimer in the}}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00020}00020 \textcolor{comment}{ *    documentation and/or other materials provided with the distribution.}}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00021}00021 \textcolor{comment}{ *}}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00022}00022 \textcolor{comment}{ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND}}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00023}00023 \textcolor{comment}{ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE}}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00024}00024 \textcolor{comment}{ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE}}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00025}00025 \textcolor{comment}{ * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE}}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00026}00026 \textcolor{comment}{ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL}}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00027}00027 \textcolor{comment}{ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS}}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00028}00028 \textcolor{comment}{ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)}}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00029}00029 \textcolor{comment}{ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT}}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00030}00030 \textcolor{comment}{ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY}}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00031}00031 \textcolor{comment}{ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF}}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00032}00032 \textcolor{comment}{ * SUCH DAMAGE.}}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00033}00033 \textcolor{comment}{ *}}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00034}00034 \textcolor{comment}{ * \$FreeBSD\$}}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00035}00035 \textcolor{comment}{ */}}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00036}00036 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00037}00037 \textcolor{comment}{ * This source file contains the state-\/engine which makes things happen in the}}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00038}00038 \textcolor{comment}{ * right order.}}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00039}00039 \textcolor{comment}{ *}}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00040}00040 \textcolor{comment}{ * Outline:}}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00041}00041 \textcolor{comment}{ *   1) g\_bde\_start1()}}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00042}00042 \textcolor{comment}{ *      Break the struct bio into multiple work packets one per zone.}}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00043}00043 \textcolor{comment}{ *   2) g\_bde\_start2()}}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00044}00044 \textcolor{comment}{ *      Setup the necessary sector buffers and start those read operations}}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00045}00045 \textcolor{comment}{ *      which we can start at this time and put the item on the work-\/list.}}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00046}00046 \textcolor{comment}{ *   3) g\_bde\_worker()}}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00047}00047 \textcolor{comment}{ *      Scan the work-\/list for items which are ready for crypto processing}}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00048}00048 \textcolor{comment}{ *      and call the matching crypto function in g\_bde\_crypt.c and schedule}}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00049}00049 \textcolor{comment}{ *      any writes needed.  Read operations finish here by releasing the}}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00050}00050 \textcolor{comment}{ *      sector buffers and delivering the original bio request.}}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00051}00051 \textcolor{comment}{ *   4) g\_bde\_write\_done()}}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00052}00052 \textcolor{comment}{ *      Release sector buffers and deliver the original bio request.}}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00053}00053 \textcolor{comment}{ *}}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00054}00054 \textcolor{comment}{ * Because of the C-\/scope rules, the functions are almost perfectly in the}}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00055}00055 \textcolor{comment}{ * opposite order in this source file.}}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00056}00056 \textcolor{comment}{ *}}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00057}00057 \textcolor{comment}{ * XXX: A switch to the hardware assisted crypto in src/sys/opencrypto will add}}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00058}00058 \textcolor{comment}{ * XXX: additional states to this state-\/engine.  Since no hardware available}}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00059}00059 \textcolor{comment}{ * XXX: at this time has AES support, implementing this has been postponed}}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00060}00060 \textcolor{comment}{ * XXX: until such time as it would result in a benefit.}}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00061}00061 \textcolor{comment}{ */}}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00062}00062 }
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00063}00063 \textcolor{preprocessor}{\#include <sys/param.h>}}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00064}00064 \textcolor{preprocessor}{\#include <sys/bio.h>}}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00065}00065 \textcolor{preprocessor}{\#include <sys/lock.h>}}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00066}00066 \textcolor{preprocessor}{\#include <sys/mutex.h>}}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00067}00067 \textcolor{preprocessor}{\#include <sys/queue.h>}}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00068}00068 \textcolor{preprocessor}{\#include <sys/malloc.h>}}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00069}00069 \textcolor{preprocessor}{\#include <sys/systm.h>}}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00070}00070 \textcolor{preprocessor}{\#include <sys/kernel.h>}}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00071}00071 \textcolor{preprocessor}{\#include <sys/sysctl.h>}}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00072}00072 \textcolor{preprocessor}{\#include <sys/proc.h>}}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00073}00073 \textcolor{preprocessor}{\#include <sys/kthread.h>}}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00074}00074 }
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00075}00075 \textcolor{preprocessor}{\#include <crypto/rijndael/rijndael-\/api-\/fst.h>}}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00076}00076 \textcolor{preprocessor}{\#include <crypto/sha2/sha512.h>}}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00077}00077 \textcolor{preprocessor}{\#include <\mbox{\hyperlink{geom_8h}{geom/geom.h}}>}}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00078}00078 \textcolor{preprocessor}{\#include <\mbox{\hyperlink{g__bde_8h}{geom/bde/g\_bde.h}}>}}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00079}00079 }
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00080}00080 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00081}00081 \textcolor{comment}{ * FIXME: This used to call malloc\_last\_fail which in practice was almost}}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00082}00082 \textcolor{comment}{ * guaranteed to return time\_uptime even in face of severe memory shortage.}}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00083}00083 \textcolor{comment}{ * As GBDE is the only consumer the kludge below was added to facilitate the}}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00084}00084 \textcolor{comment}{ * removal with minimial changes. The code should be fixed to respond to memory}}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00085}00085 \textcolor{comment}{ * pressure (e.g., by using lowmem eventhandler) instead.}}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00086}00086 \textcolor{comment}{ */}}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00087}00087 \textcolor{keyword}{static} \textcolor{keywordtype}{int}}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00088}\mbox{\hyperlink{g__bde__work_8c_af38901431ca0d525bed4b706aa160435}{00088}} \mbox{\hyperlink{g__bde__work_8c_af38901431ca0d525bed4b706aa160435}{g\_bde\_malloc\_last\_fail}}(\textcolor{keywordtype}{void})}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00089}00089 \{}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00090}00090 }
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00091}00091         \textcolor{keywordflow}{return} (time\_uptime);}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00092}00092 \}}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00093}00093 }
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00094}00094 \textcolor{keyword}{static} \textcolor{keywordtype}{void} \mbox{\hyperlink{g__bde__work_8c_ac9576ec511e8043de46f7aa25e3744ee}{g\_bde\_delete\_sector}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structg__bde__softc}{g\_bde\_softc}} *wp, \textcolor{keyword}{struct} \mbox{\hyperlink{structg__bde__sector}{g\_bde\_sector}} *sp);}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00095}00095 \textcolor{keyword}{static} \textcolor{keyword}{struct }\mbox{\hyperlink{structg__bde__sector}{g\_bde\_sector}} * \mbox{\hyperlink{g__bde__work_8c_a741eba3afff4eccad7e34b141eb9c28c}{g\_bde\_new\_sector}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structg__bde__work}{g\_bde\_work}} *wp, u\_int len);}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00096}00096 \textcolor{keyword}{static} \textcolor{keywordtype}{void} \mbox{\hyperlink{g__bde__work_8c_adc706c7d0c4c80217e86a6b6bf3042b8}{g\_bde\_release\_keysector}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structg__bde__work}{g\_bde\_work}} *wp);}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00097}00097 \textcolor{keyword}{static} \textcolor{keyword}{struct }\mbox{\hyperlink{structg__bde__sector}{g\_bde\_sector}} *\mbox{\hyperlink{g__bde__work_8c_a4396d73db0ba2e5aae2611cc917b42a7}{g\_bde\_get\_keysector}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structg__bde__work}{g\_bde\_work}} *wp);}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00098}00098 \textcolor{keyword}{static} \textcolor{keywordtype}{int} \mbox{\hyperlink{g__bde__work_8c_acfb8c9c1bce545ce4c9a9e93fd4f09a7}{g\_bde\_start\_read}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structg__bde__sector}{g\_bde\_sector}} *sp);}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00099}00099 \textcolor{keyword}{static} \textcolor{keywordtype}{void} \mbox{\hyperlink{g__bde__work_8c_a69eed64291d320a77eefe9ac6bc8e61b}{g\_bde\_purge\_sector}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structg__bde__softc}{g\_bde\_softc}} *sc, \textcolor{keywordtype}{int} fraction);}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00100}00100 }
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00101}00101 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00102}00102 \textcolor{comment}{ * Work item allocation.}}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00103}00103 \textcolor{comment}{ *}}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00104}00104 \textcolor{comment}{ * C++ would call these constructors and destructors.}}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00105}00105 \textcolor{comment}{ */}}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00106}\mbox{\hyperlink{g__bde__work_8c_a7222e5883f06b9edcac2bb9339e69925}{00106}} \textcolor{keyword}{static} u\_int \mbox{\hyperlink{g__bde__work_8c_a7222e5883f06b9edcac2bb9339e69925}{g\_bde\_nwork}};}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00107}\mbox{\hyperlink{g__bde__work_8c_a28cff42a200084c495b47d0debe761e8}{00107}} \mbox{\hyperlink{g__bde__work_8c_a28cff42a200084c495b47d0debe761e8}{SYSCTL\_UINT}}(\_debug, OID\_AUTO, gbde\_nwork, CTLFLAG\_RD, \&\mbox{\hyperlink{g__bde__work_8c_a7222e5883f06b9edcac2bb9339e69925}{g\_bde\_nwork}}, 0, \textcolor{stringliteral}{"{}"{}});}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00108}00108 }
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00109}\mbox{\hyperlink{g__bde__work_8c_ad54b804ca6fc98179ed932cf449ae3d2}{00109}} \textcolor{keyword}{static} \mbox{\hyperlink{g__bde__work_8c_ad54b804ca6fc98179ed932cf449ae3d2}{MALLOC\_DEFINE}}(M\_GBDE, \textcolor{stringliteral}{"{}gbde"{}}, \textcolor{stringliteral}{"{}GBDE data structures"{}});}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00110}00110 }
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00111}00111 \textcolor{keyword}{static} \textcolor{keyword}{struct }\mbox{\hyperlink{structg__bde__work}{g\_bde\_work}} *}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00112}\mbox{\hyperlink{g__bde__work_8c_a79935159acf0636cad7b991c979d9b09}{00112}} \mbox{\hyperlink{g__bde__work_8c_a79935159acf0636cad7b991c979d9b09}{g\_bde\_new\_work}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structg__bde__softc}{g\_bde\_softc}} *sc)}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00113}00113 \{}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00114}00114         \textcolor{keyword}{struct }\mbox{\hyperlink{structg__bde__work}{g\_bde\_work}} *wp;}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00115}00115 }
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00116}00116         wp = malloc(\textcolor{keyword}{sizeof} *wp, M\_GBDE, M\_NOWAIT | M\_ZERO);}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00117}00117         \textcolor{keywordflow}{if} (wp == NULL)}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00118}00118                 \textcolor{keywordflow}{return} (wp);}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00119}00119         wp-\/>\mbox{\hyperlink{structg__bde__work_a49d926d67df62d56e5b510d58a76edab}{state}} = \mbox{\hyperlink{structg__bde__work_a81a2b7c3e31e3245dd9f11e493e0909fa45f86250f4b012b43c59a3ab2fb63656}{SETUP}};}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00120}00120         wp-\/>\mbox{\hyperlink{structg__bde__work_a95d7fe0bbd8677b35b2872432580b2f5}{softc}} = sc;}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00121}00121         \mbox{\hyperlink{g__bde__work_8c_a7222e5883f06b9edcac2bb9339e69925}{g\_bde\_nwork}}++;}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00122}00122         sc-\/>\mbox{\hyperlink{structg__bde__softc_ad937d083b6dfd561458ee735b1ed29eb}{nwork}}++;}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00123}00123         TAILQ\_INSERT\_TAIL(\&sc-\/>worklist, wp, list);}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00124}00124         \textcolor{keywordflow}{return} (wp);}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00125}00125 \}}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00126}00126 }
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00127}00127 \textcolor{keyword}{static} \textcolor{keywordtype}{void}}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00128}\mbox{\hyperlink{g__bde__work_8c_a935da4436064ebc20f9c4b3ec05651e9}{00128}} \mbox{\hyperlink{g__bde__work_8c_a935da4436064ebc20f9c4b3ec05651e9}{g\_bde\_delete\_work}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structg__bde__work}{g\_bde\_work}} *wp)}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00129}00129 \{}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00130}00130         \textcolor{keyword}{struct }\mbox{\hyperlink{structg__bde__softc}{g\_bde\_softc}} *sc;}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00131}00131 }
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00132}00132         sc = wp-\/>\mbox{\hyperlink{structg__bde__work_a95d7fe0bbd8677b35b2872432580b2f5}{softc}};}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00133}00133         \mbox{\hyperlink{g__bde__work_8c_a7222e5883f06b9edcac2bb9339e69925}{g\_bde\_nwork}}-\/-\/;}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00134}00134         sc-\/>\mbox{\hyperlink{structg__bde__softc_ad937d083b6dfd561458ee735b1ed29eb}{nwork}}-\/-\/;}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00135}00135         TAILQ\_REMOVE(\&sc-\/>worklist, wp, list);}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00136}00136         \mbox{\hyperlink{g__raid__md__if_8m_a4df9edb2717b3f7e4c3c903878577a54}{free}}(wp, M\_GBDE);}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00137}00137 \}}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00138}00138 }
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00139}00139 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00140}00140 \textcolor{comment}{ * Sector buffer allocation}}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00141}00141 \textcolor{comment}{ *}}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00142}00142 \textcolor{comment}{ * These two functions allocate and free back variable sized sector buffers}}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00143}00143 \textcolor{comment}{ */}}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00144}00144 }
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00145}\mbox{\hyperlink{g__bde__work_8c_a9302b0911df3b99aa276e9921cd5a5ac}{00145}} \textcolor{keyword}{static} u\_int \mbox{\hyperlink{g__bde__work_8c_a9302b0911df3b99aa276e9921cd5a5ac}{g\_bde\_nsect}};}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00146}\mbox{\hyperlink{g__bde__work_8c_a9d54bdd0bd0d9bfb24958f9126788a02}{00146}} \mbox{\hyperlink{g__bde__work_8c_a28cff42a200084c495b47d0debe761e8}{SYSCTL\_UINT}}(\_debug, OID\_AUTO, gbde\_nsect, CTLFLAG\_RD, \&\mbox{\hyperlink{g__bde__work_8c_a9302b0911df3b99aa276e9921cd5a5ac}{g\_bde\_nsect}}, 0, \textcolor{stringliteral}{"{}"{}});}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00147}00147 }
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00148}00148 \textcolor{keyword}{static} \textcolor{keywordtype}{void}}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00149}\mbox{\hyperlink{g__bde__work_8c_ac9576ec511e8043de46f7aa25e3744ee}{00149}} \mbox{\hyperlink{g__bde__work_8c_ac9576ec511e8043de46f7aa25e3744ee}{g\_bde\_delete\_sector}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structg__bde__softc}{g\_bde\_softc}} *sc, \textcolor{keyword}{struct} \mbox{\hyperlink{structg__bde__sector}{g\_bde\_sector}} *sp)}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00150}00150 \{}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00151}00151 }
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00152}00152         \mbox{\hyperlink{g__bde__work_8c_a9302b0911df3b99aa276e9921cd5a5ac}{g\_bde\_nsect}}-\/-\/;}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00153}00153         sc-\/>\mbox{\hyperlink{structg__bde__softc_ae92a95f9a8d09c55e4c0a7523f8881bb}{nsect}}-\/-\/;}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00154}00154         \textcolor{keywordflow}{if} (sp-\/>\mbox{\hyperlink{structg__bde__sector_a3c21c9c400fe675b80cb6fddf1f0f9ae}{malloc}})}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00155}00155                 \mbox{\hyperlink{g__raid__md__if_8m_a4df9edb2717b3f7e4c3c903878577a54}{free}}(sp-\/>\mbox{\hyperlink{structg__bde__sector_ab14f76aa177a3dbb8e2dff0dc721cf2a}{data}}, M\_GBDE);}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00156}00156         \mbox{\hyperlink{g__raid__md__if_8m_a4df9edb2717b3f7e4c3c903878577a54}{free}}(sp, M\_GBDE);}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00157}00157 \}}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00158}00158 }
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00159}00159 \textcolor{keyword}{static} \textcolor{keyword}{struct }\mbox{\hyperlink{structg__bde__sector}{g\_bde\_sector}} *}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00160}\mbox{\hyperlink{g__bde__work_8c_a741eba3afff4eccad7e34b141eb9c28c}{00160}} \mbox{\hyperlink{g__bde__work_8c_a741eba3afff4eccad7e34b141eb9c28c}{g\_bde\_new\_sector}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structg__bde__work}{g\_bde\_work}} *wp, u\_int len)}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00161}00161 \{}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00162}00162         \textcolor{keyword}{struct }\mbox{\hyperlink{structg__bde__sector}{g\_bde\_sector}} *sp;}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00163}00163 }
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00164}00164         sp = \mbox{\hyperlink{structg__bde__sector_a3c21c9c400fe675b80cb6fddf1f0f9ae}{malloc}}(\textcolor{keyword}{sizeof} *sp, M\_GBDE, M\_NOWAIT | M\_ZERO);}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00165}00165         \textcolor{keywordflow}{if} (sp == NULL)}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00166}00166                 \textcolor{keywordflow}{return} (sp);}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00167}00167         \textcolor{keywordflow}{if} (len > 0) \{}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00168}00168                 sp-\/>\mbox{\hyperlink{structg__bde__sector_ab14f76aa177a3dbb8e2dff0dc721cf2a}{data}} = \mbox{\hyperlink{structg__bde__sector_a3c21c9c400fe675b80cb6fddf1f0f9ae}{malloc}}(len, M\_GBDE, M\_NOWAIT | M\_ZERO);}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00169}00169                 \textcolor{keywordflow}{if} (sp-\/>\mbox{\hyperlink{structg__bde__sector_ab14f76aa177a3dbb8e2dff0dc721cf2a}{data}} == NULL) \{}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00170}00170                         \mbox{\hyperlink{g__raid__md__if_8m_a4df9edb2717b3f7e4c3c903878577a54}{free}}(sp, M\_GBDE);}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00171}00171                         \textcolor{keywordflow}{return} (NULL);}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00172}00172                 \}}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00173}00173                 sp-\/>\mbox{\hyperlink{structg__bde__sector_a3c21c9c400fe675b80cb6fddf1f0f9ae}{malloc}} = 1;}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00174}00174         \}}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00175}00175         \mbox{\hyperlink{g__bde__work_8c_a9302b0911df3b99aa276e9921cd5a5ac}{g\_bde\_nsect}}++;}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00176}00176         wp-\/>\mbox{\hyperlink{structg__bde__work_a95d7fe0bbd8677b35b2872432580b2f5}{softc}}-\/>\mbox{\hyperlink{structg__bde__softc_ae92a95f9a8d09c55e4c0a7523f8881bb}{nsect}}++;}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00177}00177         sp-\/>\mbox{\hyperlink{structg__bde__sector_abcab68e7b7f896b4b9c47ce35321a003}{size}} = len;}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00178}00178         sp-\/>\mbox{\hyperlink{structg__bde__sector_af72e5ec757f209224a78404cddef3727}{softc}} = wp-\/>\mbox{\hyperlink{structg__bde__work_a95d7fe0bbd8677b35b2872432580b2f5}{softc}};}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00179}00179         sp-\/>\mbox{\hyperlink{structg__bde__sector_a535a27e38aba9ea91d88974815eb2b08}{ref}} = 1;}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00180}00180         sp-\/>\mbox{\hyperlink{structg__bde__sector_a8ad33c0d9ceb6428427b23591153011d}{owner}} = wp;}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00181}00181         sp-\/>\mbox{\hyperlink{structg__bde__sector_a1b4e0c70a0f4aa3982da2a4072f2f9f2}{offset}} = wp-\/>\mbox{\hyperlink{structg__bde__work_a1f99159bf221d1f9d359d5c35a4b02e6}{so}};}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00182}00182         sp-\/>\mbox{\hyperlink{structg__bde__sector_ae7a82320e88fffd6ec4738e3cc02d65a}{state}} = \mbox{\hyperlink{structg__bde__sector_a647e728e060bcf34f166941492529c66af792e648802169d272b5650bb1e38a71}{JUNK}};}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00183}00183         \textcolor{keywordflow}{return} (sp);}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00184}00184 \}}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00185}00185 }
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00186}00186 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00187}00187 \textcolor{comment}{ * Skey sector cache.}}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00188}00188 \textcolor{comment}{ *}}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00189}00189 \textcolor{comment}{ * Nothing prevents two separate I/O requests from addressing the same zone}}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00190}00190 \textcolor{comment}{ * and thereby needing the same skey sector.  We therefore need to sequence}}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00191}00191 \textcolor{comment}{ * I/O operations to the skey sectors.  A certain amount of caching is also}}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00192}00192 \textcolor{comment}{ * desirable, although the extent of benefit from this is not at this point}}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00193}00193 \textcolor{comment}{ * determined.}}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00194}00194 \textcolor{comment}{ *}}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00195}00195 \textcolor{comment}{ * XXX: GEOM may be able to grow a generic caching facility at some point}}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00196}00196 \textcolor{comment}{ * XXX: to support such needs.}}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00197}00197 \textcolor{comment}{ */}}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00198}00198 }
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00199}\mbox{\hyperlink{g__bde__work_8c_a1dfc43939f55c267cfd13d38118470b2}{00199}} \textcolor{keyword}{static} u\_int \mbox{\hyperlink{g__bde__work_8c_a1dfc43939f55c267cfd13d38118470b2}{g\_bde\_ncache}};}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00200}\mbox{\hyperlink{g__bde__work_8c_a4fdebc4d89eb40b8707600e32adbf6ab}{00200}} \mbox{\hyperlink{g__bde__work_8c_a28cff42a200084c495b47d0debe761e8}{SYSCTL\_UINT}}(\_debug, OID\_AUTO, gbde\_ncache, CTLFLAG\_RD, \&\mbox{\hyperlink{g__bde__work_8c_a1dfc43939f55c267cfd13d38118470b2}{g\_bde\_ncache}}, 0, \textcolor{stringliteral}{"{}"{}});}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00201}00201 }
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00202}00202 \textcolor{keyword}{static} \textcolor{keywordtype}{void}}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00203}\mbox{\hyperlink{g__bde__work_8c_a7e152341d23dadf1d9e788b0621add53}{00203}} \mbox{\hyperlink{g__bde__work_8c_a7e152341d23dadf1d9e788b0621add53}{g\_bde\_purge\_one\_sector}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structg__bde__softc}{g\_bde\_softc}} *sc, \textcolor{keyword}{struct} \mbox{\hyperlink{structg__bde__sector}{g\_bde\_sector}} *sp)}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00204}00204 \{}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00205}00205 }
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00206}00206         \mbox{\hyperlink{geom_8h_a7588d7ea7fbf7180b345df84b8797166}{g\_trace}}(\mbox{\hyperlink{geom_8h_a7f1804ff1a11f763a1ab5bdbd3e1287c}{G\_T\_TOPOLOGY}}, \textcolor{stringliteral}{"{}g\_bde\_purge\_one\_sector(\%p, \%p)"{}}, sc, sp);}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00207}00207         \textcolor{keywordflow}{if} (sp-\/>\mbox{\hyperlink{structg__bde__sector_a535a27e38aba9ea91d88974815eb2b08}{ref}} != 0)}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00208}00208                 \textcolor{keywordflow}{return};}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00209}00209         TAILQ\_REMOVE(\&sc-\/>freelist, sp, list);}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00210}00210         \mbox{\hyperlink{g__bde__work_8c_a1dfc43939f55c267cfd13d38118470b2}{g\_bde\_ncache}}-\/-\/;}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00211}00211         sc-\/>\mbox{\hyperlink{structg__bde__softc_adc7fe17205e2babf6c98b60f2bbb2c84}{ncache}}-\/-\/;}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00212}00212         bzero(sp-\/>\mbox{\hyperlink{structg__bde__sector_ab14f76aa177a3dbb8e2dff0dc721cf2a}{data}}, sp-\/>\mbox{\hyperlink{structg__bde__sector_abcab68e7b7f896b4b9c47ce35321a003}{size}});}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00213}00213         \mbox{\hyperlink{g__bde__work_8c_ac9576ec511e8043de46f7aa25e3744ee}{g\_bde\_delete\_sector}}(sc, sp);}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00214}00214 \}}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00215}00215 }
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00216}00216 \textcolor{keyword}{static} \textcolor{keyword}{struct }\mbox{\hyperlink{structg__bde__sector}{g\_bde\_sector}} *}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00217}\mbox{\hyperlink{g__bde__work_8c_a4396d73db0ba2e5aae2611cc917b42a7}{00217}} \mbox{\hyperlink{g__bde__work_8c_a4396d73db0ba2e5aae2611cc917b42a7}{g\_bde\_get\_keysector}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structg__bde__work}{g\_bde\_work}} *wp)}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00218}00218 \{}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00219}00219         \textcolor{keyword}{struct }\mbox{\hyperlink{structg__bde__sector}{g\_bde\_sector}} *sp;}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00220}00220         \textcolor{keyword}{struct }\mbox{\hyperlink{structg__bde__softc}{g\_bde\_softc}} *sc;}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00221}00221         off\_t \mbox{\hyperlink{g__raid__tr__if_8m_ad5f0842c40c7e46344fd8df70187fa0f}{offset}};}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00222}00222 }
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00223}00223         \mbox{\hyperlink{g__raid__tr__if_8m_ad5f0842c40c7e46344fd8df70187fa0f}{offset}} = wp-\/>\mbox{\hyperlink{structg__bde__work_aacdf8f69d74bf6a308fd80ca7f77eac9}{kso}};}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00224}00224         \mbox{\hyperlink{geom_8h_a7588d7ea7fbf7180b345df84b8797166}{g\_trace}}(\mbox{\hyperlink{geom_8h_a7f1804ff1a11f763a1ab5bdbd3e1287c}{G\_T\_TOPOLOGY}}, \textcolor{stringliteral}{"{}g\_bde\_get\_keysector(\%p, \%jd)"{}}, wp, (intmax\_t)\mbox{\hyperlink{g__raid__tr__if_8m_ad5f0842c40c7e46344fd8df70187fa0f}{offset}});}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00225}00225         sc = wp-\/>\mbox{\hyperlink{structg__bde__work_a95d7fe0bbd8677b35b2872432580b2f5}{softc}};}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00226}00226 }
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00227}00227         \textcolor{keywordflow}{if} (\mbox{\hyperlink{g__bde__work_8c_af38901431ca0d525bed4b706aa160435}{g\_bde\_malloc\_last\_fail}}() < \mbox{\hyperlink{g__bde__work_8c_a1dfc43939f55c267cfd13d38118470b2}{g\_bde\_ncache}})}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00228}00228                 \mbox{\hyperlink{g__bde__work_8c_a69eed64291d320a77eefe9ac6bc8e61b}{g\_bde\_purge\_sector}}(sc, -\/1);}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00229}00229 }
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00230}00230         sp = TAILQ\_FIRST(\&sc-\/>freelist);}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00231}00231         \textcolor{keywordflow}{if} (sp != NULL \&\& sp-\/>\mbox{\hyperlink{structg__bde__sector_a535a27e38aba9ea91d88974815eb2b08}{ref}} == 0 \&\& sp-\/>\mbox{\hyperlink{structg__bde__sector_abd730bed7e2bcb043544d28f928c0aae}{used}} + 300 < time\_uptime)}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00232}00232                 \mbox{\hyperlink{g__bde__work_8c_a7e152341d23dadf1d9e788b0621add53}{g\_bde\_purge\_one\_sector}}(sc, sp);}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00233}00233 }
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00234}00234         TAILQ\_FOREACH(sp, \&sc-\/>freelist, list) \{}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00235}00235                 \textcolor{keywordflow}{if} (sp-\/>\mbox{\hyperlink{structg__bde__sector_a1b4e0c70a0f4aa3982da2a4072f2f9f2}{offset}} == \mbox{\hyperlink{g__raid__tr__if_8m_ad5f0842c40c7e46344fd8df70187fa0f}{offset}})}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00236}00236                         \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00237}00237         \}}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00238}00238         \textcolor{keywordflow}{if} (sp != NULL) \{}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00239}00239                 sp-\/>\mbox{\hyperlink{structg__bde__sector_a535a27e38aba9ea91d88974815eb2b08}{ref}}++;}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00240}00240                 KASSERT(sp-\/>\mbox{\hyperlink{structg__bde__sector_a1b4e0c70a0f4aa3982da2a4072f2f9f2}{offset}} == \mbox{\hyperlink{g__raid__tr__if_8m_ad5f0842c40c7e46344fd8df70187fa0f}{offset}}, (\textcolor{stringliteral}{"{}wrong offset"{}}));}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00241}00241                 KASSERT(sp-\/>\mbox{\hyperlink{structg__bde__sector_af72e5ec757f209224a78404cddef3727}{softc}} == wp-\/>\mbox{\hyperlink{structg__bde__work_a95d7fe0bbd8677b35b2872432580b2f5}{softc}}, (\textcolor{stringliteral}{"{}wrong softc"{}}));}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00242}00242                 \textcolor{keywordflow}{if} (sp-\/>\mbox{\hyperlink{structg__bde__sector_a535a27e38aba9ea91d88974815eb2b08}{ref}} == 1)}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00243}00243                         sp-\/>\mbox{\hyperlink{structg__bde__sector_a8ad33c0d9ceb6428427b23591153011d}{owner}} = wp;}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00244}00244         \} \textcolor{keywordflow}{else} \{}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00245}00245                 \textcolor{keywordflow}{if} (\mbox{\hyperlink{g__bde__work_8c_af38901431ca0d525bed4b706aa160435}{g\_bde\_malloc\_last\_fail}}() < \mbox{\hyperlink{g__bde__work_8c_a1dfc43939f55c267cfd13d38118470b2}{g\_bde\_ncache}}) \{}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00246}00246                         TAILQ\_FOREACH(sp, \&sc-\/>freelist, list)}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00247}00247                                 \textcolor{keywordflow}{if} (sp-\/>\mbox{\hyperlink{structg__bde__sector_a535a27e38aba9ea91d88974815eb2b08}{ref}} == 0)}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00248}00248                                         \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00249}00249                 \}}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00250}00250                 \textcolor{keywordflow}{if} (sp == NULL \&\& !TAILQ\_EMPTY(\&sc-\/>freelist))}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00251}00251                         sp = TAILQ\_FIRST(\&sc-\/>freelist);}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00252}00252                 \textcolor{keywordflow}{if} (sp != NULL \&\& sp-\/>\mbox{\hyperlink{structg__bde__sector_a535a27e38aba9ea91d88974815eb2b08}{ref}} > 0)}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00253}00253                         sp = NULL;}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00254}00254                 \textcolor{keywordflow}{if} (sp == NULL) \{}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00255}00255                         sp = \mbox{\hyperlink{g__bde__work_8c_a741eba3afff4eccad7e34b141eb9c28c}{g\_bde\_new\_sector}}(wp, sc-\/>\mbox{\hyperlink{structg__bde__softc_a3550952b25e3c8697e43254841743beb}{sectorsize}});}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00256}00256                         \textcolor{keywordflow}{if} (sp != NULL) \{}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00257}00257                                 \mbox{\hyperlink{g__bde__work_8c_a1dfc43939f55c267cfd13d38118470b2}{g\_bde\_ncache}}++;}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00258}00258                                 sc-\/>\mbox{\hyperlink{structg__bde__softc_adc7fe17205e2babf6c98b60f2bbb2c84}{ncache}}++;}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00259}00259                                 TAILQ\_INSERT\_TAIL(\&sc-\/>freelist, sp, list);}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00260}00260                                 sp-\/>\mbox{\hyperlink{structg__bde__sector_a3c21c9c400fe675b80cb6fddf1f0f9ae}{malloc}} = 2;}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00261}00261                         \}}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00262}00262                 \}}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00263}00263                 \textcolor{keywordflow}{if} (sp != NULL) \{}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00264}00264                         sp-\/>\mbox{\hyperlink{structg__bde__sector_a1b4e0c70a0f4aa3982da2a4072f2f9f2}{offset}} = \mbox{\hyperlink{g__raid__tr__if_8m_ad5f0842c40c7e46344fd8df70187fa0f}{offset}};}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00265}00265                         sp-\/>\mbox{\hyperlink{structg__bde__sector_af72e5ec757f209224a78404cddef3727}{softc}} = wp-\/>\mbox{\hyperlink{structg__bde__work_a95d7fe0bbd8677b35b2872432580b2f5}{softc}};}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00266}00266                         sp-\/>\mbox{\hyperlink{structg__bde__sector_a535a27e38aba9ea91d88974815eb2b08}{ref}} = 1;}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00267}00267                         sp-\/>\mbox{\hyperlink{structg__bde__sector_a8ad33c0d9ceb6428427b23591153011d}{owner}} = wp;}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00268}00268                         sp-\/>\mbox{\hyperlink{structg__bde__sector_ae7a82320e88fffd6ec4738e3cc02d65a}{state}} = JUNK;}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00269}00269                         sp-\/>\mbox{\hyperlink{structg__bde__sector_a7b583ef4bfbb0824e049ab59823730cf}{error}} = 0;}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00270}00270                 \}}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00271}00271         \}}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00272}00272         \textcolor{keywordflow}{if} (sp != NULL) \{}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00273}00273                 TAILQ\_REMOVE(\&sc-\/>freelist, sp, list);}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00274}00274                 TAILQ\_INSERT\_TAIL(\&sc-\/>freelist, sp, list);}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00275}00275                 sp-\/>\mbox{\hyperlink{structg__bde__sector_abd730bed7e2bcb043544d28f928c0aae}{used}} = time\_uptime;}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00276}00276         \}}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00277}00277         wp-\/>\mbox{\hyperlink{structg__bde__work_a24857e16bf46ac3c536872760b0e6986}{ksp}} = sp;}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00278}00278         \textcolor{keywordflow}{return}(sp);}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00279}00279 \}}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00280}00280 }
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00281}00281 \textcolor{keyword}{static} \textcolor{keywordtype}{void}}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00282}\mbox{\hyperlink{g__bde__work_8c_adc706c7d0c4c80217e86a6b6bf3042b8}{00282}} \mbox{\hyperlink{g__bde__work_8c_adc706c7d0c4c80217e86a6b6bf3042b8}{g\_bde\_release\_keysector}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structg__bde__work}{g\_bde\_work}} *wp)}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00283}00283 \{}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00284}00284         \textcolor{keyword}{struct }\mbox{\hyperlink{structg__bde__softc}{g\_bde\_softc}} *sc;}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00285}00285         \textcolor{keyword}{struct }\mbox{\hyperlink{structg__bde__work}{g\_bde\_work}} *wp2;}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00286}00286         \textcolor{keyword}{struct }\mbox{\hyperlink{structg__bde__sector}{g\_bde\_sector}} *sp;}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00287}00287 }
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00288}00288         sp = wp-\/>\mbox{\hyperlink{structg__bde__work_a24857e16bf46ac3c536872760b0e6986}{ksp}};}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00289}00289         \mbox{\hyperlink{geom_8h_a7588d7ea7fbf7180b345df84b8797166}{g\_trace}}(\mbox{\hyperlink{geom_8h_a7f1804ff1a11f763a1ab5bdbd3e1287c}{G\_T\_TOPOLOGY}}, \textcolor{stringliteral}{"{}g\_bde\_release\_keysector(\%p)"{}}, sp);}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00290}00290         KASSERT(sp-\/>\mbox{\hyperlink{structg__bde__sector_a3c21c9c400fe675b80cb6fddf1f0f9ae}{malloc}} == 2, (\textcolor{stringliteral}{"{}Wrong sector released"{}}));}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00291}00291         sc = sp-\/>\mbox{\hyperlink{structg__bde__sector_af72e5ec757f209224a78404cddef3727}{softc}};}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00292}00292         KASSERT(sc != NULL, (\textcolor{stringliteral}{"{}NULL sp-\/>softc"{}}));}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00293}00293         KASSERT(wp == sp-\/>\mbox{\hyperlink{structg__bde__sector_a8ad33c0d9ceb6428427b23591153011d}{owner}}, (\textcolor{stringliteral}{"{}Releasing, not owner"{}}));}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00294}00294         sp-\/>\mbox{\hyperlink{structg__bde__sector_a8ad33c0d9ceb6428427b23591153011d}{owner}} = NULL;}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00295}00295         wp-\/>\mbox{\hyperlink{structg__bde__work_a24857e16bf46ac3c536872760b0e6986}{ksp}} = NULL;}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00296}00296         sp-\/>\mbox{\hyperlink{structg__bde__sector_a535a27e38aba9ea91d88974815eb2b08}{ref}}-\/-\/;}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00297}00297         \textcolor{keywordflow}{if} (sp-\/>\mbox{\hyperlink{structg__bde__sector_a535a27e38aba9ea91d88974815eb2b08}{ref}} > 0) \{}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00298}00298                 TAILQ\_REMOVE(\&sc-\/>freelist, sp, list);}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00299}00299                 TAILQ\_INSERT\_TAIL(\&sc-\/>freelist, sp, list);}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00300}00300                 TAILQ\_FOREACH(wp2, \&sc-\/>worklist, list) \{}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00301}00301                         \textcolor{keywordflow}{if} (wp2-\/>\mbox{\hyperlink{structg__bde__work_a24857e16bf46ac3c536872760b0e6986}{ksp}} == sp) \{}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00302}00302                                 KASSERT(wp2 != wp, (\textcolor{stringliteral}{"{}Self-\/reowning"{}}));}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00303}00303                                 sp-\/>\mbox{\hyperlink{structg__bde__sector_a8ad33c0d9ceb6428427b23591153011d}{owner}} = wp2;}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00304}00304                                 wakeup(sp-\/>\mbox{\hyperlink{structg__bde__sector_af72e5ec757f209224a78404cddef3727}{softc}});}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00305}00305                                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00306}00306                         \}}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00307}00307                 \}}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00308}00308                 KASSERT(wp2 != NULL, (\textcolor{stringliteral}{"{}Failed to pick up owner for \%p\(\backslash\)n"{}}, sp));}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00309}00309         \} \textcolor{keywordflow}{else} \textcolor{keywordflow}{if} (sp-\/>\mbox{\hyperlink{structg__bde__sector_a7b583ef4bfbb0824e049ab59823730cf}{error}} != 0) \{}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00310}00310                 sp-\/>\mbox{\hyperlink{structg__bde__sector_a1b4e0c70a0f4aa3982da2a4072f2f9f2}{offset}} = \string~0;}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00311}00311                 sp-\/>\mbox{\hyperlink{structg__bde__sector_a7b583ef4bfbb0824e049ab59823730cf}{error}} = 0;}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00312}00312                 sp-\/>\mbox{\hyperlink{structg__bde__sector_ae7a82320e88fffd6ec4738e3cc02d65a}{state}} = \mbox{\hyperlink{structg__bde__sector_a647e728e060bcf34f166941492529c66af792e648802169d272b5650bb1e38a71}{JUNK}};}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00313}00313         \}}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00314}00314         TAILQ\_REMOVE(\&sc-\/>freelist, sp, list);}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00315}00315         TAILQ\_INSERT\_HEAD(\&sc-\/>freelist, sp, list);}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00316}00316 \}}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00317}00317 }
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00318}00318 \textcolor{keyword}{static} \textcolor{keywordtype}{void}}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00319}\mbox{\hyperlink{g__bde__work_8c_a69eed64291d320a77eefe9ac6bc8e61b}{00319}} \mbox{\hyperlink{g__bde__work_8c_a69eed64291d320a77eefe9ac6bc8e61b}{g\_bde\_purge\_sector}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structg__bde__softc}{g\_bde\_softc}} *sc, \textcolor{keywordtype}{int} fraction)}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00320}00320 \{}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00321}00321         \textcolor{keyword}{struct }\mbox{\hyperlink{structg__bde__sector}{g\_bde\_sector}} *sp;}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00322}00322         \textcolor{keywordtype}{int} n;}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00323}00323 }
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00324}00324         \mbox{\hyperlink{geom_8h_a7588d7ea7fbf7180b345df84b8797166}{g\_trace}}(\mbox{\hyperlink{geom_8h_a7f1804ff1a11f763a1ab5bdbd3e1287c}{G\_T\_TOPOLOGY}}, \textcolor{stringliteral}{"{}g\_bde\_purge\_sector(\%p)"{}}, sc);}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00325}00325         \textcolor{keywordflow}{if} (fraction > 0)}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00326}00326                 n = sc-\/>\mbox{\hyperlink{structg__bde__softc_adc7fe17205e2babf6c98b60f2bbb2c84}{ncache}} / fraction + 1;}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00327}00327         \textcolor{keywordflow}{else} }
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00328}00328                 n = \mbox{\hyperlink{g__bde__work_8c_a1dfc43939f55c267cfd13d38118470b2}{g\_bde\_ncache}} -\/ \mbox{\hyperlink{g__bde__work_8c_af38901431ca0d525bed4b706aa160435}{g\_bde\_malloc\_last\_fail}}();}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00329}00329         \textcolor{keywordflow}{if} (n < 0)}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00330}00330                 \textcolor{keywordflow}{return};}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00331}00331         \textcolor{keywordflow}{if} (n > sc-\/>\mbox{\hyperlink{structg__bde__softc_adc7fe17205e2babf6c98b60f2bbb2c84}{ncache}})}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00332}00332                 n = sc-\/>\mbox{\hyperlink{structg__bde__softc_adc7fe17205e2babf6c98b60f2bbb2c84}{ncache}};}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00333}00333         \textcolor{keywordflow}{while}(n-\/-\/) \{}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00334}00334                 TAILQ\_FOREACH(sp, \&sc-\/>freelist, list) \{}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00335}00335                         \textcolor{keywordflow}{if} (sp-\/>\mbox{\hyperlink{structg__bde__sector_a535a27e38aba9ea91d88974815eb2b08}{ref}} != 0)}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00336}00336                                 \textcolor{keywordflow}{continue};}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00337}00337                         TAILQ\_REMOVE(\&sc-\/>freelist, sp, list);}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00338}00338                         \mbox{\hyperlink{g__bde__work_8c_a1dfc43939f55c267cfd13d38118470b2}{g\_bde\_ncache}}-\/-\/;}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00339}00339                         sc-\/>\mbox{\hyperlink{structg__bde__softc_adc7fe17205e2babf6c98b60f2bbb2c84}{ncache}}-\/-\/;}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00340}00340                         bzero(sp-\/>\mbox{\hyperlink{structg__bde__sector_ab14f76aa177a3dbb8e2dff0dc721cf2a}{data}}, sp-\/>\mbox{\hyperlink{structg__bde__sector_abcab68e7b7f896b4b9c47ce35321a003}{size}});}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00341}00341                         \mbox{\hyperlink{g__bde__work_8c_ac9576ec511e8043de46f7aa25e3744ee}{g\_bde\_delete\_sector}}(sc, sp);}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00342}00342                         \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00343}00343                 \}}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00344}00344         \}}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00345}00345 \}}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00346}00346 }
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00347}00347 \textcolor{keyword}{static} \textcolor{keyword}{struct }\mbox{\hyperlink{structg__bde__sector}{g\_bde\_sector}} *}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00348}\mbox{\hyperlink{g__bde__work_8c_aeb34377fc3821261ca8c6236820424c2}{00348}} \mbox{\hyperlink{g__bde__work_8c_aeb34377fc3821261ca8c6236820424c2}{g\_bde\_read\_keysector}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structg__bde__softc}{g\_bde\_softc}} *sc, \textcolor{keyword}{struct} \mbox{\hyperlink{structg__bde__work}{g\_bde\_work}} *wp)}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00349}00349 \{}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00350}00350         \textcolor{keyword}{struct }\mbox{\hyperlink{structg__bde__sector}{g\_bde\_sector}} *sp;}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00351}00351 }
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00352}00352         \mbox{\hyperlink{geom_8h_a7588d7ea7fbf7180b345df84b8797166}{g\_trace}}(\mbox{\hyperlink{geom_8h_a7f1804ff1a11f763a1ab5bdbd3e1287c}{G\_T\_TOPOLOGY}}, \textcolor{stringliteral}{"{}g\_bde\_read\_keysector(\%p)"{}}, wp);}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00353}00353         sp = \mbox{\hyperlink{g__bde__work_8c_a4396d73db0ba2e5aae2611cc917b42a7}{g\_bde\_get\_keysector}}(wp);}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00354}00354         \textcolor{keywordflow}{if} (sp == NULL) \{}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00355}00355                 \mbox{\hyperlink{g__bde__work_8c_a69eed64291d320a77eefe9ac6bc8e61b}{g\_bde\_purge\_sector}}(sc, -\/1);}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00356}00356                 sp = \mbox{\hyperlink{g__bde__work_8c_a4396d73db0ba2e5aae2611cc917b42a7}{g\_bde\_get\_keysector}}(wp);}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00357}00357         \}}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00358}00358         \textcolor{keywordflow}{if} (sp == NULL)}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00359}00359                 \textcolor{keywordflow}{return} (sp);}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00360}00360         \textcolor{keywordflow}{if} (sp-\/>\mbox{\hyperlink{structg__bde__sector_a8ad33c0d9ceb6428427b23591153011d}{owner}} != wp)}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00361}00361                 \textcolor{keywordflow}{return} (sp);}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00362}00362         \textcolor{keywordflow}{if} (sp-\/>\mbox{\hyperlink{structg__bde__sector_ae7a82320e88fffd6ec4738e3cc02d65a}{state}} == \mbox{\hyperlink{structg__bde__sector_a647e728e060bcf34f166941492529c66af0dfaf7c76327eae9884d677fa91e5a6}{VALID}})}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00363}00363                 \textcolor{keywordflow}{return} (sp);}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00364}00364         \textcolor{keywordflow}{if} (\mbox{\hyperlink{g__bde__work_8c_acfb8c9c1bce545ce4c9a9e93fd4f09a7}{g\_bde\_start\_read}}(sp) == 0)}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00365}00365                 \textcolor{keywordflow}{return} (sp);}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00366}00366         \mbox{\hyperlink{g__bde__work_8c_adc706c7d0c4c80217e86a6b6bf3042b8}{g\_bde\_release\_keysector}}(wp);}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00367}00367         \textcolor{keywordflow}{return} (NULL);}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00368}00368 \}}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00369}00369 }
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00370}00370 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00371}00371 \textcolor{comment}{ * Contribute to the completion of the original bio request.}}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00372}00372 \textcolor{comment}{ *}}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00373}00373 \textcolor{comment}{ * We have no simple way to tell how many bits the original bio request has}}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00374}00374 \textcolor{comment}{ * been segmented into, so the easiest way to determine when we can deliver}}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00375}00375 \textcolor{comment}{ * it is to keep track of the number of bytes we have completed.  We keep}}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00376}00376 \textcolor{comment}{ * track of any errors underway and latch onto the first one.}}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00377}00377 \textcolor{comment}{ *}}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00378}00378 \textcolor{comment}{ * We always report "{}nothing done"{} in case of error, because random bits here}}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00379}00379 \textcolor{comment}{ * and there may be completed and returning a number of completed bytes does}}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00380}00380 \textcolor{comment}{ * not convey any useful information about which bytes they were.  If some}}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00381}00381 \textcolor{comment}{ * piece of broken code somewhere interprets this to mean that nothing has}}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00382}00382 \textcolor{comment}{ * changed on the underlying media they deserve the lossage headed for them.}}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00383}00383 \textcolor{comment}{ *}}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00384}00384 \textcolor{comment}{ * A single mutex per g\_bde instance is used to prevent contention.}}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00385}00385 \textcolor{comment}{ */}}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00386}00386 }
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00387}00387 \textcolor{keyword}{static} \textcolor{keywordtype}{void}}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00388}\mbox{\hyperlink{g__bde__work_8c_abcab7b3954e6536e589c05db715e805c}{00388}} \mbox{\hyperlink{g__bde__work_8c_abcab7b3954e6536e589c05db715e805c}{g\_bde\_contribute}}(\textcolor{keyword}{struct} bio *\mbox{\hyperlink{g__part__if_8m_a3786db8db96c32f69df9f7cd325a7507}{bp}}, off\_t bytes, \textcolor{keywordtype}{int} \mbox{\hyperlink{structg__bde__sector_a7b583ef4bfbb0824e049ab59823730cf}{error}})}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00389}00389 \{}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00390}00390 }
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00391}00391         \mbox{\hyperlink{geom_8h_a7588d7ea7fbf7180b345df84b8797166}{g\_trace}}(\mbox{\hyperlink{geom_8h_a7f1804ff1a11f763a1ab5bdbd3e1287c}{G\_T\_TOPOLOGY}}, \textcolor{stringliteral}{"{}g\_bde\_contribute bp \%p bytes \%jd error \%d"{}},}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00392}00392              \mbox{\hyperlink{g__part__if_8m_a3786db8db96c32f69df9f7cd325a7507}{bp}}, (intmax\_t)bytes, \mbox{\hyperlink{structg__bde__sector_a7b583ef4bfbb0824e049ab59823730cf}{error}});}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00393}00393         \textcolor{keywordflow}{if} (\mbox{\hyperlink{g__part__if_8m_a3786db8db96c32f69df9f7cd325a7507}{bp}}-\/>bio\_error == 0)}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00394}00394                 \mbox{\hyperlink{g__part__if_8m_a3786db8db96c32f69df9f7cd325a7507}{bp}}-\/>bio\_error = \mbox{\hyperlink{structg__bde__sector_a7b583ef4bfbb0824e049ab59823730cf}{error}};}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00395}00395         \mbox{\hyperlink{g__part__if_8m_a3786db8db96c32f69df9f7cd325a7507}{bp}}-\/>bio\_completed += bytes;}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00396}00396         KASSERT(\mbox{\hyperlink{g__part__if_8m_a3786db8db96c32f69df9f7cd325a7507}{bp}}-\/>bio\_completed <= \mbox{\hyperlink{g__part__if_8m_a3786db8db96c32f69df9f7cd325a7507}{bp}}-\/>bio\_length, (\textcolor{stringliteral}{"{}Too large contribution"{}}));}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00397}00397         \textcolor{keywordflow}{if} (\mbox{\hyperlink{g__part__if_8m_a3786db8db96c32f69df9f7cd325a7507}{bp}}-\/>bio\_completed == \mbox{\hyperlink{g__part__if_8m_a3786db8db96c32f69df9f7cd325a7507}{bp}}-\/>bio\_length) \{}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00398}00398                 \textcolor{keywordflow}{if} (\mbox{\hyperlink{g__part__if_8m_a3786db8db96c32f69df9f7cd325a7507}{bp}}-\/>bio\_error != 0)}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00399}00399                         \mbox{\hyperlink{g__part__if_8m_a3786db8db96c32f69df9f7cd325a7507}{bp}}-\/>bio\_completed = 0;}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00400}00400                 \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__bde__work_8c_source_l00401}00401         \}}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00402}00402 \}}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00403}00403 }
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00404}00404 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00405}00405 \textcolor{comment}{ * This is the common case "{}we're done with this work package"{} function}}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00406}00406 \textcolor{comment}{ */}}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00407}00407 }
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00408}00408 \textcolor{keyword}{static} \textcolor{keywordtype}{void}}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00409}\mbox{\hyperlink{g__bde__work_8c_a857977d8e7eb06d1070f05df1d338ff5}{00409}} \mbox{\hyperlink{g__bde__work_8c_a857977d8e7eb06d1070f05df1d338ff5}{g\_bde\_work\_done}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structg__bde__work}{g\_bde\_work}} *wp, \textcolor{keywordtype}{int} \mbox{\hyperlink{structg__bde__sector_a7b583ef4bfbb0824e049ab59823730cf}{error}})}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00410}00410 \{}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00411}00411 }
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00412}00412         \mbox{\hyperlink{g__bde__work_8c_abcab7b3954e6536e589c05db715e805c}{g\_bde\_contribute}}(wp-\/>\mbox{\hyperlink{structg__bde__work_a7619c185f0faa0a4f16c362c8065b902}{bp}}, wp-\/>\mbox{\hyperlink{structg__bde__work_a9f7d343383548b89da65779a624142d1}{length}}, \mbox{\hyperlink{structg__bde__sector_a7b583ef4bfbb0824e049ab59823730cf}{error}});}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00413}00413         \textcolor{keywordflow}{if} (wp-\/>\mbox{\hyperlink{structg__bde__work_ab479e99436eaef7b084e0de5b8efbacd}{sp}} != NULL)}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00414}00414                 \mbox{\hyperlink{g__bde__work_8c_ac9576ec511e8043de46f7aa25e3744ee}{g\_bde\_delete\_sector}}(wp-\/>\mbox{\hyperlink{structg__bde__work_a95d7fe0bbd8677b35b2872432580b2f5}{softc}}, wp-\/>\mbox{\hyperlink{structg__bde__work_ab479e99436eaef7b084e0de5b8efbacd}{sp}});}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00415}00415         \textcolor{keywordflow}{if} (wp-\/>\mbox{\hyperlink{structg__bde__work_a24857e16bf46ac3c536872760b0e6986}{ksp}} != NULL)}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00416}00416                 \mbox{\hyperlink{g__bde__work_8c_adc706c7d0c4c80217e86a6b6bf3042b8}{g\_bde\_release\_keysector}}(wp);}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00417}00417         \mbox{\hyperlink{g__bde__work_8c_a935da4436064ebc20f9c4b3ec05651e9}{g\_bde\_delete\_work}}(wp);}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00418}00418 \}}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00419}00419 }
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00420}00420 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00421}00421 \textcolor{comment}{ * A write operation has finished.  When we have all expected cows in the}}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00422}00422 \textcolor{comment}{ * barn close the door and call it a day.}}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00423}00423 \textcolor{comment}{ */}}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00424}00424 }
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00425}00425 \textcolor{keyword}{static} \textcolor{keywordtype}{void}}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00426}\mbox{\hyperlink{g__bde__work_8c_ade02995b24945ef0d56b464024ba6318}{00426}} \mbox{\hyperlink{g__bde__work_8c_ade02995b24945ef0d56b464024ba6318}{g\_bde\_write\_done}}(\textcolor{keyword}{struct} bio *\mbox{\hyperlink{g__part__if_8m_a3786db8db96c32f69df9f7cd325a7507}{bp}})}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00427}00427 \{}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00428}00428         \textcolor{keyword}{struct }\mbox{\hyperlink{structg__bde__sector}{g\_bde\_sector}} *sp;}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00429}00429         \textcolor{keyword}{struct }\mbox{\hyperlink{structg__bde__work}{g\_bde\_work}} *wp;}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00430}00430         \textcolor{keyword}{struct }\mbox{\hyperlink{structg__bde__softc}{g\_bde\_softc}} *sc;}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00431}00431 }
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00432}00432         sp = \mbox{\hyperlink{g__part__if_8m_a3786db8db96c32f69df9f7cd325a7507}{bp}}-\/>bio\_caller1;}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00433}00433         sc = \mbox{\hyperlink{g__part__if_8m_a3786db8db96c32f69df9f7cd325a7507}{bp}}-\/>bio\_caller2;}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00434}00434         mtx\_lock(\&sc-\/>\mbox{\hyperlink{structg__bde__softc_a7a9fcb7e0a97a3af4186b18ca2db9daa}{worklist\_mutex}});}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00435}00435         KASSERT(sp != NULL, (\textcolor{stringliteral}{"{}NULL sp"{}}));}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00436}00436         KASSERT(sc != NULL, (\textcolor{stringliteral}{"{}NULL sc"{}}));}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00437}00437         KASSERT(sp-\/>\mbox{\hyperlink{structg__bde__sector_a8ad33c0d9ceb6428427b23591153011d}{owner}} != NULL, (\textcolor{stringliteral}{"{}NULL sp-\/>owner"{}}));}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00438}00438         \mbox{\hyperlink{geom_8h_a7588d7ea7fbf7180b345df84b8797166}{g\_trace}}(\mbox{\hyperlink{geom_8h_a7f1804ff1a11f763a1ab5bdbd3e1287c}{G\_T\_TOPOLOGY}}, \textcolor{stringliteral}{"{}g\_bde\_write\_done(\%p)"{}}, sp);}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00439}00439         \textcolor{keywordflow}{if} (\mbox{\hyperlink{g__part__if_8m_a3786db8db96c32f69df9f7cd325a7507}{bp}}-\/>bio\_error == 0 \&\& \mbox{\hyperlink{g__part__if_8m_a3786db8db96c32f69df9f7cd325a7507}{bp}}-\/>bio\_completed != sp-\/>\mbox{\hyperlink{structg__bde__sector_abcab68e7b7f896b4b9c47ce35321a003}{size}})}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00440}00440                 \mbox{\hyperlink{g__part__if_8m_a3786db8db96c32f69df9f7cd325a7507}{bp}}-\/>bio\_error = EIO;}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00441}00441         sp-\/>\mbox{\hyperlink{structg__bde__sector_a7b583ef4bfbb0824e049ab59823730cf}{error}} = \mbox{\hyperlink{g__part__if_8m_a3786db8db96c32f69df9f7cd325a7507}{bp}}-\/>bio\_error;}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00442}00442         \mbox{\hyperlink{geom_8h_ae3cbea7d4bf48f25bb609df3d3f0bb28}{g\_destroy\_bio}}(\mbox{\hyperlink{g__part__if_8m_a3786db8db96c32f69df9f7cd325a7507}{bp}});}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00443}00443         wp = sp-\/>\mbox{\hyperlink{structg__bde__sector_a8ad33c0d9ceb6428427b23591153011d}{owner}};}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00444}00444         \textcolor{keywordflow}{if} (wp-\/>\mbox{\hyperlink{structg__bde__work_aa31308ed7d14f7b5a7ad6596f103baf2}{error}} == 0)}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00445}00445                 wp-\/>\mbox{\hyperlink{structg__bde__work_aa31308ed7d14f7b5a7ad6596f103baf2}{error}} = sp-\/>\mbox{\hyperlink{structg__bde__sector_a7b583ef4bfbb0824e049ab59823730cf}{error}};}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00446}00446 }
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00447}00447         \textcolor{keywordflow}{if} (wp-\/>\mbox{\hyperlink{structg__bde__work_a7619c185f0faa0a4f16c362c8065b902}{bp}}-\/>bio\_cmd == BIO\_DELETE) \{}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00448}00448                 KASSERT(sp == wp-\/>\mbox{\hyperlink{structg__bde__work_ab479e99436eaef7b084e0de5b8efbacd}{sp}}, (\textcolor{stringliteral}{"{}trashed delete op"{}}));}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00449}00449                 \mbox{\hyperlink{g__bde__work_8c_a857977d8e7eb06d1070f05df1d338ff5}{g\_bde\_work\_done}}(wp, wp-\/>\mbox{\hyperlink{structg__bde__work_aa31308ed7d14f7b5a7ad6596f103baf2}{error}});}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00450}00450                 mtx\_unlock(\&sc-\/>\mbox{\hyperlink{structg__bde__softc_a7a9fcb7e0a97a3af4186b18ca2db9daa}{worklist\_mutex}});}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00451}00451                 \textcolor{keywordflow}{return};}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00452}00452         \}}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00453}00453 }
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00454}00454         KASSERT(wp-\/>\mbox{\hyperlink{structg__bde__work_a7619c185f0faa0a4f16c362c8065b902}{bp}}-\/>bio\_cmd == BIO\_WRITE, (\textcolor{stringliteral}{"{}Confused in g\_bde\_write\_done()"{}}));}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00455}00455         KASSERT(sp == wp-\/>\mbox{\hyperlink{structg__bde__work_ab479e99436eaef7b084e0de5b8efbacd}{sp}} || sp == wp-\/>\mbox{\hyperlink{structg__bde__work_a24857e16bf46ac3c536872760b0e6986}{ksp}}, (\textcolor{stringliteral}{"{}trashed write op"{}}));}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00456}00456         \textcolor{keywordflow}{if} (wp-\/>\mbox{\hyperlink{structg__bde__work_ab479e99436eaef7b084e0de5b8efbacd}{sp}} == sp) \{}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00457}00457                 \mbox{\hyperlink{g__bde__work_8c_ac9576ec511e8043de46f7aa25e3744ee}{g\_bde\_delete\_sector}}(sc, wp-\/>\mbox{\hyperlink{structg__bde__work_ab479e99436eaef7b084e0de5b8efbacd}{sp}});}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00458}00458                 wp-\/>\mbox{\hyperlink{structg__bde__work_ab479e99436eaef7b084e0de5b8efbacd}{sp}} = NULL;}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00459}00459         \} \textcolor{keywordflow}{else} \{}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00460}00460                 sp-\/>\mbox{\hyperlink{structg__bde__sector_ae7a82320e88fffd6ec4738e3cc02d65a}{state}} = VALID;}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00461}00461         \}}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00462}00462         \textcolor{keywordflow}{if} (wp-\/>\mbox{\hyperlink{structg__bde__work_ab479e99436eaef7b084e0de5b8efbacd}{sp}} == NULL \&\& wp-\/>\mbox{\hyperlink{structg__bde__work_a24857e16bf46ac3c536872760b0e6986}{ksp}} != NULL \&\& wp-\/>\mbox{\hyperlink{structg__bde__work_a24857e16bf46ac3c536872760b0e6986}{ksp}}-\/>\mbox{\hyperlink{structg__bde__sector_ae7a82320e88fffd6ec4738e3cc02d65a}{state}} == VALID)}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00463}00463                 \mbox{\hyperlink{g__bde__work_8c_a857977d8e7eb06d1070f05df1d338ff5}{g\_bde\_work\_done}}(wp, wp-\/>\mbox{\hyperlink{structg__bde__work_aa31308ed7d14f7b5a7ad6596f103baf2}{error}});}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00464}00464         mtx\_unlock(\&sc-\/>\mbox{\hyperlink{structg__bde__softc_a7a9fcb7e0a97a3af4186b18ca2db9daa}{worklist\_mutex}});}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00465}00465         \textcolor{keywordflow}{return};}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00466}00466 \}}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00467}00467 }
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00468}00468 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00469}00469 \textcolor{comment}{ * Send a write request for the given sector down the pipeline.}}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00470}00470 \textcolor{comment}{ */}}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00471}00471 }
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00472}00472 \textcolor{keyword}{static} \textcolor{keywordtype}{int}}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00473}\mbox{\hyperlink{g__bde__work_8c_a826e3581ecbfe3241c39e0af034d7ad7}{00473}} \mbox{\hyperlink{g__bde__work_8c_a826e3581ecbfe3241c39e0af034d7ad7}{g\_bde\_start\_write}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structg__bde__sector}{g\_bde\_sector}} *sp)}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00474}00474 \{}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00475}00475         \textcolor{keyword}{struct }bio *\mbox{\hyperlink{g__part__if_8m_a3786db8db96c32f69df9f7cd325a7507}{bp}};}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00476}00476         \textcolor{keyword}{struct }\mbox{\hyperlink{structg__bde__softc}{g\_bde\_softc}} *sc;}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00477}00477 }
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00478}00478         \mbox{\hyperlink{geom_8h_a7588d7ea7fbf7180b345df84b8797166}{g\_trace}}(\mbox{\hyperlink{geom_8h_a7f1804ff1a11f763a1ab5bdbd3e1287c}{G\_T\_TOPOLOGY}}, \textcolor{stringliteral}{"{}g\_bde\_start\_write(\%p)"{}}, sp);}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00479}00479         sc = sp-\/>\mbox{\hyperlink{structg__bde__sector_af72e5ec757f209224a78404cddef3727}{softc}};}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00480}00480         KASSERT(sc != NULL, (\textcolor{stringliteral}{"{}NULL sc in g\_bde\_start\_write"{}}));}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00481}00481         KASSERT(sp-\/>\mbox{\hyperlink{structg__bde__sector_a8ad33c0d9ceb6428427b23591153011d}{owner}} != NULL, (\textcolor{stringliteral}{"{}NULL sp-\/>owner in g\_bde\_start\_write"{}}));}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00482}00482         \mbox{\hyperlink{g__part__if_8m_a3786db8db96c32f69df9f7cd325a7507}{bp}} = \mbox{\hyperlink{geom_8h_ad1c00a46dacd4e51a19243a557ff24f3}{g\_new\_bio}}();}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00483}00483         \textcolor{keywordflow}{if} (\mbox{\hyperlink{g__part__if_8m_a3786db8db96c32f69df9f7cd325a7507}{bp}} == NULL)}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00484}00484                 \textcolor{keywordflow}{return} (ENOMEM);}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00485}00485         \mbox{\hyperlink{g__part__if_8m_a3786db8db96c32f69df9f7cd325a7507}{bp}}-\/>bio\_cmd = BIO\_WRITE;}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00486}00486         \mbox{\hyperlink{g__part__if_8m_a3786db8db96c32f69df9f7cd325a7507}{bp}}-\/>bio\_offset = sp-\/>\mbox{\hyperlink{structg__bde__sector_a1b4e0c70a0f4aa3982da2a4072f2f9f2}{offset}};}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00487}00487         \mbox{\hyperlink{g__part__if_8m_a3786db8db96c32f69df9f7cd325a7507}{bp}}-\/>bio\_data = sp-\/>\mbox{\hyperlink{structg__bde__sector_ab14f76aa177a3dbb8e2dff0dc721cf2a}{data}};}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00488}00488         \mbox{\hyperlink{g__part__if_8m_a3786db8db96c32f69df9f7cd325a7507}{bp}}-\/>bio\_length = sp-\/>\mbox{\hyperlink{structg__bde__sector_abcab68e7b7f896b4b9c47ce35321a003}{size}};}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00489}00489         \mbox{\hyperlink{g__part__if_8m_a3786db8db96c32f69df9f7cd325a7507}{bp}}-\/>bio\_done = \mbox{\hyperlink{g__bde__work_8c_ade02995b24945ef0d56b464024ba6318}{g\_bde\_write\_done}};}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00490}00490         \mbox{\hyperlink{g__part__if_8m_a3786db8db96c32f69df9f7cd325a7507}{bp}}-\/>bio\_caller1 = sp;}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00491}00491         \mbox{\hyperlink{g__part__if_8m_a3786db8db96c32f69df9f7cd325a7507}{bp}}-\/>bio\_caller2 = sc;}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00492}00492         sp-\/>\mbox{\hyperlink{structg__bde__sector_ae7a82320e88fffd6ec4738e3cc02d65a}{state}} = IO;}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00493}00493         \mbox{\hyperlink{geom_8h_aa433c0ba9e8cad7c7da1f9e17b46eb7a}{g\_io\_request}}(\mbox{\hyperlink{g__part__if_8m_a3786db8db96c32f69df9f7cd325a7507}{bp}}, sc-\/>\mbox{\hyperlink{structg__bde__softc_a3bc97d06913991a91d0e7009c6991ce5}{consumer}});}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00494}00494         \textcolor{keywordflow}{return}(0);}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00495}00495 \}}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00496}00496 }
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00497}00497 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00498}00498 \textcolor{comment}{ * A read operation has finished.  Mark the sector no longer iobusy and}}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00499}00499 \textcolor{comment}{ * wake up the worker thread and let it do its thing.}}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00500}00500 \textcolor{comment}{ */}}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00501}00501 }
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00502}00502 \textcolor{keyword}{static} \textcolor{keywordtype}{void}}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00503}\mbox{\hyperlink{g__bde__work_8c_ad359df6acc8667f3f4e7dff5592ee3a0}{00503}} \mbox{\hyperlink{g__bde__work_8c_ad359df6acc8667f3f4e7dff5592ee3a0}{g\_bde\_read\_done}}(\textcolor{keyword}{struct} bio *\mbox{\hyperlink{g__part__if_8m_a3786db8db96c32f69df9f7cd325a7507}{bp}})}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00504}00504 \{}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00505}00505         \textcolor{keyword}{struct }\mbox{\hyperlink{structg__bde__sector}{g\_bde\_sector}} *sp;}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00506}00506         \textcolor{keyword}{struct }\mbox{\hyperlink{structg__bde__softc}{g\_bde\_softc}} *sc;}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00507}00507 }
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00508}00508         sp = \mbox{\hyperlink{g__part__if_8m_a3786db8db96c32f69df9f7cd325a7507}{bp}}-\/>bio\_caller1;}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00509}00509         \mbox{\hyperlink{geom_8h_a7588d7ea7fbf7180b345df84b8797166}{g\_trace}}(\mbox{\hyperlink{geom_8h_a7f1804ff1a11f763a1ab5bdbd3e1287c}{G\_T\_TOPOLOGY}}, \textcolor{stringliteral}{"{}g\_bde\_read\_done(\%p)"{}}, sp);}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00510}00510         sc = \mbox{\hyperlink{g__part__if_8m_a3786db8db96c32f69df9f7cd325a7507}{bp}}-\/>bio\_caller2;}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00511}00511         mtx\_lock(\&sc-\/>\mbox{\hyperlink{structg__bde__softc_a7a9fcb7e0a97a3af4186b18ca2db9daa}{worklist\_mutex}});}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00512}00512         \textcolor{keywordflow}{if} (\mbox{\hyperlink{g__part__if_8m_a3786db8db96c32f69df9f7cd325a7507}{bp}}-\/>bio\_error == 0 \&\& \mbox{\hyperlink{g__part__if_8m_a3786db8db96c32f69df9f7cd325a7507}{bp}}-\/>bio\_completed != sp-\/>\mbox{\hyperlink{structg__bde__sector_abcab68e7b7f896b4b9c47ce35321a003}{size}})}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00513}00513                 \mbox{\hyperlink{g__part__if_8m_a3786db8db96c32f69df9f7cd325a7507}{bp}}-\/>bio\_error = EIO;}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00514}00514         sp-\/>\mbox{\hyperlink{structg__bde__sector_a7b583ef4bfbb0824e049ab59823730cf}{error}} = \mbox{\hyperlink{g__part__if_8m_a3786db8db96c32f69df9f7cd325a7507}{bp}}-\/>bio\_error;}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00515}00515         \textcolor{keywordflow}{if} (sp-\/>\mbox{\hyperlink{structg__bde__sector_a7b583ef4bfbb0824e049ab59823730cf}{error}} == 0)}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00516}00516                 sp-\/>\mbox{\hyperlink{structg__bde__sector_ae7a82320e88fffd6ec4738e3cc02d65a}{state}} = VALID;}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00517}00517         \textcolor{keywordflow}{else}}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00518}00518                 sp-\/>\mbox{\hyperlink{structg__bde__sector_ae7a82320e88fffd6ec4738e3cc02d65a}{state}} = JUNK;}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00519}00519         wakeup(sc);}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00520}00520         \mbox{\hyperlink{geom_8h_ae3cbea7d4bf48f25bb609df3d3f0bb28}{g\_destroy\_bio}}(\mbox{\hyperlink{g__part__if_8m_a3786db8db96c32f69df9f7cd325a7507}{bp}});}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00521}00521         mtx\_unlock(\&sc-\/>\mbox{\hyperlink{structg__bde__softc_a7a9fcb7e0a97a3af4186b18ca2db9daa}{worklist\_mutex}});}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00522}00522 \}}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00523}00523 }
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00524}00524 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00525}00525 \textcolor{comment}{ * Send a read request for the given sector down the pipeline.}}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00526}00526 \textcolor{comment}{ */}}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00527}00527 }
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00528}00528 \textcolor{keyword}{static} \textcolor{keywordtype}{int}}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00529}\mbox{\hyperlink{g__bde__work_8c_acfb8c9c1bce545ce4c9a9e93fd4f09a7}{00529}} \mbox{\hyperlink{g__bde__work_8c_acfb8c9c1bce545ce4c9a9e93fd4f09a7}{g\_bde\_start\_read}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structg__bde__sector}{g\_bde\_sector}} *sp)}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00530}00530 \{}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00531}00531         \textcolor{keyword}{struct }bio *\mbox{\hyperlink{g__part__if_8m_a3786db8db96c32f69df9f7cd325a7507}{bp}};}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00532}00532         \textcolor{keyword}{struct }\mbox{\hyperlink{structg__bde__softc}{g\_bde\_softc}} *sc;}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00533}00533 }
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00534}00534         \mbox{\hyperlink{geom_8h_a7588d7ea7fbf7180b345df84b8797166}{g\_trace}}(\mbox{\hyperlink{geom_8h_a7f1804ff1a11f763a1ab5bdbd3e1287c}{G\_T\_TOPOLOGY}}, \textcolor{stringliteral}{"{}g\_bde\_start\_read(\%p)"{}}, sp);}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00535}00535         sc = sp-\/>\mbox{\hyperlink{structg__bde__sector_af72e5ec757f209224a78404cddef3727}{softc}};}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00536}00536         KASSERT(sc != NULL, (\textcolor{stringliteral}{"{}Null softc in sp \%p"{}}, sp));}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00537}00537         \mbox{\hyperlink{g__part__if_8m_a3786db8db96c32f69df9f7cd325a7507}{bp}} = \mbox{\hyperlink{geom_8h_ad1c00a46dacd4e51a19243a557ff24f3}{g\_new\_bio}}();}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00538}00538         \textcolor{keywordflow}{if} (\mbox{\hyperlink{g__part__if_8m_a3786db8db96c32f69df9f7cd325a7507}{bp}} == NULL)}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00539}00539                 \textcolor{keywordflow}{return} (ENOMEM);}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00540}00540         \mbox{\hyperlink{g__part__if_8m_a3786db8db96c32f69df9f7cd325a7507}{bp}}-\/>bio\_cmd = BIO\_READ;}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00541}00541         \mbox{\hyperlink{g__part__if_8m_a3786db8db96c32f69df9f7cd325a7507}{bp}}-\/>bio\_offset = sp-\/>\mbox{\hyperlink{structg__bde__sector_a1b4e0c70a0f4aa3982da2a4072f2f9f2}{offset}};}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00542}00542         \mbox{\hyperlink{g__part__if_8m_a3786db8db96c32f69df9f7cd325a7507}{bp}}-\/>bio\_data = sp-\/>\mbox{\hyperlink{structg__bde__sector_ab14f76aa177a3dbb8e2dff0dc721cf2a}{data}};}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00543}00543         \mbox{\hyperlink{g__part__if_8m_a3786db8db96c32f69df9f7cd325a7507}{bp}}-\/>bio\_length = sp-\/>\mbox{\hyperlink{structg__bde__sector_abcab68e7b7f896b4b9c47ce35321a003}{size}};}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00544}00544         \mbox{\hyperlink{g__part__if_8m_a3786db8db96c32f69df9f7cd325a7507}{bp}}-\/>bio\_done = \mbox{\hyperlink{g__bde__work_8c_ad359df6acc8667f3f4e7dff5592ee3a0}{g\_bde\_read\_done}};}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00545}00545         \mbox{\hyperlink{g__part__if_8m_a3786db8db96c32f69df9f7cd325a7507}{bp}}-\/>bio\_caller1 = sp;}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00546}00546         \mbox{\hyperlink{g__part__if_8m_a3786db8db96c32f69df9f7cd325a7507}{bp}}-\/>bio\_caller2 = sc;}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00547}00547         sp-\/>\mbox{\hyperlink{structg__bde__sector_ae7a82320e88fffd6ec4738e3cc02d65a}{state}} = IO;}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00548}00548         \mbox{\hyperlink{geom_8h_aa433c0ba9e8cad7c7da1f9e17b46eb7a}{g\_io\_request}}(\mbox{\hyperlink{g__part__if_8m_a3786db8db96c32f69df9f7cd325a7507}{bp}}, sc-\/>\mbox{\hyperlink{structg__bde__softc_a3bc97d06913991a91d0e7009c6991ce5}{consumer}});}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00549}00549         \textcolor{keywordflow}{return}(0);}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00550}00550 \}}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00551}00551 }
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00552}00552 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00553}00553 \textcolor{comment}{ * The worker thread.}}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00554}00554 \textcolor{comment}{ *}}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00555}00555 \textcolor{comment}{ * The up/down path of GEOM is not allowed to sleep or do any major work}}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00556}00556 \textcolor{comment}{ * so we use this thread to do the actual crypto operations and to push}}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00557}00557 \textcolor{comment}{ * the state engine onwards.}}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00558}00558 \textcolor{comment}{ *}}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00559}00559 \textcolor{comment}{ * XXX: if we switch to the src/sys/opencrypt hardware assisted encryption}}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00560}00560 \textcolor{comment}{ * XXX: using a thread here is probably not needed.}}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00561}00561 \textcolor{comment}{ */}}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00562}00562 }
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00563}00563 \textcolor{keywordtype}{void}}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00564}\mbox{\hyperlink{g__bde_8h_a6d037c99d1189618a550c7b1d84b53bb}{00564}} \mbox{\hyperlink{g__bde__work_8c_a6d037c99d1189618a550c7b1d84b53bb}{g\_bde\_worker}}(\textcolor{keywordtype}{void} *arg)}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00565}00565 \{}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00566}00566         \textcolor{keyword}{struct }\mbox{\hyperlink{structg__bde__softc}{g\_bde\_softc}} *sc;}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00567}00567         \textcolor{keyword}{struct }\mbox{\hyperlink{structg__bde__work}{g\_bde\_work}} *wp, *twp;}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00568}00568         \textcolor{keyword}{struct }\mbox{\hyperlink{structg__geom}{g\_geom}} *\mbox{\hyperlink{g__part__if_8m_abdc908a08b24cd2e589de2f44e40eeb9}{gp}};}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00569}00569         \textcolor{keywordtype}{int} restart, error;}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00570}00570 }
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00571}00571         \mbox{\hyperlink{g__part__if_8m_abdc908a08b24cd2e589de2f44e40eeb9}{gp}} = arg;}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00572}00572         sc = \mbox{\hyperlink{g__part__if_8m_abdc908a08b24cd2e589de2f44e40eeb9}{gp}}-\/>\mbox{\hyperlink{structg__geom_aa83c08c83459420f6cbcfe64c6099466}{softc}};}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00573}00573 }
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00574}00574         mtx\_lock(\&sc-\/>\mbox{\hyperlink{structg__bde__softc_a7a9fcb7e0a97a3af4186b18ca2db9daa}{worklist\_mutex}});}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00575}00575         \textcolor{keywordflow}{for} (;;) \{}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00576}00576                 restart = 0;}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00577}00577                 \mbox{\hyperlink{geom_8h_a7588d7ea7fbf7180b345df84b8797166}{g\_trace}}(\mbox{\hyperlink{geom_8h_a7f1804ff1a11f763a1ab5bdbd3e1287c}{G\_T\_TOPOLOGY}}, \textcolor{stringliteral}{"{}g\_bde\_worker scan"{}});}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00578}00578                 TAILQ\_FOREACH\_SAFE(wp, \&sc-\/>worklist, list, twp) \{}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00579}00579                         KASSERT(wp != NULL, (\textcolor{stringliteral}{"{}NULL wp"{}}));}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00580}00580                         KASSERT(wp-\/>\mbox{\hyperlink{structg__bde__work_a95d7fe0bbd8677b35b2872432580b2f5}{softc}} != NULL, (\textcolor{stringliteral}{"{}NULL wp-\/>softc"{}}));}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00581}00581                         \textcolor{keywordflow}{if} (wp-\/>\mbox{\hyperlink{structg__bde__work_a49d926d67df62d56e5b510d58a76edab}{state}} != WAIT)}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00582}00582                                 \textcolor{keywordflow}{continue};       \textcolor{comment}{/* Not interesting here */}}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00583}00583 }
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00584}00584                         KASSERT(wp-\/>\mbox{\hyperlink{structg__bde__work_a7619c185f0faa0a4f16c362c8065b902}{bp}} != NULL, (\textcolor{stringliteral}{"{}NULL wp-\/>bp"{}}));}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00585}00585                         KASSERT(wp-\/>\mbox{\hyperlink{structg__bde__work_ab479e99436eaef7b084e0de5b8efbacd}{sp}} != NULL, (\textcolor{stringliteral}{"{}NULL wp-\/>sp"{}}));}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00586}00586 }
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00587}00587                         \textcolor{keywordflow}{if} (wp-\/>\mbox{\hyperlink{structg__bde__work_a24857e16bf46ac3c536872760b0e6986}{ksp}} != NULL) \{}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00588}00588                                 \textcolor{keywordflow}{if} (wp-\/>\mbox{\hyperlink{structg__bde__work_a24857e16bf46ac3c536872760b0e6986}{ksp}}-\/>\mbox{\hyperlink{structg__bde__sector_a8ad33c0d9ceb6428427b23591153011d}{owner}} != wp)}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00589}00589                                         \textcolor{keywordflow}{continue};}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00590}00590                                 \textcolor{keywordflow}{if} (wp-\/>\mbox{\hyperlink{structg__bde__work_a24857e16bf46ac3c536872760b0e6986}{ksp}}-\/>\mbox{\hyperlink{structg__bde__sector_ae7a82320e88fffd6ec4738e3cc02d65a}{state}} == IO)}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00591}00591                                         \textcolor{keywordflow}{continue};}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00592}00592                                 KASSERT(wp-\/>\mbox{\hyperlink{structg__bde__work_a24857e16bf46ac3c536872760b0e6986}{ksp}}-\/>\mbox{\hyperlink{structg__bde__sector_ae7a82320e88fffd6ec4738e3cc02d65a}{state}} == VALID,}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00593}00593                                     (\textcolor{stringliteral}{"{}Illegal sector state (\%d)"{}},}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00594}00594                                     wp-\/>\mbox{\hyperlink{structg__bde__work_a24857e16bf46ac3c536872760b0e6986}{ksp}}-\/>\mbox{\hyperlink{structg__bde__sector_ae7a82320e88fffd6ec4738e3cc02d65a}{state}}));}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00595}00595                         \}}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00596}00596 }
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00597}00597                         \textcolor{keywordflow}{if} (wp-\/>\mbox{\hyperlink{structg__bde__work_a7619c185f0faa0a4f16c362c8065b902}{bp}}-\/>bio\_cmd == BIO\_READ \&\& wp-\/>\mbox{\hyperlink{structg__bde__work_ab479e99436eaef7b084e0de5b8efbacd}{sp}}-\/>\mbox{\hyperlink{structg__bde__sector_ae7a82320e88fffd6ec4738e3cc02d65a}{state}} == IO)}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00598}00598                                 \textcolor{keywordflow}{continue};}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00599}00599 }
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00600}00600                         \textcolor{keywordflow}{if} (wp-\/>\mbox{\hyperlink{structg__bde__work_a24857e16bf46ac3c536872760b0e6986}{ksp}} != NULL \&\& wp-\/>\mbox{\hyperlink{structg__bde__work_a24857e16bf46ac3c536872760b0e6986}{ksp}}-\/>\mbox{\hyperlink{structg__bde__sector_a7b583ef4bfbb0824e049ab59823730cf}{error}} != 0) \{}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00601}00601                                 \mbox{\hyperlink{g__bde__work_8c_a857977d8e7eb06d1070f05df1d338ff5}{g\_bde\_work\_done}}(wp, wp-\/>\mbox{\hyperlink{structg__bde__work_a24857e16bf46ac3c536872760b0e6986}{ksp}}-\/>\mbox{\hyperlink{structg__bde__sector_a7b583ef4bfbb0824e049ab59823730cf}{error}});}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00602}00602                                 \textcolor{keywordflow}{continue};}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00603}00603                         \} }
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00604}00604                         \textcolor{keywordflow}{switch}(wp-\/>\mbox{\hyperlink{structg__bde__work_a7619c185f0faa0a4f16c362c8065b902}{bp}}-\/>bio\_cmd) \{}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00605}00605                         \textcolor{keywordflow}{case} BIO\_READ:}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00606}00606                                 \textcolor{keywordflow}{if} (wp-\/>\mbox{\hyperlink{structg__bde__work_a24857e16bf46ac3c536872760b0e6986}{ksp}} == NULL) \{}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00607}00607                                         KASSERT(wp-\/>\mbox{\hyperlink{structg__bde__work_aa31308ed7d14f7b5a7ad6596f103baf2}{error}} != 0,}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00608}00608                                             (\textcolor{stringliteral}{"{}BIO\_READ, no ksp and no error"{}}));}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00609}00609                                         \mbox{\hyperlink{g__bde__work_8c_a857977d8e7eb06d1070f05df1d338ff5}{g\_bde\_work\_done}}(wp, wp-\/>\mbox{\hyperlink{structg__bde__work_aa31308ed7d14f7b5a7ad6596f103baf2}{error}});}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00610}00610                                         \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00611}00611                                 \}}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00612}00612                                 \textcolor{keywordflow}{if} (wp-\/>\mbox{\hyperlink{structg__bde__work_ab479e99436eaef7b084e0de5b8efbacd}{sp}}-\/>\mbox{\hyperlink{structg__bde__sector_a7b583ef4bfbb0824e049ab59823730cf}{error}} != 0) \{}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00613}00613                                         \mbox{\hyperlink{g__bde__work_8c_a857977d8e7eb06d1070f05df1d338ff5}{g\_bde\_work\_done}}(wp, wp-\/>\mbox{\hyperlink{structg__bde__work_ab479e99436eaef7b084e0de5b8efbacd}{sp}}-\/>\mbox{\hyperlink{structg__bde__sector_a7b583ef4bfbb0824e049ab59823730cf}{error}});}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00614}00614                                         \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00615}00615                                 \}}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00616}00616                                 mtx\_unlock(\&sc-\/>\mbox{\hyperlink{structg__bde__softc_a7a9fcb7e0a97a3af4186b18ca2db9daa}{worklist\_mutex}});}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00617}00617                                 \mbox{\hyperlink{g__bde_8h_a0e360ba2bc6c7e1f8cd28e1766276311}{g\_bde\_crypt\_read}}(wp);}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00618}00618                                 mtx\_lock(\&sc-\/>\mbox{\hyperlink{structg__bde__softc_a7a9fcb7e0a97a3af4186b18ca2db9daa}{worklist\_mutex}});}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00619}00619                                 restart++;}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00620}00620                                 \mbox{\hyperlink{g__bde__work_8c_a857977d8e7eb06d1070f05df1d338ff5}{g\_bde\_work\_done}}(wp, wp-\/>\mbox{\hyperlink{structg__bde__work_ab479e99436eaef7b084e0de5b8efbacd}{sp}}-\/>\mbox{\hyperlink{structg__bde__sector_a7b583ef4bfbb0824e049ab59823730cf}{error}});}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00621}00621                                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00622}00622                         \textcolor{keywordflow}{case} BIO\_WRITE:}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00623}00623                                 wp-\/>\mbox{\hyperlink{structg__bde__work_a49d926d67df62d56e5b510d58a76edab}{state}} = FINISH;}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00624}00624                                 KASSERT(wp-\/>\mbox{\hyperlink{structg__bde__work_ab479e99436eaef7b084e0de5b8efbacd}{sp}}-\/>\mbox{\hyperlink{structg__bde__sector_a8ad33c0d9ceb6428427b23591153011d}{owner}} == wp,}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00625}00625                                     (\textcolor{stringliteral}{"{}Write not owner sp"{}}));}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00626}00626                                 KASSERT(wp-\/>\mbox{\hyperlink{structg__bde__work_a24857e16bf46ac3c536872760b0e6986}{ksp}}-\/>\mbox{\hyperlink{structg__bde__sector_a8ad33c0d9ceb6428427b23591153011d}{owner}} == wp,}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00627}00627                                     (\textcolor{stringliteral}{"{}Write not owner ksp"{}}));}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00628}00628                                 mtx\_unlock(\&sc-\/>\mbox{\hyperlink{structg__bde__softc_a7a9fcb7e0a97a3af4186b18ca2db9daa}{worklist\_mutex}});}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00629}00629                                 \mbox{\hyperlink{g__bde_8h_a3704204fda32232892e3c0f046c04e8c}{g\_bde\_crypt\_write}}(wp);}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00630}00630                                 mtx\_lock(\&sc-\/>\mbox{\hyperlink{structg__bde__softc_a7a9fcb7e0a97a3af4186b18ca2db9daa}{worklist\_mutex}});}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00631}00631                                 restart++;}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00632}00632                                 error = \mbox{\hyperlink{g__bde__work_8c_a826e3581ecbfe3241c39e0af034d7ad7}{g\_bde\_start\_write}}(wp-\/>\mbox{\hyperlink{structg__bde__work_ab479e99436eaef7b084e0de5b8efbacd}{sp}});}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00633}00633                                 \textcolor{keywordflow}{if} (error) \{}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00634}00634                                         \mbox{\hyperlink{g__bde__work_8c_a857977d8e7eb06d1070f05df1d338ff5}{g\_bde\_work\_done}}(wp, error);}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00635}00635                                         \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00636}00636                                 \}}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00637}00637                                 error = \mbox{\hyperlink{g__bde__work_8c_a826e3581ecbfe3241c39e0af034d7ad7}{g\_bde\_start\_write}}(wp-\/>\mbox{\hyperlink{structg__bde__work_a24857e16bf46ac3c536872760b0e6986}{ksp}});}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00638}00638                                 \textcolor{keywordflow}{if} (wp-\/>\mbox{\hyperlink{structg__bde__work_aa31308ed7d14f7b5a7ad6596f103baf2}{error}} != 0)}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00639}00639                                         wp-\/>\mbox{\hyperlink{structg__bde__work_aa31308ed7d14f7b5a7ad6596f103baf2}{error}} = error;}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00640}00640                                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00641}00641                         \textcolor{keywordflow}{case} BIO\_DELETE:}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00642}00642                                 wp-\/>\mbox{\hyperlink{structg__bde__work_a49d926d67df62d56e5b510d58a76edab}{state}} = FINISH;}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00643}00643                                 mtx\_unlock(\&sc-\/>\mbox{\hyperlink{structg__bde__softc_a7a9fcb7e0a97a3af4186b18ca2db9daa}{worklist\_mutex}});}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00644}00644                                 \mbox{\hyperlink{g__bde_8h_aa424947a388f787015d468937a543765}{g\_bde\_crypt\_delete}}(wp);}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00645}00645                                 mtx\_lock(\&sc-\/>\mbox{\hyperlink{structg__bde__softc_a7a9fcb7e0a97a3af4186b18ca2db9daa}{worklist\_mutex}});}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00646}00646                                 restart++;}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00647}00647                                 \mbox{\hyperlink{g__bde__work_8c_a826e3581ecbfe3241c39e0af034d7ad7}{g\_bde\_start\_write}}(wp-\/>\mbox{\hyperlink{structg__bde__work_ab479e99436eaef7b084e0de5b8efbacd}{sp}});}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00648}00648                                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00649}00649                         \}}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00650}00650                         \textcolor{keywordflow}{if} (restart)}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00651}00651                                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00652}00652                 \}}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00653}00653                 \textcolor{keywordflow}{if} (!restart) \{}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00654}00654                         \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00655}00655 \textcolor{comment}{                         * We don't look for our death-\/warrant until we are}}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00656}00656 \textcolor{comment}{                         * idle.  Shouldn't make a difference in practice.}}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00657}00657 \textcolor{comment}{                         */}}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00658}00658                         \textcolor{keywordflow}{if} (sc-\/>\mbox{\hyperlink{structg__bde__softc_a42b28a4bf4f575371fcdfda95425c601}{dead}})}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00659}00659                                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00660}00660                         \mbox{\hyperlink{geom_8h_a7588d7ea7fbf7180b345df84b8797166}{g\_trace}}(\mbox{\hyperlink{geom_8h_a7f1804ff1a11f763a1ab5bdbd3e1287c}{G\_T\_TOPOLOGY}}, \textcolor{stringliteral}{"{}g\_bde\_worker sleep"{}});}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00661}00661                         error = msleep(sc, \&sc-\/>\mbox{\hyperlink{structg__bde__softc_a7a9fcb7e0a97a3af4186b18ca2db9daa}{worklist\_mutex}},}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00662}00662                             PRIBIO, \textcolor{stringliteral}{"{}-\/"{}}, hz);}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00663}00663                         \textcolor{keywordflow}{if} (error == EWOULDBLOCK) \{}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00664}00664                                 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00665}00665 \textcolor{comment}{                                 * Lose our skey cache in an orderly fashion.}}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00666}00666 \textcolor{comment}{                                 * The exact rate can be tuned to be less}}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00667}00667 \textcolor{comment}{                                 * aggressive if this is desirable.  10\% per}}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00668}00668 \textcolor{comment}{                                 * second means that the cache is gone in a}}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00669}00669 \textcolor{comment}{                                 * few minutes.}}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00670}00670 \textcolor{comment}{                                 */}}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00671}00671                                 \mbox{\hyperlink{g__bde__work_8c_a69eed64291d320a77eefe9ac6bc8e61b}{g\_bde\_purge\_sector}}(sc, 10);}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00672}00672                         \}}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00673}00673                 \}}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00674}00674         \}}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00675}00675         \mbox{\hyperlink{geom_8h_a7588d7ea7fbf7180b345df84b8797166}{g\_trace}}(\mbox{\hyperlink{geom_8h_a7f1804ff1a11f763a1ab5bdbd3e1287c}{G\_T\_TOPOLOGY}}, \textcolor{stringliteral}{"{}g\_bde\_worker die"{}});}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00676}00676         \mbox{\hyperlink{g__bde__work_8c_a69eed64291d320a77eefe9ac6bc8e61b}{g\_bde\_purge\_sector}}(sc, 1);}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00677}00677         KASSERT(sc-\/>\mbox{\hyperlink{structg__bde__softc_ad937d083b6dfd561458ee735b1ed29eb}{nwork}} == 0, (\textcolor{stringliteral}{"{}Dead but \%d work remaining"{}}, sc-\/>\mbox{\hyperlink{structg__bde__softc_ad937d083b6dfd561458ee735b1ed29eb}{nwork}}));}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00678}00678         KASSERT(sc-\/>\mbox{\hyperlink{structg__bde__softc_adc7fe17205e2babf6c98b60f2bbb2c84}{ncache}} == 0, (\textcolor{stringliteral}{"{}Dead but \%d cache remaining"{}}, sc-\/>\mbox{\hyperlink{structg__bde__softc_adc7fe17205e2babf6c98b60f2bbb2c84}{ncache}}));}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00679}00679         KASSERT(sc-\/>\mbox{\hyperlink{structg__bde__softc_ae92a95f9a8d09c55e4c0a7523f8881bb}{nsect}} == 0, (\textcolor{stringliteral}{"{}Dead but \%d sect remaining"{}}, sc-\/>\mbox{\hyperlink{structg__bde__softc_ae92a95f9a8d09c55e4c0a7523f8881bb}{nsect}}));}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00680}00680         mtx\_unlock(\&sc-\/>\mbox{\hyperlink{structg__bde__softc_a7a9fcb7e0a97a3af4186b18ca2db9daa}{worklist\_mutex}});}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00681}00681         sc-\/>\mbox{\hyperlink{structg__bde__softc_a42b28a4bf4f575371fcdfda95425c601}{dead}} = 2;}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00682}00682         wakeup(sc);}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00683}00683         kproc\_exit(0);}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00684}00684 \}}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00685}00685 }
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00686}00686 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00687}00687 \textcolor{comment}{ * g\_bde\_start1 has chopped the incoming request up so all the requests}}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00688}00688 \textcolor{comment}{ * we see here are inside a single zone.  Map the data and key locations}}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00689}00689 \textcolor{comment}{ * grab the buffers we need and fire off the first volley of read requests.}}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00690}00690 \textcolor{comment}{ */}}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00691}00691 }
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00692}00692 \textcolor{keyword}{static} \textcolor{keywordtype}{void}}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00693}\mbox{\hyperlink{g__bde__work_8c_ab5982e416b4ecfae96925e72a3644ece}{00693}} \mbox{\hyperlink{g__bde__work_8c_ab5982e416b4ecfae96925e72a3644ece}{g\_bde\_start2}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structg__bde__work}{g\_bde\_work}} *wp)}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00694}00694 \{}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00695}00695         \textcolor{keyword}{struct }\mbox{\hyperlink{structg__bde__softc}{g\_bde\_softc}} *sc;}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00696}00696 }
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00697}00697         KASSERT(wp != NULL, (\textcolor{stringliteral}{"{}NULL wp in g\_bde\_start2"{}}));}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00698}00698         KASSERT(wp-\/>\mbox{\hyperlink{structg__bde__work_a95d7fe0bbd8677b35b2872432580b2f5}{softc}} != NULL, (\textcolor{stringliteral}{"{}NULL wp-\/>softc"{}}));}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00699}00699         \mbox{\hyperlink{geom_8h_a7588d7ea7fbf7180b345df84b8797166}{g\_trace}}(\mbox{\hyperlink{geom_8h_a7f1804ff1a11f763a1ab5bdbd3e1287c}{G\_T\_TOPOLOGY}}, \textcolor{stringliteral}{"{}g\_bde\_start2(\%p)"{}}, wp);}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00700}00700         sc = wp-\/>\mbox{\hyperlink{structg__bde__work_a95d7fe0bbd8677b35b2872432580b2f5}{softc}};}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00701}00701         \textcolor{keywordflow}{switch} (wp-\/>\mbox{\hyperlink{structg__bde__work_a7619c185f0faa0a4f16c362c8065b902}{bp}}-\/>bio\_cmd) \{}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00702}00702         \textcolor{keywordflow}{case} BIO\_READ:}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00703}00703                 wp-\/>\mbox{\hyperlink{structg__bde__work_ab479e99436eaef7b084e0de5b8efbacd}{sp}} = \mbox{\hyperlink{g__bde__work_8c_a741eba3afff4eccad7e34b141eb9c28c}{g\_bde\_new\_sector}}(wp, 0);}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00704}00704                 \textcolor{keywordflow}{if} (wp-\/>\mbox{\hyperlink{structg__bde__work_ab479e99436eaef7b084e0de5b8efbacd}{sp}} == NULL) \{}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00705}00705                         \mbox{\hyperlink{g__bde__work_8c_a857977d8e7eb06d1070f05df1d338ff5}{g\_bde\_work\_done}}(wp, ENOMEM);}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00706}00706                         \textcolor{keywordflow}{return};}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00707}00707                 \}}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00708}00708                 wp-\/>\mbox{\hyperlink{structg__bde__work_ab479e99436eaef7b084e0de5b8efbacd}{sp}}-\/>\mbox{\hyperlink{structg__bde__sector_abcab68e7b7f896b4b9c47ce35321a003}{size}} = wp-\/>\mbox{\hyperlink{structg__bde__work_a9f7d343383548b89da65779a624142d1}{length}};}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00709}00709                 wp-\/>\mbox{\hyperlink{structg__bde__work_ab479e99436eaef7b084e0de5b8efbacd}{sp}}-\/>\mbox{\hyperlink{structg__bde__sector_ab14f76aa177a3dbb8e2dff0dc721cf2a}{data}} = wp-\/>\mbox{\hyperlink{structg__bde__work_a6feacf929bb3b01d0a28013504de8d8a}{data}};}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00710}00710                 \textcolor{keywordflow}{if} (\mbox{\hyperlink{g__bde__work_8c_acfb8c9c1bce545ce4c9a9e93fd4f09a7}{g\_bde\_start\_read}}(wp-\/>\mbox{\hyperlink{structg__bde__work_ab479e99436eaef7b084e0de5b8efbacd}{sp}}) != 0) \{}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00711}00711                         \mbox{\hyperlink{g__bde__work_8c_a857977d8e7eb06d1070f05df1d338ff5}{g\_bde\_work\_done}}(wp, ENOMEM);}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00712}00712                         \textcolor{keywordflow}{return};}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00713}00713                 \}}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00714}00714                 \mbox{\hyperlink{g__bde__work_8c_aeb34377fc3821261ca8c6236820424c2}{g\_bde\_read\_keysector}}(sc, wp);}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00715}00715                 \textcolor{keywordflow}{if} (wp-\/>\mbox{\hyperlink{structg__bde__work_a24857e16bf46ac3c536872760b0e6986}{ksp}} == NULL)}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00716}00716                         wp-\/>\mbox{\hyperlink{structg__bde__work_aa31308ed7d14f7b5a7ad6596f103baf2}{error}} = ENOMEM;}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00717}00717                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00718}00718         \textcolor{keywordflow}{case} BIO\_DELETE:}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00719}00719                 wp-\/>\mbox{\hyperlink{structg__bde__work_ab479e99436eaef7b084e0de5b8efbacd}{sp}} = \mbox{\hyperlink{g__bde__work_8c_a741eba3afff4eccad7e34b141eb9c28c}{g\_bde\_new\_sector}}(wp, wp-\/>\mbox{\hyperlink{structg__bde__work_a9f7d343383548b89da65779a624142d1}{length}});}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00720}00720                 \textcolor{keywordflow}{if} (wp-\/>\mbox{\hyperlink{structg__bde__work_ab479e99436eaef7b084e0de5b8efbacd}{sp}} == NULL) \{}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00721}00721                         \mbox{\hyperlink{g__bde__work_8c_a857977d8e7eb06d1070f05df1d338ff5}{g\_bde\_work\_done}}(wp, ENOMEM);}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00722}00722                         \textcolor{keywordflow}{return};}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00723}00723                 \}}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00724}00724                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00725}00725         \textcolor{keywordflow}{case} BIO\_WRITE:}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00726}00726                 wp-\/>\mbox{\hyperlink{structg__bde__work_ab479e99436eaef7b084e0de5b8efbacd}{sp}} = \mbox{\hyperlink{g__bde__work_8c_a741eba3afff4eccad7e34b141eb9c28c}{g\_bde\_new\_sector}}(wp, wp-\/>\mbox{\hyperlink{structg__bde__work_a9f7d343383548b89da65779a624142d1}{length}});}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00727}00727                 \textcolor{keywordflow}{if} (wp-\/>\mbox{\hyperlink{structg__bde__work_ab479e99436eaef7b084e0de5b8efbacd}{sp}} == NULL) \{}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00728}00728                         \mbox{\hyperlink{g__bde__work_8c_a857977d8e7eb06d1070f05df1d338ff5}{g\_bde\_work\_done}}(wp, ENOMEM);}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00729}00729                         \textcolor{keywordflow}{return};}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00730}00730                 \}}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00731}00731                 \mbox{\hyperlink{g__bde__work_8c_aeb34377fc3821261ca8c6236820424c2}{g\_bde\_read\_keysector}}(sc, wp);}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00732}00732                 \textcolor{keywordflow}{if} (wp-\/>\mbox{\hyperlink{structg__bde__work_a24857e16bf46ac3c536872760b0e6986}{ksp}} == NULL) \{}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00733}00733                         \mbox{\hyperlink{g__bde__work_8c_a857977d8e7eb06d1070f05df1d338ff5}{g\_bde\_work\_done}}(wp, ENOMEM);}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00734}00734                         \textcolor{keywordflow}{return};}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00735}00735                 \}}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00736}00736                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00737}00737         \textcolor{keywordflow}{default}:}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00738}00738                 KASSERT(0 == 1, }
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00739}00739                     (\textcolor{stringliteral}{"{}Wrong bio\_cmd \%d in g\_bde\_start2"{}}, wp-\/>\mbox{\hyperlink{structg__bde__work_a7619c185f0faa0a4f16c362c8065b902}{bp}}-\/>bio\_cmd));}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00740}00740         \}}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00741}00741 }
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00742}00742         wp-\/>\mbox{\hyperlink{structg__bde__work_a49d926d67df62d56e5b510d58a76edab}{state}} = WAIT;}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00743}00743         wakeup(sc);}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00744}00744 \}}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00745}00745 }
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00746}00746 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00747}00747 \textcolor{comment}{ * Create a sequence of work structures, and have g\_bde\_map\_sector() determine}}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00748}00748 \textcolor{comment}{ * how long they each can be.  Feed them to g\_bde\_start2().}}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00749}00749 \textcolor{comment}{ */}}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00750}00750 }
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00751}00751 \textcolor{keywordtype}{void}}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00752}\mbox{\hyperlink{g__bde_8h_afa8a48bd707806368e19c97a59f12718}{00752}} \mbox{\hyperlink{g__bde__work_8c_afa8a48bd707806368e19c97a59f12718}{g\_bde\_start1}}(\textcolor{keyword}{struct} bio *\mbox{\hyperlink{g__part__if_8m_a3786db8db96c32f69df9f7cd325a7507}{bp}})}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00753}00753 \{}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00754}00754         \textcolor{keyword}{struct }\mbox{\hyperlink{structg__bde__softc}{g\_bde\_softc}} *sc;}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00755}00755         \textcolor{keyword}{struct }\mbox{\hyperlink{structg__bde__work}{g\_bde\_work}} *wp;}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00756}00756         off\_t done;}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00757}00757 }
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00758}00758         sc = \mbox{\hyperlink{g__part__if_8m_a3786db8db96c32f69df9f7cd325a7507}{bp}}-\/>bio\_to-\/>geom-\/>softc;}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00759}00759         \mbox{\hyperlink{g__part__if_8m_a3786db8db96c32f69df9f7cd325a7507}{bp}}-\/>bio\_driver1 = sc;}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00760}00760 }
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00761}00761         mtx\_lock(\&sc-\/>\mbox{\hyperlink{structg__bde__softc_a7a9fcb7e0a97a3af4186b18ca2db9daa}{worklist\_mutex}});}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00762}00762         \textcolor{keywordflow}{for}(done = 0; done < \mbox{\hyperlink{g__part__if_8m_a3786db8db96c32f69df9f7cd325a7507}{bp}}-\/>bio\_length; ) \{}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00763}00763                 wp = \mbox{\hyperlink{g__bde__work_8c_a79935159acf0636cad7b991c979d9b09}{g\_bde\_new\_work}}(sc);}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00764}00764                 \textcolor{keywordflow}{if} (wp != NULL) \{}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00765}00765                         wp-\/>\mbox{\hyperlink{structg__bde__work_a7619c185f0faa0a4f16c362c8065b902}{bp}} = \mbox{\hyperlink{g__part__if_8m_a3786db8db96c32f69df9f7cd325a7507}{bp}};}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00766}00766                         wp-\/>\mbox{\hyperlink{structg__bde__work_a3e62b5e2255f2d340b3f661458d05ad8}{offset}} = \mbox{\hyperlink{g__part__if_8m_a3786db8db96c32f69df9f7cd325a7507}{bp}}-\/>bio\_offset + done;}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00767}00767                         wp-\/>\mbox{\hyperlink{structg__bde__work_a6feacf929bb3b01d0a28013504de8d8a}{data}} = \mbox{\hyperlink{g__part__if_8m_a3786db8db96c32f69df9f7cd325a7507}{bp}}-\/>bio\_data + done;}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00768}00768                         wp-\/>\mbox{\hyperlink{structg__bde__work_a9f7d343383548b89da65779a624142d1}{length}} = \mbox{\hyperlink{g__part__if_8m_a3786db8db96c32f69df9f7cd325a7507}{bp}}-\/>bio\_length -\/ done;}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00769}00769                         \mbox{\hyperlink{g__bde_8h_ac2890ae097fa50be721493bdd8d5b3d7}{g\_bde\_map\_sector}}(wp);}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00770}00770                         done += wp-\/>\mbox{\hyperlink{structg__bde__work_a9f7d343383548b89da65779a624142d1}{length}};}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00771}00771                         \mbox{\hyperlink{g__bde__work_8c_ab5982e416b4ecfae96925e72a3644ece}{g\_bde\_start2}}(wp);}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00772}00772                 \}}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00773}00773                 \textcolor{keywordflow}{if} (wp == NULL || \mbox{\hyperlink{g__part__if_8m_a3786db8db96c32f69df9f7cd325a7507}{bp}}-\/>bio\_error != 0) \{}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00774}00774                         \mbox{\hyperlink{g__bde__work_8c_abcab7b3954e6536e589c05db715e805c}{g\_bde\_contribute}}(\mbox{\hyperlink{g__part__if_8m_a3786db8db96c32f69df9f7cd325a7507}{bp}}, \mbox{\hyperlink{g__part__if_8m_a3786db8db96c32f69df9f7cd325a7507}{bp}}-\/>bio\_length -\/ done, ENOMEM);}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00775}00775                         \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00776}00776                 \}}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00777}00777         \}}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00778}00778         mtx\_unlock(\&sc-\/>\mbox{\hyperlink{structg__bde__softc_a7a9fcb7e0a97a3af4186b18ca2db9daa}{worklist\_mutex}});}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00779}00779         \textcolor{keywordflow}{return};}
\DoxyCodeLine{\Hypertarget{g__bde__work_8c_source_l00780}00780 \}}

\end{DoxyCode}
