\hypertarget{tr__raid1_8c_source}{}\doxysection{tr\+\_\+raid1.\+c}
\label{tr__raid1_8c_source}\index{geom/raid/tr\_raid1.c@{geom/raid/tr\_raid1.c}}
\mbox{\hyperlink{tr__raid1_8c}{Go to the documentation of this file.}}
\begin{DoxyCode}{0}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00001}00001 \textcolor{comment}{/*-\/}}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00002}00002 \textcolor{comment}{ * SPDX-\/License-\/Identifier: BSD-\/2-\/Clause-\/FreeBSD}}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00003}00003 \textcolor{comment}{ *}}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00004}00004 \textcolor{comment}{ * Copyright (c) 2010 Alexander Motin <mav@FreeBSD.org>}}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00005}00005 \textcolor{comment}{ * All rights reserved.}}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00006}00006 \textcolor{comment}{ *}}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00007}00007 \textcolor{comment}{ * Redistribution and use in source and binary forms, with or without}}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00008}00008 \textcolor{comment}{ * modification, are permitted provided that the following conditions}}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00009}00009 \textcolor{comment}{ * are met:}}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00010}00010 \textcolor{comment}{ * 1. Redistributions of source code must retain the above copyright}}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00011}00011 \textcolor{comment}{ *    notice, this list of conditions and the following disclaimer.}}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00012}00012 \textcolor{comment}{ * 2. Redistributions in binary form must reproduce the above copyright}}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00013}00013 \textcolor{comment}{ *    notice, this list of conditions and the following disclaimer in the}}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00014}00014 \textcolor{comment}{ *    documentation and/or other materials provided with the distribution.}}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00015}00015 \textcolor{comment}{ *}}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00016}00016 \textcolor{comment}{ * THIS SOFTWARE IS PROVIDED BY THE AUTHORS AND CONTRIBUTORS ``AS IS'' AND}}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00017}00017 \textcolor{comment}{ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE}}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00018}00018 \textcolor{comment}{ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE}}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00019}00019 \textcolor{comment}{ * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHORS OR CONTRIBUTORS BE LIABLE}}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00020}00020 \textcolor{comment}{ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL}}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00021}00021 \textcolor{comment}{ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS}}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00022}00022 \textcolor{comment}{ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)}}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00023}00023 \textcolor{comment}{ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT}}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00024}00024 \textcolor{comment}{ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY}}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00025}00025 \textcolor{comment}{ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF}}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00026}00026 \textcolor{comment}{ * SUCH DAMAGE.}}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00027}00027 \textcolor{comment}{ */}}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00028}00028 }
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00029}00029 \textcolor{preprocessor}{\#include <sys/cdefs.h>}}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00030}\mbox{\hyperlink{tr__raid1_8c_a8c3ef283470a68cd30afe9b8a72cb60f}{00030}} \mbox{\hyperlink{tr__raid1_8c_a8c3ef283470a68cd30afe9b8a72cb60f}{\_\_FBSDID}}(\textcolor{stringliteral}{"{}\$FreeBSD\$"{}});}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00031}00031 }
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00032}00032 \textcolor{preprocessor}{\#include <sys/param.h>}}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00033}00033 \textcolor{preprocessor}{\#include <sys/bio.h>}}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00034}00034 \textcolor{preprocessor}{\#include <sys/endian.h>}}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00035}00035 \textcolor{preprocessor}{\#include <sys/kernel.h>}}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00036}00036 \textcolor{preprocessor}{\#include <sys/kobj.h>}}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00037}00037 \textcolor{preprocessor}{\#include <sys/limits.h>}}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00038}00038 \textcolor{preprocessor}{\#include <sys/lock.h>}}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00039}00039 \textcolor{preprocessor}{\#include <sys/malloc.h>}}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00040}00040 \textcolor{preprocessor}{\#include <sys/mutex.h>}}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00041}00041 \textcolor{preprocessor}{\#include <sys/sysctl.h>}}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00042}00042 \textcolor{preprocessor}{\#include <sys/systm.h>}}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00043}00043 \textcolor{preprocessor}{\#include <\mbox{\hyperlink{geom_8h}{geom/geom.h}}>}}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00044}00044 \textcolor{preprocessor}{\#include <\mbox{\hyperlink{geom__dbg_8h}{geom/geom\_dbg.h}}>}}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00045}00045 \textcolor{preprocessor}{\#include "{}\mbox{\hyperlink{g__raid_8h}{geom/raid/g\_raid.h}}"{}}}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00046}00046 \textcolor{preprocessor}{\#include "{}g\_raid\_tr\_if.h"{}}}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00047}00047 }
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00048}\mbox{\hyperlink{tr__raid1_8c_a97e6da5efec2b06353b3bdfd6a8b3705}{00048}} \mbox{\hyperlink{tr__raid1_8c_a97e6da5efec2b06353b3bdfd6a8b3705}{SYSCTL\_DECL}}(\_kern\_geom\_raid\_raid1);}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00049}00049 }
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00050}\mbox{\hyperlink{tr__raid1_8c_aaa090dda99b70c745065fdc1ad5f3a92}{00050}} \textcolor{preprocessor}{\#define RAID1\_REBUILD\_SLAB      (1 << 20) }\textcolor{comment}{/* One transation in a rebuild */}\textcolor{preprocessor}{}}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00051}\mbox{\hyperlink{tr__raid1_8c_a86f903929c5664af1b6ae013045741b2}{00051}} \textcolor{keyword}{static} \textcolor{keywordtype}{int} \mbox{\hyperlink{tr__raid1_8c_a86f903929c5664af1b6ae013045741b2}{g\_raid1\_rebuild\_slab}} = \mbox{\hyperlink{tr__raid1_8c_aaa090dda99b70c745065fdc1ad5f3a92}{RAID1\_REBUILD\_SLAB}};}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00052}\mbox{\hyperlink{tr__raid1_8c_a186ae2dc315712715ddc8d65aaece127}{00052}} \mbox{\hyperlink{tr__raid1_8c_a186ae2dc315712715ddc8d65aaece127}{SYSCTL\_UINT}}(\_kern\_geom\_raid\_raid1, OID\_AUTO, rebuild\_slab\_size, CTLFLAG\_RWTUN,}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00053}00053     \&\mbox{\hyperlink{tr__raid1_8c_a86f903929c5664af1b6ae013045741b2}{g\_raid1\_rebuild\_slab}}, 0,}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00054}00054     \textcolor{stringliteral}{"{}Amount of the disk to rebuild each read/write cycle of the rebuild."{}});}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00055}00055 }
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00056}\mbox{\hyperlink{tr__raid1_8c_ad55ed864691022783193da9187ff2e6b}{00056}} \textcolor{preprocessor}{\#define RAID1\_REBUILD\_FAIR\_IO 20 }\textcolor{comment}{/* use 1/x of the available I/O */}\textcolor{preprocessor}{}}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00057}\mbox{\hyperlink{tr__raid1_8c_a9d7427e22ecf16b0472d862199d0635a}{00057}} \textcolor{keyword}{static} \textcolor{keywordtype}{int} \mbox{\hyperlink{tr__raid1_8c_a9d7427e22ecf16b0472d862199d0635a}{g\_raid1\_rebuild\_fair\_io}} = \mbox{\hyperlink{tr__raid1_8c_ad55ed864691022783193da9187ff2e6b}{RAID1\_REBUILD\_FAIR\_IO}};}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00058}\mbox{\hyperlink{tr__raid1_8c_abb95b3ebd3d2389025ff95e036c43f8d}{00058}} \mbox{\hyperlink{tr__raid1_8c_a186ae2dc315712715ddc8d65aaece127}{SYSCTL\_UINT}}(\_kern\_geom\_raid\_raid1, OID\_AUTO, rebuild\_fair\_io, CTLFLAG\_RWTUN,}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00059}00059     \&\mbox{\hyperlink{tr__raid1_8c_a9d7427e22ecf16b0472d862199d0635a}{g\_raid1\_rebuild\_fair\_io}}, 0,}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00060}00060     \textcolor{stringliteral}{"{}Fraction of the I/O bandwidth to use when disk busy for rebuild."{}});}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00061}00061 }
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00062}\mbox{\hyperlink{tr__raid1_8c_a00986ff356704282664bd192289d0db8}{00062}} \textcolor{preprocessor}{\#define RAID1\_REBUILD\_CLUSTER\_IDLE 100}}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00063}\mbox{\hyperlink{tr__raid1_8c_a54613be8c64ce8b7ba6f758fc2b48751}{00063}} \textcolor{keyword}{static} \textcolor{keywordtype}{int} \mbox{\hyperlink{tr__raid1_8c_a54613be8c64ce8b7ba6f758fc2b48751}{g\_raid1\_rebuild\_cluster\_idle}} = \mbox{\hyperlink{tr__raid1_8c_a00986ff356704282664bd192289d0db8}{RAID1\_REBUILD\_CLUSTER\_IDLE}};}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00064}\mbox{\hyperlink{tr__raid1_8c_a767b7b4572bc14bbcff9a3a5cfe5f758}{00064}} \mbox{\hyperlink{tr__raid1_8c_a186ae2dc315712715ddc8d65aaece127}{SYSCTL\_UINT}}(\_kern\_geom\_raid\_raid1, OID\_AUTO, rebuild\_cluster\_idle, CTLFLAG\_RWTUN,}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00065}00065     \&\mbox{\hyperlink{tr__raid1_8c_a54613be8c64ce8b7ba6f758fc2b48751}{g\_raid1\_rebuild\_cluster\_idle}}, 0,}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00066}00066     \textcolor{stringliteral}{"{}Number of slabs to do each time we trigger a rebuild cycle"{}});}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00067}00067 }
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00068}\mbox{\hyperlink{tr__raid1_8c_adbd6a47715551de16674f87eee88f7e4}{00068}} \textcolor{preprocessor}{\#define RAID1\_REBUILD\_META\_UPDATE 1024 }\textcolor{comment}{/* update meta data every 1GB or so */}\textcolor{preprocessor}{}}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00069}\mbox{\hyperlink{tr__raid1_8c_ade086c9ab8b71a57c696d08bbf667e76}{00069}} \textcolor{keyword}{static} \textcolor{keywordtype}{int} \mbox{\hyperlink{tr__raid1_8c_ade086c9ab8b71a57c696d08bbf667e76}{g\_raid1\_rebuild\_meta\_update}} = \mbox{\hyperlink{tr__raid1_8c_adbd6a47715551de16674f87eee88f7e4}{RAID1\_REBUILD\_META\_UPDATE}};}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00070}\mbox{\hyperlink{tr__raid1_8c_a0c311a21c652a7adb22aee612c6a27c4}{00070}} \mbox{\hyperlink{tr__raid1_8c_a186ae2dc315712715ddc8d65aaece127}{SYSCTL\_UINT}}(\_kern\_geom\_raid\_raid1, OID\_AUTO, rebuild\_meta\_update, CTLFLAG\_RWTUN,}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00071}00071     \&\mbox{\hyperlink{tr__raid1_8c_ade086c9ab8b71a57c696d08bbf667e76}{g\_raid1\_rebuild\_meta\_update}}, 0,}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00072}00072     \textcolor{stringliteral}{"{}When to update the meta data."{}});}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00073}00073 }
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00074}\mbox{\hyperlink{tr__raid1_8c_a5208bf1aa83239dcea113391e3b76916}{00074}} \textcolor{keyword}{static} \mbox{\hyperlink{tr__raid1_8c_a5208bf1aa83239dcea113391e3b76916}{MALLOC\_DEFINE}}(M\_TR\_RAID1, \textcolor{stringliteral}{"{}tr\_raid1\_data"{}}, \textcolor{stringliteral}{"{}GEOM\_RAID RAID1 data"{}});}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00075}00075 }
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00076}\mbox{\hyperlink{tr__raid1_8c_a050a155c9f74475d03ceb03b682d3952}{00076}} \textcolor{preprocessor}{\#define TR\_RAID1\_NONE 0}}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00077}\mbox{\hyperlink{tr__raid1_8c_a54d21ddc205a11a78c293b3e645b7f05}{00077}} \textcolor{preprocessor}{\#define TR\_RAID1\_REBUILD 1}}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00078}\mbox{\hyperlink{tr__raid1_8c_afc7f212ac70fbd4db051b75683420e02}{00078}} \textcolor{preprocessor}{\#define TR\_RAID1\_RESYNC 2}}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00079}00079 }
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00080}\mbox{\hyperlink{tr__raid1_8c_ae7c890e5907e23f75d7c6f366e427029}{00080}} \textcolor{preprocessor}{\#define TR\_RAID1\_F\_DOING\_SOME   0x1}}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00081}\mbox{\hyperlink{tr__raid1_8c_a9b20c9954212913093ab1b67c7ce026c}{00081}} \textcolor{preprocessor}{\#define TR\_RAID1\_F\_LOCKED       0x2}}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00082}\mbox{\hyperlink{tr__raid1_8c_ac8df5babf9a8e344ed5ffee26ebe7925}{00082}} \textcolor{preprocessor}{\#define TR\_RAID1\_F\_ABORT        0x4}}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00083}00083 }
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00084}\mbox{\hyperlink{structg__raid__tr__raid1__object}{00084}} \textcolor{keyword}{struct }\mbox{\hyperlink{structg__raid__tr__raid1__object}{g\_raid\_tr\_raid1\_object}} \{}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00085}\mbox{\hyperlink{structg__raid__tr__raid1__object_ac86cded4dc99e5282b7b6061ffe4cee6}{00085}}         \textcolor{keyword}{struct }\mbox{\hyperlink{structg__raid__tr__object}{g\_raid\_tr\_object}}  \mbox{\hyperlink{structg__raid__tr__raid1__object_ac86cded4dc99e5282b7b6061ffe4cee6}{trso\_base}};}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00086}\mbox{\hyperlink{structg__raid__tr__raid1__object_afa5c356bf55fc7ec7d502816dd3a8d63}{00086}}         \textcolor{keywordtype}{int}                      \mbox{\hyperlink{structg__raid__tr__raid1__object_afa5c356bf55fc7ec7d502816dd3a8d63}{trso\_starting}};}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00087}\mbox{\hyperlink{structg__raid__tr__raid1__object_a9cc5c15ab1d890783628073d7c58e693}{00087}}         \textcolor{keywordtype}{int}                      \mbox{\hyperlink{structg__raid__tr__raid1__object_a9cc5c15ab1d890783628073d7c58e693}{trso\_stopping}};}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00088}\mbox{\hyperlink{structg__raid__tr__raid1__object_ab4ed4109230e65364f77539ecf0d52f1}{00088}}         \textcolor{keywordtype}{int}                      \mbox{\hyperlink{structg__raid__tr__raid1__object_ab4ed4109230e65364f77539ecf0d52f1}{trso\_type}};}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00089}\mbox{\hyperlink{structg__raid__tr__raid1__object_a48c83778a4f4b189859229644ab92595}{00089}}         \textcolor{keywordtype}{int}                      \mbox{\hyperlink{structg__raid__tr__raid1__object_a48c83778a4f4b189859229644ab92595}{trso\_recover\_slabs}}; \textcolor{comment}{/* slabs before rest */}}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00090}\mbox{\hyperlink{structg__raid__tr__raid1__object_ab7e8381e99a88e622f8189358dbd106c}{00090}}         \textcolor{keywordtype}{int}                      \mbox{\hyperlink{structg__raid__tr__raid1__object_ab7e8381e99a88e622f8189358dbd106c}{trso\_fair\_io}};}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00091}\mbox{\hyperlink{structg__raid__tr__raid1__object_a3fcc84b5e1a2d2784ecd9eae6f30f7b4}{00091}}         \textcolor{keywordtype}{int}                      \mbox{\hyperlink{structg__raid__tr__raid1__object_a3fcc84b5e1a2d2784ecd9eae6f30f7b4}{trso\_meta\_update}};}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00092}\mbox{\hyperlink{structg__raid__tr__raid1__object_aa2a5e604edc54ebe3bc48693696f2f7d}{00092}}         \textcolor{keywordtype}{int}                      \mbox{\hyperlink{structg__raid__tr__raid1__object_aa2a5e604edc54ebe3bc48693696f2f7d}{trso\_flags}};}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00093}\mbox{\hyperlink{structg__raid__tr__raid1__object_a71f6f7e36e0c38408ea4d55363d852d9}{00093}}         \textcolor{keyword}{struct }\mbox{\hyperlink{structg__raid__subdisk}{g\_raid\_subdisk}}     *\mbox{\hyperlink{structg__raid__tr__raid1__object_a71f6f7e36e0c38408ea4d55363d852d9}{trso\_failed\_sd}}; \textcolor{comment}{/* like per volume */}}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00094}\mbox{\hyperlink{structg__raid__tr__raid1__object_a3402e3582abac26880ca0512b675302a}{00094}}         \textcolor{keywordtype}{void}                    *\mbox{\hyperlink{structg__raid__tr__raid1__object_a3402e3582abac26880ca0512b675302a}{trso\_buffer}};         \textcolor{comment}{/* Buffer space */}}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00095}\mbox{\hyperlink{structg__raid__tr__raid1__object_a5f4684dab63b091d94cc5e2c587d638a}{00095}}         \textcolor{keyword}{struct }bio               \mbox{\hyperlink{structg__raid__tr__raid1__object_a5f4684dab63b091d94cc5e2c587d638a}{trso\_bio}};}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00096}00096 \};}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00097}00097 }
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00098}\mbox{\hyperlink{tr__raid1_8c_a1cc14bb0871bc15642cdd13d67be438b}{00098}} \textcolor{keyword}{static} g\_raid\_tr\_taste\_t \mbox{\hyperlink{tr__raid1_8c_a1cc14bb0871bc15642cdd13d67be438b}{g\_raid\_tr\_taste\_raid1}};}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00099}\mbox{\hyperlink{tr__raid1_8c_aa1f59b2dc7f2cba2f3f6e7a703c46632}{00099}} \textcolor{keyword}{static} g\_raid\_tr\_event\_t \mbox{\hyperlink{tr__raid1_8c_aa1f59b2dc7f2cba2f3f6e7a703c46632}{g\_raid\_tr\_event\_raid1}};}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00100}\mbox{\hyperlink{tr__raid1_8c_ab2ff58010880990c459a5a9f29ff52be}{00100}} \textcolor{keyword}{static} g\_raid\_tr\_start\_t \mbox{\hyperlink{tr__raid1_8c_ab2ff58010880990c459a5a9f29ff52be}{g\_raid\_tr\_start\_raid1}};}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00101}\mbox{\hyperlink{tr__raid1_8c_ab1b7ad3dd42ed66ebaf84e3cf522e417}{00101}} \textcolor{keyword}{static} g\_raid\_tr\_stop\_t \mbox{\hyperlink{tr__raid1_8c_ab1b7ad3dd42ed66ebaf84e3cf522e417}{g\_raid\_tr\_stop\_raid1}};}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00102}\mbox{\hyperlink{tr__raid1_8c_af942a22457c9e994bfac3a56a078dc58}{00102}} \textcolor{keyword}{static} g\_raid\_tr\_iostart\_t \mbox{\hyperlink{tr__raid1_8c_af942a22457c9e994bfac3a56a078dc58}{g\_raid\_tr\_iostart\_raid1}};}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00103}\mbox{\hyperlink{tr__raid1_8c_a5ec0fd61e63978a0fe3fb64a01f9ff62}{00103}} \textcolor{keyword}{static} g\_raid\_tr\_iodone\_t \mbox{\hyperlink{tr__raid1_8c_a5ec0fd61e63978a0fe3fb64a01f9ff62}{g\_raid\_tr\_iodone\_raid1}};}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00104}\mbox{\hyperlink{tr__raid1_8c_a584463c83ec8f895126f805aeac26b9e}{00104}} \textcolor{keyword}{static} g\_raid\_tr\_kerneldump\_t \mbox{\hyperlink{tr__raid1_8c_a584463c83ec8f895126f805aeac26b9e}{g\_raid\_tr\_kerneldump\_raid1}};}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00105}\mbox{\hyperlink{tr__raid1_8c_a0e06430791d3005ed236461a6b2c506b}{00105}} \textcolor{keyword}{static} g\_raid\_tr\_locked\_t \mbox{\hyperlink{tr__raid1_8c_a0e06430791d3005ed236461a6b2c506b}{g\_raid\_tr\_locked\_raid1}};}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00106}\mbox{\hyperlink{tr__raid1_8c_a575b4893daa165117ae8f7be5c4f7799}{00106}} \textcolor{keyword}{static} g\_raid\_tr\_idle\_t \mbox{\hyperlink{tr__raid1_8c_a575b4893daa165117ae8f7be5c4f7799}{g\_raid\_tr\_idle\_raid1}};}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00107}\mbox{\hyperlink{tr__raid1_8c_a22187984729c5b41252f159e8fcac79e}{00107}} \textcolor{keyword}{static} g\_raid\_tr\_free\_t \mbox{\hyperlink{tr__raid1_8c_a22187984729c5b41252f159e8fcac79e}{g\_raid\_tr\_free\_raid1}};}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00108}00108 }
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00109}\mbox{\hyperlink{tr__raid1_8c_aa5eee593b40b00505656493156404402}{00109}} \textcolor{keyword}{static} kobj\_method\_t \mbox{\hyperlink{tr__raid1_8c_aa5eee593b40b00505656493156404402}{g\_raid\_tr\_raid1\_methods}}[] = \{}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00110}00110         KOBJMETHOD(g\_raid\_tr\_taste,     \mbox{\hyperlink{tr__raid1_8c_a1cc14bb0871bc15642cdd13d67be438b}{g\_raid\_tr\_taste\_raid1}}),}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00111}00111         KOBJMETHOD(g\_raid\_tr\_event,     \mbox{\hyperlink{tr__raid1_8c_aa1f59b2dc7f2cba2f3f6e7a703c46632}{g\_raid\_tr\_event\_raid1}}),}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00112}00112         KOBJMETHOD(g\_raid\_tr\_start,     \mbox{\hyperlink{tr__raid1_8c_ab2ff58010880990c459a5a9f29ff52be}{g\_raid\_tr\_start\_raid1}}),}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00113}00113         KOBJMETHOD(g\_raid\_tr\_stop,      \mbox{\hyperlink{tr__raid1_8c_ab1b7ad3dd42ed66ebaf84e3cf522e417}{g\_raid\_tr\_stop\_raid1}}),}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00114}00114         KOBJMETHOD(g\_raid\_tr\_iostart,   \mbox{\hyperlink{tr__raid1_8c_af942a22457c9e994bfac3a56a078dc58}{g\_raid\_tr\_iostart\_raid1}}),}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00115}00115         KOBJMETHOD(g\_raid\_tr\_iodone,    \mbox{\hyperlink{tr__raid1_8c_a5ec0fd61e63978a0fe3fb64a01f9ff62}{g\_raid\_tr\_iodone\_raid1}}),}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00116}00116         KOBJMETHOD(g\_raid\_tr\_kerneldump, \mbox{\hyperlink{tr__raid1_8c_a584463c83ec8f895126f805aeac26b9e}{g\_raid\_tr\_kerneldump\_raid1}}),}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00117}00117         KOBJMETHOD(g\_raid\_tr\_locked,    \mbox{\hyperlink{tr__raid1_8c_a0e06430791d3005ed236461a6b2c506b}{g\_raid\_tr\_locked\_raid1}}),}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00118}00118         KOBJMETHOD(g\_raid\_tr\_idle,      \mbox{\hyperlink{tr__raid1_8c_a575b4893daa165117ae8f7be5c4f7799}{g\_raid\_tr\_idle\_raid1}}),}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00119}00119         KOBJMETHOD(g\_raid\_tr\_free,      \mbox{\hyperlink{tr__raid1_8c_a22187984729c5b41252f159e8fcac79e}{g\_raid\_tr\_free\_raid1}}),}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00120}00120         \{ 0, 0 \}}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00121}00121 \};}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00122}00122 }
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00123}\mbox{\hyperlink{tr__raid1_8c_a6fb55f585573facf77a6c1627d6255b0}{00123}} \textcolor{keyword}{static} \textcolor{keyword}{struct }\mbox{\hyperlink{structg__raid__tr__class}{g\_raid\_tr\_class}} \mbox{\hyperlink{tr__raid1_8c_a6fb55f585573facf77a6c1627d6255b0}{g\_raid\_tr\_raid1\_class}} = \{}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00124}00124         \textcolor{stringliteral}{"{}RAID1"{}},}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00125}00125         \mbox{\hyperlink{tr__raid1_8c_aa5eee593b40b00505656493156404402}{g\_raid\_tr\_raid1\_methods}},}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00126}00126         \textcolor{keyword}{sizeof}(\textcolor{keyword}{struct }\mbox{\hyperlink{structg__raid__tr__raid1__object}{g\_raid\_tr\_raid1\_object}}),}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00127}00127         .trc\_enable = 1,}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00128}00128         .trc\_priority = 100,}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00129}00129         .trc\_accept\_unmapped = 1}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00130}00130 \};}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00131}00131 }
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00132}00132 \textcolor{keyword}{static} \textcolor{keywordtype}{void} \mbox{\hyperlink{tr__raid1_8c_a1621e05a87c4426395942ed8c6644c4d}{g\_raid\_tr\_raid1\_rebuild\_abort}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structg__raid__tr__object}{g\_raid\_tr\_object}} *tr);}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00133}00133 \textcolor{keyword}{static} \textcolor{keywordtype}{void} \mbox{\hyperlink{tr__raid1_8c_aa7765f78771a40cf1ff8b5238a6aeac2}{g\_raid\_tr\_raid1\_maybe\_rebuild}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structg__raid__tr__object}{g\_raid\_tr\_object}} *tr,}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00134}00134     \textcolor{keyword}{struct} \mbox{\hyperlink{structg__raid__subdisk}{g\_raid\_subdisk}} *\mbox{\hyperlink{g__raid__md__if_8m_a910062273088d146e8533398780701eb}{sd}});}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00135}00135 }
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00136}00136 \textcolor{keyword}{static} \textcolor{keywordtype}{int}}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00137}\mbox{\hyperlink{tr__raid1_8c_a14a4884144e889e2d6e0d940dad0c693}{00137}} \mbox{\hyperlink{tr__raid1_8c_a1cc14bb0871bc15642cdd13d67be438b}{g\_raid\_tr\_taste\_raid1}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structg__raid__tr__object}{g\_raid\_tr\_object}} *tr, \textcolor{keyword}{struct} \mbox{\hyperlink{structg__raid__volume}{g\_raid\_volume}} *\mbox{\hyperlink{g__raid__md__if_8m_aaa46aabd2a891668d71cec64e90b4848}{vol}})}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00138}00138 \{}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00139}00139         \textcolor{keyword}{struct }\mbox{\hyperlink{structg__raid__tr__raid1__object}{g\_raid\_tr\_raid1\_object}} *trs;}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00140}00140 }
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00141}00141         trs = (\textcolor{keyword}{struct }\mbox{\hyperlink{structg__raid__tr__raid1__object}{g\_raid\_tr\_raid1\_object}} *)tr;}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00142}00142         \textcolor{keywordflow}{if} (tr-\/>\mbox{\hyperlink{structg__raid__tr__object_adda608cedccd305f267d8593f2bebe7f}{tro\_volume}}-\/>\mbox{\hyperlink{structg__raid__volume_ab7c2840f8398e5a91b560d7644957a57}{v\_raid\_level}} != \mbox{\hyperlink{g__raid_8h_a270bdf6b61fc7d810795e08ebbe60931}{G\_RAID\_VOLUME\_RL\_RAID1}} ||}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00143}00143             (tr-\/>\mbox{\hyperlink{structg__raid__tr__object_adda608cedccd305f267d8593f2bebe7f}{tro\_volume}}-\/>\mbox{\hyperlink{structg__raid__volume_ad17bb2da7eadd462f1f27551cb1da76f}{v\_raid\_level\_qualifier}} != \mbox{\hyperlink{g__raid_8h_a2e3f7fef03bb85894aa048b218b1243c}{G\_RAID\_VOLUME\_RLQ\_R1SM}} \&\&}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00144}00144              tr-\/>\mbox{\hyperlink{structg__raid__tr__object_adda608cedccd305f267d8593f2bebe7f}{tro\_volume}}-\/>\mbox{\hyperlink{structg__raid__volume_ad17bb2da7eadd462f1f27551cb1da76f}{v\_raid\_level\_qualifier}} != \mbox{\hyperlink{g__raid_8h_af718e7c961e8067baee4b69ec913cde4}{G\_RAID\_VOLUME\_RLQ\_R1MM}}))}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00145}00145                 \textcolor{keywordflow}{return} (\mbox{\hyperlink{g__raid__tr__if_8m_a6d6fd1743789570a3aab513506428e85}{G\_RAID\_TR\_TASTE\_FAIL}});}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00146}00146         trs-\/>\mbox{\hyperlink{structg__raid__tr__raid1__object_afa5c356bf55fc7ec7d502816dd3a8d63}{trso\_starting}} = 1;}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00147}00147         \textcolor{keywordflow}{return} (\mbox{\hyperlink{g__raid__tr__if_8m_a39400a4126bc301e1c305060bfb7c250}{G\_RAID\_TR\_TASTE\_SUCCEED}});}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00148}00148 \}}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00149}00149 }
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00150}00150 \textcolor{keyword}{static} \textcolor{keywordtype}{int}}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00151}\mbox{\hyperlink{tr__raid1_8c_a96eaf5ff88659e26da070d55ad183dd8}{00151}} \mbox{\hyperlink{tr__raid1_8c_a96eaf5ff88659e26da070d55ad183dd8}{g\_raid\_tr\_update\_state\_raid1}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structg__raid__volume}{g\_raid\_volume}} *\mbox{\hyperlink{g__raid__md__if_8m_aaa46aabd2a891668d71cec64e90b4848}{vol}},}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00152}00152     \textcolor{keyword}{struct} \mbox{\hyperlink{structg__raid__subdisk}{g\_raid\_subdisk}} *\mbox{\hyperlink{g__raid__md__if_8m_a910062273088d146e8533398780701eb}{sd}})}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00153}00153 \{}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00154}00154         \textcolor{keyword}{struct }\mbox{\hyperlink{structg__raid__tr__raid1__object}{g\_raid\_tr\_raid1\_object}} *trs;}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00155}00155         \textcolor{keyword}{struct }\mbox{\hyperlink{structg__raid__softc}{g\_raid\_softc}} *sc;}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00156}00156         \textcolor{keyword}{struct }\mbox{\hyperlink{structg__raid__subdisk}{g\_raid\_subdisk}} *tsd, *bestsd;}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00157}00157         u\_int s;}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00158}00158         \textcolor{keywordtype}{int} i, na, ns;}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00159}00159 }
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00160}00160         sc = \mbox{\hyperlink{g__raid__md__if_8m_aaa46aabd2a891668d71cec64e90b4848}{vol}}-\/>\mbox{\hyperlink{structg__raid__volume_a5ddf3eff3aa40bdcbbfedb4d0458b332}{v\_softc}};}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00161}00161         trs = (\textcolor{keyword}{struct }\mbox{\hyperlink{structg__raid__tr__raid1__object}{g\_raid\_tr\_raid1\_object}} *)\mbox{\hyperlink{g__raid__md__if_8m_aaa46aabd2a891668d71cec64e90b4848}{vol}}-\/>\mbox{\hyperlink{structg__raid__volume_a03bf7d238e7b0f9bf3fddadd21624039}{v\_tr}};}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00162}00162         if (trs-\/>\mbox{\hyperlink{structg__raid__tr__raid1__object_a9cc5c15ab1d890783628073d7c58e693}{trso\_stopping}} \&\&}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00163}00163             (trs-\/>\mbox{\hyperlink{structg__raid__tr__raid1__object_aa2a5e604edc54ebe3bc48693696f2f7d}{trso\_flags}} \& \mbox{\hyperlink{tr__raid1_8c_ae7c890e5907e23f75d7c6f366e427029}{TR\_RAID1\_F\_DOING\_SOME}}) == 0)}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00164}00164                 s = \mbox{\hyperlink{g__raid_8h_af54d408d323606c1f4fc52c10c6d89e1}{G\_RAID\_VOLUME\_S\_STOPPED}};}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00165}00165         \textcolor{keywordflow}{else} \textcolor{keywordflow}{if} (trs-\/>\mbox{\hyperlink{structg__raid__tr__raid1__object_afa5c356bf55fc7ec7d502816dd3a8d63}{trso\_starting}})}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00166}00166                 s = \mbox{\hyperlink{g__raid_8h_a0b0174c2570883e792d691bc22f9b8d4}{G\_RAID\_VOLUME\_S\_STARTING}};}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00167}00167         \textcolor{keywordflow}{else} \{}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00168}00168                 \textcolor{comment}{/* Make sure we have at least one ACTIVE disk. */}}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00169}00169                 na = \mbox{\hyperlink{g__raid_8c_ab8f738fdad1ea577cf8da5e1537f342c}{g\_raid\_nsubdisks}}(\mbox{\hyperlink{g__raid__md__if_8m_aaa46aabd2a891668d71cec64e90b4848}{vol}}, \mbox{\hyperlink{g__raid_8h_a498effa0ffa87b75f6c40381c6d4eb39}{G\_RAID\_SUBDISK\_S\_ACTIVE}});}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00170}00170                 \textcolor{keywordflow}{if} (na == 0) \{}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00171}00171                         \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00172}00172 \textcolor{comment}{                         * Critical situation! We have no any active disk!}}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00173}00173 \textcolor{comment}{                         * Choose the best disk we have to make it active.}}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00174}00174 \textcolor{comment}{                         */}}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00175}00175                         bestsd = \&\mbox{\hyperlink{g__raid__md__if_8m_aaa46aabd2a891668d71cec64e90b4848}{vol}}-\/>\mbox{\hyperlink{structg__raid__volume_a3c43185db4bd1c4818d95a415635854b}{v\_subdisks}}[0];}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00176}00176                         \textcolor{keywordflow}{for} (i = 1; i < \mbox{\hyperlink{g__raid__md__if_8m_aaa46aabd2a891668d71cec64e90b4848}{vol}}-\/>\mbox{\hyperlink{structg__raid__volume_a21482a5ac78a397faf4e95eb1ebef431}{v\_disks\_count}}; i++) \{}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00177}00177                                 tsd = \&\mbox{\hyperlink{g__raid__md__if_8m_aaa46aabd2a891668d71cec64e90b4848}{vol}}-\/>\mbox{\hyperlink{structg__raid__volume_a3c43185db4bd1c4818d95a415635854b}{v\_subdisks}}[i];}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00178}00178                                 \textcolor{keywordflow}{if} (tsd-\/>\mbox{\hyperlink{structg__raid__subdisk_acd19794916930f74ecad38ca7dd69f69}{sd\_state}} > bestsd-\/>\mbox{\hyperlink{structg__raid__subdisk_acd19794916930f74ecad38ca7dd69f69}{sd\_state}})}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00179}00179                                         bestsd = tsd;}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00180}00180                                 \textcolor{keywordflow}{else} \textcolor{keywordflow}{if} (tsd-\/>\mbox{\hyperlink{structg__raid__subdisk_acd19794916930f74ecad38ca7dd69f69}{sd\_state}} == bestsd-\/>\mbox{\hyperlink{structg__raid__subdisk_acd19794916930f74ecad38ca7dd69f69}{sd\_state}} \&\&}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00181}00181                                     (tsd-\/>\mbox{\hyperlink{structg__raid__subdisk_acd19794916930f74ecad38ca7dd69f69}{sd\_state}} == \mbox{\hyperlink{g__raid_8h_a856d6801d600e0089b0cd39ff5af7224}{G\_RAID\_SUBDISK\_S\_REBUILD}} ||}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00182}00182                                      tsd-\/>\mbox{\hyperlink{structg__raid__subdisk_acd19794916930f74ecad38ca7dd69f69}{sd\_state}} == \mbox{\hyperlink{g__raid_8h_a8c3d62bf4e551976a8941a23c8984e5d}{G\_RAID\_SUBDISK\_S\_RESYNC}}) \&\&}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00183}00183                                     tsd-\/>\mbox{\hyperlink{structg__raid__subdisk_aca58c7c621e10d2cbe97cd1c87214d7b}{sd\_rebuild\_pos}} > bestsd-\/>\mbox{\hyperlink{structg__raid__subdisk_aca58c7c621e10d2cbe97cd1c87214d7b}{sd\_rebuild\_pos}})}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00184}00184                                         bestsd = tsd;}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00185}00185                         \}}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00186}00186                         \textcolor{keywordflow}{if} (bestsd-\/>\mbox{\hyperlink{structg__raid__subdisk_acd19794916930f74ecad38ca7dd69f69}{sd\_state}} >= \mbox{\hyperlink{g__raid_8h_a13d824d436f40abb3ab52f0d96a79b62}{G\_RAID\_SUBDISK\_S\_UNINITIALIZED}}) \{}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00187}00187                                 \textcolor{comment}{/* We found reasonable candidate. */}}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00188}00188                                 \mbox{\hyperlink{g__raid_8h_ace7234f8197b96e1b636f9376de8d7ea}{G\_RAID\_DEBUG1}}(1, sc,}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00189}00189                                     \textcolor{stringliteral}{"{}Promote subdisk \%s:\%d from \%s to ACTIVE."{}},}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00190}00190                                     \mbox{\hyperlink{g__raid__md__if_8m_aaa46aabd2a891668d71cec64e90b4848}{vol}}-\/>\mbox{\hyperlink{structg__raid__volume_abdedb24b3ca3f4d3020f94e62d63fa05}{v\_name}}, bestsd-\/>\mbox{\hyperlink{structg__raid__subdisk_a415c982fbd2537861e39aa04fa582969}{sd\_pos}},}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00191}00191                                     \mbox{\hyperlink{g__raid_8c_a2851538590fe257cd3714dbf4d03320a}{g\_raid\_subdisk\_state2str}}(bestsd-\/>\mbox{\hyperlink{structg__raid__subdisk_acd19794916930f74ecad38ca7dd69f69}{sd\_state}}));}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00192}00192                                 \mbox{\hyperlink{g__raid_8c_a058db459d5349d2130fda3a02dd2af29}{g\_raid\_change\_subdisk\_state}}(bestsd,}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00193}00193                                     \mbox{\hyperlink{g__raid_8h_a498effa0ffa87b75f6c40381c6d4eb39}{G\_RAID\_SUBDISK\_S\_ACTIVE}});}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00194}00194                                 \mbox{\hyperlink{g__raid_8c_a9cf6273a366922dadcce1047df240cb5}{g\_raid\_write\_metadata}}(sc,}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00195}00195                                     \mbox{\hyperlink{g__raid__md__if_8m_aaa46aabd2a891668d71cec64e90b4848}{vol}}, bestsd, bestsd-\/>\mbox{\hyperlink{structg__raid__subdisk_a5570ab684f57213078d94750e63354e1}{sd\_disk}});}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00196}00196                         \}}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00197}00197                 \}}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00198}00198                 na = \mbox{\hyperlink{g__raid_8c_ab8f738fdad1ea577cf8da5e1537f342c}{g\_raid\_nsubdisks}}(\mbox{\hyperlink{g__raid__md__if_8m_aaa46aabd2a891668d71cec64e90b4848}{vol}}, \mbox{\hyperlink{g__raid_8h_a498effa0ffa87b75f6c40381c6d4eb39}{G\_RAID\_SUBDISK\_S\_ACTIVE}});}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00199}00199                 ns = \mbox{\hyperlink{g__raid_8c_ab8f738fdad1ea577cf8da5e1537f342c}{g\_raid\_nsubdisks}}(\mbox{\hyperlink{g__raid__md__if_8m_aaa46aabd2a891668d71cec64e90b4848}{vol}}, \mbox{\hyperlink{g__raid_8h_a41bff35bee21218d2aba7a261eb2e83c}{G\_RAID\_SUBDISK\_S\_STALE}}) +}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00200}00200                      \mbox{\hyperlink{g__raid_8c_ab8f738fdad1ea577cf8da5e1537f342c}{g\_raid\_nsubdisks}}(\mbox{\hyperlink{g__raid__md__if_8m_aaa46aabd2a891668d71cec64e90b4848}{vol}}, \mbox{\hyperlink{g__raid_8h_a8c3d62bf4e551976a8941a23c8984e5d}{G\_RAID\_SUBDISK\_S\_RESYNC}});}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00201}00201                 \textcolor{keywordflow}{if} (na == \mbox{\hyperlink{g__raid__md__if_8m_aaa46aabd2a891668d71cec64e90b4848}{vol}}-\/>\mbox{\hyperlink{structg__raid__volume_a21482a5ac78a397faf4e95eb1ebef431}{v\_disks\_count}})}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00202}00202                         s = \mbox{\hyperlink{g__raid_8h_a20afd300edb0e3cdbfb0386d2fbb36c3}{G\_RAID\_VOLUME\_S\_OPTIMAL}};}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00203}00203                 \textcolor{keywordflow}{else} \textcolor{keywordflow}{if} (na + ns == \mbox{\hyperlink{g__raid__md__if_8m_aaa46aabd2a891668d71cec64e90b4848}{vol}}-\/>\mbox{\hyperlink{structg__raid__volume_a21482a5ac78a397faf4e95eb1ebef431}{v\_disks\_count}})}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00204}00204                         s = \mbox{\hyperlink{g__raid_8h_a48e4e755439965447a7116e19309dd16}{G\_RAID\_VOLUME\_S\_SUBOPTIMAL}};}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00205}00205                 \textcolor{keywordflow}{else} \textcolor{keywordflow}{if} (na > 0)}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00206}00206                         s = \mbox{\hyperlink{g__raid_8h_a127fdd15d01e1ff21b274d56dabc3df5}{G\_RAID\_VOLUME\_S\_DEGRADED}};}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00207}00207                 \textcolor{keywordflow}{else}}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00208}00208                         s = \mbox{\hyperlink{g__raid_8h_a271c4821091e2a44a8a3412dde015fea}{G\_RAID\_VOLUME\_S\_BROKEN}};}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00209}00209                 \mbox{\hyperlink{tr__raid1_8c_aa7765f78771a40cf1ff8b5238a6aeac2}{g\_raid\_tr\_raid1\_maybe\_rebuild}}(\mbox{\hyperlink{g__raid__md__if_8m_aaa46aabd2a891668d71cec64e90b4848}{vol}}-\/>\mbox{\hyperlink{structg__raid__volume_a03bf7d238e7b0f9bf3fddadd21624039}{v\_tr}}, \mbox{\hyperlink{g__raid__md__if_8m_a910062273088d146e8533398780701eb}{sd}});}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00210}00210         \}}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00211}00211         \textcolor{keywordflow}{if} (s != \mbox{\hyperlink{g__raid__md__if_8m_aaa46aabd2a891668d71cec64e90b4848}{vol}}-\/>\mbox{\hyperlink{structg__raid__volume_a5a90d68c226a2ae59ff670759f9cad28}{v\_state}}) \{}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00212}00212                 \mbox{\hyperlink{g__raid_8c_ac49cc1991dccaeef0743e0bc4f64e0b5}{g\_raid\_event\_send}}(\mbox{\hyperlink{g__raid__md__if_8m_aaa46aabd2a891668d71cec64e90b4848}{vol}}, \mbox{\hyperlink{g__raid_8h_ac01262dc2989e4e4e0a5a1521809f5b3}{G\_RAID\_VOLUME\_S\_ALIVE}}(s) ?}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00213}00213                     \mbox{\hyperlink{g__raid_8h_ac4efcccfb7b2b1505ea4a458213ca844}{G\_RAID\_VOLUME\_E\_UP}} : \mbox{\hyperlink{g__raid_8h_a6d2e441dd210a0f2e4f9714400f2bab8}{G\_RAID\_VOLUME\_E\_DOWN}},}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00214}00214                     \mbox{\hyperlink{g__raid_8h_aa6f84af705b9b366dcb0e4aabd807667}{G\_RAID\_EVENT\_VOLUME}});}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00215}00215                 \mbox{\hyperlink{g__raid_8c_aefc2d93d4b02523eea4c62e99988ee67}{g\_raid\_change\_volume\_state}}(\mbox{\hyperlink{g__raid__md__if_8m_aaa46aabd2a891668d71cec64e90b4848}{vol}}, s);}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00216}00216                 \textcolor{keywordflow}{if} (!trs-\/>\mbox{\hyperlink{structg__raid__tr__raid1__object_afa5c356bf55fc7ec7d502816dd3a8d63}{trso\_starting}} \&\& !trs-\/>\mbox{\hyperlink{structg__raid__tr__raid1__object_a9cc5c15ab1d890783628073d7c58e693}{trso\_stopping}})}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00217}00217                         \mbox{\hyperlink{g__raid_8c_a9cf6273a366922dadcce1047df240cb5}{g\_raid\_write\_metadata}}(sc, \mbox{\hyperlink{g__raid__md__if_8m_aaa46aabd2a891668d71cec64e90b4848}{vol}}, NULL, NULL);}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00218}00218         \}}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00219}00219         \textcolor{keywordflow}{return} (0);}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00220}00220 \}}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00221}00221 }
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00222}00222 \textcolor{keyword}{static} \textcolor{keywordtype}{void}}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00223}\mbox{\hyperlink{tr__raid1_8c_aaf1bb5f56413e3729d2cb75fb1f75dd4}{00223}} \mbox{\hyperlink{tr__raid1_8c_aaf1bb5f56413e3729d2cb75fb1f75dd4}{g\_raid\_tr\_raid1\_fail\_disk}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structg__raid__softc}{g\_raid\_softc}} *sc, \textcolor{keyword}{struct} \mbox{\hyperlink{structg__raid__subdisk}{g\_raid\_subdisk}} *\mbox{\hyperlink{g__raid__md__if_8m_a910062273088d146e8533398780701eb}{sd}},}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00224}00224     \textcolor{keyword}{struct} \mbox{\hyperlink{structg__raid__disk}{g\_raid\_disk}} *\mbox{\hyperlink{structdisk}{disk}})}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00225}00225 \{}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00226}00226         \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00227}00227 \textcolor{comment}{         * We don't fail the last disk in the pack, since it still has decent}}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00228}00228 \textcolor{comment}{         * data on it and that's better than failing the disk if it is the root}}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00229}00229 \textcolor{comment}{         * file system.}}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00230}00230 \textcolor{comment}{         *}}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00231}00231 \textcolor{comment}{         * XXX should this be controlled via a tunable?  It makes sense for}}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00232}00232 \textcolor{comment}{         * the volume that has / on it.  I can't think of a case where we'd}}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00233}00233 \textcolor{comment}{         * want the volume to go away on this kind of event.}}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00234}00234 \textcolor{comment}{         */}}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00235}00235         \textcolor{keywordflow}{if} (\mbox{\hyperlink{g__raid_8c_ab8f738fdad1ea577cf8da5e1537f342c}{g\_raid\_nsubdisks}}(\mbox{\hyperlink{g__raid__md__if_8m_a910062273088d146e8533398780701eb}{sd}}-\/>\mbox{\hyperlink{structg__raid__subdisk_ab7f11cd5b966d381d1ae75c6ac9e3ddd}{sd\_volume}}, \mbox{\hyperlink{g__raid_8h_a498effa0ffa87b75f6c40381c6d4eb39}{G\_RAID\_SUBDISK\_S\_ACTIVE}}) == 1 \&\&}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00236}00236             \mbox{\hyperlink{g__raid_8c_a28bc982d0cc9829646f5e87d4bf00213}{g\_raid\_get\_subdisk}}(\mbox{\hyperlink{g__raid__md__if_8m_a910062273088d146e8533398780701eb}{sd}}-\/>\mbox{\hyperlink{structg__raid__subdisk_ab7f11cd5b966d381d1ae75c6ac9e3ddd}{sd\_volume}}, \mbox{\hyperlink{g__raid_8h_a498effa0ffa87b75f6c40381c6d4eb39}{G\_RAID\_SUBDISK\_S\_ACTIVE}}) == \mbox{\hyperlink{g__raid__md__if_8m_a910062273088d146e8533398780701eb}{sd}})}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00237}00237                 \textcolor{keywordflow}{return};}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00238}00238         \mbox{\hyperlink{g__raid_8c_a99d5c298ad4719f8e68331bf0b1d1130}{g\_raid\_fail\_disk}}(sc, \mbox{\hyperlink{g__raid__md__if_8m_a910062273088d146e8533398780701eb}{sd}}, \mbox{\hyperlink{structdisk}{disk}});}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00239}00239 \}}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00240}00240 }
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00241}00241 \textcolor{keyword}{static} \textcolor{keywordtype}{void}}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00242}\mbox{\hyperlink{tr__raid1_8c_a759d79b32c464fca6127394d5d5aad48}{00242}} \mbox{\hyperlink{tr__raid1_8c_a759d79b32c464fca6127394d5d5aad48}{g\_raid\_tr\_raid1\_rebuild\_some}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structg__raid__tr__object}{g\_raid\_tr\_object}} *tr)}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00243}00243 \{}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00244}00244         \textcolor{keyword}{struct }\mbox{\hyperlink{structg__raid__tr__raid1__object}{g\_raid\_tr\_raid1\_object}} *trs;}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00245}00245         \textcolor{keyword}{struct }\mbox{\hyperlink{structg__raid__subdisk}{g\_raid\_subdisk}} *\mbox{\hyperlink{g__raid__md__if_8m_a910062273088d146e8533398780701eb}{sd}}, *good\_sd;}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00246}00246         \textcolor{keyword}{struct }bio *\mbox{\hyperlink{g__part__if_8m_a3786db8db96c32f69df9f7cd325a7507}{bp}};}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00247}00247 }
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00248}00248         trs = (\textcolor{keyword}{struct }\mbox{\hyperlink{structg__raid__tr__raid1__object}{g\_raid\_tr\_raid1\_object}} *)tr;}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00249}00249         \textcolor{keywordflow}{if} (trs-\/>\mbox{\hyperlink{structg__raid__tr__raid1__object_aa2a5e604edc54ebe3bc48693696f2f7d}{trso\_flags}} \& \mbox{\hyperlink{tr__raid1_8c_ae7c890e5907e23f75d7c6f366e427029}{TR\_RAID1\_F\_DOING\_SOME}})}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00250}00250                 \textcolor{keywordflow}{return};}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00251}00251         \mbox{\hyperlink{g__raid__md__if_8m_a910062273088d146e8533398780701eb}{sd}} = trs-\/>\mbox{\hyperlink{structg__raid__tr__raid1__object_a71f6f7e36e0c38408ea4d55363d852d9}{trso\_failed\_sd}};}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00252}00252         good\_sd = \mbox{\hyperlink{g__raid_8c_a28bc982d0cc9829646f5e87d4bf00213}{g\_raid\_get\_subdisk}}(\mbox{\hyperlink{g__raid__md__if_8m_a910062273088d146e8533398780701eb}{sd}}-\/>\mbox{\hyperlink{structg__raid__subdisk_ab7f11cd5b966d381d1ae75c6ac9e3ddd}{sd\_volume}}, \mbox{\hyperlink{g__raid_8h_a498effa0ffa87b75f6c40381c6d4eb39}{G\_RAID\_SUBDISK\_S\_ACTIVE}});}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00253}00253         \textcolor{keywordflow}{if} (good\_sd == NULL) \{}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00254}00254                 \mbox{\hyperlink{tr__raid1_8c_a1621e05a87c4426395942ed8c6644c4d}{g\_raid\_tr\_raid1\_rebuild\_abort}}(tr);}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00255}00255                 \textcolor{keywordflow}{return};}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00256}00256         \}}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00257}00257         \mbox{\hyperlink{g__part__if_8m_a3786db8db96c32f69df9f7cd325a7507}{bp}} = \&trs-\/>\mbox{\hyperlink{structg__raid__tr__raid1__object_a5f4684dab63b091d94cc5e2c587d638a}{trso\_bio}};}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00258}00258         memset(\mbox{\hyperlink{g__part__if_8m_a3786db8db96c32f69df9f7cd325a7507}{bp}}, 0, \textcolor{keyword}{sizeof}(*\mbox{\hyperlink{g__part__if_8m_a3786db8db96c32f69df9f7cd325a7507}{bp}}));}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00259}00259         \mbox{\hyperlink{g__part__if_8m_a3786db8db96c32f69df9f7cd325a7507}{bp}}-\/>bio\_offset = \mbox{\hyperlink{g__raid__md__if_8m_a910062273088d146e8533398780701eb}{sd}}-\/>\mbox{\hyperlink{structg__raid__subdisk_aca58c7c621e10d2cbe97cd1c87214d7b}{sd\_rebuild\_pos}};}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00260}00260         \mbox{\hyperlink{g__part__if_8m_a3786db8db96c32f69df9f7cd325a7507}{bp}}-\/>bio\_length = MIN(\mbox{\hyperlink{tr__raid1_8c_a86f903929c5664af1b6ae013045741b2}{g\_raid1\_rebuild\_slab}},}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00261}00261             \mbox{\hyperlink{g__raid__md__if_8m_a910062273088d146e8533398780701eb}{sd}}-\/>\mbox{\hyperlink{structg__raid__subdisk_abc4da1103e29e3a8e2bbadb18fbccbf6}{sd\_size}} -\/ \mbox{\hyperlink{g__raid__md__if_8m_a910062273088d146e8533398780701eb}{sd}}-\/>\mbox{\hyperlink{structg__raid__subdisk_aca58c7c621e10d2cbe97cd1c87214d7b}{sd\_rebuild\_pos}});}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00262}00262         \mbox{\hyperlink{g__part__if_8m_a3786db8db96c32f69df9f7cd325a7507}{bp}}-\/>bio\_data = trs-\/>\mbox{\hyperlink{structg__raid__tr__raid1__object_a3402e3582abac26880ca0512b675302a}{trso\_buffer}};}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00263}00263         \mbox{\hyperlink{g__part__if_8m_a3786db8db96c32f69df9f7cd325a7507}{bp}}-\/>bio\_cmd = BIO\_READ;}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00264}00264         \mbox{\hyperlink{g__part__if_8m_a3786db8db96c32f69df9f7cd325a7507}{bp}}-\/>bio\_cflags = \mbox{\hyperlink{g__raid_8h_a4124ef9ee0577985d8115e21c9124296}{G\_RAID\_BIO\_FLAG\_SYNC}};}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00265}00265         \mbox{\hyperlink{g__part__if_8m_a3786db8db96c32f69df9f7cd325a7507}{bp}}-\/>bio\_caller1 = good\_sd;}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00266}00266         trs-\/>\mbox{\hyperlink{structg__raid__tr__raid1__object_aa2a5e604edc54ebe3bc48693696f2f7d}{trso\_flags}} |= \mbox{\hyperlink{tr__raid1_8c_ae7c890e5907e23f75d7c6f366e427029}{TR\_RAID1\_F\_DOING\_SOME}};}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00267}00267         trs-\/>\mbox{\hyperlink{structg__raid__tr__raid1__object_aa2a5e604edc54ebe3bc48693696f2f7d}{trso\_flags}} |= \mbox{\hyperlink{tr__raid1_8c_a9b20c9954212913093ab1b67c7ce026c}{TR\_RAID1\_F\_LOCKED}};}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00268}00268         \mbox{\hyperlink{g__raid_8c_ad98dd3a6574e48bd8c824a6ed05ae5dc}{g\_raid\_lock\_range}}(\mbox{\hyperlink{g__raid__md__if_8m_a910062273088d146e8533398780701eb}{sd}}-\/>\mbox{\hyperlink{structg__raid__subdisk_ab7f11cd5b966d381d1ae75c6ac9e3ddd}{sd\_volume}},    \textcolor{comment}{/* Lock callback starts I/O */}}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00269}00269            \mbox{\hyperlink{g__part__if_8m_a3786db8db96c32f69df9f7cd325a7507}{bp}}-\/>bio\_offset, \mbox{\hyperlink{g__part__if_8m_a3786db8db96c32f69df9f7cd325a7507}{bp}}-\/>bio\_length, NULL, \mbox{\hyperlink{g__part__if_8m_a3786db8db96c32f69df9f7cd325a7507}{bp}});}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00270}00270 \}}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00271}00271 }
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00272}00272 \textcolor{keyword}{static} \textcolor{keywordtype}{void}}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00273}\mbox{\hyperlink{tr__raid1_8c_a6ee01d4ba6c5a94f3335012e2a2cc1df}{00273}} \mbox{\hyperlink{tr__raid1_8c_a6ee01d4ba6c5a94f3335012e2a2cc1df}{g\_raid\_tr\_raid1\_rebuild\_done}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structg__raid__tr__raid1__object}{g\_raid\_tr\_raid1\_object}} *trs)}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00274}00274 \{}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00275}00275         \textcolor{keyword}{struct }\mbox{\hyperlink{structg__raid__volume}{g\_raid\_volume}} *\mbox{\hyperlink{g__raid__md__if_8m_aaa46aabd2a891668d71cec64e90b4848}{vol}};}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00276}00276         \textcolor{keyword}{struct }\mbox{\hyperlink{structg__raid__subdisk}{g\_raid\_subdisk}} *\mbox{\hyperlink{g__raid__md__if_8m_a910062273088d146e8533398780701eb}{sd}};}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00277}00277 }
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00278}00278         \mbox{\hyperlink{g__raid__md__if_8m_aaa46aabd2a891668d71cec64e90b4848}{vol}} = trs-\/>\mbox{\hyperlink{structg__raid__tr__raid1__object_ac86cded4dc99e5282b7b6061ffe4cee6}{trso\_base}}.\mbox{\hyperlink{structg__raid__tr__object_adda608cedccd305f267d8593f2bebe7f}{tro\_volume}};}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00279}00279         \mbox{\hyperlink{g__raid__md__if_8m_a910062273088d146e8533398780701eb}{sd}} = trs-\/>\mbox{\hyperlink{structg__raid__tr__raid1__object_a71f6f7e36e0c38408ea4d55363d852d9}{trso\_failed\_sd}};}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00280}00280         \mbox{\hyperlink{g__raid_8c_a9cf6273a366922dadcce1047df240cb5}{g\_raid\_write\_metadata}}(\mbox{\hyperlink{g__raid__md__if_8m_aaa46aabd2a891668d71cec64e90b4848}{vol}}-\/>\mbox{\hyperlink{structg__raid__volume_a5ddf3eff3aa40bdcbbfedb4d0458b332}{v\_softc}}, \mbox{\hyperlink{g__raid__md__if_8m_aaa46aabd2a891668d71cec64e90b4848}{vol}}, \mbox{\hyperlink{g__raid__md__if_8m_a910062273088d146e8533398780701eb}{sd}}, \mbox{\hyperlink{g__raid__md__if_8m_a910062273088d146e8533398780701eb}{sd}}-\/>\mbox{\hyperlink{structg__raid__subdisk_a5570ab684f57213078d94750e63354e1}{sd\_disk}});}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00281}00281         \mbox{\hyperlink{g__raid__md__if_8m_a4df9edb2717b3f7e4c3c903878577a54}{free}}(trs-\/>\mbox{\hyperlink{structg__raid__tr__raid1__object_a3402e3582abac26880ca0512b675302a}{trso\_buffer}}, M\_TR\_RAID1);}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00282}00282         trs-\/>\mbox{\hyperlink{structg__raid__tr__raid1__object_a3402e3582abac26880ca0512b675302a}{trso\_buffer}} = NULL;}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00283}00283         trs-\/>\mbox{\hyperlink{structg__raid__tr__raid1__object_aa2a5e604edc54ebe3bc48693696f2f7d}{trso\_flags}} \&= \string~TR\_RAID1\_F\_DOING\_SOME;}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00284}00284         trs-\/>\mbox{\hyperlink{structg__raid__tr__raid1__object_ab4ed4109230e65364f77539ecf0d52f1}{trso\_type}} = \mbox{\hyperlink{tr__raid1_8c_a050a155c9f74475d03ceb03b682d3952}{TR\_RAID1\_NONE}};}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00285}00285         trs-\/>\mbox{\hyperlink{structg__raid__tr__raid1__object_a48c83778a4f4b189859229644ab92595}{trso\_recover\_slabs}} = 0;}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00286}00286         trs-\/>\mbox{\hyperlink{structg__raid__tr__raid1__object_a71f6f7e36e0c38408ea4d55363d852d9}{trso\_failed\_sd}} = NULL;}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00287}00287         \mbox{\hyperlink{tr__raid1_8c_a96eaf5ff88659e26da070d55ad183dd8}{g\_raid\_tr\_update\_state\_raid1}}(\mbox{\hyperlink{g__raid__md__if_8m_aaa46aabd2a891668d71cec64e90b4848}{vol}}, NULL);}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00288}00288 \}}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00289}00289 }
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00290}00290 \textcolor{keyword}{static} \textcolor{keywordtype}{void}}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00291}\mbox{\hyperlink{tr__raid1_8c_a424414225997bd3c368e2ff0c136997a}{00291}} \mbox{\hyperlink{tr__raid1_8c_a424414225997bd3c368e2ff0c136997a}{g\_raid\_tr\_raid1\_rebuild\_finish}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structg__raid__tr__object}{g\_raid\_tr\_object}} *tr)}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00292}00292 \{}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00293}00293         \textcolor{keyword}{struct }\mbox{\hyperlink{structg__raid__tr__raid1__object}{g\_raid\_tr\_raid1\_object}} *trs;}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00294}00294         \textcolor{keyword}{struct }\mbox{\hyperlink{structg__raid__subdisk}{g\_raid\_subdisk}} *\mbox{\hyperlink{g__raid__md__if_8m_a910062273088d146e8533398780701eb}{sd}};}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00295}00295 }
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00296}00296         trs = (\textcolor{keyword}{struct }\mbox{\hyperlink{structg__raid__tr__raid1__object}{g\_raid\_tr\_raid1\_object}} *)tr;}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00297}00297         \mbox{\hyperlink{g__raid__md__if_8m_a910062273088d146e8533398780701eb}{sd}} = trs-\/>\mbox{\hyperlink{structg__raid__tr__raid1__object_a71f6f7e36e0c38408ea4d55363d852d9}{trso\_failed\_sd}};}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00298}00298         \mbox{\hyperlink{g__raid_8h_ace7234f8197b96e1b636f9376de8d7ea}{G\_RAID\_DEBUG1}}(0, tr-\/>\mbox{\hyperlink{structg__raid__tr__object_adda608cedccd305f267d8593f2bebe7f}{tro\_volume}}-\/>\mbox{\hyperlink{structg__raid__volume_a5ddf3eff3aa40bdcbbfedb4d0458b332}{v\_softc}},}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00299}00299             \textcolor{stringliteral}{"{}Subdisk \%s:\%d-\/\%s rebuild completed."{}},}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00300}00300             \mbox{\hyperlink{g__raid__md__if_8m_a910062273088d146e8533398780701eb}{sd}}-\/>\mbox{\hyperlink{structg__raid__subdisk_ab7f11cd5b966d381d1ae75c6ac9e3ddd}{sd\_volume}}-\/>\mbox{\hyperlink{structg__raid__volume_abdedb24b3ca3f4d3020f94e62d63fa05}{v\_name}}, \mbox{\hyperlink{g__raid__md__if_8m_a910062273088d146e8533398780701eb}{sd}}-\/>\mbox{\hyperlink{structg__raid__subdisk_a415c982fbd2537861e39aa04fa582969}{sd\_pos}},}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00301}00301             \mbox{\hyperlink{g__raid__md__if_8m_a910062273088d146e8533398780701eb}{sd}}-\/>\mbox{\hyperlink{structg__raid__subdisk_a5570ab684f57213078d94750e63354e1}{sd\_disk}} ? \mbox{\hyperlink{g__raid_8c_a8ceaeb12952563e6fe9869ed6b8daa5d}{g\_raid\_get\_diskname}}(\mbox{\hyperlink{g__raid__md__if_8m_a910062273088d146e8533398780701eb}{sd}}-\/>\mbox{\hyperlink{structg__raid__subdisk_a5570ab684f57213078d94750e63354e1}{sd\_disk}}) : \textcolor{stringliteral}{"{}[none]"{}});}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00302}00302         \mbox{\hyperlink{g__raid_8c_a058db459d5349d2130fda3a02dd2af29}{g\_raid\_change\_subdisk\_state}}(\mbox{\hyperlink{g__raid__md__if_8m_a910062273088d146e8533398780701eb}{sd}}, \mbox{\hyperlink{g__raid_8h_a498effa0ffa87b75f6c40381c6d4eb39}{G\_RAID\_SUBDISK\_S\_ACTIVE}});}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00303}00303         \mbox{\hyperlink{g__raid__md__if_8m_a910062273088d146e8533398780701eb}{sd}}-\/>\mbox{\hyperlink{structg__raid__subdisk_aca58c7c621e10d2cbe97cd1c87214d7b}{sd\_rebuild\_pos}} = 0;}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00304}00304         \mbox{\hyperlink{tr__raid1_8c_a6ee01d4ba6c5a94f3335012e2a2cc1df}{g\_raid\_tr\_raid1\_rebuild\_done}}(trs);}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00305}00305 \}}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00306}00306 }
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00307}00307 \textcolor{keyword}{static} \textcolor{keywordtype}{void}}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00308}\mbox{\hyperlink{tr__raid1_8c_a1621e05a87c4426395942ed8c6644c4d}{00308}} \mbox{\hyperlink{tr__raid1_8c_a1621e05a87c4426395942ed8c6644c4d}{g\_raid\_tr\_raid1\_rebuild\_abort}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structg__raid__tr__object}{g\_raid\_tr\_object}} *tr)}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00309}00309 \{}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00310}00310         \textcolor{keyword}{struct }\mbox{\hyperlink{structg__raid__tr__raid1__object}{g\_raid\_tr\_raid1\_object}} *trs;}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00311}00311         \textcolor{keyword}{struct }\mbox{\hyperlink{structg__raid__subdisk}{g\_raid\_subdisk}} *\mbox{\hyperlink{g__raid__md__if_8m_a910062273088d146e8533398780701eb}{sd}};}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00312}00312         \textcolor{keyword}{struct }\mbox{\hyperlink{structg__raid__volume}{g\_raid\_volume}} *\mbox{\hyperlink{g__raid__md__if_8m_aaa46aabd2a891668d71cec64e90b4848}{vol}};}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00313}00313         off\_t len;}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00314}00314 }
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00315}00315         \mbox{\hyperlink{g__raid__md__if_8m_aaa46aabd2a891668d71cec64e90b4848}{vol}} = tr-\/>\mbox{\hyperlink{structg__raid__tr__object_adda608cedccd305f267d8593f2bebe7f}{tro\_volume}};}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00316}00316         trs = (\textcolor{keyword}{struct }\mbox{\hyperlink{structg__raid__tr__raid1__object}{g\_raid\_tr\_raid1\_object}} *)tr;}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00317}00317         \mbox{\hyperlink{g__raid__md__if_8m_a910062273088d146e8533398780701eb}{sd}} = trs-\/>\mbox{\hyperlink{structg__raid__tr__raid1__object_a71f6f7e36e0c38408ea4d55363d852d9}{trso\_failed\_sd}};}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00318}00318         \textcolor{keywordflow}{if} (trs-\/>\mbox{\hyperlink{structg__raid__tr__raid1__object_aa2a5e604edc54ebe3bc48693696f2f7d}{trso\_flags}} \& \mbox{\hyperlink{tr__raid1_8c_ae7c890e5907e23f75d7c6f366e427029}{TR\_RAID1\_F\_DOING\_SOME}}) \{}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00319}00319                 \mbox{\hyperlink{g__raid_8h_ace7234f8197b96e1b636f9376de8d7ea}{G\_RAID\_DEBUG1}}(1, \mbox{\hyperlink{g__raid__md__if_8m_aaa46aabd2a891668d71cec64e90b4848}{vol}}-\/>\mbox{\hyperlink{structg__raid__volume_a5ddf3eff3aa40bdcbbfedb4d0458b332}{v\_softc}},}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00320}00320                     \textcolor{stringliteral}{"{}Subdisk \%s:\%d-\/\%s rebuild is aborting."{}},}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00321}00321                     \mbox{\hyperlink{g__raid__md__if_8m_a910062273088d146e8533398780701eb}{sd}}-\/>\mbox{\hyperlink{structg__raid__subdisk_ab7f11cd5b966d381d1ae75c6ac9e3ddd}{sd\_volume}}-\/>\mbox{\hyperlink{structg__raid__volume_abdedb24b3ca3f4d3020f94e62d63fa05}{v\_name}}, \mbox{\hyperlink{g__raid__md__if_8m_a910062273088d146e8533398780701eb}{sd}}-\/>\mbox{\hyperlink{structg__raid__subdisk_a415c982fbd2537861e39aa04fa582969}{sd\_pos}},}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00322}00322                     \mbox{\hyperlink{g__raid__md__if_8m_a910062273088d146e8533398780701eb}{sd}}-\/>\mbox{\hyperlink{structg__raid__subdisk_a5570ab684f57213078d94750e63354e1}{sd\_disk}} ? \mbox{\hyperlink{g__raid_8c_a8ceaeb12952563e6fe9869ed6b8daa5d}{g\_raid\_get\_diskname}}(\mbox{\hyperlink{g__raid__md__if_8m_a910062273088d146e8533398780701eb}{sd}}-\/>\mbox{\hyperlink{structg__raid__subdisk_a5570ab684f57213078d94750e63354e1}{sd\_disk}}) : \textcolor{stringliteral}{"{}[none]"{}});}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00323}00323                 trs-\/>\mbox{\hyperlink{structg__raid__tr__raid1__object_aa2a5e604edc54ebe3bc48693696f2f7d}{trso\_flags}} |= \mbox{\hyperlink{tr__raid1_8c_ac8df5babf9a8e344ed5ffee26ebe7925}{TR\_RAID1\_F\_ABORT}};}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00324}00324         \} \textcolor{keywordflow}{else} \{}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00325}00325                 \mbox{\hyperlink{g__raid_8h_ace7234f8197b96e1b636f9376de8d7ea}{G\_RAID\_DEBUG1}}(0, \mbox{\hyperlink{g__raid__md__if_8m_aaa46aabd2a891668d71cec64e90b4848}{vol}}-\/>\mbox{\hyperlink{structg__raid__volume_a5ddf3eff3aa40bdcbbfedb4d0458b332}{v\_softc}},}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00326}00326                     \textcolor{stringliteral}{"{}Subdisk \%s:\%d-\/\%s rebuild aborted."{}},}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00327}00327                     \mbox{\hyperlink{g__raid__md__if_8m_a910062273088d146e8533398780701eb}{sd}}-\/>\mbox{\hyperlink{structg__raid__subdisk_ab7f11cd5b966d381d1ae75c6ac9e3ddd}{sd\_volume}}-\/>\mbox{\hyperlink{structg__raid__volume_abdedb24b3ca3f4d3020f94e62d63fa05}{v\_name}}, \mbox{\hyperlink{g__raid__md__if_8m_a910062273088d146e8533398780701eb}{sd}}-\/>\mbox{\hyperlink{structg__raid__subdisk_a415c982fbd2537861e39aa04fa582969}{sd\_pos}},}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00328}00328                     \mbox{\hyperlink{g__raid__md__if_8m_a910062273088d146e8533398780701eb}{sd}}-\/>\mbox{\hyperlink{structg__raid__subdisk_a5570ab684f57213078d94750e63354e1}{sd\_disk}} ? \mbox{\hyperlink{g__raid_8c_a8ceaeb12952563e6fe9869ed6b8daa5d}{g\_raid\_get\_diskname}}(\mbox{\hyperlink{g__raid__md__if_8m_a910062273088d146e8533398780701eb}{sd}}-\/>\mbox{\hyperlink{structg__raid__subdisk_a5570ab684f57213078d94750e63354e1}{sd\_disk}}) : \textcolor{stringliteral}{"{}[none]"{}});}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00329}00329                 trs-\/>\mbox{\hyperlink{structg__raid__tr__raid1__object_aa2a5e604edc54ebe3bc48693696f2f7d}{trso\_flags}} \&= \string~TR\_RAID1\_F\_ABORT;}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00330}00330                 \textcolor{keywordflow}{if} (trs-\/>\mbox{\hyperlink{structg__raid__tr__raid1__object_aa2a5e604edc54ebe3bc48693696f2f7d}{trso\_flags}} \& \mbox{\hyperlink{tr__raid1_8c_a9b20c9954212913093ab1b67c7ce026c}{TR\_RAID1\_F\_LOCKED}}) \{}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00331}00331                         trs-\/>\mbox{\hyperlink{structg__raid__tr__raid1__object_aa2a5e604edc54ebe3bc48693696f2f7d}{trso\_flags}} \&= \string~TR\_RAID1\_F\_LOCKED;}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00332}00332                         len = MIN(\mbox{\hyperlink{tr__raid1_8c_a86f903929c5664af1b6ae013045741b2}{g\_raid1\_rebuild\_slab}},}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00333}00333                             \mbox{\hyperlink{g__raid__md__if_8m_a910062273088d146e8533398780701eb}{sd}}-\/>\mbox{\hyperlink{structg__raid__subdisk_abc4da1103e29e3a8e2bbadb18fbccbf6}{sd\_size}} -\/ \mbox{\hyperlink{g__raid__md__if_8m_a910062273088d146e8533398780701eb}{sd}}-\/>\mbox{\hyperlink{structg__raid__subdisk_aca58c7c621e10d2cbe97cd1c87214d7b}{sd\_rebuild\_pos}});}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00334}00334                         \mbox{\hyperlink{g__raid_8c_ae97b7a5015a2b67a9c1853bf1d1ec4b1}{g\_raid\_unlock\_range}}(tr-\/>\mbox{\hyperlink{structg__raid__tr__object_adda608cedccd305f267d8593f2bebe7f}{tro\_volume}},}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00335}00335                             \mbox{\hyperlink{g__raid__md__if_8m_a910062273088d146e8533398780701eb}{sd}}-\/>\mbox{\hyperlink{structg__raid__subdisk_aca58c7c621e10d2cbe97cd1c87214d7b}{sd\_rebuild\_pos}}, len);}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00336}00336                 \}}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00337}00337                 \mbox{\hyperlink{tr__raid1_8c_a6ee01d4ba6c5a94f3335012e2a2cc1df}{g\_raid\_tr\_raid1\_rebuild\_done}}(trs);}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00338}00338         \}}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00339}00339 \}}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00340}00340 }
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00341}00341 \textcolor{keyword}{static} \textcolor{keywordtype}{void}}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00342}\mbox{\hyperlink{tr__raid1_8c_a561bff307d8327f763da86cdb454e074}{00342}} \mbox{\hyperlink{tr__raid1_8c_a561bff307d8327f763da86cdb454e074}{g\_raid\_tr\_raid1\_rebuild\_start}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structg__raid__tr__object}{g\_raid\_tr\_object}} *tr)}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00343}00343 \{}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00344}00344         \textcolor{keyword}{struct }\mbox{\hyperlink{structg__raid__volume}{g\_raid\_volume}} *\mbox{\hyperlink{g__raid__md__if_8m_aaa46aabd2a891668d71cec64e90b4848}{vol}};}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00345}00345         \textcolor{keyword}{struct }\mbox{\hyperlink{structg__raid__tr__raid1__object}{g\_raid\_tr\_raid1\_object}} *trs;}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00346}00346         \textcolor{keyword}{struct }\mbox{\hyperlink{structg__raid__subdisk}{g\_raid\_subdisk}} *\mbox{\hyperlink{g__raid__md__if_8m_a910062273088d146e8533398780701eb}{sd}}, *fsd;}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00347}00347 }
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00348}00348         \mbox{\hyperlink{g__raid__md__if_8m_aaa46aabd2a891668d71cec64e90b4848}{vol}} = tr-\/>\mbox{\hyperlink{structg__raid__tr__object_adda608cedccd305f267d8593f2bebe7f}{tro\_volume}};}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00349}00349         trs = (\textcolor{keyword}{struct }\mbox{\hyperlink{structg__raid__tr__raid1__object}{g\_raid\_tr\_raid1\_object}} *)tr;}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00350}00350         \textcolor{keywordflow}{if} (trs-\/>\mbox{\hyperlink{structg__raid__tr__raid1__object_a71f6f7e36e0c38408ea4d55363d852d9}{trso\_failed\_sd}}) \{}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00351}00351                 \mbox{\hyperlink{g__raid_8h_ace7234f8197b96e1b636f9376de8d7ea}{G\_RAID\_DEBUG1}}(1, \mbox{\hyperlink{g__raid__md__if_8m_aaa46aabd2a891668d71cec64e90b4848}{vol}}-\/>\mbox{\hyperlink{structg__raid__volume_a5ddf3eff3aa40bdcbbfedb4d0458b332}{v\_softc}},}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00352}00352                     \textcolor{stringliteral}{"{}Already rebuild in start rebuild. pos \%jd\(\backslash\)n"{}},}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00353}00353                     (intmax\_t)trs-\/>\mbox{\hyperlink{structg__raid__tr__raid1__object_a71f6f7e36e0c38408ea4d55363d852d9}{trso\_failed\_sd}}-\/>\mbox{\hyperlink{structg__raid__subdisk_aca58c7c621e10d2cbe97cd1c87214d7b}{sd\_rebuild\_pos}});}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00354}00354                 \textcolor{keywordflow}{return};}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00355}00355         \}}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00356}00356         \mbox{\hyperlink{g__raid__md__if_8m_a910062273088d146e8533398780701eb}{sd}} = \mbox{\hyperlink{g__raid_8c_a28bc982d0cc9829646f5e87d4bf00213}{g\_raid\_get\_subdisk}}(\mbox{\hyperlink{g__raid__md__if_8m_aaa46aabd2a891668d71cec64e90b4848}{vol}}, \mbox{\hyperlink{g__raid_8h_a498effa0ffa87b75f6c40381c6d4eb39}{G\_RAID\_SUBDISK\_S\_ACTIVE}});}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00357}00357         \textcolor{keywordflow}{if} (\mbox{\hyperlink{g__raid__md__if_8m_a910062273088d146e8533398780701eb}{sd}} == NULL) \{}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00358}00358                 \mbox{\hyperlink{g__raid_8h_ace7234f8197b96e1b636f9376de8d7ea}{G\_RAID\_DEBUG1}}(1, \mbox{\hyperlink{g__raid__md__if_8m_aaa46aabd2a891668d71cec64e90b4848}{vol}}-\/>\mbox{\hyperlink{structg__raid__volume_a5ddf3eff3aa40bdcbbfedb4d0458b332}{v\_softc}},}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00359}00359                     \textcolor{stringliteral}{"{}No active disk to rebuild.  night night."{}});}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00360}00360                 \textcolor{keywordflow}{return};}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00361}00361         \}}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00362}00362         fsd = \mbox{\hyperlink{g__raid_8c_a28bc982d0cc9829646f5e87d4bf00213}{g\_raid\_get\_subdisk}}(\mbox{\hyperlink{g__raid__md__if_8m_aaa46aabd2a891668d71cec64e90b4848}{vol}}, \mbox{\hyperlink{g__raid_8h_a8c3d62bf4e551976a8941a23c8984e5d}{G\_RAID\_SUBDISK\_S\_RESYNC}});}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00363}00363         \textcolor{keywordflow}{if} (fsd == NULL)}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00364}00364                 fsd = \mbox{\hyperlink{g__raid_8c_a28bc982d0cc9829646f5e87d4bf00213}{g\_raid\_get\_subdisk}}(\mbox{\hyperlink{g__raid__md__if_8m_aaa46aabd2a891668d71cec64e90b4848}{vol}}, \mbox{\hyperlink{g__raid_8h_a856d6801d600e0089b0cd39ff5af7224}{G\_RAID\_SUBDISK\_S\_REBUILD}});}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00365}00365         \textcolor{keywordflow}{if} (fsd == NULL) \{}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00366}00366                 fsd = \mbox{\hyperlink{g__raid_8c_a28bc982d0cc9829646f5e87d4bf00213}{g\_raid\_get\_subdisk}}(\mbox{\hyperlink{g__raid__md__if_8m_aaa46aabd2a891668d71cec64e90b4848}{vol}}, \mbox{\hyperlink{g__raid_8h_a41bff35bee21218d2aba7a261eb2e83c}{G\_RAID\_SUBDISK\_S\_STALE}});}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00367}00367                 \textcolor{keywordflow}{if} (fsd != NULL) \{}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00368}00368                         fsd-\/>\mbox{\hyperlink{structg__raid__subdisk_aca58c7c621e10d2cbe97cd1c87214d7b}{sd\_rebuild\_pos}} = 0;}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00369}00369                         \mbox{\hyperlink{g__raid_8c_a058db459d5349d2130fda3a02dd2af29}{g\_raid\_change\_subdisk\_state}}(fsd,}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00370}00370                             \mbox{\hyperlink{g__raid_8h_a8c3d62bf4e551976a8941a23c8984e5d}{G\_RAID\_SUBDISK\_S\_RESYNC}});}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00371}00371                         \mbox{\hyperlink{g__raid_8c_a9cf6273a366922dadcce1047df240cb5}{g\_raid\_write\_metadata}}(\mbox{\hyperlink{g__raid__md__if_8m_aaa46aabd2a891668d71cec64e90b4848}{vol}}-\/>\mbox{\hyperlink{structg__raid__volume_a5ddf3eff3aa40bdcbbfedb4d0458b332}{v\_softc}}, \mbox{\hyperlink{g__raid__md__if_8m_aaa46aabd2a891668d71cec64e90b4848}{vol}}, fsd, NULL);}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00372}00372                 \} \textcolor{keywordflow}{else} \{}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00373}00373                         fsd = \mbox{\hyperlink{g__raid_8c_a28bc982d0cc9829646f5e87d4bf00213}{g\_raid\_get\_subdisk}}(\mbox{\hyperlink{g__raid__md__if_8m_aaa46aabd2a891668d71cec64e90b4848}{vol}},}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00374}00374                             \mbox{\hyperlink{g__raid_8h_a13d824d436f40abb3ab52f0d96a79b62}{G\_RAID\_SUBDISK\_S\_UNINITIALIZED}});}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00375}00375                         \textcolor{keywordflow}{if} (fsd == NULL)}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00376}00376                                 fsd = \mbox{\hyperlink{g__raid_8c_a28bc982d0cc9829646f5e87d4bf00213}{g\_raid\_get\_subdisk}}(\mbox{\hyperlink{g__raid__md__if_8m_aaa46aabd2a891668d71cec64e90b4848}{vol}},}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00377}00377                                     \mbox{\hyperlink{g__raid_8h_a9dd59db9322af74b4b15021c3fc8f2f5}{G\_RAID\_SUBDISK\_S\_NEW}});}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00378}00378                         \textcolor{keywordflow}{if} (fsd != NULL) \{}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00379}00379                                 fsd-\/>\mbox{\hyperlink{structg__raid__subdisk_aca58c7c621e10d2cbe97cd1c87214d7b}{sd\_rebuild\_pos}} = 0;}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00380}00380                                 \mbox{\hyperlink{g__raid_8c_a058db459d5349d2130fda3a02dd2af29}{g\_raid\_change\_subdisk\_state}}(fsd,}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00381}00381                                     \mbox{\hyperlink{g__raid_8h_a856d6801d600e0089b0cd39ff5af7224}{G\_RAID\_SUBDISK\_S\_REBUILD}});}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00382}00382                                 \mbox{\hyperlink{g__raid_8c_a9cf6273a366922dadcce1047df240cb5}{g\_raid\_write\_metadata}}(\mbox{\hyperlink{g__raid__md__if_8m_aaa46aabd2a891668d71cec64e90b4848}{vol}}-\/>\mbox{\hyperlink{structg__raid__volume_a5ddf3eff3aa40bdcbbfedb4d0458b332}{v\_softc}},}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00383}00383                                     \mbox{\hyperlink{g__raid__md__if_8m_aaa46aabd2a891668d71cec64e90b4848}{vol}}, fsd, NULL);}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00384}00384                         \}}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00385}00385                 \}}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00386}00386         \}}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00387}00387         \textcolor{keywordflow}{if} (fsd == NULL) \{}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00388}00388                 \mbox{\hyperlink{g__raid_8h_ace7234f8197b96e1b636f9376de8d7ea}{G\_RAID\_DEBUG1}}(1, \mbox{\hyperlink{g__raid__md__if_8m_aaa46aabd2a891668d71cec64e90b4848}{vol}}-\/>\mbox{\hyperlink{structg__raid__volume_a5ddf3eff3aa40bdcbbfedb4d0458b332}{v\_softc}},}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00389}00389                     \textcolor{stringliteral}{"{}No failed disk to rebuild.  night night."{}});}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00390}00390                 \textcolor{keywordflow}{return};}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00391}00391         \}}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00392}00392         trs-\/>\mbox{\hyperlink{structg__raid__tr__raid1__object_a71f6f7e36e0c38408ea4d55363d852d9}{trso\_failed\_sd}} = fsd;}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00393}00393         \mbox{\hyperlink{g__raid_8h_ace7234f8197b96e1b636f9376de8d7ea}{G\_RAID\_DEBUG1}}(0, \mbox{\hyperlink{g__raid__md__if_8m_aaa46aabd2a891668d71cec64e90b4848}{vol}}-\/>\mbox{\hyperlink{structg__raid__volume_a5ddf3eff3aa40bdcbbfedb4d0458b332}{v\_softc}},}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00394}00394             \textcolor{stringliteral}{"{}Subdisk \%s:\%d-\/\%s rebuild start at \%jd."{}},}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00395}00395             fsd-\/>\mbox{\hyperlink{structg__raid__subdisk_ab7f11cd5b966d381d1ae75c6ac9e3ddd}{sd\_volume}}-\/>\mbox{\hyperlink{structg__raid__volume_abdedb24b3ca3f4d3020f94e62d63fa05}{v\_name}}, fsd-\/>\mbox{\hyperlink{structg__raid__subdisk_a415c982fbd2537861e39aa04fa582969}{sd\_pos}},}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00396}00396             fsd-\/>\mbox{\hyperlink{structg__raid__subdisk_a5570ab684f57213078d94750e63354e1}{sd\_disk}} ? \mbox{\hyperlink{g__raid_8c_a8ceaeb12952563e6fe9869ed6b8daa5d}{g\_raid\_get\_diskname}}(fsd-\/>\mbox{\hyperlink{structg__raid__subdisk_a5570ab684f57213078d94750e63354e1}{sd\_disk}}) : \textcolor{stringliteral}{"{}[none]"{}},}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00397}00397             trs-\/>\mbox{\hyperlink{structg__raid__tr__raid1__object_a71f6f7e36e0c38408ea4d55363d852d9}{trso\_failed\_sd}}-\/>\mbox{\hyperlink{structg__raid__subdisk_aca58c7c621e10d2cbe97cd1c87214d7b}{sd\_rebuild\_pos}});}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00398}00398         trs-\/>\mbox{\hyperlink{structg__raid__tr__raid1__object_ab4ed4109230e65364f77539ecf0d52f1}{trso\_type}} = \mbox{\hyperlink{tr__raid1_8c_a54d21ddc205a11a78c293b3e645b7f05}{TR\_RAID1\_REBUILD}};}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00399}00399         trs-\/>\mbox{\hyperlink{structg__raid__tr__raid1__object_a3402e3582abac26880ca0512b675302a}{trso\_buffer}} = malloc(\mbox{\hyperlink{tr__raid1_8c_a86f903929c5664af1b6ae013045741b2}{g\_raid1\_rebuild\_slab}}, M\_TR\_RAID1, M\_WAITOK);}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00400}00400         trs-\/>\mbox{\hyperlink{structg__raid__tr__raid1__object_a3fcc84b5e1a2d2784ecd9eae6f30f7b4}{trso\_meta\_update}} = \mbox{\hyperlink{tr__raid1_8c_ade086c9ab8b71a57c696d08bbf667e76}{g\_raid1\_rebuild\_meta\_update}};}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00401}00401         \mbox{\hyperlink{tr__raid1_8c_a759d79b32c464fca6127394d5d5aad48}{g\_raid\_tr\_raid1\_rebuild\_some}}(tr);}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00402}00402 \}}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00403}00403 }
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00404}00404 \textcolor{keyword}{static} \textcolor{keywordtype}{void}}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00405}\mbox{\hyperlink{tr__raid1_8c_aa7765f78771a40cf1ff8b5238a6aeac2}{00405}} \mbox{\hyperlink{tr__raid1_8c_aa7765f78771a40cf1ff8b5238a6aeac2}{g\_raid\_tr\_raid1\_maybe\_rebuild}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structg__raid__tr__object}{g\_raid\_tr\_object}} *tr,}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00406}00406     \textcolor{keyword}{struct} \mbox{\hyperlink{structg__raid__subdisk}{g\_raid\_subdisk}} *\mbox{\hyperlink{g__raid__md__if_8m_a910062273088d146e8533398780701eb}{sd}})}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00407}00407 \{}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00408}00408         \textcolor{keyword}{struct }\mbox{\hyperlink{structg__raid__volume}{g\_raid\_volume}} *\mbox{\hyperlink{g__raid__md__if_8m_aaa46aabd2a891668d71cec64e90b4848}{vol}};}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00409}00409         \textcolor{keyword}{struct }\mbox{\hyperlink{structg__raid__tr__raid1__object}{g\_raid\_tr\_raid1\_object}} *trs;}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00410}00410         \textcolor{keywordtype}{int} na, nr;}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00411}00411 }
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00412}00412         \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00413}00413 \textcolor{comment}{         * If we're stopping, don't do anything.  If we don't have at least one}}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00414}00414 \textcolor{comment}{         * good disk and one bad disk, we don't do anything.  And if there's a}}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00415}00415 \textcolor{comment}{         * 'good disk' stored in the trs, then we're in progress and we punt.}}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00416}00416 \textcolor{comment}{         * If we make it past all these checks, we need to rebuild.}}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00417}00417 \textcolor{comment}{         */}}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00418}00418         \mbox{\hyperlink{g__raid__md__if_8m_aaa46aabd2a891668d71cec64e90b4848}{vol}} = tr-\/>\mbox{\hyperlink{structg__raid__tr__object_adda608cedccd305f267d8593f2bebe7f}{tro\_volume}};}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00419}00419         trs = (\textcolor{keyword}{struct }\mbox{\hyperlink{structg__raid__tr__raid1__object}{g\_raid\_tr\_raid1\_object}} *)tr;}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00420}00420         \textcolor{keywordflow}{if} (trs-\/>\mbox{\hyperlink{structg__raid__tr__raid1__object_a9cc5c15ab1d890783628073d7c58e693}{trso\_stopping}})}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00421}00421                 \textcolor{keywordflow}{return};}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00422}00422         na = \mbox{\hyperlink{g__raid_8c_ab8f738fdad1ea577cf8da5e1537f342c}{g\_raid\_nsubdisks}}(\mbox{\hyperlink{g__raid__md__if_8m_aaa46aabd2a891668d71cec64e90b4848}{vol}}, \mbox{\hyperlink{g__raid_8h_a498effa0ffa87b75f6c40381c6d4eb39}{G\_RAID\_SUBDISK\_S\_ACTIVE}});}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00423}00423         nr = \mbox{\hyperlink{g__raid_8c_ab8f738fdad1ea577cf8da5e1537f342c}{g\_raid\_nsubdisks}}(\mbox{\hyperlink{g__raid__md__if_8m_aaa46aabd2a891668d71cec64e90b4848}{vol}}, \mbox{\hyperlink{g__raid_8h_a856d6801d600e0089b0cd39ff5af7224}{G\_RAID\_SUBDISK\_S\_REBUILD}}) +}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00424}00424             \mbox{\hyperlink{g__raid_8c_ab8f738fdad1ea577cf8da5e1537f342c}{g\_raid\_nsubdisks}}(\mbox{\hyperlink{g__raid__md__if_8m_aaa46aabd2a891668d71cec64e90b4848}{vol}}, \mbox{\hyperlink{g__raid_8h_a8c3d62bf4e551976a8941a23c8984e5d}{G\_RAID\_SUBDISK\_S\_RESYNC}});}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00425}00425         \textcolor{keywordflow}{switch}(trs-\/>\mbox{\hyperlink{structg__raid__tr__raid1__object_ab4ed4109230e65364f77539ecf0d52f1}{trso\_type}}) \{}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00426}00426         \textcolor{keywordflow}{case} \mbox{\hyperlink{tr__raid1_8c_a050a155c9f74475d03ceb03b682d3952}{TR\_RAID1\_NONE}}:}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00427}00427                 \textcolor{keywordflow}{if} (na == 0)}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00428}00428                         \textcolor{keywordflow}{return};}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00429}00429                 \textcolor{keywordflow}{if} (nr == 0) \{}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00430}00430                         nr = \mbox{\hyperlink{g__raid_8c_ab8f738fdad1ea577cf8da5e1537f342c}{g\_raid\_nsubdisks}}(\mbox{\hyperlink{g__raid__md__if_8m_aaa46aabd2a891668d71cec64e90b4848}{vol}}, \mbox{\hyperlink{g__raid_8h_a9dd59db9322af74b4b15021c3fc8f2f5}{G\_RAID\_SUBDISK\_S\_NEW}}) +}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00431}00431                             \mbox{\hyperlink{g__raid_8c_ab8f738fdad1ea577cf8da5e1537f342c}{g\_raid\_nsubdisks}}(\mbox{\hyperlink{g__raid__md__if_8m_aaa46aabd2a891668d71cec64e90b4848}{vol}}, \mbox{\hyperlink{g__raid_8h_a41bff35bee21218d2aba7a261eb2e83c}{G\_RAID\_SUBDISK\_S\_STALE}}) +}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00432}00432                             \mbox{\hyperlink{g__raid_8c_ab8f738fdad1ea577cf8da5e1537f342c}{g\_raid\_nsubdisks}}(\mbox{\hyperlink{g__raid__md__if_8m_aaa46aabd2a891668d71cec64e90b4848}{vol}}, \mbox{\hyperlink{g__raid_8h_a13d824d436f40abb3ab52f0d96a79b62}{G\_RAID\_SUBDISK\_S\_UNINITIALIZED}});}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00433}00433                         \textcolor{keywordflow}{if} (nr == 0)}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00434}00434                                 \textcolor{keywordflow}{return};}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00435}00435                 \}}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00436}00436                 \mbox{\hyperlink{tr__raid1_8c_a561bff307d8327f763da86cdb454e074}{g\_raid\_tr\_raid1\_rebuild\_start}}(tr);}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00437}00437                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00438}00438         \textcolor{keywordflow}{case} \mbox{\hyperlink{tr__raid1_8c_a54d21ddc205a11a78c293b3e645b7f05}{TR\_RAID1\_REBUILD}}:}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00439}00439                 \textcolor{keywordflow}{if} (na == 0 || nr == 0 || trs-\/>\mbox{\hyperlink{structg__raid__tr__raid1__object_a71f6f7e36e0c38408ea4d55363d852d9}{trso\_failed\_sd}} == \mbox{\hyperlink{g__raid__md__if_8m_a910062273088d146e8533398780701eb}{sd}})}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00440}00440                         \mbox{\hyperlink{tr__raid1_8c_a1621e05a87c4426395942ed8c6644c4d}{g\_raid\_tr\_raid1\_rebuild\_abort}}(tr);}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00441}00441                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00442}00442         \textcolor{keywordflow}{case} \mbox{\hyperlink{tr__raid1_8c_afc7f212ac70fbd4db051b75683420e02}{TR\_RAID1\_RESYNC}}:}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00443}00443                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00444}00444         \}}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00445}00445 \}}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00446}00446 }
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00447}00447 \textcolor{keyword}{static} \textcolor{keywordtype}{int}}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00448}\mbox{\hyperlink{tr__raid1_8c_a3bfc52687b4e05de773c30c75997adb7}{00448}} \mbox{\hyperlink{tr__raid1_8c_aa1f59b2dc7f2cba2f3f6e7a703c46632}{g\_raid\_tr\_event\_raid1}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structg__raid__tr__object}{g\_raid\_tr\_object}} *tr,}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00449}00449     \textcolor{keyword}{struct} \mbox{\hyperlink{structg__raid__subdisk}{g\_raid\_subdisk}} *\mbox{\hyperlink{g__raid__md__if_8m_a910062273088d146e8533398780701eb}{sd}}, u\_int \mbox{\hyperlink{g__raid__md__if_8m_a683a43faabf5ffc974caacd425b678d0}{event}})}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00450}00450 \{}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00451}00451 }
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00452}00452         \mbox{\hyperlink{tr__raid1_8c_a96eaf5ff88659e26da070d55ad183dd8}{g\_raid\_tr\_update\_state\_raid1}}(tr-\/>\mbox{\hyperlink{structg__raid__tr__object_adda608cedccd305f267d8593f2bebe7f}{tro\_volume}}, \mbox{\hyperlink{g__raid__md__if_8m_a910062273088d146e8533398780701eb}{sd}});}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00453}00453         \textcolor{keywordflow}{return} (0);}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00454}00454 \}}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00455}00455 }
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00456}00456 \textcolor{keyword}{static} \textcolor{keywordtype}{int}}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00457}\mbox{\hyperlink{tr__raid1_8c_a176d14c75414fda6af55e6b49605f984}{00457}} \mbox{\hyperlink{tr__raid1_8c_ab2ff58010880990c459a5a9f29ff52be}{g\_raid\_tr\_start\_raid1}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structg__raid__tr__object}{g\_raid\_tr\_object}} *tr)}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00458}00458 \{}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00459}00459         \textcolor{keyword}{struct }\mbox{\hyperlink{structg__raid__tr__raid1__object}{g\_raid\_tr\_raid1\_object}} *trs;}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00460}00460         \textcolor{keyword}{struct }\mbox{\hyperlink{structg__raid__volume}{g\_raid\_volume}} *\mbox{\hyperlink{g__raid__md__if_8m_aaa46aabd2a891668d71cec64e90b4848}{vol}};}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00461}00461 }
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00462}00462         trs = (\textcolor{keyword}{struct }\mbox{\hyperlink{structg__raid__tr__raid1__object}{g\_raid\_tr\_raid1\_object}} *)tr;}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00463}00463         \mbox{\hyperlink{g__raid__md__if_8m_aaa46aabd2a891668d71cec64e90b4848}{vol}} = tr-\/>\mbox{\hyperlink{structg__raid__tr__object_adda608cedccd305f267d8593f2bebe7f}{tro\_volume}};}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00464}00464         trs-\/>\mbox{\hyperlink{structg__raid__tr__raid1__object_afa5c356bf55fc7ec7d502816dd3a8d63}{trso\_starting}} = 0;}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00465}00465         \mbox{\hyperlink{tr__raid1_8c_a96eaf5ff88659e26da070d55ad183dd8}{g\_raid\_tr\_update\_state\_raid1}}(\mbox{\hyperlink{g__raid__md__if_8m_aaa46aabd2a891668d71cec64e90b4848}{vol}}, NULL);}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00466}00466         \textcolor{keywordflow}{return} (0);}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00467}00467 \}}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00468}00468 }
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00469}00469 \textcolor{keyword}{static} \textcolor{keywordtype}{int}}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00470}\mbox{\hyperlink{tr__raid1_8c_a1a9f49ed716227e535190b905d51d2bb}{00470}} \mbox{\hyperlink{tr__raid1_8c_ab1b7ad3dd42ed66ebaf84e3cf522e417}{g\_raid\_tr\_stop\_raid1}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structg__raid__tr__object}{g\_raid\_tr\_object}} *tr)}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00471}00471 \{}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00472}00472         \textcolor{keyword}{struct }\mbox{\hyperlink{structg__raid__tr__raid1__object}{g\_raid\_tr\_raid1\_object}} *trs;}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00473}00473         \textcolor{keyword}{struct }\mbox{\hyperlink{structg__raid__volume}{g\_raid\_volume}} *\mbox{\hyperlink{g__raid__md__if_8m_aaa46aabd2a891668d71cec64e90b4848}{vol}};}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00474}00474 }
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00475}00475         trs = (\textcolor{keyword}{struct }\mbox{\hyperlink{structg__raid__tr__raid1__object}{g\_raid\_tr\_raid1\_object}} *)tr;}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00476}00476         \mbox{\hyperlink{g__raid__md__if_8m_aaa46aabd2a891668d71cec64e90b4848}{vol}} = tr-\/>\mbox{\hyperlink{structg__raid__tr__object_adda608cedccd305f267d8593f2bebe7f}{tro\_volume}};}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00477}00477         trs-\/>\mbox{\hyperlink{structg__raid__tr__raid1__object_afa5c356bf55fc7ec7d502816dd3a8d63}{trso\_starting}} = 0;}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00478}00478         trs-\/>\mbox{\hyperlink{structg__raid__tr__raid1__object_a9cc5c15ab1d890783628073d7c58e693}{trso\_stopping}} = 1;}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00479}00479         \mbox{\hyperlink{tr__raid1_8c_a96eaf5ff88659e26da070d55ad183dd8}{g\_raid\_tr\_update\_state\_raid1}}(\mbox{\hyperlink{g__raid__md__if_8m_aaa46aabd2a891668d71cec64e90b4848}{vol}}, NULL);}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00480}00480         \textcolor{keywordflow}{return} (0);}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00481}00481 \}}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00482}00482 }
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00483}00483 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00484}00484 \textcolor{comment}{ * Select the disk to read from.  Take into account: subdisk state, running}}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00485}00485 \textcolor{comment}{ * error recovery, average disk load, head position and possible cache hits.}}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00486}00486 \textcolor{comment}{ */}}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00487}\mbox{\hyperlink{tr__raid1_8c_a996f7be338ccb40d1a2a5abc1ad61759}{00487}} \textcolor{preprocessor}{\#define ABS(x)          (((x) >= 0) ? (x) : (-\/(x)))}}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00488}00488 \textcolor{keyword}{static} \textcolor{keyword}{struct }\mbox{\hyperlink{structg__raid__subdisk}{g\_raid\_subdisk}} *}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00489}\mbox{\hyperlink{tr__raid1_8c_a23badff029cca5cbfb66516b9181aafd}{00489}} \mbox{\hyperlink{tr__raid1_8c_a23badff029cca5cbfb66516b9181aafd}{g\_raid\_tr\_raid1\_select\_read\_disk}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structg__raid__volume}{g\_raid\_volume}} *\mbox{\hyperlink{g__raid__md__if_8m_aaa46aabd2a891668d71cec64e90b4848}{vol}}, \textcolor{keyword}{struct} bio *\mbox{\hyperlink{g__part__if_8m_a3786db8db96c32f69df9f7cd325a7507}{bp}},}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00490}00490     u\_int mask)}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00491}00491 \{}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00492}00492         \textcolor{keyword}{struct }\mbox{\hyperlink{structg__raid__subdisk}{g\_raid\_subdisk}} *\mbox{\hyperlink{g__raid__md__if_8m_a910062273088d146e8533398780701eb}{sd}}, *best;}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00493}00493         \textcolor{keywordtype}{int} i, prio, bestprio;}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00494}00494 }
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00495}00495         best = NULL;}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00496}00496         bestprio = INT\_MAX;}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00497}00497         \textcolor{keywordflow}{for} (i = 0; i < \mbox{\hyperlink{g__raid__md__if_8m_aaa46aabd2a891668d71cec64e90b4848}{vol}}-\/>\mbox{\hyperlink{structg__raid__volume_a21482a5ac78a397faf4e95eb1ebef431}{v\_disks\_count}}; i++) \{}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00498}00498                 \mbox{\hyperlink{g__raid__md__if_8m_a910062273088d146e8533398780701eb}{sd}} = \&\mbox{\hyperlink{g__raid__md__if_8m_aaa46aabd2a891668d71cec64e90b4848}{vol}}-\/>\mbox{\hyperlink{structg__raid__volume_a3c43185db4bd1c4818d95a415635854b}{v\_subdisks}}[i];}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00499}00499                 \textcolor{keywordflow}{if} (\mbox{\hyperlink{g__raid__md__if_8m_a910062273088d146e8533398780701eb}{sd}}-\/>\mbox{\hyperlink{structg__raid__subdisk_acd19794916930f74ecad38ca7dd69f69}{sd\_state}} != \mbox{\hyperlink{g__raid_8h_a498effa0ffa87b75f6c40381c6d4eb39}{G\_RAID\_SUBDISK\_S\_ACTIVE}} \&\&}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00500}00500                     ((\mbox{\hyperlink{g__raid__md__if_8m_a910062273088d146e8533398780701eb}{sd}}-\/>\mbox{\hyperlink{structg__raid__subdisk_acd19794916930f74ecad38ca7dd69f69}{sd\_state}} != \mbox{\hyperlink{g__raid_8h_a856d6801d600e0089b0cd39ff5af7224}{G\_RAID\_SUBDISK\_S\_REBUILD}} \&\&}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00501}00501                       \mbox{\hyperlink{g__raid__md__if_8m_a910062273088d146e8533398780701eb}{sd}}-\/>\mbox{\hyperlink{structg__raid__subdisk_acd19794916930f74ecad38ca7dd69f69}{sd\_state}} != \mbox{\hyperlink{g__raid_8h_a8c3d62bf4e551976a8941a23c8984e5d}{G\_RAID\_SUBDISK\_S\_RESYNC}}) ||}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00502}00502                      \mbox{\hyperlink{g__part__if_8m_a3786db8db96c32f69df9f7cd325a7507}{bp}}-\/>bio\_offset + \mbox{\hyperlink{g__part__if_8m_a3786db8db96c32f69df9f7cd325a7507}{bp}}-\/>bio\_length > \mbox{\hyperlink{g__raid__md__if_8m_a910062273088d146e8533398780701eb}{sd}}-\/>\mbox{\hyperlink{structg__raid__subdisk_aca58c7c621e10d2cbe97cd1c87214d7b}{sd\_rebuild\_pos}}))}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00503}00503                         \textcolor{keywordflow}{continue};}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00504}00504                 \textcolor{keywordflow}{if} ((mask \& (1 << i)) != 0)}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00505}00505                         \textcolor{keywordflow}{continue};}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00506}00506                 prio = \mbox{\hyperlink{g__raid_8h_a54473a359c32cd2b6f2b15b34282e9c1}{G\_RAID\_SUBDISK\_LOAD}}(\mbox{\hyperlink{g__raid__md__if_8m_a910062273088d146e8533398780701eb}{sd}});}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00507}00507                 prio += min(\mbox{\hyperlink{g__raid__md__if_8m_a910062273088d146e8533398780701eb}{sd}}-\/>\mbox{\hyperlink{structg__raid__subdisk_a3dea6e577567a0bd5b37262232b65966}{sd\_recovery}}, 255) << 22;}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00508}00508                 prio += (\mbox{\hyperlink{g__raid_8h_a498effa0ffa87b75f6c40381c6d4eb39}{G\_RAID\_SUBDISK\_S\_ACTIVE}} -\/ \mbox{\hyperlink{g__raid__md__if_8m_a910062273088d146e8533398780701eb}{sd}}-\/>\mbox{\hyperlink{structg__raid__subdisk_acd19794916930f74ecad38ca7dd69f69}{sd\_state}}) << 16;}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00509}00509                 \textcolor{comment}{/* If disk head is precisely in position -\/ highly prefer it. */}}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00510}00510                 \textcolor{keywordflow}{if} (\mbox{\hyperlink{g__raid_8h_ab5f9a37d0707b2361e9df6af8b951541}{G\_RAID\_SUBDISK\_POS}}(\mbox{\hyperlink{g__raid__md__if_8m_a910062273088d146e8533398780701eb}{sd}}) == \mbox{\hyperlink{g__part__if_8m_a3786db8db96c32f69df9f7cd325a7507}{bp}}-\/>bio\_offset)}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00511}00511                         prio -\/= 2 * \mbox{\hyperlink{g__raid_8h_a11409c7533a90df641a55ed08e1ce71a}{G\_RAID\_SUBDISK\_LOAD\_SCALE}};}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00512}00512                 \textcolor{keywordflow}{else}}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00513}00513                 \textcolor{comment}{/* If disk head is close to position -\/ prefer it. */}}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00514}00514                 \textcolor{keywordflow}{if} (\mbox{\hyperlink{tr__raid1_8c_a996f7be338ccb40d1a2a5abc1ad61759}{ABS}}(\mbox{\hyperlink{g__raid_8h_ab5f9a37d0707b2361e9df6af8b951541}{G\_RAID\_SUBDISK\_POS}}(\mbox{\hyperlink{g__raid__md__if_8m_a910062273088d146e8533398780701eb}{sd}}) -\/ \mbox{\hyperlink{g__part__if_8m_a3786db8db96c32f69df9f7cd325a7507}{bp}}-\/>bio\_offset) <}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00515}00515                     \mbox{\hyperlink{g__raid_8h_a87b6299cade2054652918e321046f223}{G\_RAID\_SUBDISK\_TRACK\_SIZE}})}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00516}00516                         prio -\/= 1 * \mbox{\hyperlink{g__raid_8h_a11409c7533a90df641a55ed08e1ce71a}{G\_RAID\_SUBDISK\_LOAD\_SCALE}};}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00517}00517                 \textcolor{keywordflow}{if} (prio < bestprio) \{}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00518}00518                         best = \mbox{\hyperlink{g__raid__md__if_8m_a910062273088d146e8533398780701eb}{sd}};}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00519}00519                         bestprio = prio;}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00520}00520                 \}}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00521}00521         \}}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00522}00522         \textcolor{keywordflow}{return} (best);}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00523}00523 \}}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00524}00524 }
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00525}00525 \textcolor{keyword}{static} \textcolor{keywordtype}{void}}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00526}\mbox{\hyperlink{tr__raid1_8c_a20f94064bc34a3d81fadc84e598dea5b}{00526}} \mbox{\hyperlink{tr__raid1_8c_a20f94064bc34a3d81fadc84e598dea5b}{g\_raid\_tr\_iostart\_raid1\_read}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structg__raid__tr__object}{g\_raid\_tr\_object}} *tr, \textcolor{keyword}{struct} bio *\mbox{\hyperlink{g__part__if_8m_a3786db8db96c32f69df9f7cd325a7507}{bp}})}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00527}00527 \{}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00528}00528         \textcolor{keyword}{struct }\mbox{\hyperlink{structg__raid__subdisk}{g\_raid\_subdisk}} *\mbox{\hyperlink{g__raid__md__if_8m_a910062273088d146e8533398780701eb}{sd}};}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00529}00529         \textcolor{keyword}{struct }bio *cbp;}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00530}00530 }
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00531}00531         \mbox{\hyperlink{g__raid__md__if_8m_a910062273088d146e8533398780701eb}{sd}} = \mbox{\hyperlink{tr__raid1_8c_a23badff029cca5cbfb66516b9181aafd}{g\_raid\_tr\_raid1\_select\_read\_disk}}(tr-\/>\mbox{\hyperlink{structg__raid__tr__object_adda608cedccd305f267d8593f2bebe7f}{tro\_volume}}, \mbox{\hyperlink{g__part__if_8m_a3786db8db96c32f69df9f7cd325a7507}{bp}}, 0);}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00532}00532         KASSERT(\mbox{\hyperlink{g__raid__md__if_8m_a910062273088d146e8533398780701eb}{sd}} != NULL, (\textcolor{stringliteral}{"{}No active disks in volume \%s."{}},}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00533}00533                 tr-\/>\mbox{\hyperlink{structg__raid__tr__object_adda608cedccd305f267d8593f2bebe7f}{tro\_volume}}-\/>\mbox{\hyperlink{structg__raid__volume_abdedb24b3ca3f4d3020f94e62d63fa05}{v\_name}}));}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00534}00534 }
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00535}00535         cbp = \mbox{\hyperlink{geom_8h_a4ef26e4ec68e35e8f892692c524a3d4f}{g\_clone\_bio}}(\mbox{\hyperlink{g__part__if_8m_a3786db8db96c32f69df9f7cd325a7507}{bp}});}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00536}00536         \textcolor{keywordflow}{if} (cbp == NULL) \{}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00537}00537                 \mbox{\hyperlink{g__raid_8c_aac26055db228a9070904855aa7fcec89}{g\_raid\_iodone}}(\mbox{\hyperlink{g__part__if_8m_a3786db8db96c32f69df9f7cd325a7507}{bp}}, ENOMEM);}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00538}00538                 \textcolor{keywordflow}{return};}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00539}00539         \}}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00540}00540 }
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00541}00541         \mbox{\hyperlink{g__raid_8c_a685376bcb4756d784a9a433ced731e79}{g\_raid\_subdisk\_iostart}}(\mbox{\hyperlink{g__raid__md__if_8m_a910062273088d146e8533398780701eb}{sd}}, cbp);}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00542}00542 \}}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00543}00543 }
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00544}00544 \textcolor{keyword}{static} \textcolor{keywordtype}{void}}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00545}\mbox{\hyperlink{tr__raid1_8c_abb66662b3ad1b5aaf2f0728ecb28ade9}{00545}} \mbox{\hyperlink{tr__raid1_8c_abb66662b3ad1b5aaf2f0728ecb28ade9}{g\_raid\_tr\_iostart\_raid1\_write}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structg__raid__tr__object}{g\_raid\_tr\_object}} *tr, \textcolor{keyword}{struct} bio *\mbox{\hyperlink{g__part__if_8m_a3786db8db96c32f69df9f7cd325a7507}{bp}})}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00546}00546 \{}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00547}00547         \textcolor{keyword}{struct }\mbox{\hyperlink{structg__raid__volume}{g\_raid\_volume}} *\mbox{\hyperlink{g__raid__md__if_8m_aaa46aabd2a891668d71cec64e90b4848}{vol}};}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00548}00548         \textcolor{keyword}{struct }\mbox{\hyperlink{structg__raid__subdisk}{g\_raid\_subdisk}} *\mbox{\hyperlink{g__raid__md__if_8m_a910062273088d146e8533398780701eb}{sd}};}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00549}00549         \textcolor{keyword}{struct }bio\_queue\_head queue;}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00550}00550         \textcolor{keyword}{struct }bio *cbp;}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00551}00551         \textcolor{keywordtype}{int} i;}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00552}00552 }
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00553}00553         \mbox{\hyperlink{g__raid__md__if_8m_aaa46aabd2a891668d71cec64e90b4848}{vol}} = tr-\/>\mbox{\hyperlink{structg__raid__tr__object_adda608cedccd305f267d8593f2bebe7f}{tro\_volume}};}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00554}00554 }
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00555}00555         \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00556}00556 \textcolor{comment}{         * Allocate all bios before sending any request, so we can return}}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00557}00557 \textcolor{comment}{         * ENOMEM in nice and clean way.}}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00558}00558 \textcolor{comment}{         */}}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00559}00559         bioq\_init(\&queue);}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00560}00560         \textcolor{keywordflow}{for} (i = 0; i < \mbox{\hyperlink{g__raid__md__if_8m_aaa46aabd2a891668d71cec64e90b4848}{vol}}-\/>\mbox{\hyperlink{structg__raid__volume_a21482a5ac78a397faf4e95eb1ebef431}{v\_disks\_count}}; i++) \{}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00561}00561                 \mbox{\hyperlink{g__raid__md__if_8m_a910062273088d146e8533398780701eb}{sd}} = \&\mbox{\hyperlink{g__raid__md__if_8m_aaa46aabd2a891668d71cec64e90b4848}{vol}}-\/>\mbox{\hyperlink{structg__raid__volume_a3c43185db4bd1c4818d95a415635854b}{v\_subdisks}}[i];}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00562}00562                 \textcolor{keywordflow}{switch} (\mbox{\hyperlink{g__raid__md__if_8m_a910062273088d146e8533398780701eb}{sd}}-\/>\mbox{\hyperlink{structg__raid__subdisk_acd19794916930f74ecad38ca7dd69f69}{sd\_state}}) \{}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00563}00563                 \textcolor{keywordflow}{case} \mbox{\hyperlink{g__raid_8h_a498effa0ffa87b75f6c40381c6d4eb39}{G\_RAID\_SUBDISK\_S\_ACTIVE}}:}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00564}00564                         \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00565}00565                 \textcolor{keywordflow}{case} \mbox{\hyperlink{g__raid_8h_a856d6801d600e0089b0cd39ff5af7224}{G\_RAID\_SUBDISK\_S\_REBUILD}}:}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00566}00566                         \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00567}00567 \textcolor{comment}{                         * When rebuilding, only part of this subdisk is}}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00568}00568 \textcolor{comment}{                         * writable, the rest will be written as part of the}}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00569}00569 \textcolor{comment}{                         * that process.}}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00570}00570 \textcolor{comment}{                         */}}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00571}00571                         \textcolor{keywordflow}{if} (\mbox{\hyperlink{g__part__if_8m_a3786db8db96c32f69df9f7cd325a7507}{bp}}-\/>bio\_offset >= \mbox{\hyperlink{g__raid__md__if_8m_a910062273088d146e8533398780701eb}{sd}}-\/>\mbox{\hyperlink{structg__raid__subdisk_aca58c7c621e10d2cbe97cd1c87214d7b}{sd\_rebuild\_pos}})}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00572}00572                                 \textcolor{keywordflow}{continue};}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00573}00573                         \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00574}00574                 \textcolor{keywordflow}{case} \mbox{\hyperlink{g__raid_8h_a41bff35bee21218d2aba7a261eb2e83c}{G\_RAID\_SUBDISK\_S\_STALE}}:}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00575}00575                 \textcolor{keywordflow}{case} \mbox{\hyperlink{g__raid_8h_a8c3d62bf4e551976a8941a23c8984e5d}{G\_RAID\_SUBDISK\_S\_RESYNC}}:}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00576}00576                         \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00577}00577 \textcolor{comment}{                         * Resyncing still writes on the theory that the}}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00578}00578 \textcolor{comment}{                         * resync'd disk is very close and writing it will}}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00579}00579 \textcolor{comment}{                         * keep it that way better if we keep up while}}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00580}00580 \textcolor{comment}{                         * resyncing.}}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00581}00581 \textcolor{comment}{                         */}}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00582}00582                         \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00583}00583                 \textcolor{keywordflow}{default}:}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00584}00584                         \textcolor{keywordflow}{continue};}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00585}00585                 \}}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00586}00586                 cbp = \mbox{\hyperlink{geom_8h_a4ef26e4ec68e35e8f892692c524a3d4f}{g\_clone\_bio}}(\mbox{\hyperlink{g__part__if_8m_a3786db8db96c32f69df9f7cd325a7507}{bp}});}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00587}00587                 \textcolor{keywordflow}{if} (cbp == NULL)}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00588}00588                         \textcolor{keywordflow}{goto} failure;}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00589}00589                 cbp-\/>bio\_caller1 = \mbox{\hyperlink{g__raid__md__if_8m_a910062273088d146e8533398780701eb}{sd}};}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00590}00590                 bioq\_insert\_tail(\&queue, cbp);}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00591}00591         \}}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00592}00592         \textcolor{keywordflow}{while} ((cbp = bioq\_takefirst(\&queue)) != NULL) \{}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00593}00593                 \mbox{\hyperlink{g__raid__md__if_8m_a910062273088d146e8533398780701eb}{sd}} = cbp-\/>bio\_caller1;}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00594}00594                 cbp-\/>bio\_caller1 = NULL;}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00595}00595                 \mbox{\hyperlink{g__raid_8c_a685376bcb4756d784a9a433ced731e79}{g\_raid\_subdisk\_iostart}}(\mbox{\hyperlink{g__raid__md__if_8m_a910062273088d146e8533398780701eb}{sd}}, cbp);}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00596}00596         \}}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00597}00597         \textcolor{keywordflow}{return};}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00598}00598 failure:}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00599}00599         \textcolor{keywordflow}{while} ((cbp = bioq\_takefirst(\&queue)) != NULL)}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00600}00600                 \mbox{\hyperlink{geom_8h_ae3cbea7d4bf48f25bb609df3d3f0bb28}{g\_destroy\_bio}}(cbp);}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00601}00601         \textcolor{keywordflow}{if} (\mbox{\hyperlink{g__part__if_8m_a3786db8db96c32f69df9f7cd325a7507}{bp}}-\/>bio\_error == 0)}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00602}00602                 \mbox{\hyperlink{g__part__if_8m_a3786db8db96c32f69df9f7cd325a7507}{bp}}-\/>bio\_error = ENOMEM;}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00603}00603         \mbox{\hyperlink{g__raid_8c_aac26055db228a9070904855aa7fcec89}{g\_raid\_iodone}}(\mbox{\hyperlink{g__part__if_8m_a3786db8db96c32f69df9f7cd325a7507}{bp}}, \mbox{\hyperlink{g__part__if_8m_a3786db8db96c32f69df9f7cd325a7507}{bp}}-\/>bio\_error);}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00604}00604 \}}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00605}00605 }
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00606}00606 \textcolor{keyword}{static} \textcolor{keywordtype}{void}}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00607}\mbox{\hyperlink{tr__raid1_8c_aef6ddd3c65b27baa705f62318ceeea2c}{00607}} \mbox{\hyperlink{tr__raid1_8c_af942a22457c9e994bfac3a56a078dc58}{g\_raid\_tr\_iostart\_raid1}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structg__raid__tr__object}{g\_raid\_tr\_object}} *tr, \textcolor{keyword}{struct} bio *\mbox{\hyperlink{g__part__if_8m_a3786db8db96c32f69df9f7cd325a7507}{bp}})}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00608}00608 \{}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00609}00609         \textcolor{keyword}{struct }\mbox{\hyperlink{structg__raid__volume}{g\_raid\_volume}} *\mbox{\hyperlink{g__raid__md__if_8m_aaa46aabd2a891668d71cec64e90b4848}{vol}};}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00610}00610         \textcolor{keyword}{struct }\mbox{\hyperlink{structg__raid__tr__raid1__object}{g\_raid\_tr\_raid1\_object}} *trs;}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00611}00611 }
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00612}00612         \mbox{\hyperlink{g__raid__md__if_8m_aaa46aabd2a891668d71cec64e90b4848}{vol}} = tr-\/>\mbox{\hyperlink{structg__raid__tr__object_adda608cedccd305f267d8593f2bebe7f}{tro\_volume}};}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00613}00613         trs = (\textcolor{keyword}{struct }\mbox{\hyperlink{structg__raid__tr__raid1__object}{g\_raid\_tr\_raid1\_object}} *)tr;}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00614}00614         \textcolor{keywordflow}{if} (\mbox{\hyperlink{g__raid__md__if_8m_aaa46aabd2a891668d71cec64e90b4848}{vol}}-\/>\mbox{\hyperlink{structg__raid__volume_a5a90d68c226a2ae59ff670759f9cad28}{v\_state}} != \mbox{\hyperlink{g__raid_8h_a20afd300edb0e3cdbfb0386d2fbb36c3}{G\_RAID\_VOLUME\_S\_OPTIMAL}} \&\&}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00615}00615             \mbox{\hyperlink{g__raid__md__if_8m_aaa46aabd2a891668d71cec64e90b4848}{vol}}-\/>\mbox{\hyperlink{structg__raid__volume_a5a90d68c226a2ae59ff670759f9cad28}{v\_state}} != \mbox{\hyperlink{g__raid_8h_a48e4e755439965447a7116e19309dd16}{G\_RAID\_VOLUME\_S\_SUBOPTIMAL}} \&\&}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00616}00616             \mbox{\hyperlink{g__raid__md__if_8m_aaa46aabd2a891668d71cec64e90b4848}{vol}}-\/>\mbox{\hyperlink{structg__raid__volume_a5a90d68c226a2ae59ff670759f9cad28}{v\_state}} != \mbox{\hyperlink{g__raid_8h_a127fdd15d01e1ff21b274d56dabc3df5}{G\_RAID\_VOLUME\_S\_DEGRADED}}) \{}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00617}00617                 \mbox{\hyperlink{g__raid_8c_aac26055db228a9070904855aa7fcec89}{g\_raid\_iodone}}(\mbox{\hyperlink{g__part__if_8m_a3786db8db96c32f69df9f7cd325a7507}{bp}}, EIO);}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00618}00618                 \textcolor{keywordflow}{return};}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00619}00619         \}}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00620}00620         \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00621}00621 \textcolor{comment}{         * If we're rebuilding, squeeze in rebuild activity every so often,}}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00622}00622 \textcolor{comment}{         * even when the disk is busy.  Be sure to only count real I/O}}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00623}00623 \textcolor{comment}{         * to the disk.  All 'SPECIAL' I/O is traffic generated to the disk}}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00624}00624 \textcolor{comment}{         * by this module.}}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00625}00625 \textcolor{comment}{         */}}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00626}00626         \textcolor{keywordflow}{if} (trs-\/>\mbox{\hyperlink{structg__raid__tr__raid1__object_a71f6f7e36e0c38408ea4d55363d852d9}{trso\_failed\_sd}} != NULL \&\&}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00627}00627             !(\mbox{\hyperlink{g__part__if_8m_a3786db8db96c32f69df9f7cd325a7507}{bp}}-\/>bio\_cflags \& \mbox{\hyperlink{g__raid_8h_aac3f027cbd94314b36e8c7b9eda64181}{G\_RAID\_BIO\_FLAG\_SPECIAL}})) \{}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00628}00628                 \textcolor{comment}{/* Make this new or running now round short. */}}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00629}00629                 trs-\/>\mbox{\hyperlink{structg__raid__tr__raid1__object_a48c83778a4f4b189859229644ab92595}{trso\_recover\_slabs}} = 0;}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00630}00630                 \textcolor{keywordflow}{if} (-\/-\/trs-\/>\mbox{\hyperlink{structg__raid__tr__raid1__object_ab7e8381e99a88e622f8189358dbd106c}{trso\_fair\_io}} <= 0) \{}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00631}00631                         trs-\/>\mbox{\hyperlink{structg__raid__tr__raid1__object_ab7e8381e99a88e622f8189358dbd106c}{trso\_fair\_io}} = \mbox{\hyperlink{tr__raid1_8c_a9d7427e22ecf16b0472d862199d0635a}{g\_raid1\_rebuild\_fair\_io}};}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00632}00632                         \mbox{\hyperlink{tr__raid1_8c_a759d79b32c464fca6127394d5d5aad48}{g\_raid\_tr\_raid1\_rebuild\_some}}(tr);}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00633}00633                 \}}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00634}00634         \}}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00635}00635         \textcolor{keywordflow}{switch} (\mbox{\hyperlink{g__part__if_8m_a3786db8db96c32f69df9f7cd325a7507}{bp}}-\/>bio\_cmd) \{}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00636}00636         \textcolor{keywordflow}{case} BIO\_READ:}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00637}00637                 \mbox{\hyperlink{tr__raid1_8c_a20f94064bc34a3d81fadc84e598dea5b}{g\_raid\_tr\_iostart\_raid1\_read}}(tr, \mbox{\hyperlink{g__part__if_8m_a3786db8db96c32f69df9f7cd325a7507}{bp}});}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00638}00638                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00639}00639         \textcolor{keywordflow}{case} BIO\_WRITE:}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00640}00640         \textcolor{keywordflow}{case} BIO\_DELETE:}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00641}00641                 \mbox{\hyperlink{tr__raid1_8c_abb66662b3ad1b5aaf2f0728ecb28ade9}{g\_raid\_tr\_iostart\_raid1\_write}}(tr, \mbox{\hyperlink{g__part__if_8m_a3786db8db96c32f69df9f7cd325a7507}{bp}});}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00642}00642                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00643}00643         \textcolor{keywordflow}{case} BIO\_SPEEDUP:}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00644}00644         \textcolor{keywordflow}{case} BIO\_FLUSH:}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00645}00645                 \mbox{\hyperlink{g__raid_8c_a1f79988e4121e92e58c04fbc2971aeb4}{g\_raid\_tr\_flush\_common}}(tr, \mbox{\hyperlink{g__part__if_8m_a3786db8db96c32f69df9f7cd325a7507}{bp}});}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00646}00646                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00647}00647         \textcolor{keywordflow}{default}:}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00648}00648                 KASSERT(1 == 0, (\textcolor{stringliteral}{"{}Invalid command here: \%u (volume=\%s)"{}},}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00649}00649                     \mbox{\hyperlink{g__part__if_8m_a3786db8db96c32f69df9f7cd325a7507}{bp}}-\/>bio\_cmd, \mbox{\hyperlink{g__raid__md__if_8m_aaa46aabd2a891668d71cec64e90b4848}{vol}}-\/>\mbox{\hyperlink{structg__raid__volume_abdedb24b3ca3f4d3020f94e62d63fa05}{v\_name}}));}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00650}00650                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00651}00651         \}}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00652}00652 \}}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00653}00653 }
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00654}00654 \textcolor{keyword}{static} \textcolor{keywordtype}{void}}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00655}\mbox{\hyperlink{tr__raid1_8c_a599aac38eaf498dd6897ab562681985e}{00655}} \mbox{\hyperlink{tr__raid1_8c_a5ec0fd61e63978a0fe3fb64a01f9ff62}{g\_raid\_tr\_iodone\_raid1}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structg__raid__tr__object}{g\_raid\_tr\_object}} *tr,}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00656}00656     \textcolor{keyword}{struct} \mbox{\hyperlink{structg__raid__subdisk}{g\_raid\_subdisk}} *\mbox{\hyperlink{g__raid__md__if_8m_a910062273088d146e8533398780701eb}{sd}}, \textcolor{keyword}{struct} bio *\mbox{\hyperlink{g__part__if_8m_a3786db8db96c32f69df9f7cd325a7507}{bp}})}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00657}00657 \{}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00658}00658         \textcolor{keyword}{struct }bio *cbp;}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00659}00659         \textcolor{keyword}{struct }\mbox{\hyperlink{structg__raid__subdisk}{g\_raid\_subdisk}} *nsd;}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00660}00660         \textcolor{keyword}{struct }\mbox{\hyperlink{structg__raid__volume}{g\_raid\_volume}} *\mbox{\hyperlink{g__raid__md__if_8m_aaa46aabd2a891668d71cec64e90b4848}{vol}};}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00661}00661         \textcolor{keyword}{struct }bio *pbp;}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00662}00662         \textcolor{keyword}{struct }\mbox{\hyperlink{structg__raid__tr__raid1__object}{g\_raid\_tr\_raid1\_object}} *trs;}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00663}00663         uintptr\_t *mask;}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00664}00664         \textcolor{keywordtype}{int} error, do\_write;}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00665}00665 }
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00666}00666         trs = (\textcolor{keyword}{struct }\mbox{\hyperlink{structg__raid__tr__raid1__object}{g\_raid\_tr\_raid1\_object}} *)tr;}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00667}00667         \mbox{\hyperlink{g__raid__md__if_8m_aaa46aabd2a891668d71cec64e90b4848}{vol}} = tr-\/>\mbox{\hyperlink{structg__raid__tr__object_adda608cedccd305f267d8593f2bebe7f}{tro\_volume}};}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00668}00668         \textcolor{keywordflow}{if} (\mbox{\hyperlink{g__part__if_8m_a3786db8db96c32f69df9f7cd325a7507}{bp}}-\/>bio\_cflags \& \mbox{\hyperlink{g__raid_8h_a4124ef9ee0577985d8115e21c9124296}{G\_RAID\_BIO\_FLAG\_SYNC}}) \{}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00669}00669                 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00670}00670 \textcolor{comment}{                 * This operation is part of a rebuild or resync operation.}}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00671}00671 \textcolor{comment}{                 * See what work just got done, then schedule the next bit of}}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00672}00672 \textcolor{comment}{                 * work, if any.  Rebuild/resync is done a little bit at a}}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00673}00673 \textcolor{comment}{                 * time.  Either when a timeout happens, or after we get a}}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00674}00674 \textcolor{comment}{                 * bunch of I/Os to the disk (to make sure an active system}}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00675}00675 \textcolor{comment}{                 * will complete in a sane amount of time).}}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00676}00676 \textcolor{comment}{                 *}}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00677}00677 \textcolor{comment}{                 * We are setup to do differing amounts of work for each of}}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00678}00678 \textcolor{comment}{                 * these cases.  so long as the slabs is smallish (less than}}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00679}00679 \textcolor{comment}{                 * 50 or so, I'd guess, but that's just a WAG), we shouldn't}}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00680}00680 \textcolor{comment}{                 * have any bio starvation issues.  For active disks, we do}}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00681}00681 \textcolor{comment}{                 * 5MB of data, for inactive ones, we do 50MB.}}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00682}00682 \textcolor{comment}{                 */}}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00683}00683                 \textcolor{keywordflow}{if} (trs-\/>\mbox{\hyperlink{structg__raid__tr__raid1__object_ab4ed4109230e65364f77539ecf0d52f1}{trso\_type}} == \mbox{\hyperlink{tr__raid1_8c_a54d21ddc205a11a78c293b3e645b7f05}{TR\_RAID1\_REBUILD}}) \{}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00684}00684                         \textcolor{keywordflow}{if} (\mbox{\hyperlink{g__part__if_8m_a3786db8db96c32f69df9f7cd325a7507}{bp}}-\/>bio\_cmd == BIO\_READ) \{}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00685}00685                                 \textcolor{comment}{/* Immediately abort rebuild, if requested. */}}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00686}00686                                 \textcolor{keywordflow}{if} (trs-\/>\mbox{\hyperlink{structg__raid__tr__raid1__object_aa2a5e604edc54ebe3bc48693696f2f7d}{trso\_flags}} \& \mbox{\hyperlink{tr__raid1_8c_ac8df5babf9a8e344ed5ffee26ebe7925}{TR\_RAID1\_F\_ABORT}}) \{}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00687}00687                                         trs-\/>\mbox{\hyperlink{structg__raid__tr__raid1__object_aa2a5e604edc54ebe3bc48693696f2f7d}{trso\_flags}} \&= \string~TR\_RAID1\_F\_DOING\_SOME;}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00688}00688                                         \mbox{\hyperlink{tr__raid1_8c_a1621e05a87c4426395942ed8c6644c4d}{g\_raid\_tr\_raid1\_rebuild\_abort}}(tr);}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00689}00689                                         \textcolor{keywordflow}{return};}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00690}00690                                 \}}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00691}00691 }
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00692}00692                                 \textcolor{comment}{/* On read error, skip and cross fingers. */}}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00693}00693                                 \textcolor{keywordflow}{if} (\mbox{\hyperlink{g__part__if_8m_a3786db8db96c32f69df9f7cd325a7507}{bp}}-\/>bio\_error != 0) \{}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00694}00694                                         \mbox{\hyperlink{g__raid_8h_a754366ef9ae163d81d8948151a02cb4d}{G\_RAID\_LOGREQ}}(0, \mbox{\hyperlink{g__part__if_8m_a3786db8db96c32f69df9f7cd325a7507}{bp}},}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00695}00695                                             \textcolor{stringliteral}{"{}Read error during rebuild (\%d), "{}}}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00696}00696                                             \textcolor{stringliteral}{"{}possible data loss!"{}},}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00697}00697                                             \mbox{\hyperlink{g__part__if_8m_a3786db8db96c32f69df9f7cd325a7507}{bp}}-\/>bio\_error);}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00698}00698                                         \textcolor{keywordflow}{goto} rebuild\_round\_done;}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00699}00699                                 \}}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00700}00700 }
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00701}00701                                 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00702}00702 \textcolor{comment}{                                 * The read operation finished, queue the}}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00703}00703 \textcolor{comment}{                                 * write and get out.}}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00704}00704 \textcolor{comment}{                                 */}}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00705}00705                                 \mbox{\hyperlink{g__raid_8h_a754366ef9ae163d81d8948151a02cb4d}{G\_RAID\_LOGREQ}}(4, \mbox{\hyperlink{g__part__if_8m_a3786db8db96c32f69df9f7cd325a7507}{bp}}, \textcolor{stringliteral}{"{}rebuild read done. \%d"{}},}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00706}00706                                     \mbox{\hyperlink{g__part__if_8m_a3786db8db96c32f69df9f7cd325a7507}{bp}}-\/>bio\_error);}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00707}00707                                 \mbox{\hyperlink{g__part__if_8m_a3786db8db96c32f69df9f7cd325a7507}{bp}}-\/>bio\_cmd = BIO\_WRITE;}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00708}00708                                 \mbox{\hyperlink{g__part__if_8m_a3786db8db96c32f69df9f7cd325a7507}{bp}}-\/>bio\_cflags = \mbox{\hyperlink{g__raid_8h_a4124ef9ee0577985d8115e21c9124296}{G\_RAID\_BIO\_FLAG\_SYNC}};}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00709}00709                                 \mbox{\hyperlink{g__raid_8h_a754366ef9ae163d81d8948151a02cb4d}{G\_RAID\_LOGREQ}}(4, \mbox{\hyperlink{g__part__if_8m_a3786db8db96c32f69df9f7cd325a7507}{bp}}, \textcolor{stringliteral}{"{}Queueing rebuild write."{}});}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00710}00710                                 \mbox{\hyperlink{g__raid_8c_a685376bcb4756d784a9a433ced731e79}{g\_raid\_subdisk\_iostart}}(trs-\/>\mbox{\hyperlink{structg__raid__tr__raid1__object_a71f6f7e36e0c38408ea4d55363d852d9}{trso\_failed\_sd}}, \mbox{\hyperlink{g__part__if_8m_a3786db8db96c32f69df9f7cd325a7507}{bp}});}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00711}00711                         \} \textcolor{keywordflow}{else} \{}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00712}00712                                 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00713}00713 \textcolor{comment}{                                 * The write operation just finished.  Do}}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00714}00714 \textcolor{comment}{                                 * another.  We keep cloning the master bio}}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00715}00715 \textcolor{comment}{                                 * since it has the right buffers allocated to}}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00716}00716 \textcolor{comment}{                                 * it.}}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00717}00717 \textcolor{comment}{                                 */}}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00718}00718                                 \mbox{\hyperlink{g__raid_8h_a754366ef9ae163d81d8948151a02cb4d}{G\_RAID\_LOGREQ}}(4, \mbox{\hyperlink{g__part__if_8m_a3786db8db96c32f69df9f7cd325a7507}{bp}},}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00719}00719                                     \textcolor{stringliteral}{"{}rebuild write done. Error \%d"{}},}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00720}00720                                     \mbox{\hyperlink{g__part__if_8m_a3786db8db96c32f69df9f7cd325a7507}{bp}}-\/>bio\_error);}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00721}00721                                 nsd = trs-\/>\mbox{\hyperlink{structg__raid__tr__raid1__object_a71f6f7e36e0c38408ea4d55363d852d9}{trso\_failed\_sd}};}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00722}00722                                 \textcolor{keywordflow}{if} (\mbox{\hyperlink{g__part__if_8m_a3786db8db96c32f69df9f7cd325a7507}{bp}}-\/>bio\_error != 0 ||}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00723}00723                                     trs-\/>\mbox{\hyperlink{structg__raid__tr__raid1__object_aa2a5e604edc54ebe3bc48693696f2f7d}{trso\_flags}} \& \mbox{\hyperlink{tr__raid1_8c_ac8df5babf9a8e344ed5ffee26ebe7925}{TR\_RAID1\_F\_ABORT}}) \{}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00724}00724                                         \textcolor{keywordflow}{if} ((trs-\/>\mbox{\hyperlink{structg__raid__tr__raid1__object_aa2a5e604edc54ebe3bc48693696f2f7d}{trso\_flags}} \&}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00725}00725                                             \mbox{\hyperlink{tr__raid1_8c_ac8df5babf9a8e344ed5ffee26ebe7925}{TR\_RAID1\_F\_ABORT}}) == 0) \{}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00726}00726                                                 \mbox{\hyperlink{tr__raid1_8c_aaf1bb5f56413e3729d2cb75fb1f75dd4}{g\_raid\_tr\_raid1\_fail\_disk}}(\mbox{\hyperlink{g__raid__md__if_8m_a910062273088d146e8533398780701eb}{sd}}-\/>\mbox{\hyperlink{structg__raid__subdisk_af107ee6026dc0f10eeeac8b75ed91e50}{sd\_softc}},}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00727}00727                                                     nsd, nsd-\/>\mbox{\hyperlink{structg__raid__subdisk_a5570ab684f57213078d94750e63354e1}{sd\_disk}});}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00728}00728                                         \}}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00729}00729                                         trs-\/>\mbox{\hyperlink{structg__raid__tr__raid1__object_aa2a5e604edc54ebe3bc48693696f2f7d}{trso\_flags}} \&= \string~TR\_RAID1\_F\_DOING\_SOME;}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00730}00730                                         \mbox{\hyperlink{tr__raid1_8c_a1621e05a87c4426395942ed8c6644c4d}{g\_raid\_tr\_raid1\_rebuild\_abort}}(tr);}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00731}00731                                         \textcolor{keywordflow}{return};}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00732}00732                                 \}}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00733}00733 rebuild\_round\_done:}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00734}00734                                 nsd = trs-\/>\mbox{\hyperlink{structg__raid__tr__raid1__object_a71f6f7e36e0c38408ea4d55363d852d9}{trso\_failed\_sd}};}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00735}00735                                 trs-\/>\mbox{\hyperlink{structg__raid__tr__raid1__object_aa2a5e604edc54ebe3bc48693696f2f7d}{trso\_flags}} \&= \string~TR\_RAID1\_F\_LOCKED;}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00736}00736                                 \mbox{\hyperlink{g__raid_8c_ae97b7a5015a2b67a9c1853bf1d1ec4b1}{g\_raid\_unlock\_range}}(\mbox{\hyperlink{g__raid__md__if_8m_a910062273088d146e8533398780701eb}{sd}}-\/>\mbox{\hyperlink{structg__raid__subdisk_ab7f11cd5b966d381d1ae75c6ac9e3ddd}{sd\_volume}},}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00737}00737                                     \mbox{\hyperlink{g__part__if_8m_a3786db8db96c32f69df9f7cd325a7507}{bp}}-\/>bio\_offset, \mbox{\hyperlink{g__part__if_8m_a3786db8db96c32f69df9f7cd325a7507}{bp}}-\/>bio\_length);}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00738}00738                                 nsd-\/>\mbox{\hyperlink{structg__raid__subdisk_aca58c7c621e10d2cbe97cd1c87214d7b}{sd\_rebuild\_pos}} += \mbox{\hyperlink{g__part__if_8m_a3786db8db96c32f69df9f7cd325a7507}{bp}}-\/>bio\_length;}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00739}00739                                 \textcolor{keywordflow}{if} (nsd-\/>\mbox{\hyperlink{structg__raid__subdisk_aca58c7c621e10d2cbe97cd1c87214d7b}{sd\_rebuild\_pos}} >= nsd-\/>\mbox{\hyperlink{structg__raid__subdisk_abc4da1103e29e3a8e2bbadb18fbccbf6}{sd\_size}}) \{}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00740}00740                                         \mbox{\hyperlink{tr__raid1_8c_a424414225997bd3c368e2ff0c136997a}{g\_raid\_tr\_raid1\_rebuild\_finish}}(tr);}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00741}00741                                         \textcolor{keywordflow}{return};}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00742}00742                                 \}}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00743}00743 }
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00744}00744                                 \textcolor{comment}{/* Abort rebuild if we are stopping */}}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00745}00745                                 \textcolor{keywordflow}{if} (trs-\/>\mbox{\hyperlink{structg__raid__tr__raid1__object_a9cc5c15ab1d890783628073d7c58e693}{trso\_stopping}}) \{}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00746}00746                                         trs-\/>\mbox{\hyperlink{structg__raid__tr__raid1__object_aa2a5e604edc54ebe3bc48693696f2f7d}{trso\_flags}} \&= \string~TR\_RAID1\_F\_DOING\_SOME;}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00747}00747                                         \mbox{\hyperlink{tr__raid1_8c_a1621e05a87c4426395942ed8c6644c4d}{g\_raid\_tr\_raid1\_rebuild\_abort}}(tr);}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00748}00748                                         \textcolor{keywordflow}{return};}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00749}00749                                 \}}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00750}00750 }
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00751}00751                                 \textcolor{keywordflow}{if} (-\/-\/trs-\/>\mbox{\hyperlink{structg__raid__tr__raid1__object_a3fcc84b5e1a2d2784ecd9eae6f30f7b4}{trso\_meta\_update}} <= 0) \{}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00752}00752                                         \mbox{\hyperlink{g__raid_8c_a9cf6273a366922dadcce1047df240cb5}{g\_raid\_write\_metadata}}(\mbox{\hyperlink{g__raid__md__if_8m_aaa46aabd2a891668d71cec64e90b4848}{vol}}-\/>\mbox{\hyperlink{structg__raid__volume_a5ddf3eff3aa40bdcbbfedb4d0458b332}{v\_softc}},}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00753}00753                                             \mbox{\hyperlink{g__raid__md__if_8m_aaa46aabd2a891668d71cec64e90b4848}{vol}}, nsd, nsd-\/>\mbox{\hyperlink{structg__raid__subdisk_a5570ab684f57213078d94750e63354e1}{sd\_disk}});}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00754}00754                                         trs-\/>\mbox{\hyperlink{structg__raid__tr__raid1__object_a3fcc84b5e1a2d2784ecd9eae6f30f7b4}{trso\_meta\_update}} =}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00755}00755                                             \mbox{\hyperlink{tr__raid1_8c_ade086c9ab8b71a57c696d08bbf667e76}{g\_raid1\_rebuild\_meta\_update}};}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00756}00756                                 \}}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00757}00757                                 trs-\/>\mbox{\hyperlink{structg__raid__tr__raid1__object_aa2a5e604edc54ebe3bc48693696f2f7d}{trso\_flags}} \&= \string~TR\_RAID1\_F\_DOING\_SOME;}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00758}00758                                 \textcolor{keywordflow}{if} (-\/-\/trs-\/>\mbox{\hyperlink{structg__raid__tr__raid1__object_a48c83778a4f4b189859229644ab92595}{trso\_recover\_slabs}} <= 0)}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00759}00759                                         \textcolor{keywordflow}{return};}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00760}00760                                 \mbox{\hyperlink{tr__raid1_8c_a759d79b32c464fca6127394d5d5aad48}{g\_raid\_tr\_raid1\_rebuild\_some}}(tr);}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00761}00761                         \}}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00762}00762                 \} \textcolor{keywordflow}{else} \textcolor{keywordflow}{if} (trs-\/>\mbox{\hyperlink{structg__raid__tr__raid1__object_ab4ed4109230e65364f77539ecf0d52f1}{trso\_type}} == \mbox{\hyperlink{tr__raid1_8c_afc7f212ac70fbd4db051b75683420e02}{TR\_RAID1\_RESYNC}}) \{}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00763}00763                         \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00764}00764 \textcolor{comment}{                         * read good sd, read bad sd in parallel.  when both}}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00765}00765 \textcolor{comment}{                         * done, compare the buffers.  write good to the bad}}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00766}00766 \textcolor{comment}{                         * if different.  do the next bit of work.}}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00767}00767 \textcolor{comment}{                         */}}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00768}00768                         panic(\textcolor{stringliteral}{"{}Somehow, we think we're doing a resync"{}});}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00769}00769                 \}}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00770}00770                 \textcolor{keywordflow}{return};}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00771}00771         \}}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00772}00772         pbp = \mbox{\hyperlink{g__part__if_8m_a3786db8db96c32f69df9f7cd325a7507}{bp}}-\/>bio\_parent;}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00773}00773         pbp-\/>bio\_inbed++;}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00774}00774         \textcolor{keywordflow}{if} (\mbox{\hyperlink{g__part__if_8m_a3786db8db96c32f69df9f7cd325a7507}{bp}}-\/>bio\_cmd == BIO\_READ \&\& \mbox{\hyperlink{g__part__if_8m_a3786db8db96c32f69df9f7cd325a7507}{bp}}-\/>bio\_error != 0) \{}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00775}00775                 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00776}00776 \textcolor{comment}{                 * Read failed on first drive.  Retry the read error on}}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00777}00777 \textcolor{comment}{                 * another disk drive, if available, before erroring out the}}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00778}00778 \textcolor{comment}{                 * read.}}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00779}00779 \textcolor{comment}{                 */}}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00780}00780                 \mbox{\hyperlink{g__raid__md__if_8m_a910062273088d146e8533398780701eb}{sd}}-\/>\mbox{\hyperlink{structg__raid__subdisk_a5570ab684f57213078d94750e63354e1}{sd\_disk}}-\/>\mbox{\hyperlink{structg__raid__disk_a50fc20a73cd8aefbfdef48ac9c2762f8}{d\_read\_errs}}++;}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00781}00781                 \mbox{\hyperlink{g__raid_8h_a754366ef9ae163d81d8948151a02cb4d}{G\_RAID\_LOGREQ}}(0, \mbox{\hyperlink{g__part__if_8m_a3786db8db96c32f69df9f7cd325a7507}{bp}},}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00782}00782                     \textcolor{stringliteral}{"{}Read error (\%d), \%d read errors total"{}},}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00783}00783                     \mbox{\hyperlink{g__part__if_8m_a3786db8db96c32f69df9f7cd325a7507}{bp}}-\/>bio\_error, \mbox{\hyperlink{g__raid__md__if_8m_a910062273088d146e8533398780701eb}{sd}}-\/>\mbox{\hyperlink{structg__raid__subdisk_a5570ab684f57213078d94750e63354e1}{sd\_disk}}-\/>\mbox{\hyperlink{structg__raid__disk_a50fc20a73cd8aefbfdef48ac9c2762f8}{d\_read\_errs}});}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00784}00784 }
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00785}00785                 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00786}00786 \textcolor{comment}{                 * If there are too many read errors, we move to degraded.}}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00787}00787 \textcolor{comment}{                 * XXX Do we want to FAIL the drive (eg, make the user redo}}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00788}00788 \textcolor{comment}{                 * everything to get it back in sync), or just degrade the}}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00789}00789 \textcolor{comment}{                 * drive, which kicks off a resync?}}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00790}00790 \textcolor{comment}{                 */}}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00791}00791                 do\_write = 1;}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00792}00792                 \textcolor{keywordflow}{if} (\mbox{\hyperlink{g__raid__md__if_8m_a910062273088d146e8533398780701eb}{sd}}-\/>\mbox{\hyperlink{structg__raid__subdisk_a5570ab684f57213078d94750e63354e1}{sd\_disk}}-\/>\mbox{\hyperlink{structg__raid__disk_a50fc20a73cd8aefbfdef48ac9c2762f8}{d\_read\_errs}} > \mbox{\hyperlink{g__raid_8c_adfba98ac942584aa94a58153ed0837e2}{g\_raid\_read\_err\_thresh}}) \{}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00793}00793                         \mbox{\hyperlink{tr__raid1_8c_aaf1bb5f56413e3729d2cb75fb1f75dd4}{g\_raid\_tr\_raid1\_fail\_disk}}(\mbox{\hyperlink{g__raid__md__if_8m_a910062273088d146e8533398780701eb}{sd}}-\/>\mbox{\hyperlink{structg__raid__subdisk_af107ee6026dc0f10eeeac8b75ed91e50}{sd\_softc}}, \mbox{\hyperlink{g__raid__md__if_8m_a910062273088d146e8533398780701eb}{sd}}, \mbox{\hyperlink{g__raid__md__if_8m_a910062273088d146e8533398780701eb}{sd}}-\/>\mbox{\hyperlink{structg__raid__subdisk_a5570ab684f57213078d94750e63354e1}{sd\_disk}});}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00794}00794                         \textcolor{keywordflow}{if} (pbp-\/>bio\_children == 1)}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00795}00795                                 do\_write = 0;}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00796}00796                 \}}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00797}00797 }
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00798}00798                 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00799}00799 \textcolor{comment}{                 * Find the other disk, and try to do the I/O to it.}}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00800}00800 \textcolor{comment}{                 */}}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00801}00801                 mask = (uintptr\_t *)(\&pbp-\/>bio\_driver2);}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00802}00802                 \textcolor{keywordflow}{if} (pbp-\/>bio\_children == 1) \{}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00803}00803                         \textcolor{comment}{/* Save original subdisk. */}}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00804}00804                         pbp-\/>bio\_driver1 = do\_write ? \mbox{\hyperlink{g__raid__md__if_8m_a910062273088d146e8533398780701eb}{sd}} : NULL;}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00805}00805                         *mask = 0;}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00806}00806                 \}}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00807}00807                 *mask |= 1 << \mbox{\hyperlink{g__raid__md__if_8m_a910062273088d146e8533398780701eb}{sd}}-\/>\mbox{\hyperlink{structg__raid__subdisk_a415c982fbd2537861e39aa04fa582969}{sd\_pos}};}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00808}00808                 nsd = \mbox{\hyperlink{tr__raid1_8c_a23badff029cca5cbfb66516b9181aafd}{g\_raid\_tr\_raid1\_select\_read\_disk}}(\mbox{\hyperlink{g__raid__md__if_8m_aaa46aabd2a891668d71cec64e90b4848}{vol}}, pbp, *mask);}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00809}00809                 \textcolor{keywordflow}{if} (nsd != NULL \&\& (cbp = \mbox{\hyperlink{geom_8h_a4ef26e4ec68e35e8f892692c524a3d4f}{g\_clone\_bio}}(pbp)) != NULL) \{}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00810}00810                         \mbox{\hyperlink{geom_8h_ae3cbea7d4bf48f25bb609df3d3f0bb28}{g\_destroy\_bio}}(\mbox{\hyperlink{g__part__if_8m_a3786db8db96c32f69df9f7cd325a7507}{bp}});}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00811}00811                         \mbox{\hyperlink{g__raid_8h_a754366ef9ae163d81d8948151a02cb4d}{G\_RAID\_LOGREQ}}(2, cbp, \textcolor{stringliteral}{"{}Retrying read from \%d"{}},}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00812}00812                             nsd-\/>\mbox{\hyperlink{structg__raid__subdisk_a415c982fbd2537861e39aa04fa582969}{sd\_pos}});}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00813}00813                         \textcolor{keywordflow}{if} (pbp-\/>bio\_children == 2 \&\& do\_write) \{}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00814}00814                                 \mbox{\hyperlink{g__raid__md__if_8m_a910062273088d146e8533398780701eb}{sd}}-\/>\mbox{\hyperlink{structg__raid__subdisk_a3dea6e577567a0bd5b37262232b65966}{sd\_recovery}}++;}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00815}00815                                 cbp-\/>bio\_caller1 = nsd;}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00816}00816                                 pbp-\/>bio\_pflags = \mbox{\hyperlink{g__raid_8h_a61b22cb5f0b553243d44a6d36f2493ca}{G\_RAID\_BIO\_FLAG\_LOCKED}};}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00817}00817                                 \textcolor{comment}{/* Lock callback starts I/O */}}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00818}00818                                 \mbox{\hyperlink{g__raid_8c_ad98dd3a6574e48bd8c824a6ed05ae5dc}{g\_raid\_lock\_range}}(\mbox{\hyperlink{g__raid__md__if_8m_a910062273088d146e8533398780701eb}{sd}}-\/>\mbox{\hyperlink{structg__raid__subdisk_ab7f11cd5b966d381d1ae75c6ac9e3ddd}{sd\_volume}},}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00819}00819                                     cbp-\/>bio\_offset, cbp-\/>bio\_length, pbp, cbp);}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00820}00820                         \} \textcolor{keywordflow}{else} \{}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00821}00821                                 \mbox{\hyperlink{g__raid_8c_a685376bcb4756d784a9a433ced731e79}{g\_raid\_subdisk\_iostart}}(nsd, cbp);}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00822}00822                         \}}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00823}00823                         \textcolor{keywordflow}{return};}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00824}00824                 \}}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00825}00825                 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00826}00826 \textcolor{comment}{                 * We can't retry.  Return the original error by falling}}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00827}00827 \textcolor{comment}{                 * through.  This will happen when there's only one good disk.}}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00828}00828 \textcolor{comment}{                 * We don't need to fail the raid, since its actual state is}}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00829}00829 \textcolor{comment}{                 * based on the state of the subdisks.}}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00830}00830 \textcolor{comment}{                 */}}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00831}00831                 \mbox{\hyperlink{g__raid_8h_a754366ef9ae163d81d8948151a02cb4d}{G\_RAID\_LOGREQ}}(2, \mbox{\hyperlink{g__part__if_8m_a3786db8db96c32f69df9f7cd325a7507}{bp}}, \textcolor{stringliteral}{"{}Couldn't retry read, failing it"{}});}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00832}00832         \}}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00833}00833         \textcolor{keywordflow}{if} (\mbox{\hyperlink{g__part__if_8m_a3786db8db96c32f69df9f7cd325a7507}{bp}}-\/>bio\_cmd == BIO\_READ \&\&}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00834}00834             \mbox{\hyperlink{g__part__if_8m_a3786db8db96c32f69df9f7cd325a7507}{bp}}-\/>bio\_error == 0 \&\&}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00835}00835             pbp-\/>bio\_children > 1 \&\&}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00836}00836             pbp-\/>bio\_driver1 != NULL) \{}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00837}00837                 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00838}00838 \textcolor{comment}{                 * If it was a read, and bio\_children is >1, then we just}}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00839}00839 \textcolor{comment}{                 * recovered the data from the second drive.  We should try to}}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00840}00840 \textcolor{comment}{                 * write that data to the first drive if sector remapping is}}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00841}00841 \textcolor{comment}{                 * enabled.  A write should put the data in a new place on the}}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00842}00842 \textcolor{comment}{                 * disk, remapping the bad sector.  Do we need to do that by}}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00843}00843 \textcolor{comment}{                 * queueing a request to the main worker thread?  It doesn't}}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00844}00844 \textcolor{comment}{                 * affect the return code of this current read, and can be}}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00845}00845 \textcolor{comment}{                 * done at our leisure.  However, to make the code simpler, it}}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00846}00846 \textcolor{comment}{                 * is done synchronously.}}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00847}00847 \textcolor{comment}{                 */}}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00848}00848                 \mbox{\hyperlink{g__raid_8h_a754366ef9ae163d81d8948151a02cb4d}{G\_RAID\_LOGREQ}}(3, \mbox{\hyperlink{g__part__if_8m_a3786db8db96c32f69df9f7cd325a7507}{bp}}, \textcolor{stringliteral}{"{}Recovered data from other drive"{}});}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00849}00849                 cbp = \mbox{\hyperlink{geom_8h_a4ef26e4ec68e35e8f892692c524a3d4f}{g\_clone\_bio}}(pbp);}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00850}00850                 \textcolor{keywordflow}{if} (cbp != NULL) \{}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00851}00851                         \mbox{\hyperlink{geom_8h_ae3cbea7d4bf48f25bb609df3d3f0bb28}{g\_destroy\_bio}}(\mbox{\hyperlink{g__part__if_8m_a3786db8db96c32f69df9f7cd325a7507}{bp}});}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00852}00852                         cbp-\/>bio\_cmd = BIO\_WRITE;}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00853}00853                         cbp-\/>bio\_cflags = \mbox{\hyperlink{g__raid_8h_a231026ac880c9cb5dbbb7adcfe51224c}{G\_RAID\_BIO\_FLAG\_REMAP}};}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00854}00854                         \mbox{\hyperlink{g__raid_8h_a754366ef9ae163d81d8948151a02cb4d}{G\_RAID\_LOGREQ}}(2, cbp,}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00855}00855                             \textcolor{stringliteral}{"{}Attempting bad sector remap on failing drive."{}});}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00856}00856                         \mbox{\hyperlink{g__raid_8c_a685376bcb4756d784a9a433ced731e79}{g\_raid\_subdisk\_iostart}}(pbp-\/>bio\_driver1, cbp);}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00857}00857                         \textcolor{keywordflow}{return};}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00858}00858                 \}}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00859}00859         \}}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00860}00860         \textcolor{keywordflow}{if} (pbp-\/>bio\_pflags \& \mbox{\hyperlink{g__raid_8h_a61b22cb5f0b553243d44a6d36f2493ca}{G\_RAID\_BIO\_FLAG\_LOCKED}}) \{}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00861}00861                 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00862}00862 \textcolor{comment}{                 * We're done with a recovery, mark the range as unlocked.}}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00863}00863 \textcolor{comment}{                 * For any write errors, we aggressively fail the disk since}}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00864}00864 \textcolor{comment}{                 * there was both a READ and a WRITE error at this location.}}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00865}00865 \textcolor{comment}{                 * Both types of errors generally indicates the drive is on}}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00866}00866 \textcolor{comment}{                 * the verge of total failure anyway.  Better to stop trusting}}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00867}00867 \textcolor{comment}{                 * it now.  However, we need to reset error to 0 in that case}}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00868}00868 \textcolor{comment}{                 * because we're not failing the original I/O which succeeded.}}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00869}00869 \textcolor{comment}{                 */}}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00870}00870                 \textcolor{keywordflow}{if} (\mbox{\hyperlink{g__part__if_8m_a3786db8db96c32f69df9f7cd325a7507}{bp}}-\/>bio\_cmd == BIO\_WRITE \&\& \mbox{\hyperlink{g__part__if_8m_a3786db8db96c32f69df9f7cd325a7507}{bp}}-\/>bio\_error) \{}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00871}00871                         \mbox{\hyperlink{g__raid_8h_a754366ef9ae163d81d8948151a02cb4d}{G\_RAID\_LOGREQ}}(0, \mbox{\hyperlink{g__part__if_8m_a3786db8db96c32f69df9f7cd325a7507}{bp}}, \textcolor{stringliteral}{"{}Remap write failed: "{}}}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00872}00872                             \textcolor{stringliteral}{"{}failing subdisk."{}});}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00873}00873                         \mbox{\hyperlink{tr__raid1_8c_aaf1bb5f56413e3729d2cb75fb1f75dd4}{g\_raid\_tr\_raid1\_fail\_disk}}(\mbox{\hyperlink{g__raid__md__if_8m_a910062273088d146e8533398780701eb}{sd}}-\/>\mbox{\hyperlink{structg__raid__subdisk_af107ee6026dc0f10eeeac8b75ed91e50}{sd\_softc}}, \mbox{\hyperlink{g__raid__md__if_8m_a910062273088d146e8533398780701eb}{sd}}, \mbox{\hyperlink{g__raid__md__if_8m_a910062273088d146e8533398780701eb}{sd}}-\/>\mbox{\hyperlink{structg__raid__subdisk_a5570ab684f57213078d94750e63354e1}{sd\_disk}});}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00874}00874                         \mbox{\hyperlink{g__part__if_8m_a3786db8db96c32f69df9f7cd325a7507}{bp}}-\/>bio\_error = 0;}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00875}00875                 \}}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00876}00876                 \textcolor{keywordflow}{if} (pbp-\/>bio\_driver1 != NULL) \{}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00877}00877                         ((\textcolor{keyword}{struct }\mbox{\hyperlink{structg__raid__subdisk}{g\_raid\_subdisk}} *)pbp-\/>bio\_driver1)}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00878}00878                             -\/>sd\_recovery-\/-\/;}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00879}00879                 \}}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00880}00880                 \mbox{\hyperlink{g__raid_8h_a754366ef9ae163d81d8948151a02cb4d}{G\_RAID\_LOGREQ}}(2, \mbox{\hyperlink{g__part__if_8m_a3786db8db96c32f69df9f7cd325a7507}{bp}}, \textcolor{stringliteral}{"{}REMAP done \%d."{}}, \mbox{\hyperlink{g__part__if_8m_a3786db8db96c32f69df9f7cd325a7507}{bp}}-\/>bio\_error);}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00881}00881                 \mbox{\hyperlink{g__raid_8c_ae97b7a5015a2b67a9c1853bf1d1ec4b1}{g\_raid\_unlock\_range}}(\mbox{\hyperlink{g__raid__md__if_8m_a910062273088d146e8533398780701eb}{sd}}-\/>\mbox{\hyperlink{structg__raid__subdisk_ab7f11cd5b966d381d1ae75c6ac9e3ddd}{sd\_volume}}, \mbox{\hyperlink{g__part__if_8m_a3786db8db96c32f69df9f7cd325a7507}{bp}}-\/>bio\_offset,}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00882}00882                     \mbox{\hyperlink{g__part__if_8m_a3786db8db96c32f69df9f7cd325a7507}{bp}}-\/>bio\_length);}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00883}00883         \}}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00884}00884         \textcolor{keywordflow}{if} (pbp-\/>bio\_cmd != BIO\_READ) \{}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00885}00885                 \textcolor{keywordflow}{if} (pbp-\/>bio\_inbed == 1 || pbp-\/>bio\_error != 0)}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00886}00886                         pbp-\/>bio\_error = \mbox{\hyperlink{g__part__if_8m_a3786db8db96c32f69df9f7cd325a7507}{bp}}-\/>bio\_error;}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00887}00887                 \textcolor{keywordflow}{if} (pbp-\/>bio\_cmd == BIO\_WRITE \&\& \mbox{\hyperlink{g__part__if_8m_a3786db8db96c32f69df9f7cd325a7507}{bp}}-\/>bio\_error != 0) \{}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00888}00888                         \mbox{\hyperlink{g__raid_8h_a754366ef9ae163d81d8948151a02cb4d}{G\_RAID\_LOGREQ}}(0, \mbox{\hyperlink{g__part__if_8m_a3786db8db96c32f69df9f7cd325a7507}{bp}}, \textcolor{stringliteral}{"{}Write failed: failing subdisk."{}});}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00889}00889                         \mbox{\hyperlink{tr__raid1_8c_aaf1bb5f56413e3729d2cb75fb1f75dd4}{g\_raid\_tr\_raid1\_fail\_disk}}(\mbox{\hyperlink{g__raid__md__if_8m_a910062273088d146e8533398780701eb}{sd}}-\/>\mbox{\hyperlink{structg__raid__subdisk_af107ee6026dc0f10eeeac8b75ed91e50}{sd\_softc}}, \mbox{\hyperlink{g__raid__md__if_8m_a910062273088d146e8533398780701eb}{sd}}, \mbox{\hyperlink{g__raid__md__if_8m_a910062273088d146e8533398780701eb}{sd}}-\/>\mbox{\hyperlink{structg__raid__subdisk_a5570ab684f57213078d94750e63354e1}{sd\_disk}});}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00890}00890                 \}}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00891}00891                 error = pbp-\/>bio\_error;}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00892}00892         \} \textcolor{keywordflow}{else}}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00893}00893                 error = \mbox{\hyperlink{g__part__if_8m_a3786db8db96c32f69df9f7cd325a7507}{bp}}-\/>bio\_error;}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00894}00894         \mbox{\hyperlink{geom_8h_ae3cbea7d4bf48f25bb609df3d3f0bb28}{g\_destroy\_bio}}(\mbox{\hyperlink{g__part__if_8m_a3786db8db96c32f69df9f7cd325a7507}{bp}});}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00895}00895         \textcolor{keywordflow}{if} (pbp-\/>bio\_children == pbp-\/>bio\_inbed) \{}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00896}00896                 pbp-\/>bio\_completed = pbp-\/>bio\_length;}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00897}00897                 \mbox{\hyperlink{g__raid_8c_aac26055db228a9070904855aa7fcec89}{g\_raid\_iodone}}(pbp, error);}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00898}00898         \}}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00899}00899 \}}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00900}00900 }
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00901}00901 \textcolor{keyword}{static} \textcolor{keywordtype}{int}}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00902}\mbox{\hyperlink{tr__raid1_8c_a2bfe8613a9275f9f50698343d4d30411}{00902}} \mbox{\hyperlink{tr__raid1_8c_a584463c83ec8f895126f805aeac26b9e}{g\_raid\_tr\_kerneldump\_raid1}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structg__raid__tr__object}{g\_raid\_tr\_object}} *tr,}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00903}00903     \textcolor{keywordtype}{void} *\textcolor{keyword}{virtual}, vm\_offset\_t \mbox{\hyperlink{g__raid__tr__if_8m_a27729ff5ed96d4c7c45950d01a07c654}{physical}}, off\_t \mbox{\hyperlink{g__raid__tr__if_8m_ad5f0842c40c7e46344fd8df70187fa0f}{offset}}, \textcolor{keywordtype}{size\_t} \mbox{\hyperlink{g__raid__tr__if_8m_ae809d5359ac030c60a30a8f0b2294b82}{length}})}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00904}00904 \{}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00905}00905         \textcolor{keyword}{struct }\mbox{\hyperlink{structg__raid__volume}{g\_raid\_volume}} *\mbox{\hyperlink{g__raid__md__if_8m_aaa46aabd2a891668d71cec64e90b4848}{vol}};}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00906}00906         \textcolor{keyword}{struct }\mbox{\hyperlink{structg__raid__subdisk}{g\_raid\_subdisk}} *\mbox{\hyperlink{g__raid__md__if_8m_a910062273088d146e8533398780701eb}{sd}};}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00907}00907         \textcolor{keywordtype}{int} error, i, ok;}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00908}00908 }
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00909}00909         \mbox{\hyperlink{g__raid__md__if_8m_aaa46aabd2a891668d71cec64e90b4848}{vol}} = tr-\/>\mbox{\hyperlink{structg__raid__tr__object_adda608cedccd305f267d8593f2bebe7f}{tro\_volume}};}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00910}00910         error = 0;}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00911}00911         ok = 0;}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00912}00912         \textcolor{keywordflow}{for} (i = 0; i < \mbox{\hyperlink{g__raid__md__if_8m_aaa46aabd2a891668d71cec64e90b4848}{vol}}-\/>\mbox{\hyperlink{structg__raid__volume_a21482a5ac78a397faf4e95eb1ebef431}{v\_disks\_count}}; i++) \{}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00913}00913                 \mbox{\hyperlink{g__raid__md__if_8m_a910062273088d146e8533398780701eb}{sd}} = \&\mbox{\hyperlink{g__raid__md__if_8m_aaa46aabd2a891668d71cec64e90b4848}{vol}}-\/>\mbox{\hyperlink{structg__raid__volume_a3c43185db4bd1c4818d95a415635854b}{v\_subdisks}}[i];}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00914}00914                 \textcolor{keywordflow}{switch} (\mbox{\hyperlink{g__raid__md__if_8m_a910062273088d146e8533398780701eb}{sd}}-\/>\mbox{\hyperlink{structg__raid__subdisk_acd19794916930f74ecad38ca7dd69f69}{sd\_state}}) \{}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00915}00915                 \textcolor{keywordflow}{case} \mbox{\hyperlink{g__raid_8h_a498effa0ffa87b75f6c40381c6d4eb39}{G\_RAID\_SUBDISK\_S\_ACTIVE}}:}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00916}00916                         \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00917}00917                 \textcolor{keywordflow}{case} \mbox{\hyperlink{g__raid_8h_a856d6801d600e0089b0cd39ff5af7224}{G\_RAID\_SUBDISK\_S\_REBUILD}}:}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00918}00918                         \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00919}00919 \textcolor{comment}{                         * When rebuilding, only part of this subdisk is}}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00920}00920 \textcolor{comment}{                         * writable, the rest will be written as part of the}}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00921}00921 \textcolor{comment}{                         * that process.}}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00922}00922 \textcolor{comment}{                         */}}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00923}00923                         \textcolor{keywordflow}{if} (\mbox{\hyperlink{g__raid__tr__if_8m_ad5f0842c40c7e46344fd8df70187fa0f}{offset}} >= \mbox{\hyperlink{g__raid__md__if_8m_a910062273088d146e8533398780701eb}{sd}}-\/>\mbox{\hyperlink{structg__raid__subdisk_aca58c7c621e10d2cbe97cd1c87214d7b}{sd\_rebuild\_pos}})}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00924}00924                                 \textcolor{keywordflow}{continue};}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00925}00925                         \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00926}00926                 \textcolor{keywordflow}{case} \mbox{\hyperlink{g__raid_8h_a41bff35bee21218d2aba7a261eb2e83c}{G\_RAID\_SUBDISK\_S\_STALE}}:}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00927}00927                 \textcolor{keywordflow}{case} \mbox{\hyperlink{g__raid_8h_a8c3d62bf4e551976a8941a23c8984e5d}{G\_RAID\_SUBDISK\_S\_RESYNC}}:}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00928}00928                         \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00929}00929 \textcolor{comment}{                         * Resyncing still writes on the theory that the}}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00930}00930 \textcolor{comment}{                         * resync'd disk is very close and writing it will}}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00931}00931 \textcolor{comment}{                         * keep it that way better if we keep up while}}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00932}00932 \textcolor{comment}{                         * resyncing.}}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00933}00933 \textcolor{comment}{                         */}}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00934}00934                         \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00935}00935                 \textcolor{keywordflow}{default}:}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00936}00936                         \textcolor{keywordflow}{continue};}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00937}00937                 \}}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00938}00938                 error = \mbox{\hyperlink{g__raid_8c_a756b77f738835af96cae5e6456b11f89}{g\_raid\_subdisk\_kerneldump}}(\mbox{\hyperlink{g__raid__md__if_8m_a910062273088d146e8533398780701eb}{sd}},}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00939}00939                     \textcolor{keyword}{virtual}, \mbox{\hyperlink{g__raid__tr__if_8m_a27729ff5ed96d4c7c45950d01a07c654}{physical}}, \mbox{\hyperlink{g__raid__tr__if_8m_ad5f0842c40c7e46344fd8df70187fa0f}{offset}}, \mbox{\hyperlink{g__raid__tr__if_8m_ae809d5359ac030c60a30a8f0b2294b82}{length}});}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00940}00940                 \textcolor{keywordflow}{if} (error == 0)}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00941}00941                         ok++;}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00942}00942         \}}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00943}00943         \textcolor{keywordflow}{return} (ok > 0 ? 0 : error);}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00944}00944 \}}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00945}00945 }
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00946}00946 \textcolor{keyword}{static} \textcolor{keywordtype}{int}}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00947}\mbox{\hyperlink{tr__raid1_8c_af28b8fe9dd5d76ec6f26ad34572e13bc}{00947}} \mbox{\hyperlink{tr__raid1_8c_a0e06430791d3005ed236461a6b2c506b}{g\_raid\_tr\_locked\_raid1}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structg__raid__tr__object}{g\_raid\_tr\_object}} *tr, \textcolor{keywordtype}{void} *\mbox{\hyperlink{g__raid__tr__if_8m_a246ef34fa2df332898e5b96c81d46f5e}{argp}})}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00948}00948 \{}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00949}00949         \textcolor{keyword}{struct }bio *\mbox{\hyperlink{g__part__if_8m_a3786db8db96c32f69df9f7cd325a7507}{bp}};}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00950}00950         \textcolor{keyword}{struct }\mbox{\hyperlink{structg__raid__subdisk}{g\_raid\_subdisk}} *\mbox{\hyperlink{g__raid__md__if_8m_a910062273088d146e8533398780701eb}{sd}};}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00951}00951 }
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00952}00952         \mbox{\hyperlink{g__part__if_8m_a3786db8db96c32f69df9f7cd325a7507}{bp}} = (\textcolor{keyword}{struct }bio *)\mbox{\hyperlink{g__raid__tr__if_8m_a246ef34fa2df332898e5b96c81d46f5e}{argp}};}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00953}00953         \mbox{\hyperlink{g__raid__md__if_8m_a910062273088d146e8533398780701eb}{sd}} = (\textcolor{keyword}{struct }\mbox{\hyperlink{structg__raid__subdisk}{g\_raid\_subdisk}} *)\mbox{\hyperlink{g__part__if_8m_a3786db8db96c32f69df9f7cd325a7507}{bp}}-\/>bio\_caller1;}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00954}00954         \mbox{\hyperlink{g__raid_8c_a685376bcb4756d784a9a433ced731e79}{g\_raid\_subdisk\_iostart}}(\mbox{\hyperlink{g__raid__md__if_8m_a910062273088d146e8533398780701eb}{sd}}, \mbox{\hyperlink{g__part__if_8m_a3786db8db96c32f69df9f7cd325a7507}{bp}});}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00955}00955 }
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00956}00956         \textcolor{keywordflow}{return} (0);}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00957}00957 \}}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00958}00958 }
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00959}00959 \textcolor{keyword}{static} \textcolor{keywordtype}{int}}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00960}\mbox{\hyperlink{tr__raid1_8c_aa0d051aac55cef73df6e3ace5e43c1e2}{00960}} \mbox{\hyperlink{tr__raid1_8c_a575b4893daa165117ae8f7be5c4f7799}{g\_raid\_tr\_idle\_raid1}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structg__raid__tr__object}{g\_raid\_tr\_object}} *tr)}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00961}00961 \{}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00962}00962         \textcolor{keyword}{struct }\mbox{\hyperlink{structg__raid__tr__raid1__object}{g\_raid\_tr\_raid1\_object}} *trs;}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00963}00963 }
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00964}00964         trs = (\textcolor{keyword}{struct }\mbox{\hyperlink{structg__raid__tr__raid1__object}{g\_raid\_tr\_raid1\_object}} *)tr;}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00965}00965         trs-\/>\mbox{\hyperlink{structg__raid__tr__raid1__object_ab7e8381e99a88e622f8189358dbd106c}{trso\_fair\_io}} = \mbox{\hyperlink{tr__raid1_8c_a9d7427e22ecf16b0472d862199d0635a}{g\_raid1\_rebuild\_fair\_io}};}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00966}00966         trs-\/>\mbox{\hyperlink{structg__raid__tr__raid1__object_a48c83778a4f4b189859229644ab92595}{trso\_recover\_slabs}} = \mbox{\hyperlink{tr__raid1_8c_a54613be8c64ce8b7ba6f758fc2b48751}{g\_raid1\_rebuild\_cluster\_idle}};}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00967}00967         \textcolor{keywordflow}{if} (trs-\/>\mbox{\hyperlink{structg__raid__tr__raid1__object_ab4ed4109230e65364f77539ecf0d52f1}{trso\_type}} == \mbox{\hyperlink{tr__raid1_8c_a54d21ddc205a11a78c293b3e645b7f05}{TR\_RAID1\_REBUILD}})}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00968}00968                 \mbox{\hyperlink{tr__raid1_8c_a759d79b32c464fca6127394d5d5aad48}{g\_raid\_tr\_raid1\_rebuild\_some}}(tr);}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00969}00969         \textcolor{keywordflow}{return} (0);}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00970}00970 \}}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00971}00971 }
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00972}00972 \textcolor{keyword}{static} \textcolor{keywordtype}{int}}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00973}\mbox{\hyperlink{tr__raid1_8c_aeef46e51ffd845528ccaca37eca3eda8}{00973}} \mbox{\hyperlink{tr__raid1_8c_a22187984729c5b41252f159e8fcac79e}{g\_raid\_tr\_free\_raid1}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structg__raid__tr__object}{g\_raid\_tr\_object}} *tr)}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00974}00974 \{}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00975}00975         \textcolor{keyword}{struct }\mbox{\hyperlink{structg__raid__tr__raid1__object}{g\_raid\_tr\_raid1\_object}} *trs;}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00976}00976 }
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00977}00977         trs = (\textcolor{keyword}{struct }\mbox{\hyperlink{structg__raid__tr__raid1__object}{g\_raid\_tr\_raid1\_object}} *)tr;}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00978}00978 }
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00979}00979         \textcolor{keywordflow}{if} (trs-\/>\mbox{\hyperlink{structg__raid__tr__raid1__object_a3402e3582abac26880ca0512b675302a}{trso\_buffer}} != NULL) \{}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00980}00980                 \mbox{\hyperlink{g__raid__md__if_8m_a4df9edb2717b3f7e4c3c903878577a54}{free}}(trs-\/>\mbox{\hyperlink{structg__raid__tr__raid1__object_a3402e3582abac26880ca0512b675302a}{trso\_buffer}}, M\_TR\_RAID1);}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00981}00981                 trs-\/>\mbox{\hyperlink{structg__raid__tr__raid1__object_a3402e3582abac26880ca0512b675302a}{trso\_buffer}} = NULL;}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00982}00982         \}}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00983}00983         \textcolor{keywordflow}{return} (0);}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00984}00984 \}}
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00985}00985 }
\DoxyCodeLine{\Hypertarget{tr__raid1_8c_source_l00986}\mbox{\hyperlink{tr__raid1_8c_a02cfd77ecfb1bda3d0cab32a591f7dc7}{00986}} \mbox{\hyperlink{tr__raid1_8c_a02cfd77ecfb1bda3d0cab32a591f7dc7}{G\_RAID\_TR\_DECLARE}}(raid1, \textcolor{stringliteral}{"{}RAID1"{}});}

\end{DoxyCode}
