\hypertarget{md__jmicron_8c_source}{}\doxysection{md\+\_\+jmicron.\+c}
\label{md__jmicron_8c_source}\index{geom/raid/md\_jmicron.c@{geom/raid/md\_jmicron.c}}
\mbox{\hyperlink{md__jmicron_8c}{Go to the documentation of this file.}}
\begin{DoxyCode}{0}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00001}00001 \textcolor{comment}{/*-\/}}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00002}00002 \textcolor{comment}{ * SPDX-\/License-\/Identifier: BSD-\/2-\/Clause-\/FreeBSD}}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00003}00003 \textcolor{comment}{ *}}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00004}00004 \textcolor{comment}{ * Copyright (c) 2010 Alexander Motin <mav@FreeBSD.org>}}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00005}00005 \textcolor{comment}{ * Copyright (c) 2000 -\/ 2008 Søren Schmidt <sos@FreeBSD.org>}}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00006}00006 \textcolor{comment}{ * All rights reserved.}}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00007}00007 \textcolor{comment}{ *}}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00008}00008 \textcolor{comment}{ * Redistribution and use in source and binary forms, with or without}}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00009}00009 \textcolor{comment}{ * modification, are permitted provided that the following conditions}}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00010}00010 \textcolor{comment}{ * are met:}}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00011}00011 \textcolor{comment}{ * 1. Redistributions of source code must retain the above copyright}}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00012}00012 \textcolor{comment}{ *    notice, this list of conditions and the following disclaimer.}}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00013}00013 \textcolor{comment}{ * 2. Redistributions in binary form must reproduce the above copyright}}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00014}00014 \textcolor{comment}{ *    notice, this list of conditions and the following disclaimer in the}}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00015}00015 \textcolor{comment}{ *    documentation and/or other materials provided with the distribution.}}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00016}00016 \textcolor{comment}{ *}}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00017}00017 \textcolor{comment}{ * THIS SOFTWARE IS PROVIDED BY THE AUTHORS AND CONTRIBUTORS ``AS IS'' AND}}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00018}00018 \textcolor{comment}{ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE}}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00019}00019 \textcolor{comment}{ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE}}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00020}00020 \textcolor{comment}{ * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHORS OR CONTRIBUTORS BE LIABLE}}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00021}00021 \textcolor{comment}{ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL}}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00022}00022 \textcolor{comment}{ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS}}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00023}00023 \textcolor{comment}{ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)}}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00024}00024 \textcolor{comment}{ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT}}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00025}00025 \textcolor{comment}{ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY}}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00026}00026 \textcolor{comment}{ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF}}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00027}00027 \textcolor{comment}{ * SUCH DAMAGE.}}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00028}00028 \textcolor{comment}{ */}}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00029}00029 }
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00030}00030 \textcolor{preprocessor}{\#include <sys/cdefs.h>}}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00031}\mbox{\hyperlink{md__jmicron_8c_a8c3ef283470a68cd30afe9b8a72cb60f}{00031}} \mbox{\hyperlink{md__jmicron_8c_a8c3ef283470a68cd30afe9b8a72cb60f}{\_\_FBSDID}}(\textcolor{stringliteral}{"{}\$FreeBSD\$"{}});}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00032}00032 }
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00033}00033 \textcolor{preprocessor}{\#include <sys/param.h>}}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00034}00034 \textcolor{preprocessor}{\#include <sys/bio.h>}}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00035}00035 \textcolor{preprocessor}{\#include <sys/endian.h>}}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00036}00036 \textcolor{preprocessor}{\#include <sys/kernel.h>}}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00037}00037 \textcolor{preprocessor}{\#include <sys/kobj.h>}}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00038}00038 \textcolor{preprocessor}{\#include <sys/limits.h>}}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00039}00039 \textcolor{preprocessor}{\#include <sys/lock.h>}}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00040}00040 \textcolor{preprocessor}{\#include <sys/malloc.h>}}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00041}00041 \textcolor{preprocessor}{\#include <sys/mutex.h>}}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00042}00042 \textcolor{preprocessor}{\#include <sys/systm.h>}}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00043}00043 \textcolor{preprocessor}{\#include <sys/taskqueue.h>}}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00044}00044 \textcolor{preprocessor}{\#include <\mbox{\hyperlink{geom_8h}{geom/geom.h}}>}}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00045}00045 \textcolor{preprocessor}{\#include <\mbox{\hyperlink{geom__dbg_8h}{geom/geom\_dbg.h}}>}}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00046}00046 \textcolor{preprocessor}{\#include "{}\mbox{\hyperlink{g__raid_8h}{geom/raid/g\_raid.h}}"{}}}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00047}00047 \textcolor{preprocessor}{\#include "{}g\_raid\_md\_if.h"{}}}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00048}00048 }
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00049}\mbox{\hyperlink{md__jmicron_8c_a0f1cd41a5ec6655e92aec1bc6fdd859b}{00049}} \textcolor{keyword}{static} \mbox{\hyperlink{md__jmicron_8c_a0f1cd41a5ec6655e92aec1bc6fdd859b}{MALLOC\_DEFINE}}(M\_MD\_JMICRON, \textcolor{stringliteral}{"{}md\_jmicron\_data"{}}, \textcolor{stringliteral}{"{}GEOM\_RAID JMicron metadata"{}});}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00050}00050 }
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00051}\mbox{\hyperlink{md__jmicron_8c_a2bcd5e978621a25303473584d3878ad2}{00051}} \textcolor{preprocessor}{\#define JMICRON\_MAX\_DISKS       8}}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00052}\mbox{\hyperlink{md__jmicron_8c_afabd12199bb41742092c8e2b0d02ed2a}{00052}} \textcolor{preprocessor}{\#define JMICRON\_MAX\_SPARE       2}}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00053}00053 }
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00054}\mbox{\hyperlink{structjmicron__raid__conf}{00054}} \textcolor{keyword}{struct }\mbox{\hyperlink{structjmicron__raid__conf}{jmicron\_raid\_conf}} \{}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00055}\mbox{\hyperlink{structjmicron__raid__conf_a31dabc190b0678711e27f5c2edcee307}{00055}}     \mbox{\hyperlink{binstream_8h_ab077fa1127453be2bd9d4c3c8a768fa7}{uint8\_t}}              \mbox{\hyperlink{structjmicron__raid__conf_a31dabc190b0678711e27f5c2edcee307}{signature}}[2];}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00056}\mbox{\hyperlink{md__jmicron_8c_addff85c305efbce93d954c396f7a9469}{00056}} \textcolor{preprocessor}{\#define JMICRON\_MAGIC           "{}JM"{}}}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00057}00057 }
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00058}\mbox{\hyperlink{structjmicron__raid__conf_ad13be346660399b7d0027f1b9011158d}{00058}}     uint16\_t            \mbox{\hyperlink{structjmicron__raid__conf_ad13be346660399b7d0027f1b9011158d}{version}};}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00059}\mbox{\hyperlink{md__jmicron_8c_add07c2bcc8c2b7ecbcf66c887b6d8064}{00059}} \textcolor{preprocessor}{\#define JMICRON\_VERSION         0x0001}}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00060}00060 }
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00061}\mbox{\hyperlink{structjmicron__raid__conf_a114848ac9a4ce23d8acef5458ab0d1fa}{00061}}     uint16\_t            \mbox{\hyperlink{structjmicron__raid__conf_a114848ac9a4ce23d8acef5458ab0d1fa}{checksum}};}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00062}\mbox{\hyperlink{structjmicron__raid__conf_a00796a77c2a2ec82ffc453921d1fa59a}{00062}}     \mbox{\hyperlink{binstream_8h_ab077fa1127453be2bd9d4c3c8a768fa7}{uint8\_t}}              \mbox{\hyperlink{structjmicron__raid__conf_a00796a77c2a2ec82ffc453921d1fa59a}{filler\_1}}[10];}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00063}\mbox{\hyperlink{structjmicron__raid__conf_aeccbf0f339ffb5dc10d2489d3d154e80}{00063}}     uint32\_t            \mbox{\hyperlink{structjmicron__raid__conf_aeccbf0f339ffb5dc10d2489d3d154e80}{disk\_id}};}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00064}\mbox{\hyperlink{structjmicron__raid__conf_a47970969ccfc7aa96a0a076e5bd7dae8}{00064}}     uint32\_t            \mbox{\hyperlink{structjmicron__raid__conf_a47970969ccfc7aa96a0a076e5bd7dae8}{offset}};}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00065}\mbox{\hyperlink{structjmicron__raid__conf_a53cb3d8a2e58df232b2ba5d6e27811dd}{00065}}     uint32\_t            \mbox{\hyperlink{structjmicron__raid__conf_a53cb3d8a2e58df232b2ba5d6e27811dd}{disk\_sectors\_high}};}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00066}\mbox{\hyperlink{structjmicron__raid__conf_a8e4cfaa514a26b0a4b701041cb7e4198}{00066}}     uint16\_t            \mbox{\hyperlink{structjmicron__raid__conf_a8e4cfaa514a26b0a4b701041cb7e4198}{disk\_sectors\_low}};}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00067}\mbox{\hyperlink{structjmicron__raid__conf_a8b553a0d76eb945a09e2fdd5061dc072}{00067}}     \mbox{\hyperlink{binstream_8h_ab077fa1127453be2bd9d4c3c8a768fa7}{uint8\_t}}              \mbox{\hyperlink{structjmicron__raid__conf_a8b553a0d76eb945a09e2fdd5061dc072}{filler\_2}}[2];}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00068}\mbox{\hyperlink{structjmicron__raid__conf_a939a0360be0c1824e37541dae609bc87}{00068}}     \mbox{\hyperlink{binstream_8h_ab077fa1127453be2bd9d4c3c8a768fa7}{uint8\_t}}              \mbox{\hyperlink{structjmicron__raid__conf_a939a0360be0c1824e37541dae609bc87}{name}}[16];}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00069}\mbox{\hyperlink{structjmicron__raid__conf_a076e01c2fe3b5654d104b77c45fc55da}{00069}}     \mbox{\hyperlink{binstream_8h_ab077fa1127453be2bd9d4c3c8a768fa7}{uint8\_t}}              \mbox{\hyperlink{structjmicron__raid__conf_a076e01c2fe3b5654d104b77c45fc55da}{type}};}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00070}\mbox{\hyperlink{md__jmicron_8c_a1f2855e53c0606e6acadc2296d44c5dc}{00070}} \textcolor{preprocessor}{\#define JMICRON\_T\_RAID0         0}}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00071}\mbox{\hyperlink{md__jmicron_8c_af37a98d5205a0567ca4348bd1d009ae3}{00071}} \textcolor{preprocessor}{\#define JMICRON\_T\_RAID1         1}}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00072}\mbox{\hyperlink{md__jmicron_8c_acefecc0e95e211d13000451fa8ef8737}{00072}} \textcolor{preprocessor}{\#define JMICRON\_T\_RAID01        2}}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00073}\mbox{\hyperlink{md__jmicron_8c_a3985571252d6b7de9ca4faa7e1c0529c}{00073}} \textcolor{preprocessor}{\#define JMICRON\_T\_CONCAT        3}}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00074}\mbox{\hyperlink{md__jmicron_8c_a21789928e250aa273d03b1c2f9dee985}{00074}} \textcolor{preprocessor}{\#define JMICRON\_T\_RAID5         5}}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00075}00075 }
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00076}\mbox{\hyperlink{structjmicron__raid__conf_a3d27c760d3541ed0dda17ea03c65b987}{00076}}     \mbox{\hyperlink{binstream_8h_ab077fa1127453be2bd9d4c3c8a768fa7}{uint8\_t}}              \mbox{\hyperlink{structjmicron__raid__conf_a3d27c760d3541ed0dda17ea03c65b987}{stripe\_shift}};}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00077}\mbox{\hyperlink{structjmicron__raid__conf_a6bd3f9f2cf164a45a43c2519edfab653}{00077}}     uint16\_t            \mbox{\hyperlink{structjmicron__raid__conf_a6bd3f9f2cf164a45a43c2519edfab653}{flags}};}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00078}\mbox{\hyperlink{md__jmicron_8c_a463dfe2e77c2c4fec9436159c5c35597}{00078}} \textcolor{preprocessor}{\#define JMICRON\_F\_READY         0x0001}}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00079}\mbox{\hyperlink{md__jmicron_8c_a3e2e37f75591c68c2a7d7eddbf7821ba}{00079}} \textcolor{preprocessor}{\#define JMICRON\_F\_BOOTABLE      0x0002}}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00080}\mbox{\hyperlink{md__jmicron_8c_a82560a77e932e075c6f4b87eda94c7d9}{00080}} \textcolor{preprocessor}{\#define JMICRON\_F\_BADSEC        0x0004}}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00081}\mbox{\hyperlink{md__jmicron_8c_a9f563b56e9f561d1c8cd26fd1c3ffc3b}{00081}} \textcolor{preprocessor}{\#define JMICRON\_F\_ACTIVE        0x0010}}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00082}\mbox{\hyperlink{md__jmicron_8c_a858950190a80ad6c735e15d5cb2ddfa8}{00082}} \textcolor{preprocessor}{\#define JMICRON\_F\_UNSYNC        0x0020}}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00083}\mbox{\hyperlink{md__jmicron_8c_afb9e90244fe8104048c66f18678c245f}{00083}} \textcolor{preprocessor}{\#define JMICRON\_F\_NEWEST        0x0040}}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00084}00084 }
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00085}\mbox{\hyperlink{structjmicron__raid__conf_ad04856323a3b02f295613fddbb896363}{00085}}     \mbox{\hyperlink{binstream_8h_ab077fa1127453be2bd9d4c3c8a768fa7}{uint8\_t}}              \mbox{\hyperlink{structjmicron__raid__conf_ad04856323a3b02f295613fddbb896363}{filler\_3}}[4];}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00086}\mbox{\hyperlink{structjmicron__raid__conf_acf1f91a97139967cb07ef752a6cc993d}{00086}}     uint32\_t            \mbox{\hyperlink{structjmicron__raid__conf_acf1f91a97139967cb07ef752a6cc993d}{spare}}[\mbox{\hyperlink{md__jmicron_8c_afabd12199bb41742092c8e2b0d02ed2a}{JMICRON\_MAX\_SPARE}}];}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00087}\mbox{\hyperlink{structjmicron__raid__conf_a1b06fd2819bf2a863f9b8115413bc47a}{00087}}     uint32\_t            \mbox{\hyperlink{structjmicron__raid__conf_a1b06fd2819bf2a863f9b8115413bc47a}{disks}}[\mbox{\hyperlink{md__jmicron_8c_a2bcd5e978621a25303473584d3878ad2}{JMICRON\_MAX\_DISKS}}];}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00088}\mbox{\hyperlink{md__jmicron_8c_ae5a6c6dc90a396412a801d5e62abf05f}{00088}} \textcolor{preprocessor}{\#define JMICRON\_DISK\_MASK       0xFFFFFFF0}}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00089}\mbox{\hyperlink{md__jmicron_8c_a0049d55c46bc6070d2e48b794d8858db}{00089}} \textcolor{preprocessor}{\#define JMICRON\_SEG\_MASK        0x0000000F}}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00090}\mbox{\hyperlink{structjmicron__raid__conf_affb0793d55bbfa29424b4355ad67fba9}{00090}}     \mbox{\hyperlink{binstream_8h_ab077fa1127453be2bd9d4c3c8a768fa7}{uint8\_t}}              \mbox{\hyperlink{structjmicron__raid__conf_affb0793d55bbfa29424b4355ad67fba9}{filler\_4}}[32];}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00091}\mbox{\hyperlink{structjmicron__raid__conf_a5cec1e57be769bdfc216f65354e8fbcc}{00091}}     \mbox{\hyperlink{binstream_8h_ab077fa1127453be2bd9d4c3c8a768fa7}{uint8\_t}}              \mbox{\hyperlink{structjmicron__raid__conf_a5cec1e57be769bdfc216f65354e8fbcc}{filler\_5}}[384];}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00092}00092 \};}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00093}00093 }
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00094}\mbox{\hyperlink{structg__raid__md__jmicron__perdisk}{00094}} \textcolor{keyword}{struct }\mbox{\hyperlink{structg__raid__md__jmicron__perdisk}{g\_raid\_md\_jmicron\_perdisk}} \{}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00095}\mbox{\hyperlink{structg__raid__md__jmicron__perdisk_ac2b4421d277ebd509be1854f4c1e1f53}{00095}}         \textcolor{keyword}{struct }\mbox{\hyperlink{structjmicron__raid__conf}{jmicron\_raid\_conf}}       *\mbox{\hyperlink{structg__raid__md__jmicron__perdisk_ac2b4421d277ebd509be1854f4c1e1f53}{pd\_meta}};}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00096}\mbox{\hyperlink{structg__raid__md__jmicron__perdisk_a65960334e7c32b993e9ea104819243b9}{00096}}         \textcolor{keywordtype}{int}                              \mbox{\hyperlink{structg__raid__md__jmicron__perdisk_a65960334e7c32b993e9ea104819243b9}{pd\_disk\_pos}};}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00097}\mbox{\hyperlink{structg__raid__md__jmicron__perdisk_a46a598fbfa7cbd51384eb2ea86325455}{00097}}         \textcolor{keywordtype}{int}                              \mbox{\hyperlink{structg__raid__md__jmicron__perdisk_a46a598fbfa7cbd51384eb2ea86325455}{pd\_disk\_id}};}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00098}\mbox{\hyperlink{structg__raid__md__jmicron__perdisk_a1a732ac096c218a73964b0bbecb9b236}{00098}}         off\_t                            \mbox{\hyperlink{structg__raid__md__jmicron__perdisk_a1a732ac096c218a73964b0bbecb9b236}{pd\_disk\_size}};}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00099}00099 \};}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00100}00100 }
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00101}\mbox{\hyperlink{structg__raid__md__jmicron__object}{00101}} \textcolor{keyword}{struct }\mbox{\hyperlink{structg__raid__md__jmicron__object}{g\_raid\_md\_jmicron\_object}} \{}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00102}\mbox{\hyperlink{structg__raid__md__jmicron__object_a9b68b31423397991ca2474cb4808dfa5}{00102}}         \textcolor{keyword}{struct }\mbox{\hyperlink{structg__raid__md__object}{g\_raid\_md\_object}}  \mbox{\hyperlink{structg__raid__md__jmicron__object_a9b68b31423397991ca2474cb4808dfa5}{mdio\_base}};}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00103}\mbox{\hyperlink{structg__raid__md__jmicron__object_afc55c88b5b58ee08c5c7a5be6801156a}{00103}}         uint32\_t                 \mbox{\hyperlink{structg__raid__md__jmicron__object_afc55c88b5b58ee08c5c7a5be6801156a}{mdio\_config\_id}};}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00104}\mbox{\hyperlink{structg__raid__md__jmicron__object_a99dfc14fc8a6fe56d6822564249c3a54}{00104}}         \textcolor{keyword}{struct }\mbox{\hyperlink{structjmicron__raid__conf}{jmicron\_raid\_conf}}       *\mbox{\hyperlink{structg__raid__md__jmicron__object_a99dfc14fc8a6fe56d6822564249c3a54}{mdio\_meta}};}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00105}\mbox{\hyperlink{structg__raid__md__jmicron__object_af59f91509fa472e35ba85b4e78d99b07}{00105}}         \textcolor{keyword}{struct }callout           \mbox{\hyperlink{structg__raid__md__jmicron__object_af59f91509fa472e35ba85b4e78d99b07}{mdio\_start\_co}};    \textcolor{comment}{/* STARTING state timer. */}}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00106}\mbox{\hyperlink{structg__raid__md__jmicron__object_a736479d42184be44bcb41f9176594ee3}{00106}}         \textcolor{keywordtype}{int}                      \mbox{\hyperlink{structg__raid__md__jmicron__object_a736479d42184be44bcb41f9176594ee3}{mdio\_total\_disks}};}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00107}\mbox{\hyperlink{structg__raid__md__jmicron__object_a032e6dc7773885007c9ae248affe6ad5}{00107}}         \textcolor{keywordtype}{int}                      \mbox{\hyperlink{structg__raid__md__jmicron__object_a032e6dc7773885007c9ae248affe6ad5}{mdio\_disks\_present}};}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00108}\mbox{\hyperlink{structg__raid__md__jmicron__object_adeedb342e0d17d9db3bce7dfc408b72c}{00108}}         \textcolor{keywordtype}{int}                      \mbox{\hyperlink{structg__raid__md__jmicron__object_adeedb342e0d17d9db3bce7dfc408b72c}{mdio\_started}};}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00109}\mbox{\hyperlink{structg__raid__md__jmicron__object_a03a05cb696e82019951d9641fb7568ae}{00109}}         \textcolor{keywordtype}{int}                      \mbox{\hyperlink{structg__raid__md__jmicron__object_a03a05cb696e82019951d9641fb7568ae}{mdio\_incomplete}};}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00110}\mbox{\hyperlink{structg__raid__md__jmicron__object_ae5ddd50412f23f4106c7a7760a91e3db}{00110}}         \textcolor{keyword}{struct }root\_hold\_token  *\mbox{\hyperlink{structg__raid__md__jmicron__object_ae5ddd50412f23f4106c7a7760a91e3db}{mdio\_rootmount}}; \textcolor{comment}{/* Root mount delay token. */}}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00111}00111 \};}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00112}00112 }
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00113}\mbox{\hyperlink{md__jmicron_8c_a023cfe32948ee2b2c745e7ba8398d9dd}{00113}} \textcolor{keyword}{static} g\_raid\_md\_create\_t \mbox{\hyperlink{md__jmicron_8c_a023cfe32948ee2b2c745e7ba8398d9dd}{g\_raid\_md\_create\_jmicron}};}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00114}\mbox{\hyperlink{md__jmicron_8c_ae17d9058bbc539474ef601a87819dfb0}{00114}} \textcolor{keyword}{static} g\_raid\_md\_taste\_t \mbox{\hyperlink{md__jmicron_8c_ae17d9058bbc539474ef601a87819dfb0}{g\_raid\_md\_taste\_jmicron}};}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00115}\mbox{\hyperlink{md__jmicron_8c_a665c28ad395d21228359429d66fe759f}{00115}} \textcolor{keyword}{static} g\_raid\_md\_event\_t \mbox{\hyperlink{md__jmicron_8c_a665c28ad395d21228359429d66fe759f}{g\_raid\_md\_event\_jmicron}};}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00116}\mbox{\hyperlink{md__jmicron_8c_af925716ea4c409c9bab6d9c060de7805}{00116}} \textcolor{keyword}{static} g\_raid\_md\_ctl\_t \mbox{\hyperlink{md__jmicron_8c_af925716ea4c409c9bab6d9c060de7805}{g\_raid\_md\_ctl\_jmicron}};}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00117}\mbox{\hyperlink{md__jmicron_8c_aaf5dc9d91eb1d2ddad515c7844468905}{00117}} \textcolor{keyword}{static} g\_raid\_md\_write\_t \mbox{\hyperlink{md__jmicron_8c_aaf5dc9d91eb1d2ddad515c7844468905}{g\_raid\_md\_write\_jmicron}};}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00118}\mbox{\hyperlink{md__jmicron_8c_aa81b7896dc923ed3557af65493e17a9d}{00118}} \textcolor{keyword}{static} g\_raid\_md\_fail\_disk\_t \mbox{\hyperlink{md__jmicron_8c_aa81b7896dc923ed3557af65493e17a9d}{g\_raid\_md\_fail\_disk\_jmicron}};}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00119}\mbox{\hyperlink{md__jmicron_8c_a6eb57f4798a84f27857fbb9edf3e4532}{00119}} \textcolor{keyword}{static} g\_raid\_md\_free\_disk\_t \mbox{\hyperlink{md__jmicron_8c_a6eb57f4798a84f27857fbb9edf3e4532}{g\_raid\_md\_free\_disk\_jmicron}};}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00120}\mbox{\hyperlink{md__jmicron_8c_ae7cf97461cbdb8342e28daa6e21e0ce4}{00120}} \textcolor{keyword}{static} g\_raid\_md\_free\_t \mbox{\hyperlink{md__jmicron_8c_ae7cf97461cbdb8342e28daa6e21e0ce4}{g\_raid\_md\_free\_jmicron}};}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00121}00121 }
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00122}\mbox{\hyperlink{md__jmicron_8c_a50169a8a71ff9c334105aa03e3421467}{00122}} \textcolor{keyword}{static} kobj\_method\_t \mbox{\hyperlink{md__jmicron_8c_a50169a8a71ff9c334105aa03e3421467}{g\_raid\_md\_jmicron\_methods}}[] = \{}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00123}00123         KOBJMETHOD(g\_raid\_md\_create,    \mbox{\hyperlink{md__jmicron_8c_a023cfe32948ee2b2c745e7ba8398d9dd}{g\_raid\_md\_create\_jmicron}}),}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00124}00124         KOBJMETHOD(g\_raid\_md\_taste,     \mbox{\hyperlink{md__jmicron_8c_ae17d9058bbc539474ef601a87819dfb0}{g\_raid\_md\_taste\_jmicron}}),}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00125}00125         KOBJMETHOD(g\_raid\_md\_event,     \mbox{\hyperlink{md__jmicron_8c_a665c28ad395d21228359429d66fe759f}{g\_raid\_md\_event\_jmicron}}),}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00126}00126         KOBJMETHOD(g\_raid\_md\_ctl,       \mbox{\hyperlink{md__jmicron_8c_af925716ea4c409c9bab6d9c060de7805}{g\_raid\_md\_ctl\_jmicron}}),}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00127}00127         KOBJMETHOD(g\_raid\_md\_write,     \mbox{\hyperlink{md__jmicron_8c_aaf5dc9d91eb1d2ddad515c7844468905}{g\_raid\_md\_write\_jmicron}}),}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00128}00128         KOBJMETHOD(g\_raid\_md\_fail\_disk, \mbox{\hyperlink{md__jmicron_8c_aa81b7896dc923ed3557af65493e17a9d}{g\_raid\_md\_fail\_disk\_jmicron}}),}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00129}00129         KOBJMETHOD(g\_raid\_md\_free\_disk, \mbox{\hyperlink{md__jmicron_8c_a6eb57f4798a84f27857fbb9edf3e4532}{g\_raid\_md\_free\_disk\_jmicron}}),}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00130}00130         KOBJMETHOD(g\_raid\_md\_free,      \mbox{\hyperlink{md__jmicron_8c_ae7cf97461cbdb8342e28daa6e21e0ce4}{g\_raid\_md\_free\_jmicron}}),}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00131}00131         \{ 0, 0 \}}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00132}00132 \};}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00133}00133 }
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00134}\mbox{\hyperlink{md__jmicron_8c_a43a7551b48ddbf285858dad8fed80b3f}{00134}} \textcolor{keyword}{static} \textcolor{keyword}{struct }\mbox{\hyperlink{structg__raid__md__class}{g\_raid\_md\_class}} \mbox{\hyperlink{md__jmicron_8c_a43a7551b48ddbf285858dad8fed80b3f}{g\_raid\_md\_jmicron\_class}} = \{}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00135}00135         \textcolor{stringliteral}{"{}JMicron"{}},}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00136}00136         \mbox{\hyperlink{md__jmicron_8c_a50169a8a71ff9c334105aa03e3421467}{g\_raid\_md\_jmicron\_methods}},}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00137}00137         \textcolor{keyword}{sizeof}(\textcolor{keyword}{struct }\mbox{\hyperlink{structg__raid__md__jmicron__object}{g\_raid\_md\_jmicron\_object}}),}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00138}00138         .mdc\_enable = 1,}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00139}00139         .mdc\_priority = 100}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00140}00140 \};}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00141}00141 }
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00142}00142 \textcolor{keyword}{static} \textcolor{keywordtype}{void}}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00143}\mbox{\hyperlink{md__jmicron_8c_a48fd6da4e42cb60e7476439913eb743a}{00143}} \mbox{\hyperlink{md__jmicron_8c_a48fd6da4e42cb60e7476439913eb743a}{g\_raid\_md\_jmicron\_print}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structjmicron__raid__conf}{jmicron\_raid\_conf}} *meta)}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00144}00144 \{}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00145}00145         \textcolor{keywordtype}{int} k;}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00146}00146 }
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00147}00147         \textcolor{keywordflow}{if} (\mbox{\hyperlink{g__raid_8c_a60062ce0bb852760514459b7a1f3d32e}{g\_raid\_debug}} < 1)}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00148}00148                 \textcolor{keywordflow}{return};}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00149}00149 }
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00150}00150         printf(\textcolor{stringliteral}{"{}********* ATA JMicron RAID Metadata *********\(\backslash\)n"{}});}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00151}00151         printf(\textcolor{stringliteral}{"{}signature           <\%c\%c>\(\backslash\)n"{}}, meta-\/>\mbox{\hyperlink{structjmicron__raid__conf_a31dabc190b0678711e27f5c2edcee307}{signature}}[0], meta-\/>\mbox{\hyperlink{structjmicron__raid__conf_a31dabc190b0678711e27f5c2edcee307}{signature}}[1]);}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00152}00152         printf(\textcolor{stringliteral}{"{}version             \%04x\(\backslash\)n"{}}, meta-\/>\mbox{\hyperlink{structjmicron__raid__conf_ad13be346660399b7d0027f1b9011158d}{version}});}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00153}00153         printf(\textcolor{stringliteral}{"{}checksum            0x\%04x\(\backslash\)n"{}}, meta-\/>\mbox{\hyperlink{structjmicron__raid__conf_a114848ac9a4ce23d8acef5458ab0d1fa}{checksum}});}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00154}00154         printf(\textcolor{stringliteral}{"{}disk\_id             0x\%08x\(\backslash\)n"{}}, meta-\/>\mbox{\hyperlink{structjmicron__raid__conf_aeccbf0f339ffb5dc10d2489d3d154e80}{disk\_id}});}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00155}00155         printf(\textcolor{stringliteral}{"{}offset              0x\%08x\(\backslash\)n"{}}, meta-\/>\mbox{\hyperlink{structjmicron__raid__conf_a47970969ccfc7aa96a0a076e5bd7dae8}{offset}});}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00156}00156         printf(\textcolor{stringliteral}{"{}disk\_sectors\_high   0x\%08x\(\backslash\)n"{}}, meta-\/>\mbox{\hyperlink{structjmicron__raid__conf_a53cb3d8a2e58df232b2ba5d6e27811dd}{disk\_sectors\_high}});}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00157}00157         printf(\textcolor{stringliteral}{"{}disk\_sectors\_low    0x\%04x\(\backslash\)n"{}}, meta-\/>\mbox{\hyperlink{structjmicron__raid__conf_a8e4cfaa514a26b0a4b701041cb7e4198}{disk\_sectors\_low}});}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00158}00158         printf(\textcolor{stringliteral}{"{}name                <\%.16s>\(\backslash\)n"{}}, meta-\/>\mbox{\hyperlink{structjmicron__raid__conf_a939a0360be0c1824e37541dae609bc87}{name}});}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00159}00159         printf(\textcolor{stringliteral}{"{}type                \%d\(\backslash\)n"{}}, meta-\/>\mbox{\hyperlink{structjmicron__raid__conf_a076e01c2fe3b5654d104b77c45fc55da}{type}});}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00160}00160         printf(\textcolor{stringliteral}{"{}stripe\_shift        \%d\(\backslash\)n"{}}, meta-\/>\mbox{\hyperlink{structjmicron__raid__conf_a3d27c760d3541ed0dda17ea03c65b987}{stripe\_shift}});}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00161}00161         printf(\textcolor{stringliteral}{"{}flags               \%04x\(\backslash\)n"{}}, meta-\/>\mbox{\hyperlink{structjmicron__raid__conf_a6bd3f9f2cf164a45a43c2519edfab653}{flags}});}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00162}00162         printf(\textcolor{stringliteral}{"{}spare              "{}});}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00163}00163         \textcolor{keywordflow}{for} (k = 0; k < \mbox{\hyperlink{md__jmicron_8c_afabd12199bb41742092c8e2b0d02ed2a}{JMICRON\_MAX\_SPARE}}; k++)}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00164}00164                 printf(\textcolor{stringliteral}{"{} 0x\%08x"{}}, meta-\/>\mbox{\hyperlink{structjmicron__raid__conf_acf1f91a97139967cb07ef752a6cc993d}{spare}}[k]);}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00165}00165         printf(\textcolor{stringliteral}{"{}\(\backslash\)n"{}});}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00166}00166         printf(\textcolor{stringliteral}{"{}disks              "{}});}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00167}00167         \textcolor{keywordflow}{for} (k = 0; k < \mbox{\hyperlink{md__jmicron_8c_a2bcd5e978621a25303473584d3878ad2}{JMICRON\_MAX\_DISKS}}; k++)}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00168}00168                 printf(\textcolor{stringliteral}{"{} 0x\%08x"{}}, meta-\/>\mbox{\hyperlink{structjmicron__raid__conf_a1b06fd2819bf2a863f9b8115413bc47a}{disks}}[k]);}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00169}00169         printf(\textcolor{stringliteral}{"{}\(\backslash\)n"{}});}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00170}00170         printf(\textcolor{stringliteral}{"{}=================================================\(\backslash\)n"{}});}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00171}00171 \}}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00172}00172 }
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00173}00173 \textcolor{keyword}{static} \textcolor{keyword}{struct }\mbox{\hyperlink{structjmicron__raid__conf}{jmicron\_raid\_conf}} *}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00174}\mbox{\hyperlink{md__jmicron_8c_a975b1371f2b98518ecbd2994d7a4b607}{00174}} \mbox{\hyperlink{md__jmicron_8c_a975b1371f2b98518ecbd2994d7a4b607}{jmicron\_meta\_copy}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structjmicron__raid__conf}{jmicron\_raid\_conf}} *meta)}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00175}00175 \{}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00176}00176         \textcolor{keyword}{struct }\mbox{\hyperlink{structjmicron__raid__conf}{jmicron\_raid\_conf}} *nmeta;}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00177}00177 }
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00178}00178         nmeta = malloc(\textcolor{keyword}{sizeof}(*meta), M\_MD\_JMICRON, M\_WAITOK);}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00179}00179         memcpy(nmeta, meta, \textcolor{keyword}{sizeof}(*meta));}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00180}00180         \textcolor{keywordflow}{return} (nmeta);}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00181}00181 \}}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00182}00182 }
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00183}00183 \textcolor{keyword}{static} \textcolor{keywordtype}{int}}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00184}\mbox{\hyperlink{md__jmicron_8c_a4a49f23e304d32226a781a5151fe65f9}{00184}} \mbox{\hyperlink{md__jmicron_8c_a4a49f23e304d32226a781a5151fe65f9}{jmicron\_meta\_total\_disks}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structjmicron__raid__conf}{jmicron\_raid\_conf}} *meta)}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00185}00185 \{}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00186}00186         \textcolor{keywordtype}{int} pos;}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00187}00187 }
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00188}00188         \textcolor{keywordflow}{for} (pos = 0; pos < \mbox{\hyperlink{md__jmicron_8c_a2bcd5e978621a25303473584d3878ad2}{JMICRON\_MAX\_DISKS}}; pos++) \{}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00189}00189                 \textcolor{keywordflow}{if} (meta-\/>\mbox{\hyperlink{structjmicron__raid__conf_a1b06fd2819bf2a863f9b8115413bc47a}{disks}}[pos] == 0)}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00190}00190                         \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00191}00191         \}}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00192}00192         \textcolor{keywordflow}{return} (pos);}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00193}00193 \}}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00194}00194 }
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00195}00195 \textcolor{keyword}{static} \textcolor{keywordtype}{int}}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00196}\mbox{\hyperlink{md__jmicron_8c_aa6f0fccb53d14c2308784d4f95fae275}{00196}} \mbox{\hyperlink{md__jmicron_8c_aa6f0fccb53d14c2308784d4f95fae275}{jmicron\_meta\_total\_spare}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structjmicron__raid__conf}{jmicron\_raid\_conf}} *meta)}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00197}00197 \{}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00198}00198         \textcolor{keywordtype}{int} pos, n;}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00199}00199 }
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00200}00200         n = 0;}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00201}00201         \textcolor{keywordflow}{for} (pos = 0; pos < \mbox{\hyperlink{md__jmicron_8c_afabd12199bb41742092c8e2b0d02ed2a}{JMICRON\_MAX\_SPARE}}; pos++) \{}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00202}00202                 \textcolor{keywordflow}{if} (meta-\/>\mbox{\hyperlink{structjmicron__raid__conf_acf1f91a97139967cb07ef752a6cc993d}{spare}}[pos] != 0)}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00203}00203                         n++;}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00204}00204         \}}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00205}00205         \textcolor{keywordflow}{return} (n);}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00206}00206 \}}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00207}00207 }
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00208}00208 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00209}00209 \textcolor{comment}{ * Generate fake Configuration ID based on disk IDs.}}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00210}00210 \textcolor{comment}{ * Note: it will change after each disk set change.}}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00211}00211 \textcolor{comment}{ */}}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00212}00212 \textcolor{keyword}{static} uint32\_t}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00213}\mbox{\hyperlink{md__jmicron_8c_ac180f9de75252335b3b8a565a66cb91b}{00213}} \mbox{\hyperlink{md__jmicron_8c_ac180f9de75252335b3b8a565a66cb91b}{jmicron\_meta\_config\_id}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structjmicron__raid__conf}{jmicron\_raid\_conf}} *meta)}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00214}00214 \{}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00215}00215         \textcolor{keywordtype}{int} pos;}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00216}00216         uint32\_t config\_id;}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00217}00217 }
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00218}00218         config\_id = 0;}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00219}00219         \textcolor{keywordflow}{for} (pos = 0; pos < \mbox{\hyperlink{md__jmicron_8c_a2bcd5e978621a25303473584d3878ad2}{JMICRON\_MAX\_DISKS}}; pos++)}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00220}00220                 config\_id += meta-\/>\mbox{\hyperlink{structjmicron__raid__conf_a1b06fd2819bf2a863f9b8115413bc47a}{disks}}[pos] << pos;}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00221}00221         return (config\_id);}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00222}00222 \}}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00223}00223 }
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00224}00224 \textcolor{keyword}{static} \textcolor{keywordtype}{void}}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00225}\mbox{\hyperlink{md__jmicron_8c_a46258b691dc39170138f6d05c2d718cf}{00225}} \mbox{\hyperlink{md__jmicron_8c_a46258b691dc39170138f6d05c2d718cf}{jmicron\_meta\_get\_name}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structjmicron__raid__conf}{jmicron\_raid\_conf}} *meta, \textcolor{keywordtype}{char} *\mbox{\hyperlink{g__part__if_8m_ac14417684334d01b4e1e807a19d92816}{buf}})}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00226}00226 \{}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00227}00227         \textcolor{keywordtype}{int} i;}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00228}00228 }
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00229}00229         strncpy(\mbox{\hyperlink{g__part__if_8m_ac14417684334d01b4e1e807a19d92816}{buf}}, meta-\/>\mbox{\hyperlink{structjmicron__raid__conf_a939a0360be0c1824e37541dae609bc87}{name}}, 16);}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00230}00230         \mbox{\hyperlink{g__part__if_8m_ac14417684334d01b4e1e807a19d92816}{buf}}[16] = 0;}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00231}00231         \textcolor{keywordflow}{for} (i = 15; i >= 0; i-\/-\/) \{}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00232}00232                 \textcolor{keywordflow}{if} (\mbox{\hyperlink{g__part__if_8m_ac14417684334d01b4e1e807a19d92816}{buf}}[i] > 0x20)}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00233}00233                         \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00234}00234                 \mbox{\hyperlink{g__part__if_8m_ac14417684334d01b4e1e807a19d92816}{buf}}[i] = 0;}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00235}00235         \}}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00236}00236 \}}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00237}00237 }
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00238}00238 \textcolor{keyword}{static} \textcolor{keywordtype}{void}}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00239}\mbox{\hyperlink{md__jmicron_8c_a66e01e79614d404aad6e1b25d0ed22c7}{00239}} \mbox{\hyperlink{md__jmicron_8c_a66e01e79614d404aad6e1b25d0ed22c7}{jmicron\_meta\_put\_name}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structjmicron__raid__conf}{jmicron\_raid\_conf}} *meta, \textcolor{keywordtype}{char} *\mbox{\hyperlink{g__part__if_8m_ac14417684334d01b4e1e807a19d92816}{buf}})}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00240}00240 \{}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00241}00241 }
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00242}00242         memset(meta-\/>\mbox{\hyperlink{structjmicron__raid__conf_a939a0360be0c1824e37541dae609bc87}{name}}, 0x20, 16);}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00243}00243         memcpy(meta-\/>\mbox{\hyperlink{structjmicron__raid__conf_a939a0360be0c1824e37541dae609bc87}{name}}, \mbox{\hyperlink{g__part__if_8m_ac14417684334d01b4e1e807a19d92816}{buf}}, MIN(strlen(\mbox{\hyperlink{g__part__if_8m_ac14417684334d01b4e1e807a19d92816}{buf}}), 16));}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00244}00244 \}}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00245}00245 }
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00246}00246 \textcolor{keyword}{static} \textcolor{keywordtype}{int}}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00247}\mbox{\hyperlink{md__jmicron_8c_a1a9e27fa92871a229492bccdae9ec7eb}{00247}} \mbox{\hyperlink{md__jmicron_8c_a1a9e27fa92871a229492bccdae9ec7eb}{jmicron\_meta\_find\_disk}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structjmicron__raid__conf}{jmicron\_raid\_conf}} *meta, uint32\_t \textcolor{keywordtype}{id})}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00248}00248 \{}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00249}00249         \textcolor{keywordtype}{int} pos;}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00250}00250 }
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00251}00251         \textcolor{keywordtype}{id} \&= \mbox{\hyperlink{md__jmicron_8c_ae5a6c6dc90a396412a801d5e62abf05f}{JMICRON\_DISK\_MASK}};}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00252}00252         \textcolor{keywordflow}{for} (pos = 0; pos < \mbox{\hyperlink{md__jmicron_8c_a2bcd5e978621a25303473584d3878ad2}{JMICRON\_MAX\_DISKS}}; pos++) \{}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00253}00253                 \textcolor{keywordflow}{if} ((meta-\/>\mbox{\hyperlink{structjmicron__raid__conf_a1b06fd2819bf2a863f9b8115413bc47a}{disks}}[pos] \& \mbox{\hyperlink{md__jmicron_8c_ae5a6c6dc90a396412a801d5e62abf05f}{JMICRON\_DISK\_MASK}}) == \textcolor{keywordtype}{id})}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00254}00254                         \textcolor{keywordflow}{return} (pos);}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00255}00255         \}}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00256}00256         \textcolor{keywordflow}{for} (pos = 0; pos < \mbox{\hyperlink{md__jmicron_8c_afabd12199bb41742092c8e2b0d02ed2a}{JMICRON\_MAX\_SPARE}}; pos++) \{}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00257}00257                 \textcolor{keywordflow}{if} ((meta-\/>\mbox{\hyperlink{structjmicron__raid__conf_acf1f91a97139967cb07ef752a6cc993d}{spare}}[pos] \& \mbox{\hyperlink{md__jmicron_8c_ae5a6c6dc90a396412a801d5e62abf05f}{JMICRON\_DISK\_MASK}}) == \textcolor{keywordtype}{id})}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00258}00258                         \textcolor{keywordflow}{return} (-\/3);}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00259}00259         \}}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00260}00260         \textcolor{keywordflow}{return} (-\/1);}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00261}00261 \}}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00262}00262 }
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00263}00263 \textcolor{keyword}{static} \textcolor{keyword}{struct }\mbox{\hyperlink{structjmicron__raid__conf}{jmicron\_raid\_conf}} *}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00264}\mbox{\hyperlink{md__jmicron_8c_a1ccbc8adbd1ccb807a87f255d7793e05}{00264}} \mbox{\hyperlink{md__jmicron_8c_a1ccbc8adbd1ccb807a87f255d7793e05}{jmicron\_meta\_read}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structg__consumer}{g\_consumer}} *\mbox{\hyperlink{g__part__if_8m_a294f18324585ff37641fb8aa1c9ccd82}{cp}})}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00265}00265 \{}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00266}00266         \textcolor{keyword}{struct }\mbox{\hyperlink{structg__provider}{g\_provider}} *\mbox{\hyperlink{g__part__if_8m_a9bc7638f295763b77465c5ebebbd3442}{pp}};}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00267}00267         \textcolor{keyword}{struct }\mbox{\hyperlink{structjmicron__raid__conf}{jmicron\_raid\_conf}} *meta;}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00268}00268         \textcolor{keywordtype}{char} *\mbox{\hyperlink{g__part__if_8m_ac14417684334d01b4e1e807a19d92816}{buf}};}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00269}00269         \textcolor{keywordtype}{int} error, i;}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00270}00270         uint16\_t \mbox{\hyperlink{structjmicron__raid__conf_a114848ac9a4ce23d8acef5458ab0d1fa}{checksum}}, *ptr;}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00271}00271 }
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00272}00272         \mbox{\hyperlink{g__part__if_8m_a9bc7638f295763b77465c5ebebbd3442}{pp}} = \mbox{\hyperlink{g__part__if_8m_a294f18324585ff37641fb8aa1c9ccd82}{cp}}-\/>\mbox{\hyperlink{structg__consumer_a6435d5aec0376e995dce3131fd3beb52}{provider}};}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00273}00273         \textcolor{keywordflow}{if} (\mbox{\hyperlink{g__part__if_8m_a9bc7638f295763b77465c5ebebbd3442}{pp}}-\/>\mbox{\hyperlink{structg__provider_aea3cd43d41461790b8d0afcd8c49a355}{sectorsize}} < \textcolor{keyword}{sizeof}(*meta))}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00274}00274                 \textcolor{keywordflow}{return} (NULL);}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00275}00275         \textcolor{comment}{/* Read the anchor sector. */}}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00276}00276         \mbox{\hyperlink{g__part__if_8m_ac14417684334d01b4e1e807a19d92816}{buf}} = \mbox{\hyperlink{geom_8h_a550c2071f79908eea3d1ccbf821c4e4f}{g\_read\_data}}(\mbox{\hyperlink{g__part__if_8m_a294f18324585ff37641fb8aa1c9ccd82}{cp}},}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00277}00277             \mbox{\hyperlink{g__part__if_8m_a9bc7638f295763b77465c5ebebbd3442}{pp}}-\/>\mbox{\hyperlink{structg__provider_a8f47c464c78aa91fa4ca5143ed3cd15e}{mediasize}} -\/ \mbox{\hyperlink{g__part__if_8m_a9bc7638f295763b77465c5ebebbd3442}{pp}}-\/>\mbox{\hyperlink{structg__provider_aea3cd43d41461790b8d0afcd8c49a355}{sectorsize}}, \mbox{\hyperlink{g__part__if_8m_a9bc7638f295763b77465c5ebebbd3442}{pp}}-\/>\mbox{\hyperlink{structg__provider_aea3cd43d41461790b8d0afcd8c49a355}{sectorsize}}, \&error);}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00278}00278         \textcolor{keywordflow}{if} (\mbox{\hyperlink{g__part__if_8m_ac14417684334d01b4e1e807a19d92816}{buf}} == NULL) \{}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00279}00279                 \mbox{\hyperlink{g__raid_8h_a4333fbd8d0899facf171aee7b60697f6}{G\_RAID\_DEBUG}}(1, \textcolor{stringliteral}{"{}Cannot read metadata from \%s (error=\%d)."{}},}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00280}00280                     \mbox{\hyperlink{g__part__if_8m_a9bc7638f295763b77465c5ebebbd3442}{pp}}-\/>\mbox{\hyperlink{structg__provider_a2bffb416ee58cf4df7839c6fd5ec004a}{name}}, error);}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00281}00281                 \textcolor{keywordflow}{return} (NULL);}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00282}00282         \}}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00283}00283         meta = (\textcolor{keyword}{struct }\mbox{\hyperlink{structjmicron__raid__conf}{jmicron\_raid\_conf}} *)\mbox{\hyperlink{g__part__if_8m_ac14417684334d01b4e1e807a19d92816}{buf}};}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00284}00284 }
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00285}00285         \textcolor{comment}{/* Check if this is an JMicron RAID struct */}}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00286}00286         \textcolor{keywordflow}{if} (strncmp(meta-\/>\mbox{\hyperlink{structjmicron__raid__conf_a31dabc190b0678711e27f5c2edcee307}{signature}}, \mbox{\hyperlink{md__jmicron_8c_addff85c305efbce93d954c396f7a9469}{JMICRON\_MAGIC}}, strlen(\mbox{\hyperlink{md__jmicron_8c_addff85c305efbce93d954c396f7a9469}{JMICRON\_MAGIC}}))) \{}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00287}00287                 \mbox{\hyperlink{g__raid_8h_a4333fbd8d0899facf171aee7b60697f6}{G\_RAID\_DEBUG}}(1, \textcolor{stringliteral}{"{}JMicron signature check failed on \%s"{}}, \mbox{\hyperlink{g__part__if_8m_a9bc7638f295763b77465c5ebebbd3442}{pp}}-\/>\mbox{\hyperlink{structg__provider_a2bffb416ee58cf4df7839c6fd5ec004a}{name}});}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00288}00288                 \mbox{\hyperlink{geom_8h_ad9924deb20de7b40cb6cf06e5ae28855}{g\_free}}(\mbox{\hyperlink{g__part__if_8m_ac14417684334d01b4e1e807a19d92816}{buf}});}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00289}00289                 \textcolor{keywordflow}{return} (NULL);}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00290}00290         \}}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00291}00291         meta = malloc(\textcolor{keyword}{sizeof}(*meta), M\_MD\_JMICRON, M\_WAITOK);}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00292}00292         memcpy(meta, \mbox{\hyperlink{g__part__if_8m_ac14417684334d01b4e1e807a19d92816}{buf}}, min(\textcolor{keyword}{sizeof}(*meta), \mbox{\hyperlink{g__part__if_8m_a9bc7638f295763b77465c5ebebbd3442}{pp}}-\/>\mbox{\hyperlink{structg__provider_aea3cd43d41461790b8d0afcd8c49a355}{sectorsize}}));}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00293}00293         \mbox{\hyperlink{geom_8h_ad9924deb20de7b40cb6cf06e5ae28855}{g\_free}}(\mbox{\hyperlink{g__part__if_8m_ac14417684334d01b4e1e807a19d92816}{buf}});}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00294}00294 }
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00295}00295         \textcolor{comment}{/* Check metadata checksum. */}}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00296}00296         \textcolor{keywordflow}{for} (\mbox{\hyperlink{structjmicron__raid__conf_a114848ac9a4ce23d8acef5458ab0d1fa}{checksum}} = 0, ptr = (uint16\_t *)meta, i = 0; i < 64; i++)}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00297}00297                 \mbox{\hyperlink{structjmicron__raid__conf_a114848ac9a4ce23d8acef5458ab0d1fa}{checksum}} += *ptr++;}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00298}00298         \textcolor{keywordflow}{if} (\mbox{\hyperlink{structjmicron__raid__conf_a114848ac9a4ce23d8acef5458ab0d1fa}{checksum}} != 0) \{}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00299}00299                 \mbox{\hyperlink{g__raid_8h_a4333fbd8d0899facf171aee7b60697f6}{G\_RAID\_DEBUG}}(1, \textcolor{stringliteral}{"{}JMicron checksum check failed on \%s"{}}, \mbox{\hyperlink{g__part__if_8m_a9bc7638f295763b77465c5ebebbd3442}{pp}}-\/>\mbox{\hyperlink{structg__provider_a2bffb416ee58cf4df7839c6fd5ec004a}{name}});}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00300}00300                 \mbox{\hyperlink{g__raid__md__if_8m_a4df9edb2717b3f7e4c3c903878577a54}{free}}(meta, M\_MD\_JMICRON);}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00301}00301                 \textcolor{keywordflow}{return} (NULL);}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00302}00302         \}}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00303}00303 }
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00304}00304         \textcolor{keywordflow}{return} (meta);}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00305}00305 \}}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00306}00306 }
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00307}00307 \textcolor{keyword}{static} \textcolor{keywordtype}{int}}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00308}\mbox{\hyperlink{md__jmicron_8c_a9b7efe879cf8a743b11dc8e18effb5b0}{00308}} \mbox{\hyperlink{md__jmicron_8c_a9b7efe879cf8a743b11dc8e18effb5b0}{jmicron\_meta\_write}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structg__consumer}{g\_consumer}} *\mbox{\hyperlink{g__part__if_8m_a294f18324585ff37641fb8aa1c9ccd82}{cp}}, \textcolor{keyword}{struct} \mbox{\hyperlink{structjmicron__raid__conf}{jmicron\_raid\_conf}} *meta)}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00309}00309 \{}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00310}00310         \textcolor{keyword}{struct }\mbox{\hyperlink{structg__provider}{g\_provider}} *\mbox{\hyperlink{g__part__if_8m_a9bc7638f295763b77465c5ebebbd3442}{pp}};}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00311}00311         \textcolor{keywordtype}{char} *\mbox{\hyperlink{g__part__if_8m_ac14417684334d01b4e1e807a19d92816}{buf}};}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00312}00312         \textcolor{keywordtype}{int} \mbox{\hyperlink{structg__provider_acacf1ee18cb6edbcfedc185846696e7f}{error}}, i;}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00313}00313         uint16\_t checksum, *ptr;}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00314}00314 }
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00315}00315         \mbox{\hyperlink{g__part__if_8m_a9bc7638f295763b77465c5ebebbd3442}{pp}} = \mbox{\hyperlink{g__part__if_8m_a294f18324585ff37641fb8aa1c9ccd82}{cp}}-\/>\mbox{\hyperlink{structg__consumer_a6435d5aec0376e995dce3131fd3beb52}{provider}};}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00316}00316 }
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00317}00317         \textcolor{comment}{/* Recalculate checksum for case if metadata were changed. */}}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00318}00318         meta-\/>\mbox{\hyperlink{structjmicron__raid__conf_a114848ac9a4ce23d8acef5458ab0d1fa}{checksum}} = 0;}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00319}00319         \textcolor{keywordflow}{for} (checksum = 0, ptr = (uint16\_t *)meta, i = 0; i < 64; i++)}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00320}00320                 checksum += *ptr++;}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00321}00321         meta-\/>\mbox{\hyperlink{structjmicron__raid__conf_a114848ac9a4ce23d8acef5458ab0d1fa}{checksum}} -\/= checksum;}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00322}00322 }
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00323}00323         \textcolor{comment}{/* Create and fill buffer. */}}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00324}00324         \mbox{\hyperlink{g__part__if_8m_ac14417684334d01b4e1e807a19d92816}{buf}} = malloc(\mbox{\hyperlink{g__part__if_8m_a9bc7638f295763b77465c5ebebbd3442}{pp}}-\/>\mbox{\hyperlink{structg__provider_aea3cd43d41461790b8d0afcd8c49a355}{sectorsize}}, M\_MD\_JMICRON, M\_WAITOK | M\_ZERO);}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00325}00325         memcpy(\mbox{\hyperlink{g__part__if_8m_ac14417684334d01b4e1e807a19d92816}{buf}}, meta, \textcolor{keyword}{sizeof}(*meta));}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00326}00326 }
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00327}00327         \mbox{\hyperlink{structg__provider_acacf1ee18cb6edbcfedc185846696e7f}{error}} = \mbox{\hyperlink{geom_8h_a9b87ecbd812c109546b077da483baada}{g\_write\_data}}(\mbox{\hyperlink{g__part__if_8m_a294f18324585ff37641fb8aa1c9ccd82}{cp}},}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00328}00328             \mbox{\hyperlink{g__part__if_8m_a9bc7638f295763b77465c5ebebbd3442}{pp}}-\/>\mbox{\hyperlink{structg__provider_a8f47c464c78aa91fa4ca5143ed3cd15e}{mediasize}} -\/ \mbox{\hyperlink{g__part__if_8m_a9bc7638f295763b77465c5ebebbd3442}{pp}}-\/>\mbox{\hyperlink{structg__provider_aea3cd43d41461790b8d0afcd8c49a355}{sectorsize}}, \mbox{\hyperlink{g__part__if_8m_ac14417684334d01b4e1e807a19d92816}{buf}}, \mbox{\hyperlink{g__part__if_8m_a9bc7638f295763b77465c5ebebbd3442}{pp}}-\/>\mbox{\hyperlink{structg__provider_aea3cd43d41461790b8d0afcd8c49a355}{sectorsize}});}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00329}00329         \textcolor{keywordflow}{if} (\mbox{\hyperlink{structg__provider_acacf1ee18cb6edbcfedc185846696e7f}{error}} != 0) \{}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00330}00330                 \mbox{\hyperlink{g__raid_8h_a4333fbd8d0899facf171aee7b60697f6}{G\_RAID\_DEBUG}}(1, \textcolor{stringliteral}{"{}Cannot write metadata to \%s (error=\%d)."{}},}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00331}00331                     \mbox{\hyperlink{g__part__if_8m_a9bc7638f295763b77465c5ebebbd3442}{pp}}-\/>\mbox{\hyperlink{structg__provider_a2bffb416ee58cf4df7839c6fd5ec004a}{name}}, \mbox{\hyperlink{structg__provider_acacf1ee18cb6edbcfedc185846696e7f}{error}});}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00332}00332         \}}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00333}00333 }
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00334}00334         \mbox{\hyperlink{g__raid__md__if_8m_a4df9edb2717b3f7e4c3c903878577a54}{free}}(\mbox{\hyperlink{g__part__if_8m_ac14417684334d01b4e1e807a19d92816}{buf}}, M\_MD\_JMICRON);}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00335}00335         \textcolor{keywordflow}{return} (\mbox{\hyperlink{structg__provider_acacf1ee18cb6edbcfedc185846696e7f}{error}});}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00336}00336 \}}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00337}00337 }
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00338}00338 \textcolor{keyword}{static} \textcolor{keywordtype}{int}}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00339}\mbox{\hyperlink{md__jmicron_8c_a5698e75f0b5354588271d5d4e0550bfc}{00339}} \mbox{\hyperlink{md__jmicron_8c_a5698e75f0b5354588271d5d4e0550bfc}{jmicron\_meta\_erase}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structg__consumer}{g\_consumer}} *\mbox{\hyperlink{g__part__if_8m_a294f18324585ff37641fb8aa1c9ccd82}{cp}})}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00340}00340 \{}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00341}00341         \textcolor{keyword}{struct }\mbox{\hyperlink{structg__provider}{g\_provider}} *\mbox{\hyperlink{g__part__if_8m_a9bc7638f295763b77465c5ebebbd3442}{pp}};}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00342}00342         \textcolor{keywordtype}{char} *\mbox{\hyperlink{g__part__if_8m_ac14417684334d01b4e1e807a19d92816}{buf}};}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00343}00343         \textcolor{keywordtype}{int} \mbox{\hyperlink{structg__provider_acacf1ee18cb6edbcfedc185846696e7f}{error}};}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00344}00344 }
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00345}00345         \mbox{\hyperlink{g__part__if_8m_a9bc7638f295763b77465c5ebebbd3442}{pp}} = \mbox{\hyperlink{g__part__if_8m_a294f18324585ff37641fb8aa1c9ccd82}{cp}}-\/>\mbox{\hyperlink{structg__consumer_a6435d5aec0376e995dce3131fd3beb52}{provider}};}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00346}00346         \mbox{\hyperlink{g__part__if_8m_ac14417684334d01b4e1e807a19d92816}{buf}} = malloc(\mbox{\hyperlink{g__part__if_8m_a9bc7638f295763b77465c5ebebbd3442}{pp}}-\/>\mbox{\hyperlink{structg__provider_aea3cd43d41461790b8d0afcd8c49a355}{sectorsize}}, M\_MD\_JMICRON, M\_WAITOK | M\_ZERO);}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00347}00347         \mbox{\hyperlink{structg__provider_acacf1ee18cb6edbcfedc185846696e7f}{error}} = \mbox{\hyperlink{geom_8h_a9b87ecbd812c109546b077da483baada}{g\_write\_data}}(\mbox{\hyperlink{g__part__if_8m_a294f18324585ff37641fb8aa1c9ccd82}{cp}},}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00348}00348             \mbox{\hyperlink{g__part__if_8m_a9bc7638f295763b77465c5ebebbd3442}{pp}}-\/>\mbox{\hyperlink{structg__provider_a8f47c464c78aa91fa4ca5143ed3cd15e}{mediasize}} -\/ \mbox{\hyperlink{g__part__if_8m_a9bc7638f295763b77465c5ebebbd3442}{pp}}-\/>\mbox{\hyperlink{structg__provider_aea3cd43d41461790b8d0afcd8c49a355}{sectorsize}}, \mbox{\hyperlink{g__part__if_8m_ac14417684334d01b4e1e807a19d92816}{buf}}, \mbox{\hyperlink{g__part__if_8m_a9bc7638f295763b77465c5ebebbd3442}{pp}}-\/>\mbox{\hyperlink{structg__provider_aea3cd43d41461790b8d0afcd8c49a355}{sectorsize}});}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00349}00349         \textcolor{keywordflow}{if} (\mbox{\hyperlink{structg__provider_acacf1ee18cb6edbcfedc185846696e7f}{error}} != 0) \{}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00350}00350                 \mbox{\hyperlink{g__raid_8h_a4333fbd8d0899facf171aee7b60697f6}{G\_RAID\_DEBUG}}(1, \textcolor{stringliteral}{"{}Cannot erase metadata on \%s (error=\%d)."{}},}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00351}00351                     \mbox{\hyperlink{g__part__if_8m_a9bc7638f295763b77465c5ebebbd3442}{pp}}-\/>\mbox{\hyperlink{structg__provider_a2bffb416ee58cf4df7839c6fd5ec004a}{name}}, \mbox{\hyperlink{structg__provider_acacf1ee18cb6edbcfedc185846696e7f}{error}});}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00352}00352         \}}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00353}00353         \mbox{\hyperlink{g__raid__md__if_8m_a4df9edb2717b3f7e4c3c903878577a54}{free}}(\mbox{\hyperlink{g__part__if_8m_ac14417684334d01b4e1e807a19d92816}{buf}}, M\_MD\_JMICRON);}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00354}00354         \textcolor{keywordflow}{return} (\mbox{\hyperlink{structg__provider_acacf1ee18cb6edbcfedc185846696e7f}{error}});}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00355}00355 \}}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00356}00356 }
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00357}00357 \textcolor{keyword}{static} \textcolor{keyword}{struct }\mbox{\hyperlink{structg__raid__disk}{g\_raid\_disk}} *}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00358}\mbox{\hyperlink{md__jmicron_8c_aab9eeca0c730772f5c63bf926e83e15c}{00358}} \mbox{\hyperlink{md__jmicron_8c_aab9eeca0c730772f5c63bf926e83e15c}{g\_raid\_md\_jmicron\_get\_disk}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structg__raid__softc}{g\_raid\_softc}} *sc, \textcolor{keywordtype}{int} \textcolor{keywordtype}{id})}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00359}00359 \{}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00360}00360         \textcolor{keyword}{struct }\mbox{\hyperlink{structg__raid__disk}{g\_raid\_disk}}   *\mbox{\hyperlink{g__raid__md__if_8m_a9508e997a57ea259d6ecc0e563261993}{disk}};}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00361}00361         \textcolor{keyword}{struct }\mbox{\hyperlink{structg__raid__md__jmicron__perdisk}{g\_raid\_md\_jmicron\_perdisk}} *pd;}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00362}00362 }
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00363}00363         TAILQ\_FOREACH(\mbox{\hyperlink{structdisk}{disk}}, \&sc-\/>sc\_disks, d\_next) \{}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00364}00364                 pd = (\textcolor{keyword}{struct }\mbox{\hyperlink{structg__raid__md__jmicron__perdisk}{g\_raid\_md\_jmicron\_perdisk}} *)\mbox{\hyperlink{structdisk}{disk}}-\/>d\_md\_data;}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00365}00365                 if (pd-\/>\mbox{\hyperlink{structg__raid__md__jmicron__perdisk_a65960334e7c32b993e9ea104819243b9}{pd\_disk\_pos}} == \textcolor{keywordtype}{id})}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00366}00366                         \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00367}00367         \}}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00368}00368         \textcolor{keywordflow}{return} (\mbox{\hyperlink{structdisk}{disk}});}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00369}00369 \}}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00370}00370 }
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00371}00371 \textcolor{keyword}{static} \textcolor{keywordtype}{int}}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00372}\mbox{\hyperlink{md__jmicron_8c_a964ba0e9c5f5a188478cceb14f1b4bd9}{00372}} \mbox{\hyperlink{md__jmicron_8c_a964ba0e9c5f5a188478cceb14f1b4bd9}{g\_raid\_md\_jmicron\_supported}}(\textcolor{keywordtype}{int} level, \textcolor{keywordtype}{int} qual, \textcolor{keywordtype}{int} disks, \textcolor{keywordtype}{int} force)}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00373}00373 \{}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00374}00374 }
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00375}00375         \textcolor{keywordflow}{if} (disks > 8)}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00376}00376                 \textcolor{keywordflow}{return} (0);}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00377}00377         \textcolor{keywordflow}{switch} (level) \{}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00378}00378         \textcolor{keywordflow}{case} \mbox{\hyperlink{g__raid_8h_a6a49f4ddd0b45eb4210ce72528786a32}{G\_RAID\_VOLUME\_RL\_RAID0}}:}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00379}00379                 \textcolor{keywordflow}{if} (disks < 1)}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00380}00380                         \textcolor{keywordflow}{return} (0);}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00381}00381                 \textcolor{keywordflow}{if} (!force \&\& (disks < 2 || disks > 6))}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00382}00382                         \textcolor{keywordflow}{return} (0);}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00383}00383                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00384}00384         \textcolor{keywordflow}{case} \mbox{\hyperlink{g__raid_8h_a270bdf6b61fc7d810795e08ebbe60931}{G\_RAID\_VOLUME\_RL\_RAID1}}:}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00385}00385                 \textcolor{keywordflow}{if} (disks < 1)}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00386}00386                         \textcolor{keywordflow}{return} (0);}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00387}00387                 \textcolor{keywordflow}{if} (!force \&\& (disks != 2))}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00388}00388                         \textcolor{keywordflow}{return} (0);}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00389}00389                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00390}00390         \textcolor{keywordflow}{case} \mbox{\hyperlink{g__raid_8h_ad0ef2cd50760a49759a6cbaf2afeb286}{G\_RAID\_VOLUME\_RL\_RAID1E}}:}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00391}00391                 \textcolor{keywordflow}{if} (disks < 2)}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00392}00392                         \textcolor{keywordflow}{return} (0);}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00393}00393                 \textcolor{keywordflow}{if} (!force \&\& (disks != 4))}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00394}00394                         \textcolor{keywordflow}{return} (0);}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00395}00395                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00396}00396         \textcolor{keywordflow}{case} \mbox{\hyperlink{g__raid_8h_acb418af006a1d84e0dd912c58cec6f57}{G\_RAID\_VOLUME\_RL\_SINGLE}}:}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00397}00397                 \textcolor{keywordflow}{if} (disks != 1)}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00398}00398                         \textcolor{keywordflow}{return} (0);}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00399}00399                 \textcolor{keywordflow}{if} (!force)}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00400}00400                         \textcolor{keywordflow}{return} (0);}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00401}00401                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00402}00402         \textcolor{keywordflow}{case} \mbox{\hyperlink{g__raid_8h_abc695e94a9e4eff0f657ec01d1f19607}{G\_RAID\_VOLUME\_RL\_CONCAT}}:}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00403}00403                 \textcolor{keywordflow}{if} (disks < 2)}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00404}00404                         \textcolor{keywordflow}{return} (0);}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00405}00405                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00406}00406         \textcolor{keywordflow}{case} \mbox{\hyperlink{g__raid_8h_af6db015b03ea390243f2df897eb1189d}{G\_RAID\_VOLUME\_RL\_RAID5}}:}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00407}00407                 \textcolor{keywordflow}{if} (disks < 3)}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00408}00408                         \textcolor{keywordflow}{return} (0);}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00409}00409                 \textcolor{keywordflow}{if} (qual != \mbox{\hyperlink{g__raid_8h_a85a42d827015531803abc6df07b15e89}{G\_RAID\_VOLUME\_RLQ\_R5LA}})}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00410}00410                         \textcolor{keywordflow}{return} (0);}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00411}00411                 \textcolor{keywordflow}{if} (!force)}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00412}00412                         \textcolor{keywordflow}{return} (0);}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00413}00413                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00414}00414         \textcolor{keywordflow}{default}:}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00415}00415                 \textcolor{keywordflow}{return} (0);}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00416}00416         \}}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00417}00417         \textcolor{keywordflow}{if} (level != \mbox{\hyperlink{g__raid_8h_af6db015b03ea390243f2df897eb1189d}{G\_RAID\_VOLUME\_RL\_RAID5}} \&\& qual != \mbox{\hyperlink{g__raid_8h_a9c036957b2fb94761b5fd084e8f991c9}{G\_RAID\_VOLUME\_RLQ\_NONE}})}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00418}00418                 \textcolor{keywordflow}{return} (0);}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00419}00419         \textcolor{keywordflow}{return} (1);}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00420}00420 \}}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00421}00421 }
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00422}00422 \textcolor{keyword}{static} \textcolor{keywordtype}{int}}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00423}\mbox{\hyperlink{md__jmicron_8c_ac0f68e614510a006ddebb34dc929f1af}{00423}} \mbox{\hyperlink{md__jmicron_8c_ac0f68e614510a006ddebb34dc929f1af}{g\_raid\_md\_jmicron\_start\_disk}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structg__raid__disk}{g\_raid\_disk}} *\mbox{\hyperlink{structdisk}{disk}})}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00424}00424 \{}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00425}00425         \textcolor{keyword}{struct }\mbox{\hyperlink{structg__raid__softc}{g\_raid\_softc}} *sc;}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00426}00426         \textcolor{keyword}{struct }\mbox{\hyperlink{structg__raid__subdisk}{g\_raid\_subdisk}} *\mbox{\hyperlink{g__raid__md__if_8m_a910062273088d146e8533398780701eb}{sd}}, *tmpsd;}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00427}00427         \textcolor{keyword}{struct }\mbox{\hyperlink{structg__raid__disk}{g\_raid\_disk}} *olddisk, *tmpdisk;}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00428}00428         \textcolor{keyword}{struct }\mbox{\hyperlink{structg__raid__md__object}{g\_raid\_md\_object}} *md;}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00429}00429         \textcolor{keyword}{struct }\mbox{\hyperlink{structg__raid__md__jmicron__object}{g\_raid\_md\_jmicron\_object}} *mdi;}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00430}00430         \textcolor{keyword}{struct }\mbox{\hyperlink{structg__raid__md__jmicron__perdisk}{g\_raid\_md\_jmicron\_perdisk}} *pd, *oldpd;}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00431}00431         \textcolor{keyword}{struct }\mbox{\hyperlink{structjmicron__raid__conf}{jmicron\_raid\_conf}} *meta;}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00432}00432         \textcolor{keywordtype}{int} disk\_pos, resurrection = 0;}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00433}00433 }
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00434}00434         sc = \mbox{\hyperlink{structdisk}{disk}}-\/>d\_softc;}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00435}00435         md = sc-\/>\mbox{\hyperlink{structg__raid__softc_a5bf7421452e0a324fc4f8b954b57314b}{sc\_md}};}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00436}00436         mdi = (\textcolor{keyword}{struct }\mbox{\hyperlink{structg__raid__md__jmicron__object}{g\_raid\_md\_jmicron\_object}} *)md;}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00437}00437         meta = mdi-\/>\mbox{\hyperlink{structg__raid__md__jmicron__object_a99dfc14fc8a6fe56d6822564249c3a54}{mdio\_meta}};}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00438}00438         pd = (\textcolor{keyword}{struct }\mbox{\hyperlink{structg__raid__md__jmicron__perdisk}{g\_raid\_md\_jmicron\_perdisk}} *)\mbox{\hyperlink{structdisk}{disk}}-\/>d\_md\_data;}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00439}00439         olddisk = NULL;}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00440}00440 }
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00441}00441         \textcolor{comment}{/* Find disk position in metadata by its serial. */}}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00442}00442         if (pd-\/>\mbox{\hyperlink{structg__raid__md__jmicron__perdisk_ac2b4421d277ebd509be1854f4c1e1f53}{pd\_meta}} != NULL)}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00443}00443                 disk\_pos = \mbox{\hyperlink{md__jmicron_8c_a1a9e27fa92871a229492bccdae9ec7eb}{jmicron\_meta\_find\_disk}}(meta, pd-\/>\mbox{\hyperlink{structg__raid__md__jmicron__perdisk_a46a598fbfa7cbd51384eb2ea86325455}{pd\_disk\_id}});}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00444}00444         \textcolor{keywordflow}{else}}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00445}00445                 disk\_pos = -\/1;}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00446}00446         \textcolor{keywordflow}{if} (disk\_pos < 0) \{}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00447}00447                 \mbox{\hyperlink{g__raid_8h_ace7234f8197b96e1b636f9376de8d7ea}{G\_RAID\_DEBUG1}}(1, sc, \textcolor{stringliteral}{"{}Unknown, probably new or stale disk"{}});}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00448}00448                 \textcolor{comment}{/* If we are in the start process, that's all for now. */}}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00449}00449                 \textcolor{keywordflow}{if} (!mdi-\/>\mbox{\hyperlink{structg__raid__md__jmicron__object_adeedb342e0d17d9db3bce7dfc408b72c}{mdio\_started}})}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00450}00450                         \textcolor{keywordflow}{goto} nofit;}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00451}00451                 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00452}00452 \textcolor{comment}{                 * If we have already started -\/ try to get use of the disk.}}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00453}00453 \textcolor{comment}{                 * Try to replace OFFLINE disks first, then FAILED.}}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00454}00454 \textcolor{comment}{                 */}}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00455}00455                 TAILQ\_FOREACH(tmpdisk, \&sc-\/>sc\_disks, d\_next) \{}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00456}00456                         \textcolor{keywordflow}{if} (tmpdisk-\/>\mbox{\hyperlink{structg__raid__disk_a893b44bb63bf0b41d6f140424e0db523}{d\_state}} != \mbox{\hyperlink{g__raid_8h_aee552862c97f7442835d7c81b3399ac2}{G\_RAID\_DISK\_S\_OFFLINE}} \&\&}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00457}00457                             tmpdisk-\/>\mbox{\hyperlink{structg__raid__disk_a893b44bb63bf0b41d6f140424e0db523}{d\_state}} != \mbox{\hyperlink{g__raid_8h_a2135c7d2f628dbf559cad6d4ea1b5c8f}{G\_RAID\_DISK\_S\_FAILED}})}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00458}00458                                 \textcolor{keywordflow}{continue};}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00459}00459                         \textcolor{comment}{/* Make sure this disk is big enough. */}}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00460}00460                         TAILQ\_FOREACH(\mbox{\hyperlink{g__raid__md__if_8m_a910062273088d146e8533398780701eb}{sd}}, \&tmpdisk-\/>d\_subdisks, sd\_next) \{}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00461}00461                                 \textcolor{keywordflow}{if} (\mbox{\hyperlink{g__raid__md__if_8m_a910062273088d146e8533398780701eb}{sd}}-\/>\mbox{\hyperlink{structg__raid__subdisk_a9b4e12573b26ee18473a16408044819f}{sd\_offset}} + \mbox{\hyperlink{g__raid__md__if_8m_a910062273088d146e8533398780701eb}{sd}}-\/>\mbox{\hyperlink{structg__raid__subdisk_abc4da1103e29e3a8e2bbadb18fbccbf6}{sd\_size}} + 512 >}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00462}00462                                     pd-\/>\mbox{\hyperlink{structg__raid__md__jmicron__perdisk_a1a732ac096c218a73964b0bbecb9b236}{pd\_disk\_size}}) \{}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00463}00463                                         \mbox{\hyperlink{g__raid_8h_ace7234f8197b96e1b636f9376de8d7ea}{G\_RAID\_DEBUG1}}(1, sc,}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00464}00464                                             \textcolor{stringliteral}{"{}Disk too small (\%ju < \%ju)"{}},}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00465}00465                                             pd-\/>\mbox{\hyperlink{structg__raid__md__jmicron__perdisk_a1a732ac096c218a73964b0bbecb9b236}{pd\_disk\_size}},}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00466}00466                                             \mbox{\hyperlink{g__raid__md__if_8m_a910062273088d146e8533398780701eb}{sd}}-\/>\mbox{\hyperlink{structg__raid__subdisk_a9b4e12573b26ee18473a16408044819f}{sd\_offset}} + \mbox{\hyperlink{g__raid__md__if_8m_a910062273088d146e8533398780701eb}{sd}}-\/>\mbox{\hyperlink{structg__raid__subdisk_abc4da1103e29e3a8e2bbadb18fbccbf6}{sd\_size}} + 512);}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00467}00467                                         \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00468}00468                                 \}}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00469}00469                         \}}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00470}00470                         \textcolor{keywordflow}{if} (\mbox{\hyperlink{g__raid__md__if_8m_a910062273088d146e8533398780701eb}{sd}} != NULL)}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00471}00471                                 \textcolor{keywordflow}{continue};}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00472}00472                         \textcolor{keywordflow}{if} (tmpdisk-\/>\mbox{\hyperlink{structg__raid__disk_a893b44bb63bf0b41d6f140424e0db523}{d\_state}} == \mbox{\hyperlink{g__raid_8h_aee552862c97f7442835d7c81b3399ac2}{G\_RAID\_DISK\_S\_OFFLINE}}) \{}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00473}00473                                 olddisk = tmpdisk;}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00474}00474                                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00475}00475                         \} \textcolor{keywordflow}{else} \textcolor{keywordflow}{if} (olddisk == NULL)}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00476}00476                                 olddisk = tmpdisk;}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00477}00477                 \}}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00478}00478                 \textcolor{keywordflow}{if} (olddisk == NULL) \{}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00479}00479 nofit:}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00480}00480                         \textcolor{keywordflow}{if} (disk\_pos == -\/3 || pd-\/>\mbox{\hyperlink{structg__raid__md__jmicron__perdisk_a65960334e7c32b993e9ea104819243b9}{pd\_disk\_pos}} == -\/3) \{}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00481}00481                                 \mbox{\hyperlink{g__raid_8c_a342da571518e21e0521b6416c838d00e}{g\_raid\_change\_disk\_state}}(\mbox{\hyperlink{structdisk}{disk}},}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00482}00482                                     \mbox{\hyperlink{g__raid_8h_a53208a3eca6d67917c6fdf6321292c99}{G\_RAID\_DISK\_S\_SPARE}});}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00483}00483                                 \textcolor{keywordflow}{return} (1);}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00484}00484                         \} \textcolor{keywordflow}{else} \{}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00485}00485                                 \mbox{\hyperlink{g__raid_8c_a342da571518e21e0521b6416c838d00e}{g\_raid\_change\_disk\_state}}(\mbox{\hyperlink{structdisk}{disk}},}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00486}00486                                     \mbox{\hyperlink{g__raid_8h_a12c815344c6e588760a1619861a54122}{G\_RAID\_DISK\_S\_STALE}});}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00487}00487                                 \textcolor{keywordflow}{return} (0);}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00488}00488                         \}}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00489}00489                 \}}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00490}00490                 oldpd = (\textcolor{keyword}{struct }\mbox{\hyperlink{structg__raid__md__jmicron__perdisk}{g\_raid\_md\_jmicron\_perdisk}} *)olddisk-\/>\mbox{\hyperlink{structg__raid__disk_ab6681cb16ceeb79b9e88d639eca0bd9e}{d\_md\_data}};}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00491}00491                 disk\_pos = oldpd-\/>\mbox{\hyperlink{structg__raid__md__jmicron__perdisk_a65960334e7c32b993e9ea104819243b9}{pd\_disk\_pos}};}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00492}00492                 resurrection = 1;}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00493}00493         \}}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00494}00494 }
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00495}00495         \textcolor{keywordflow}{if} (olddisk == NULL) \{}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00496}00496                 \textcolor{comment}{/* Find placeholder by position. */}}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00497}00497                 olddisk = \mbox{\hyperlink{md__jmicron_8c_aab9eeca0c730772f5c63bf926e83e15c}{g\_raid\_md\_jmicron\_get\_disk}}(sc, disk\_pos);}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00498}00498                 \textcolor{keywordflow}{if} (olddisk == NULL)}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00499}00499                         panic(\textcolor{stringliteral}{"{}No disk at position \%d!"{}}, disk\_pos);}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00500}00500                 \textcolor{keywordflow}{if} (olddisk-\/>\mbox{\hyperlink{structg__raid__disk_a893b44bb63bf0b41d6f140424e0db523}{d\_state}} != \mbox{\hyperlink{g__raid_8h_aee552862c97f7442835d7c81b3399ac2}{G\_RAID\_DISK\_S\_OFFLINE}}) \{}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00501}00501                         \mbox{\hyperlink{g__raid_8h_ace7234f8197b96e1b636f9376de8d7ea}{G\_RAID\_DEBUG1}}(1, sc, \textcolor{stringliteral}{"{}More than one disk for pos \%d"{}},}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00502}00502                             disk\_pos);}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00503}00503                         \mbox{\hyperlink{g__raid_8c_a342da571518e21e0521b6416c838d00e}{g\_raid\_change\_disk\_state}}(\mbox{\hyperlink{structdisk}{disk}}, \mbox{\hyperlink{g__raid_8h_a12c815344c6e588760a1619861a54122}{G\_RAID\_DISK\_S\_STALE}});}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00504}00504                         \textcolor{keywordflow}{return} (0);}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00505}00505                 \}}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00506}00506                 oldpd = (\textcolor{keyword}{struct }\mbox{\hyperlink{structg__raid__md__jmicron__perdisk}{g\_raid\_md\_jmicron\_perdisk}} *)olddisk-\/>\mbox{\hyperlink{structg__raid__disk_ab6681cb16ceeb79b9e88d639eca0bd9e}{d\_md\_data}};}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00507}00507         \}}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00508}00508 }
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00509}00509         \textcolor{comment}{/* Replace failed disk or placeholder with new disk. */}}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00510}00510         TAILQ\_FOREACH\_SAFE(\mbox{\hyperlink{g__raid__md__if_8m_a910062273088d146e8533398780701eb}{sd}}, \&olddisk-\/>d\_subdisks, sd\_next, tmpsd) \{}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00511}00511                 TAILQ\_REMOVE(\&olddisk-\/>d\_subdisks, \mbox{\hyperlink{g__raid__md__if_8m_a910062273088d146e8533398780701eb}{sd}}, sd\_next);}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00512}00512                 TAILQ\_INSERT\_TAIL(\&\mbox{\hyperlink{structdisk}{disk}}-\/>d\_subdisks, \mbox{\hyperlink{g__raid__md__if_8m_a910062273088d146e8533398780701eb}{sd}}, sd\_next);}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00513}00513                 \mbox{\hyperlink{g__raid__md__if_8m_a910062273088d146e8533398780701eb}{sd}}-\/>\mbox{\hyperlink{structg__raid__subdisk_a5570ab684f57213078d94750e63354e1}{sd\_disk}} = \mbox{\hyperlink{g__raid__md__if_8m_a9508e997a57ea259d6ecc0e563261993}{disk}};}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00514}00514         \}}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00515}00515         oldpd-\/>\mbox{\hyperlink{structg__raid__md__jmicron__perdisk_a65960334e7c32b993e9ea104819243b9}{pd\_disk\_pos}} = -\/2;}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00516}00516         pd-\/>\mbox{\hyperlink{structg__raid__md__jmicron__perdisk_a65960334e7c32b993e9ea104819243b9}{pd\_disk\_pos}} = disk\_pos;}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00517}00517         \textcolor{comment}{/* Update global metadata just in case. */}}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00518}00518         meta-\/>\mbox{\hyperlink{structjmicron__raid__conf_a1b06fd2819bf2a863f9b8115413bc47a}{disks}}[disk\_pos] = pd-\/>\mbox{\hyperlink{structg__raid__md__jmicron__perdisk_a46a598fbfa7cbd51384eb2ea86325455}{pd\_disk\_id}};}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00519}00519 }
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00520}00520         \textcolor{comment}{/* If it was placeholder -\/-\/ destroy it. */}}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00521}00521         \textcolor{keywordflow}{if} (olddisk-\/>\mbox{\hyperlink{structg__raid__disk_a893b44bb63bf0b41d6f140424e0db523}{d\_state}} == \mbox{\hyperlink{g__raid_8h_aee552862c97f7442835d7c81b3399ac2}{G\_RAID\_DISK\_S\_OFFLINE}}) \{}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00522}00522                 \mbox{\hyperlink{g__raid_8c_ac1e32d950d9354f1dca5d2ca34244adc}{g\_raid\_destroy\_disk}}(olddisk);}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00523}00523         \} \textcolor{keywordflow}{else} \{}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00524}00524                 \textcolor{comment}{/* Otherwise, make it STALE\_FAILED. */}}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00525}00525                 \mbox{\hyperlink{g__raid_8c_a342da571518e21e0521b6416c838d00e}{g\_raid\_change\_disk\_state}}(olddisk, \mbox{\hyperlink{g__raid_8h_ac204b4a9677b7e98bfeb81a687335e97}{G\_RAID\_DISK\_S\_STALE\_FAILED}});}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00526}00526         \}}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00527}00527 }
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00528}00528         \textcolor{comment}{/* Welcome the new disk. */}}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00529}00529         \mbox{\hyperlink{g__raid_8c_a342da571518e21e0521b6416c838d00e}{g\_raid\_change\_disk\_state}}(\mbox{\hyperlink{structdisk}{disk}}, \mbox{\hyperlink{g__raid_8h_aaf46a21394a57a2fcac34b1b7b52701c}{G\_RAID\_DISK\_S\_ACTIVE}});}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00530}00530         TAILQ\_FOREACH(\mbox{\hyperlink{g__raid__md__if_8m_a910062273088d146e8533398780701eb}{sd}}, \&\mbox{\hyperlink{structdisk}{disk}}-\/>d\_subdisks, sd\_next) \{}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00531}00531                 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00532}00532 \textcolor{comment}{                 * Different disks may have different sizes/offsets,}}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00533}00533 \textcolor{comment}{                 * especially in concat mode. Update.}}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00534}00534 \textcolor{comment}{                 */}}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00535}00535                 \textcolor{keywordflow}{if} (!resurrection) \{}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00536}00536                         \mbox{\hyperlink{g__raid__md__if_8m_a910062273088d146e8533398780701eb}{sd}}-\/>\mbox{\hyperlink{structg__raid__subdisk_a9b4e12573b26ee18473a16408044819f}{sd\_offset}} =}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00537}00537                             (off\_t)pd-\/>\mbox{\hyperlink{structg__raid__md__jmicron__perdisk_ac2b4421d277ebd509be1854f4c1e1f53}{pd\_meta}}-\/>\mbox{\hyperlink{structjmicron__raid__conf_a47970969ccfc7aa96a0a076e5bd7dae8}{offset}} * 16 * 512; \textcolor{comment}{//ZZZ}}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00538}00538                         \mbox{\hyperlink{g__raid__md__if_8m_a910062273088d146e8533398780701eb}{sd}}-\/>\mbox{\hyperlink{structg__raid__subdisk_abc4da1103e29e3a8e2bbadb18fbccbf6}{sd\_size}} =}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00539}00539                             (((off\_t)pd-\/>\mbox{\hyperlink{structg__raid__md__jmicron__perdisk_ac2b4421d277ebd509be1854f4c1e1f53}{pd\_meta}}-\/>\mbox{\hyperlink{structjmicron__raid__conf_a53cb3d8a2e58df232b2ba5d6e27811dd}{disk\_sectors\_high}} << 16) +}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00540}00540                               pd-\/>\mbox{\hyperlink{structg__raid__md__jmicron__perdisk_ac2b4421d277ebd509be1854f4c1e1f53}{pd\_meta}}-\/>\mbox{\hyperlink{structjmicron__raid__conf_a8e4cfaa514a26b0a4b701041cb7e4198}{disk\_sectors\_low}}) * 512;}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00541}00541                 \}}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00542}00542 }
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00543}00543                 \textcolor{keywordflow}{if} (resurrection) \{}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00544}00544                         \textcolor{comment}{/* Stale disk, almost same as new. */}}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00545}00545                         \mbox{\hyperlink{g__raid_8c_a058db459d5349d2130fda3a02dd2af29}{g\_raid\_change\_subdisk\_state}}(\mbox{\hyperlink{g__raid__md__if_8m_a910062273088d146e8533398780701eb}{sd}},}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00546}00546                             \mbox{\hyperlink{g__raid_8h_a9dd59db9322af74b4b15021c3fc8f2f5}{G\_RAID\_SUBDISK\_S\_NEW}});}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00547}00547                 \} \textcolor{keywordflow}{else} \textcolor{keywordflow}{if} ((meta-\/>\mbox{\hyperlink{structjmicron__raid__conf_a6bd3f9f2cf164a45a43c2519edfab653}{flags}} \& \mbox{\hyperlink{md__jmicron_8c_a82560a77e932e075c6f4b87eda94c7d9}{JMICRON\_F\_BADSEC}}) != 0 \&\&}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00548}00548                     (pd-\/>\mbox{\hyperlink{structg__raid__md__jmicron__perdisk_ac2b4421d277ebd509be1854f4c1e1f53}{pd\_meta}}-\/>\mbox{\hyperlink{structjmicron__raid__conf_a6bd3f9f2cf164a45a43c2519edfab653}{flags}} \& \mbox{\hyperlink{md__jmicron_8c_a82560a77e932e075c6f4b87eda94c7d9}{JMICRON\_F\_BADSEC}}) == 0) \{}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00549}00549                         \textcolor{comment}{/* Cold-\/inserted or rebuilding disk. */}}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00550}00550                         \mbox{\hyperlink{g__raid_8c_a058db459d5349d2130fda3a02dd2af29}{g\_raid\_change\_subdisk\_state}}(\mbox{\hyperlink{g__raid__md__if_8m_a910062273088d146e8533398780701eb}{sd}},}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00551}00551                             \mbox{\hyperlink{g__raid_8h_a9dd59db9322af74b4b15021c3fc8f2f5}{G\_RAID\_SUBDISK\_S\_NEW}});}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00552}00552                 \} \textcolor{keywordflow}{else} \textcolor{keywordflow}{if} (pd-\/>\mbox{\hyperlink{structg__raid__md__jmicron__perdisk_ac2b4421d277ebd509be1854f4c1e1f53}{pd\_meta}}-\/>\mbox{\hyperlink{structjmicron__raid__conf_a6bd3f9f2cf164a45a43c2519edfab653}{flags}} \& \mbox{\hyperlink{md__jmicron_8c_a858950190a80ad6c735e15d5cb2ddfa8}{JMICRON\_F\_UNSYNC}}) \{}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00553}00553                         \textcolor{comment}{/* Dirty or resyncing disk.. */}}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00554}00554                         \mbox{\hyperlink{g__raid_8c_a058db459d5349d2130fda3a02dd2af29}{g\_raid\_change\_subdisk\_state}}(\mbox{\hyperlink{g__raid__md__if_8m_a910062273088d146e8533398780701eb}{sd}},}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00555}00555                             \mbox{\hyperlink{g__raid_8h_a41bff35bee21218d2aba7a261eb2e83c}{G\_RAID\_SUBDISK\_S\_STALE}});}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00556}00556                 \} \textcolor{keywordflow}{else} \{}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00557}00557                         \textcolor{comment}{/* Up to date disk. */}}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00558}00558                         \mbox{\hyperlink{g__raid_8c_a058db459d5349d2130fda3a02dd2af29}{g\_raid\_change\_subdisk\_state}}(\mbox{\hyperlink{g__raid__md__if_8m_a910062273088d146e8533398780701eb}{sd}},}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00559}00559                             \mbox{\hyperlink{g__raid_8h_a498effa0ffa87b75f6c40381c6d4eb39}{G\_RAID\_SUBDISK\_S\_ACTIVE}});}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00560}00560                 \}}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00561}00561                 \mbox{\hyperlink{g__raid_8c_ac49cc1991dccaeef0743e0bc4f64e0b5}{g\_raid\_event\_send}}(\mbox{\hyperlink{g__raid__md__if_8m_a910062273088d146e8533398780701eb}{sd}}, \mbox{\hyperlink{g__raid_8h_ae59b963d99efabe56d8173f3ad914a07}{G\_RAID\_SUBDISK\_E\_NEW}},}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00562}00562                     \mbox{\hyperlink{g__raid_8h_ae6ac3f8d5dcaa73174e3e8bb9dd12f1c}{G\_RAID\_EVENT\_SUBDISK}});}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00563}00563         \}}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00564}00564 }
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00565}00565         \textcolor{comment}{/* Update status of our need for spare. */}}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00566}00566         \textcolor{keywordflow}{if} (mdi-\/>\mbox{\hyperlink{structg__raid__md__jmicron__object_adeedb342e0d17d9db3bce7dfc408b72c}{mdio\_started}}) \{}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00567}00567                 mdi-\/>\mbox{\hyperlink{structg__raid__md__jmicron__object_a03a05cb696e82019951d9641fb7568ae}{mdio\_incomplete}} =}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00568}00568                     (\mbox{\hyperlink{g__raid_8c_ad1004201fc232c60faacd7bd3f3b604f}{g\_raid\_ndisks}}(sc, \mbox{\hyperlink{g__raid_8h_aaf46a21394a57a2fcac34b1b7b52701c}{G\_RAID\_DISK\_S\_ACTIVE}}) <}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00569}00569                      mdi-\/>\mbox{\hyperlink{structg__raid__md__jmicron__object_a736479d42184be44bcb41f9176594ee3}{mdio\_total\_disks}});}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00570}00570         \}}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00571}00571 }
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00572}00572         \textcolor{keywordflow}{return} (resurrection);}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00573}00573 \}}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00574}00574 }
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00575}00575 \textcolor{keyword}{static} \textcolor{keywordtype}{void}}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00576}\mbox{\hyperlink{md__jmicron_8c_a1ebe96c1adbaa6431aa54495687a948d}{00576}} \mbox{\hyperlink{md__jmicron_8c_a1ebe96c1adbaa6431aa54495687a948d}{g\_disk\_md\_jmicron\_retaste}}(\textcolor{keywordtype}{void} *arg, \textcolor{keywordtype}{int} pending)}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00577}00577 \{}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00578}00578 }
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00579}00579         \mbox{\hyperlink{g__raid_8h_a4333fbd8d0899facf171aee7b60697f6}{G\_RAID\_DEBUG}}(1, \textcolor{stringliteral}{"{}Array is not complete, trying to retaste."{}});}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00580}00580         \mbox{\hyperlink{geom_8h_adb2947739c157b0cb4f1650d1122b953}{g\_retaste}}(\&\mbox{\hyperlink{g__raid_8h_a490a02fd5fb980866b6fbce0f042ed65}{g\_raid\_class}});}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00581}00581         \mbox{\hyperlink{g__raid__md__if_8m_a4df9edb2717b3f7e4c3c903878577a54}{free}}(arg, M\_MD\_JMICRON);}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00582}00582 \}}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00583}00583 }
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00584}00584 \textcolor{keyword}{static} \textcolor{keywordtype}{void}}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00585}\mbox{\hyperlink{md__jmicron_8c_ac7259021f21724898e2922acc5e087ca}{00585}} \mbox{\hyperlink{md__jmicron_8c_ac7259021f21724898e2922acc5e087ca}{g\_raid\_md\_jmicron\_refill}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structg__raid__softc}{g\_raid\_softc}} *sc)}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00586}00586 \{}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00587}00587         \textcolor{keyword}{struct }\mbox{\hyperlink{structg__raid__md__object}{g\_raid\_md\_object}} *md;}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00588}00588         \textcolor{keyword}{struct }\mbox{\hyperlink{structg__raid__md__jmicron__object}{g\_raid\_md\_jmicron\_object}} *mdi;}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00589}00589         \textcolor{keyword}{struct }\mbox{\hyperlink{structg__raid__disk}{g\_raid\_disk}} *\mbox{\hyperlink{g__raid__md__if_8m_a9508e997a57ea259d6ecc0e563261993}{disk}};}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00590}00590         \textcolor{keyword}{struct }task *task;}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00591}00591         \textcolor{keywordtype}{int} update, na;}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00592}00592 }
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00593}00593         md = sc-\/>\mbox{\hyperlink{structg__raid__softc_a5bf7421452e0a324fc4f8b954b57314b}{sc\_md}};}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00594}00594         mdi = (\textcolor{keyword}{struct }\mbox{\hyperlink{structg__raid__md__jmicron__object}{g\_raid\_md\_jmicron\_object}} *)md;}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00595}00595         update = 0;}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00596}00596         \textcolor{keywordflow}{do} \{}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00597}00597                 \textcolor{comment}{/* Make sure we miss anything. */}}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00598}00598                 na = \mbox{\hyperlink{g__raid_8c_ad1004201fc232c60faacd7bd3f3b604f}{g\_raid\_ndisks}}(sc, \mbox{\hyperlink{g__raid_8h_aaf46a21394a57a2fcac34b1b7b52701c}{G\_RAID\_DISK\_S\_ACTIVE}});}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00599}00599                 \textcolor{keywordflow}{if} (na == mdi-\/>\mbox{\hyperlink{structg__raid__md__jmicron__object_a736479d42184be44bcb41f9176594ee3}{mdio\_total\_disks}})}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00600}00600                         \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00601}00601 }
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00602}00602                 \mbox{\hyperlink{g__raid_8h_ace7234f8197b96e1b636f9376de8d7ea}{G\_RAID\_DEBUG1}}(1, md-\/>\mbox{\hyperlink{structg__raid__md__object_a4acc92ca2582509c74947d83b258e31d}{mdo\_softc}},}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00603}00603                     \textcolor{stringliteral}{"{}Array is not complete (\%d of \%d), "{}}}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00604}00604                     \textcolor{stringliteral}{"{}trying to refill."{}}, na, mdi-\/>\mbox{\hyperlink{structg__raid__md__jmicron__object_a736479d42184be44bcb41f9176594ee3}{mdio\_total\_disks}});}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00605}00605 }
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00606}00606                 \textcolor{comment}{/* Try to get use some of STALE disks. */}}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00607}00607                 TAILQ\_FOREACH(\mbox{\hyperlink{structdisk}{disk}}, \&sc-\/>sc\_disks, d\_next) \{}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00608}00608                         \textcolor{keywordflow}{if} (\mbox{\hyperlink{structdisk}{disk}}-\/>d\_state == \mbox{\hyperlink{g__raid_8h_a12c815344c6e588760a1619861a54122}{G\_RAID\_DISK\_S\_STALE}}) \{}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00609}00609                                 update += \mbox{\hyperlink{md__jmicron_8c_ac0f68e614510a006ddebb34dc929f1af}{g\_raid\_md\_jmicron\_start\_disk}}(\mbox{\hyperlink{structdisk}{disk}});}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00610}00610                                 \textcolor{keywordflow}{if} (\mbox{\hyperlink{structdisk}{disk}}-\/>d\_state == \mbox{\hyperlink{g__raid_8h_aaf46a21394a57a2fcac34b1b7b52701c}{G\_RAID\_DISK\_S\_ACTIVE}})}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00611}00611                                         \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00612}00612                         \}}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00613}00613                 \}}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00614}00614                 \textcolor{keywordflow}{if} (\mbox{\hyperlink{structdisk}{disk}} != NULL)}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00615}00615                         \textcolor{keywordflow}{continue};}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00616}00616 }
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00617}00617                 \textcolor{comment}{/* Try to get use some of SPARE disks. */}}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00618}00618                 TAILQ\_FOREACH(\mbox{\hyperlink{structdisk}{disk}}, \&sc-\/>sc\_disks, d\_next) \{}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00619}00619                         \textcolor{keywordflow}{if} (\mbox{\hyperlink{structdisk}{disk}}-\/>d\_state == \mbox{\hyperlink{g__raid_8h_a53208a3eca6d67917c6fdf6321292c99}{G\_RAID\_DISK\_S\_SPARE}}) \{}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00620}00620                                 update += \mbox{\hyperlink{md__jmicron_8c_ac0f68e614510a006ddebb34dc929f1af}{g\_raid\_md\_jmicron\_start\_disk}}(\mbox{\hyperlink{structdisk}{disk}});}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00621}00621                                 \textcolor{keywordflow}{if} (\mbox{\hyperlink{structdisk}{disk}}-\/>d\_state == \mbox{\hyperlink{g__raid_8h_aaf46a21394a57a2fcac34b1b7b52701c}{G\_RAID\_DISK\_S\_ACTIVE}})}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00622}00622                                         \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00623}00623                         \}}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00624}00624                 \}}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00625}00625         \} \textcolor{keywordflow}{while} (\mbox{\hyperlink{structdisk}{disk}} != NULL);}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00626}00626 }
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00627}00627         \textcolor{comment}{/* Write new metadata if we changed something. */}}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00628}00628         \textcolor{keywordflow}{if} (update)}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00629}00629                 \mbox{\hyperlink{md__jmicron_8c_aaf5dc9d91eb1d2ddad515c7844468905}{g\_raid\_md\_write\_jmicron}}(md, NULL, NULL, NULL);}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00630}00630 }
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00631}00631         \textcolor{comment}{/* Update status of our need for spare. */}}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00632}00632         mdi-\/>\mbox{\hyperlink{structg__raid__md__jmicron__object_a03a05cb696e82019951d9641fb7568ae}{mdio\_incomplete}} = (\mbox{\hyperlink{g__raid_8c_ad1004201fc232c60faacd7bd3f3b604f}{g\_raid\_ndisks}}(sc, \mbox{\hyperlink{g__raid_8h_aaf46a21394a57a2fcac34b1b7b52701c}{G\_RAID\_DISK\_S\_ACTIVE}}) <}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00633}00633             mdi-\/>\mbox{\hyperlink{structg__raid__md__jmicron__object_a736479d42184be44bcb41f9176594ee3}{mdio\_total\_disks}});}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00634}00634 }
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00635}00635         \textcolor{comment}{/* Request retaste hoping to find spare. */}}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00636}00636         \textcolor{keywordflow}{if} (mdi-\/>\mbox{\hyperlink{structg__raid__md__jmicron__object_a03a05cb696e82019951d9641fb7568ae}{mdio\_incomplete}}) \{}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00637}00637                 task = malloc(\textcolor{keyword}{sizeof}(\textcolor{keyword}{struct} task),}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00638}00638                     M\_MD\_JMICRON, M\_WAITOK | M\_ZERO);}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00639}00639                 TASK\_INIT(task, 0, \mbox{\hyperlink{md__jmicron_8c_a1ebe96c1adbaa6431aa54495687a948d}{g\_disk\_md\_jmicron\_retaste}}, task);}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00640}00640                 taskqueue\_enqueue(taskqueue\_swi, task);}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00641}00641         \}}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00642}00642 \}}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00643}00643 }
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00644}00644 \textcolor{keyword}{static} \textcolor{keywordtype}{void}}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00645}\mbox{\hyperlink{md__jmicron_8c_a81255a64e1eeb188fb9a297ca4926eb2}{00645}} \mbox{\hyperlink{md__jmicron_8c_a81255a64e1eeb188fb9a297ca4926eb2}{g\_raid\_md\_jmicron\_start}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structg__raid__softc}{g\_raid\_softc}} *sc)}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00646}00646 \{}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00647}00647         \textcolor{keyword}{struct }\mbox{\hyperlink{structg__raid__md__object}{g\_raid\_md\_object}} *md;}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00648}00648         \textcolor{keyword}{struct }\mbox{\hyperlink{structg__raid__md__jmicron__object}{g\_raid\_md\_jmicron\_object}} *mdi;}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00649}00649         \textcolor{keyword}{struct }\mbox{\hyperlink{structg__raid__md__jmicron__perdisk}{g\_raid\_md\_jmicron\_perdisk}} *pd;}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00650}00650         \textcolor{keyword}{struct }\mbox{\hyperlink{structjmicron__raid__conf}{jmicron\_raid\_conf}} *meta;}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00651}00651         \textcolor{keyword}{struct }\mbox{\hyperlink{structg__raid__volume}{g\_raid\_volume}} *\mbox{\hyperlink{g__raid__md__if_8m_aaa46aabd2a891668d71cec64e90b4848}{vol}};}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00652}00652         \textcolor{keyword}{struct }\mbox{\hyperlink{structg__raid__subdisk}{g\_raid\_subdisk}} *\mbox{\hyperlink{g__raid__md__if_8m_a910062273088d146e8533398780701eb}{sd}};}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00653}00653         \textcolor{keyword}{struct }\mbox{\hyperlink{structg__raid__disk}{g\_raid\_disk}} *\mbox{\hyperlink{g__raid__md__if_8m_a9508e997a57ea259d6ecc0e563261993}{disk}};}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00654}00654         off\_t size;}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00655}00655         \textcolor{keywordtype}{int} j, disk\_pos;}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00656}00656         \textcolor{keywordtype}{char} \mbox{\hyperlink{g__part__if_8m_ac14417684334d01b4e1e807a19d92816}{buf}}[17];}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00657}00657 }
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00658}00658         md = sc-\/>\mbox{\hyperlink{structg__raid__softc_a5bf7421452e0a324fc4f8b954b57314b}{sc\_md}};}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00659}00659         mdi = (\textcolor{keyword}{struct }\mbox{\hyperlink{structg__raid__md__jmicron__object}{g\_raid\_md\_jmicron\_object}} *)md;}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00660}00660         meta = mdi-\/>\mbox{\hyperlink{structg__raid__md__jmicron__object_a99dfc14fc8a6fe56d6822564249c3a54}{mdio\_meta}};}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00661}00661 }
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00662}00662         \textcolor{comment}{/* Create volumes and subdisks. */}}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00663}00663         \mbox{\hyperlink{md__jmicron_8c_a46258b691dc39170138f6d05c2d718cf}{jmicron\_meta\_get\_name}}(meta, \mbox{\hyperlink{g__part__if_8m_ac14417684334d01b4e1e807a19d92816}{buf}});}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00664}00664         \mbox{\hyperlink{g__raid__md__if_8m_aaa46aabd2a891668d71cec64e90b4848}{vol}} = \mbox{\hyperlink{g__raid_8c_a582a2f56fe635a9f1d2783b9342126ee}{g\_raid\_create\_volume}}(sc, \mbox{\hyperlink{g__part__if_8m_ac14417684334d01b4e1e807a19d92816}{buf}}, -\/1);}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00665}00665         size = ((off\_t)meta-\/>\mbox{\hyperlink{structjmicron__raid__conf_a53cb3d8a2e58df232b2ba5d6e27811dd}{disk\_sectors\_high}} << 16) + meta-\/>\mbox{\hyperlink{structjmicron__raid__conf_a8e4cfaa514a26b0a4b701041cb7e4198}{disk\_sectors\_low}};}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00666}00666         size *= 512; \textcolor{comment}{//ZZZ}}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00667}00667         \mbox{\hyperlink{g__raid__md__if_8m_aaa46aabd2a891668d71cec64e90b4848}{vol}}-\/>\mbox{\hyperlink{structg__raid__volume_ad17bb2da7eadd462f1f27551cb1da76f}{v\_raid\_level\_qualifier}} = \mbox{\hyperlink{g__raid_8h_a9c036957b2fb94761b5fd084e8f991c9}{G\_RAID\_VOLUME\_RLQ\_NONE}};}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00668}00668         \textcolor{keywordflow}{if} (meta-\/>\mbox{\hyperlink{structjmicron__raid__conf_a076e01c2fe3b5654d104b77c45fc55da}{type}} == \mbox{\hyperlink{md__jmicron_8c_a1f2855e53c0606e6acadc2296d44c5dc}{JMICRON\_T\_RAID0}}) \{}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00669}00669                 \mbox{\hyperlink{g__raid__md__if_8m_aaa46aabd2a891668d71cec64e90b4848}{vol}}-\/>\mbox{\hyperlink{structg__raid__volume_ab7c2840f8398e5a91b560d7644957a57}{v\_raid\_level}} = \mbox{\hyperlink{g__raid_8h_a6a49f4ddd0b45eb4210ce72528786a32}{G\_RAID\_VOLUME\_RL\_RAID0}};}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00670}00670                 \mbox{\hyperlink{g__raid__md__if_8m_aaa46aabd2a891668d71cec64e90b4848}{vol}}-\/>\mbox{\hyperlink{structg__raid__volume_ad81a0903c26424634b555fa29c0cd400}{v\_mediasize}} = size * mdi-\/>\mbox{\hyperlink{structg__raid__md__jmicron__object_a736479d42184be44bcb41f9176594ee3}{mdio\_total\_disks}};}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00671}00671         \} \textcolor{keywordflow}{else} \textcolor{keywordflow}{if} (meta-\/>\mbox{\hyperlink{structjmicron__raid__conf_a076e01c2fe3b5654d104b77c45fc55da}{type}} == \mbox{\hyperlink{md__jmicron_8c_af37a98d5205a0567ca4348bd1d009ae3}{JMICRON\_T\_RAID1}}) \{}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00672}00672                 \mbox{\hyperlink{g__raid__md__if_8m_aaa46aabd2a891668d71cec64e90b4848}{vol}}-\/>\mbox{\hyperlink{structg__raid__volume_ab7c2840f8398e5a91b560d7644957a57}{v\_raid\_level}} = \mbox{\hyperlink{g__raid_8h_a270bdf6b61fc7d810795e08ebbe60931}{G\_RAID\_VOLUME\_RL\_RAID1}};}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00673}00673                 \mbox{\hyperlink{g__raid__md__if_8m_aaa46aabd2a891668d71cec64e90b4848}{vol}}-\/>\mbox{\hyperlink{structg__raid__volume_ad81a0903c26424634b555fa29c0cd400}{v\_mediasize}} = size;}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00674}00674         \} \textcolor{keywordflow}{else} \textcolor{keywordflow}{if} (meta-\/>\mbox{\hyperlink{structjmicron__raid__conf_a076e01c2fe3b5654d104b77c45fc55da}{type}} == \mbox{\hyperlink{md__jmicron_8c_acefecc0e95e211d13000451fa8ef8737}{JMICRON\_T\_RAID01}}) \{}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00675}00675                 \mbox{\hyperlink{g__raid__md__if_8m_aaa46aabd2a891668d71cec64e90b4848}{vol}}-\/>\mbox{\hyperlink{structg__raid__volume_ab7c2840f8398e5a91b560d7644957a57}{v\_raid\_level}} = \mbox{\hyperlink{g__raid_8h_ad0ef2cd50760a49759a6cbaf2afeb286}{G\_RAID\_VOLUME\_RL\_RAID1E}};}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00676}00676                 \mbox{\hyperlink{g__raid__md__if_8m_aaa46aabd2a891668d71cec64e90b4848}{vol}}-\/>\mbox{\hyperlink{structg__raid__volume_ad81a0903c26424634b555fa29c0cd400}{v\_mediasize}} = size * mdi-\/>\mbox{\hyperlink{structg__raid__md__jmicron__object_a736479d42184be44bcb41f9176594ee3}{mdio\_total\_disks}} / 2;}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00677}00677         \} \textcolor{keywordflow}{else} \textcolor{keywordflow}{if} (meta-\/>\mbox{\hyperlink{structjmicron__raid__conf_a076e01c2fe3b5654d104b77c45fc55da}{type}} == \mbox{\hyperlink{md__jmicron_8c_a3985571252d6b7de9ca4faa7e1c0529c}{JMICRON\_T\_CONCAT}}) \{}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00678}00678                 \textcolor{keywordflow}{if} (mdi-\/>\mbox{\hyperlink{structg__raid__md__jmicron__object_a736479d42184be44bcb41f9176594ee3}{mdio\_total\_disks}} == 1)}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00679}00679                         \mbox{\hyperlink{g__raid__md__if_8m_aaa46aabd2a891668d71cec64e90b4848}{vol}}-\/>\mbox{\hyperlink{structg__raid__volume_ab7c2840f8398e5a91b560d7644957a57}{v\_raid\_level}} = \mbox{\hyperlink{g__raid_8h_acb418af006a1d84e0dd912c58cec6f57}{G\_RAID\_VOLUME\_RL\_SINGLE}};}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00680}00680                 \textcolor{keywordflow}{else}}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00681}00681                         \mbox{\hyperlink{g__raid__md__if_8m_aaa46aabd2a891668d71cec64e90b4848}{vol}}-\/>\mbox{\hyperlink{structg__raid__volume_ab7c2840f8398e5a91b560d7644957a57}{v\_raid\_level}} = \mbox{\hyperlink{g__raid_8h_abc695e94a9e4eff0f657ec01d1f19607}{G\_RAID\_VOLUME\_RL\_CONCAT}};}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00682}00682                 \mbox{\hyperlink{g__raid__md__if_8m_aaa46aabd2a891668d71cec64e90b4848}{vol}}-\/>\mbox{\hyperlink{structg__raid__volume_ad81a0903c26424634b555fa29c0cd400}{v\_mediasize}} = 0;}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00683}00683         \} \textcolor{keywordflow}{else} \textcolor{keywordflow}{if} (meta-\/>\mbox{\hyperlink{structjmicron__raid__conf_a076e01c2fe3b5654d104b77c45fc55da}{type}} == \mbox{\hyperlink{md__jmicron_8c_a21789928e250aa273d03b1c2f9dee985}{JMICRON\_T\_RAID5}}) \{}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00684}00684                 \mbox{\hyperlink{g__raid__md__if_8m_aaa46aabd2a891668d71cec64e90b4848}{vol}}-\/>\mbox{\hyperlink{structg__raid__volume_ab7c2840f8398e5a91b560d7644957a57}{v\_raid\_level}} = \mbox{\hyperlink{g__raid_8h_af6db015b03ea390243f2df897eb1189d}{G\_RAID\_VOLUME\_RL\_RAID5}};}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00685}00685                 \mbox{\hyperlink{g__raid__md__if_8m_aaa46aabd2a891668d71cec64e90b4848}{vol}}-\/>\mbox{\hyperlink{structg__raid__volume_ad17bb2da7eadd462f1f27551cb1da76f}{v\_raid\_level\_qualifier}} = \mbox{\hyperlink{g__raid_8h_a85a42d827015531803abc6df07b15e89}{G\_RAID\_VOLUME\_RLQ\_R5LA}};}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00686}00686                 \mbox{\hyperlink{g__raid__md__if_8m_aaa46aabd2a891668d71cec64e90b4848}{vol}}-\/>\mbox{\hyperlink{structg__raid__volume_ad81a0903c26424634b555fa29c0cd400}{v\_mediasize}} = size * (mdi-\/>\mbox{\hyperlink{structg__raid__md__jmicron__object_a736479d42184be44bcb41f9176594ee3}{mdio\_total\_disks}} -\/ 1);}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00687}00687         \} \textcolor{keywordflow}{else} \{}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00688}00688                 \mbox{\hyperlink{g__raid__md__if_8m_aaa46aabd2a891668d71cec64e90b4848}{vol}}-\/>\mbox{\hyperlink{structg__raid__volume_ab7c2840f8398e5a91b560d7644957a57}{v\_raid\_level}} = \mbox{\hyperlink{g__raid_8h_a44d5861b2b013283a9dbff0d3ae791e8}{G\_RAID\_VOLUME\_RL\_UNKNOWN}};}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00689}00689                 \mbox{\hyperlink{g__raid__md__if_8m_aaa46aabd2a891668d71cec64e90b4848}{vol}}-\/>\mbox{\hyperlink{structg__raid__volume_ad81a0903c26424634b555fa29c0cd400}{v\_mediasize}} = 0;}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00690}00690         \}}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00691}00691         \mbox{\hyperlink{g__raid__md__if_8m_aaa46aabd2a891668d71cec64e90b4848}{vol}}-\/>\mbox{\hyperlink{structg__raid__volume_af0ca6a1c61e893f02a43ca29953c8e39}{v\_strip\_size}} = 1024 << meta-\/>\mbox{\hyperlink{structjmicron__raid__conf_a3d27c760d3541ed0dda17ea03c65b987}{stripe\_shift}}; \textcolor{comment}{//ZZZ}}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00692}00692         \mbox{\hyperlink{g__raid__md__if_8m_aaa46aabd2a891668d71cec64e90b4848}{vol}}-\/>\mbox{\hyperlink{structg__raid__volume_a21482a5ac78a397faf4e95eb1ebef431}{v\_disks\_count}} = mdi-\/>\mbox{\hyperlink{structg__raid__md__jmicron__object_a736479d42184be44bcb41f9176594ee3}{mdio\_total\_disks}};}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00693}00693         \mbox{\hyperlink{g__raid__md__if_8m_aaa46aabd2a891668d71cec64e90b4848}{vol}}-\/>\mbox{\hyperlink{structg__raid__volume_af7b9dcf6621dc8d66be12ba187d5f34b}{v\_sectorsize}} = 512; \textcolor{comment}{//ZZZ}}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00694}00694         \textcolor{keywordflow}{for} (j = 0; j < \mbox{\hyperlink{g__raid__md__if_8m_aaa46aabd2a891668d71cec64e90b4848}{vol}}-\/>\mbox{\hyperlink{structg__raid__volume_a21482a5ac78a397faf4e95eb1ebef431}{v\_disks\_count}}; j++) \{}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00695}00695                 \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}}[j];}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00696}00696                 \mbox{\hyperlink{g__raid__md__if_8m_a910062273088d146e8533398780701eb}{sd}}-\/>\mbox{\hyperlink{structg__raid__subdisk_a9b4e12573b26ee18473a16408044819f}{sd\_offset}} = (off\_t)meta-\/>\mbox{\hyperlink{structjmicron__raid__conf_a47970969ccfc7aa96a0a076e5bd7dae8}{offset}} * 16 * 512; \textcolor{comment}{//ZZZ}}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00697}00697                 \mbox{\hyperlink{g__raid__md__if_8m_a910062273088d146e8533398780701eb}{sd}}-\/>\mbox{\hyperlink{structg__raid__subdisk_abc4da1103e29e3a8e2bbadb18fbccbf6}{sd\_size}} = size;}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00698}00698         \}}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00699}00699         \mbox{\hyperlink{g__raid_8c_a7e6ffb9d11de08e7eaa3e36d1028aa28}{g\_raid\_start\_volume}}(\mbox{\hyperlink{g__raid__md__if_8m_aaa46aabd2a891668d71cec64e90b4848}{vol}});}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00700}00700 }
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00701}00701         \textcolor{comment}{/* Create disk placeholders to store data for later writing. */}}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00702}00702         \textcolor{keywordflow}{for} (disk\_pos = 0; disk\_pos < mdi-\/>\mbox{\hyperlink{structg__raid__md__jmicron__object_a736479d42184be44bcb41f9176594ee3}{mdio\_total\_disks}}; disk\_pos++) \{}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00703}00703                 pd = malloc(\textcolor{keyword}{sizeof}(*pd), M\_MD\_JMICRON, M\_WAITOK | M\_ZERO);}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00704}00704                 pd-\/>\mbox{\hyperlink{structg__raid__md__jmicron__perdisk_a65960334e7c32b993e9ea104819243b9}{pd\_disk\_pos}} = disk\_pos;}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00705}00705                 pd-\/>\mbox{\hyperlink{structg__raid__md__jmicron__perdisk_a46a598fbfa7cbd51384eb2ea86325455}{pd\_disk\_id}} = meta-\/>\mbox{\hyperlink{structjmicron__raid__conf_a1b06fd2819bf2a863f9b8115413bc47a}{disks}}[disk\_pos];}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00706}00706                 \mbox{\hyperlink{structdisk}{disk}} = \mbox{\hyperlink{g__raid_8c_a7d896eb1612c17408eedbdda2032e897}{g\_raid\_create\_disk}}(sc);}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00707}00707                 \mbox{\hyperlink{structdisk}{disk}}-\/>d\_md\_data = (\textcolor{keywordtype}{void} *)pd;}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00708}00708                 \mbox{\hyperlink{structdisk}{disk}}-\/>d\_state = \mbox{\hyperlink{g__raid_8h_aee552862c97f7442835d7c81b3399ac2}{G\_RAID\_DISK\_S\_OFFLINE}};}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00709}00709                 \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}}[disk\_pos];}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00710}00710                 \mbox{\hyperlink{g__raid__md__if_8m_a910062273088d146e8533398780701eb}{sd}}-\/>\mbox{\hyperlink{structg__raid__subdisk_a5570ab684f57213078d94750e63354e1}{sd\_disk}} = \mbox{\hyperlink{g__raid__md__if_8m_a9508e997a57ea259d6ecc0e563261993}{disk}};}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00711}00711                 TAILQ\_INSERT\_TAIL(\&\mbox{\hyperlink{structdisk}{disk}}-\/>d\_subdisks, \mbox{\hyperlink{g__raid__md__if_8m_a910062273088d146e8533398780701eb}{sd}}, sd\_next);}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00712}00712         \}}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00713}00713 }
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00714}00714         \textcolor{comment}{/* Make all disks found till the moment take their places. */}}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00715}00715         \textcolor{keywordflow}{do} \{}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00716}00716                 TAILQ\_FOREACH(\mbox{\hyperlink{structdisk}{disk}}, \&sc-\/>sc\_disks, d\_next) \{}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00717}00717                         \textcolor{keywordflow}{if} (\mbox{\hyperlink{structdisk}{disk}}-\/>d\_state == \mbox{\hyperlink{g__raid_8h_ad090f72fa79be3f1a59687ba60f85510}{G\_RAID\_DISK\_S\_NONE}}) \{}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00718}00718                                 \mbox{\hyperlink{md__jmicron_8c_ac0f68e614510a006ddebb34dc929f1af}{g\_raid\_md\_jmicron\_start\_disk}}(\mbox{\hyperlink{structdisk}{disk}});}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00719}00719                                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00720}00720                         \}}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00721}00721                 \}}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00722}00722         \} \textcolor{keywordflow}{while} (\mbox{\hyperlink{structdisk}{disk}} != NULL);}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00723}00723 }
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00724}00724         mdi-\/>\mbox{\hyperlink{structg__raid__md__jmicron__object_adeedb342e0d17d9db3bce7dfc408b72c}{mdio\_started}} = 1;}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00725}00725         \mbox{\hyperlink{g__raid_8h_ace7234f8197b96e1b636f9376de8d7ea}{G\_RAID\_DEBUG1}}(0, sc, \textcolor{stringliteral}{"{}Array started."{}});}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00726}00726         \mbox{\hyperlink{md__jmicron_8c_aaf5dc9d91eb1d2ddad515c7844468905}{g\_raid\_md\_write\_jmicron}}(md, NULL, NULL, NULL);}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00727}00727 }
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00728}00728         \textcolor{comment}{/* Pickup any STALE/SPARE disks to refill array if needed. */}}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00729}00729         \mbox{\hyperlink{md__jmicron_8c_ac7259021f21724898e2922acc5e087ca}{g\_raid\_md\_jmicron\_refill}}(sc);}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00730}00730 }
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00731}00731         \mbox{\hyperlink{g__raid_8c_ac49cc1991dccaeef0743e0bc4f64e0b5}{g\_raid\_event\_send}}(\mbox{\hyperlink{g__raid__md__if_8m_aaa46aabd2a891668d71cec64e90b4848}{vol}}, \mbox{\hyperlink{g__raid_8h_ab4cc6f1792faa0f90f83ebf0f7217a9b}{G\_RAID\_VOLUME\_E\_START}}, \mbox{\hyperlink{g__raid_8h_aa6f84af705b9b366dcb0e4aabd807667}{G\_RAID\_EVENT\_VOLUME}});}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00732}00732 }
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00733}00733         callout\_stop(\&mdi-\/>\mbox{\hyperlink{structg__raid__md__jmicron__object_af59f91509fa472e35ba85b4e78d99b07}{mdio\_start\_co}});}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00734}00734         \mbox{\hyperlink{g__raid_8h_ace7234f8197b96e1b636f9376de8d7ea}{G\_RAID\_DEBUG1}}(1, sc, \textcolor{stringliteral}{"{}root\_mount\_rel \%p"{}}, mdi-\/>\mbox{\hyperlink{structg__raid__md__jmicron__object_ae5ddd50412f23f4106c7a7760a91e3db}{mdio\_rootmount}});}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00735}00735         root\_mount\_rel(mdi-\/>\mbox{\hyperlink{structg__raid__md__jmicron__object_ae5ddd50412f23f4106c7a7760a91e3db}{mdio\_rootmount}});}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00736}00736         mdi-\/>\mbox{\hyperlink{structg__raid__md__jmicron__object_ae5ddd50412f23f4106c7a7760a91e3db}{mdio\_rootmount}} = NULL;}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00737}00737 \}}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00738}00738 }
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00739}00739 \textcolor{keyword}{static} \textcolor{keywordtype}{void}}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00740}\mbox{\hyperlink{md__jmicron_8c_ac76ea44eb639756c5ca1247b782aeff6}{00740}} \mbox{\hyperlink{md__jmicron_8c_ac76ea44eb639756c5ca1247b782aeff6}{g\_raid\_md\_jmicron\_new\_disk}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structg__raid__disk}{g\_raid\_disk}} *\mbox{\hyperlink{structdisk}{disk}})}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00741}00741 \{}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00742}00742         \textcolor{keyword}{struct }\mbox{\hyperlink{structg__raid__softc}{g\_raid\_softc}} *sc;}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00743}00743         \textcolor{keyword}{struct }\mbox{\hyperlink{structg__raid__md__object}{g\_raid\_md\_object}} *md;}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00744}00744         \textcolor{keyword}{struct }\mbox{\hyperlink{structg__raid__md__jmicron__object}{g\_raid\_md\_jmicron\_object}} *mdi;}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00745}00745         \textcolor{keyword}{struct }\mbox{\hyperlink{structjmicron__raid__conf}{jmicron\_raid\_conf}} *pdmeta;}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00746}00746         \textcolor{keyword}{struct }\mbox{\hyperlink{structg__raid__md__jmicron__perdisk}{g\_raid\_md\_jmicron\_perdisk}} *pd;}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00747}00747 }
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00748}00748         sc = \mbox{\hyperlink{structdisk}{disk}}-\/>d\_softc;}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00749}00749         md = sc-\/>\mbox{\hyperlink{structg__raid__softc_a5bf7421452e0a324fc4f8b954b57314b}{sc\_md}};}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00750}00750         mdi = (\textcolor{keyword}{struct }\mbox{\hyperlink{structg__raid__md__jmicron__object}{g\_raid\_md\_jmicron\_object}} *)md;}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00751}00751         pd = (\textcolor{keyword}{struct }\mbox{\hyperlink{structg__raid__md__jmicron__perdisk}{g\_raid\_md\_jmicron\_perdisk}} *)\mbox{\hyperlink{structdisk}{disk}}-\/>d\_md\_data;}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00752}00752         pdmeta = pd-\/>\mbox{\hyperlink{structg__raid__md__jmicron__perdisk_ac2b4421d277ebd509be1854f4c1e1f53}{pd\_meta}};}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00753}00753 }
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00754}00754         if (mdi-\/>\mbox{\hyperlink{structg__raid__md__jmicron__object_adeedb342e0d17d9db3bce7dfc408b72c}{mdio\_started}}) \{}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00755}00755                 \textcolor{keywordflow}{if} (\mbox{\hyperlink{md__jmicron_8c_ac0f68e614510a006ddebb34dc929f1af}{g\_raid\_md\_jmicron\_start\_disk}}(\mbox{\hyperlink{structdisk}{disk}}))}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00756}00756                         \mbox{\hyperlink{md__jmicron_8c_aaf5dc9d91eb1d2ddad515c7844468905}{g\_raid\_md\_write\_jmicron}}(md, NULL, NULL, NULL);}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00757}00757         \} \textcolor{keywordflow}{else} \{}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00758}00758                 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00759}00759 \textcolor{comment}{                 * If we haven't started yet -\/ update common metadata}}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00760}00760 \textcolor{comment}{                 * to get subdisks details, avoiding data from spare disks.}}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00761}00761 \textcolor{comment}{                 */}}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00762}00762                 \textcolor{keywordflow}{if} (mdi-\/>\mbox{\hyperlink{structg__raid__md__jmicron__object_a99dfc14fc8a6fe56d6822564249c3a54}{mdio\_meta}} == NULL ||}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00763}00763                     \mbox{\hyperlink{md__jmicron_8c_a1a9e27fa92871a229492bccdae9ec7eb}{jmicron\_meta\_find\_disk}}(mdi-\/>\mbox{\hyperlink{structg__raid__md__jmicron__object_a99dfc14fc8a6fe56d6822564249c3a54}{mdio\_meta}},}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00764}00764                      mdi-\/>\mbox{\hyperlink{structg__raid__md__jmicron__object_a99dfc14fc8a6fe56d6822564249c3a54}{mdio\_meta}}-\/>\mbox{\hyperlink{structjmicron__raid__conf_aeccbf0f339ffb5dc10d2489d3d154e80}{disk\_id}}) == -\/3) \{}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00765}00765                         \textcolor{keywordflow}{if} (mdi-\/>\mbox{\hyperlink{structg__raid__md__jmicron__object_a99dfc14fc8a6fe56d6822564249c3a54}{mdio\_meta}} != NULL)}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00766}00766                                 \mbox{\hyperlink{g__raid__md__if_8m_a4df9edb2717b3f7e4c3c903878577a54}{free}}(mdi-\/>\mbox{\hyperlink{structg__raid__md__jmicron__object_a99dfc14fc8a6fe56d6822564249c3a54}{mdio\_meta}}, M\_MD\_JMICRON);}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00767}00767                         mdi-\/>\mbox{\hyperlink{structg__raid__md__jmicron__object_a99dfc14fc8a6fe56d6822564249c3a54}{mdio\_meta}} = \mbox{\hyperlink{md__jmicron_8c_a975b1371f2b98518ecbd2994d7a4b607}{jmicron\_meta\_copy}}(pdmeta);}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00768}00768                         mdi-\/>\mbox{\hyperlink{structg__raid__md__jmicron__object_a736479d42184be44bcb41f9176594ee3}{mdio\_total\_disks}} = \mbox{\hyperlink{md__jmicron_8c_a4a49f23e304d32226a781a5151fe65f9}{jmicron\_meta\_total\_disks}}(pdmeta);}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00769}00769                 \}}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00770}00770                 mdi-\/>\mbox{\hyperlink{structg__raid__md__jmicron__object_a99dfc14fc8a6fe56d6822564249c3a54}{mdio\_meta}}-\/>\mbox{\hyperlink{structjmicron__raid__conf_a6bd3f9f2cf164a45a43c2519edfab653}{flags}} |= pdmeta-\/>\mbox{\hyperlink{structjmicron__raid__conf_a6bd3f9f2cf164a45a43c2519edfab653}{flags}} \& \mbox{\hyperlink{md__jmicron_8c_a82560a77e932e075c6f4b87eda94c7d9}{JMICRON\_F\_BADSEC}};}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00771}00771 }
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00772}00772                 mdi-\/>\mbox{\hyperlink{structg__raid__md__jmicron__object_a032e6dc7773885007c9ae248affe6ad5}{mdio\_disks\_present}}++;}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00773}00773                 \mbox{\hyperlink{g__raid_8h_ace7234f8197b96e1b636f9376de8d7ea}{G\_RAID\_DEBUG1}}(1, sc, \textcolor{stringliteral}{"{}Matching disk (\%d of \%d+\%d up)"{}},}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00774}00774                     mdi-\/>\mbox{\hyperlink{structg__raid__md__jmicron__object_a032e6dc7773885007c9ae248affe6ad5}{mdio\_disks\_present}},}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00775}00775                     mdi-\/>\mbox{\hyperlink{structg__raid__md__jmicron__object_a736479d42184be44bcb41f9176594ee3}{mdio\_total\_disks}},}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00776}00776                     \mbox{\hyperlink{md__jmicron_8c_aa6f0fccb53d14c2308784d4f95fae275}{jmicron\_meta\_total\_spare}}(mdi-\/>\mbox{\hyperlink{structg__raid__md__jmicron__object_a99dfc14fc8a6fe56d6822564249c3a54}{mdio\_meta}}));}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00777}00777 }
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00778}00778                 \textcolor{comment}{/* If we collected all needed disks -\/ start array. */}}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00779}00779                 \textcolor{keywordflow}{if} (mdi-\/>\mbox{\hyperlink{structg__raid__md__jmicron__object_a032e6dc7773885007c9ae248affe6ad5}{mdio\_disks\_present}} == mdi-\/>\mbox{\hyperlink{structg__raid__md__jmicron__object_a736479d42184be44bcb41f9176594ee3}{mdio\_total\_disks}} +}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00780}00780                     \mbox{\hyperlink{md__jmicron_8c_aa6f0fccb53d14c2308784d4f95fae275}{jmicron\_meta\_total\_spare}}(mdi-\/>\mbox{\hyperlink{structg__raid__md__jmicron__object_a99dfc14fc8a6fe56d6822564249c3a54}{mdio\_meta}}))}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00781}00781                         \mbox{\hyperlink{md__jmicron_8c_a81255a64e1eeb188fb9a297ca4926eb2}{g\_raid\_md\_jmicron\_start}}(sc);}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00782}00782         \}}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00783}00783 \}}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00784}00784 }
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00785}00785 \textcolor{keyword}{static} \textcolor{keywordtype}{void}}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00786}\mbox{\hyperlink{md__jmicron_8c_a56cda4711cce240064b7024805378714}{00786}} \mbox{\hyperlink{md__jmicron_8c_a56cda4711cce240064b7024805378714}{g\_raid\_jmicron\_go}}(\textcolor{keywordtype}{void} *arg)}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00787}00787 \{}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00788}00788         \textcolor{keyword}{struct }\mbox{\hyperlink{structg__raid__softc}{g\_raid\_softc}} *sc;}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00789}00789         \textcolor{keyword}{struct }\mbox{\hyperlink{structg__raid__md__object}{g\_raid\_md\_object}} *md;}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00790}00790         \textcolor{keyword}{struct }\mbox{\hyperlink{structg__raid__md__jmicron__object}{g\_raid\_md\_jmicron\_object}} *mdi;}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00791}00791 }
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00792}00792         sc = arg;}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00793}00793         md = sc-\/>\mbox{\hyperlink{structg__raid__softc_a5bf7421452e0a324fc4f8b954b57314b}{sc\_md}};}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00794}00794         mdi = (\textcolor{keyword}{struct }\mbox{\hyperlink{structg__raid__md__jmicron__object}{g\_raid\_md\_jmicron\_object}} *)md;}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00795}00795         \textcolor{keywordflow}{if} (!mdi-\/>\mbox{\hyperlink{structg__raid__md__jmicron__object_adeedb342e0d17d9db3bce7dfc408b72c}{mdio\_started}}) \{}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00796}00796                 \mbox{\hyperlink{g__raid_8h_ace7234f8197b96e1b636f9376de8d7ea}{G\_RAID\_DEBUG1}}(0, sc, \textcolor{stringliteral}{"{}Force array start due to timeout."{}});}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00797}00797                 \mbox{\hyperlink{g__raid_8c_ac49cc1991dccaeef0743e0bc4f64e0b5}{g\_raid\_event\_send}}(sc, \mbox{\hyperlink{g__raid_8h_a24e4a89ebdc2516aa17a2d4c804b38a0}{G\_RAID\_NODE\_E\_START}}, 0);}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00798}00798         \}}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00799}00799 \}}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00800}00800 }
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00801}00801 \textcolor{keyword}{static} \textcolor{keywordtype}{int}}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00802}\mbox{\hyperlink{md__jmicron_8c_aee2cc63f7754f001e24790bd7ec862fe}{00802}} \mbox{\hyperlink{md__jmicron_8c_a023cfe32948ee2b2c745e7ba8398d9dd}{g\_raid\_md\_create\_jmicron}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structg__raid__md__object}{g\_raid\_md\_object}} *md, \textcolor{keyword}{struct} \mbox{\hyperlink{structg__class}{g\_class}} *\mbox{\hyperlink{g__raid__md__if_8m_a4f7502795edfd2493d3d223d0df33e1d}{mp}},}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00803}00803     \textcolor{keyword}{struct} \mbox{\hyperlink{structg__geom}{g\_geom}} **\mbox{\hyperlink{g__part__if_8m_abdc908a08b24cd2e589de2f44e40eeb9}{gp}})}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00804}00804 \{}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00805}00805         \textcolor{keyword}{struct }\mbox{\hyperlink{structg__raid__softc}{g\_raid\_softc}} *sc;}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00806}00806         \textcolor{keyword}{struct }\mbox{\hyperlink{structg__raid__md__jmicron__object}{g\_raid\_md\_jmicron\_object}} *mdi;}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00807}00807         \textcolor{keywordtype}{char} \mbox{\hyperlink{g__part__if_8m_aff5d3acc33944ecb11914d04ef06bb54}{name}}[16];}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00808}00808 }
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00809}00809         mdi = (\textcolor{keyword}{struct }\mbox{\hyperlink{structg__raid__md__jmicron__object}{g\_raid\_md\_jmicron\_object}} *)md;}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00810}00810         mdi-\/>\mbox{\hyperlink{structg__raid__md__jmicron__object_afc55c88b5b58ee08c5c7a5be6801156a}{mdio\_config\_id}} = arc4random();}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00811}00811         snprintf(\mbox{\hyperlink{g__part__if_8m_aff5d3acc33944ecb11914d04ef06bb54}{name}}, \textcolor{keyword}{sizeof}(\mbox{\hyperlink{g__part__if_8m_aff5d3acc33944ecb11914d04ef06bb54}{name}}), \textcolor{stringliteral}{"{}JMicron-\/\%08x"{}}, mdi-\/>\mbox{\hyperlink{structg__raid__md__jmicron__object_afc55c88b5b58ee08c5c7a5be6801156a}{mdio\_config\_id}});}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00812}00812         sc = \mbox{\hyperlink{g__raid_8c_aee6d4bf64b6c670eda4a8033cb968ae7}{g\_raid\_create\_node}}(\mbox{\hyperlink{g__raid__md__if_8m_a4f7502795edfd2493d3d223d0df33e1d}{mp}}, \mbox{\hyperlink{g__part__if_8m_aff5d3acc33944ecb11914d04ef06bb54}{name}}, md);}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00813}00813         \textcolor{keywordflow}{if} (sc == NULL)}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00814}00814                 \textcolor{keywordflow}{return} (\mbox{\hyperlink{g__raid__md__if_8m_ae3e40a1a8689841d6d6f54a441d53d43}{G\_RAID\_MD\_TASTE\_FAIL}});}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00815}00815         md-\/>\mbox{\hyperlink{structg__raid__md__object_a4acc92ca2582509c74947d83b258e31d}{mdo\_softc}} = sc;}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00816}00816         *\mbox{\hyperlink{g__part__if_8m_abdc908a08b24cd2e589de2f44e40eeb9}{gp}} = sc-\/>\mbox{\hyperlink{structg__raid__softc_aaaffc18ac5f4ad54f823080cf1842943}{sc\_geom}};}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00817}00817         \textcolor{keywordflow}{return} (\mbox{\hyperlink{g__raid__md__if_8m_aa5340dcca98f524650a3aa3675073120}{G\_RAID\_MD\_TASTE\_NEW}});}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00818}00818 \}}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00819}00819 }
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00820}00820 \textcolor{keyword}{static} \textcolor{keywordtype}{int}}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00821}\mbox{\hyperlink{md__jmicron_8c_af6e5ce41d5851117017ef09fdc042087}{00821}} \mbox{\hyperlink{md__jmicron_8c_ae17d9058bbc539474ef601a87819dfb0}{g\_raid\_md\_taste\_jmicron}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structg__raid__md__object}{g\_raid\_md\_object}} *md, \textcolor{keyword}{struct} \mbox{\hyperlink{structg__class}{g\_class}} *\mbox{\hyperlink{g__raid__md__if_8m_a4f7502795edfd2493d3d223d0df33e1d}{mp}},}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00822}00822                               \textcolor{keyword}{struct} \mbox{\hyperlink{structg__consumer}{g\_consumer}} *\mbox{\hyperlink{g__part__if_8m_a294f18324585ff37641fb8aa1c9ccd82}{cp}}, \textcolor{keyword}{struct} \mbox{\hyperlink{structg__geom}{g\_geom}} **\mbox{\hyperlink{g__part__if_8m_abdc908a08b24cd2e589de2f44e40eeb9}{gp}})}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00823}00823 \{}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00824}00824         \textcolor{keyword}{struct }\mbox{\hyperlink{structg__consumer}{g\_consumer}} *rcp;}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00825}00825         \textcolor{keyword}{struct }\mbox{\hyperlink{structg__provider}{g\_provider}} *\mbox{\hyperlink{g__part__if_8m_a9bc7638f295763b77465c5ebebbd3442}{pp}};}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00826}00826         \textcolor{keyword}{struct }\mbox{\hyperlink{structg__raid__md__jmicron__object}{g\_raid\_md\_jmicron\_object}} *mdi, *mdi1;}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00827}00827         \textcolor{keyword}{struct }\mbox{\hyperlink{structg__raid__softc}{g\_raid\_softc}} *sc;}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00828}00828         \textcolor{keyword}{struct }\mbox{\hyperlink{structg__raid__disk}{g\_raid\_disk}} *\mbox{\hyperlink{g__raid__md__if_8m_a9508e997a57ea259d6ecc0e563261993}{disk}};}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00829}00829         \textcolor{keyword}{struct }\mbox{\hyperlink{structjmicron__raid__conf}{jmicron\_raid\_conf}} *meta;}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00830}00830         \textcolor{keyword}{struct }\mbox{\hyperlink{structg__raid__md__jmicron__perdisk}{g\_raid\_md\_jmicron\_perdisk}} *pd;}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00831}00831         \textcolor{keyword}{struct }\mbox{\hyperlink{structg__geom}{g\_geom}} *geom;}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00832}00832         \textcolor{keywordtype}{int} disk\_pos, result, spare, len;}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00833}00833         \textcolor{keywordtype}{char} \mbox{\hyperlink{g__part__if_8m_aff5d3acc33944ecb11914d04ef06bb54}{name}}[16];}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00834}00834         uint16\_t vendor;}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00835}00835 }
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00836}00836         \mbox{\hyperlink{g__raid_8h_a4333fbd8d0899facf171aee7b60697f6}{G\_RAID\_DEBUG}}(1, \textcolor{stringliteral}{"{}Tasting JMicron on \%s"{}}, \mbox{\hyperlink{g__part__if_8m_a294f18324585ff37641fb8aa1c9ccd82}{cp}}-\/>\mbox{\hyperlink{structg__consumer_a6435d5aec0376e995dce3131fd3beb52}{provider}}-\/>\mbox{\hyperlink{structg__provider_a2bffb416ee58cf4df7839c6fd5ec004a}{name}});}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00837}00837         mdi = (\textcolor{keyword}{struct }\mbox{\hyperlink{structg__raid__md__jmicron__object}{g\_raid\_md\_jmicron\_object}} *)md;}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00838}00838         \mbox{\hyperlink{g__part__if_8m_a9bc7638f295763b77465c5ebebbd3442}{pp}} = \mbox{\hyperlink{g__part__if_8m_a294f18324585ff37641fb8aa1c9ccd82}{cp}}-\/>\mbox{\hyperlink{structg__consumer_a6435d5aec0376e995dce3131fd3beb52}{provider}};}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00839}00839 }
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00840}00840         \textcolor{comment}{/* Read metadata from device. */}}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00841}00841         meta = NULL;}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00842}00842         \mbox{\hyperlink{geom_8h_a4628d4de49ba84e7a6126cc30d23b83a}{g\_topology\_unlock}}();}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00843}00843         vendor = 0xffff;}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00844}00844         len = \textcolor{keyword}{sizeof}(vendor);}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00845}00845         \textcolor{keywordflow}{if} (\mbox{\hyperlink{g__part__if_8m_a9bc7638f295763b77465c5ebebbd3442}{pp}}-\/>\mbox{\hyperlink{structg__provider_afe5c92b8a2a9e4cdf1cab6daa96923c1}{geom}}-\/>\mbox{\hyperlink{structg__geom_a6e00f814c9e37ee129d5d456d0379576}{rank}} == 1)}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00846}00846                 \mbox{\hyperlink{geom_8h_a63ec0c10c4635c215416171e7e804d17}{g\_io\_getattr}}(\textcolor{stringliteral}{"{}GEOM::hba\_vendor"{}}, \mbox{\hyperlink{g__part__if_8m_a294f18324585ff37641fb8aa1c9ccd82}{cp}}, \&len, \&vendor);}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00847}00847         meta = \mbox{\hyperlink{md__jmicron_8c_a1ccbc8adbd1ccb807a87f255d7793e05}{jmicron\_meta\_read}}(\mbox{\hyperlink{g__part__if_8m_a294f18324585ff37641fb8aa1c9ccd82}{cp}});}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00848}00848         \mbox{\hyperlink{geom_8h_a232419d2cfa06ff3f4ff7551041aed31}{g\_topology\_lock}}();}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00849}00849         \textcolor{keywordflow}{if} (meta == NULL) \{}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00850}00850                 \textcolor{keywordflow}{if} (\mbox{\hyperlink{g__raid_8c_afffb01dfa563be86d3c73e5f264c75ce}{g\_raid\_aggressive\_spare}}) \{}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00851}00851                         \textcolor{keywordflow}{if} (vendor == 0x197b) \{}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00852}00852                                 \mbox{\hyperlink{g__raid_8h_a4333fbd8d0899facf171aee7b60697f6}{G\_RAID\_DEBUG}}(1,}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00853}00853                                     \textcolor{stringliteral}{"{}No JMicron metadata, forcing spare."{}});}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00854}00854                                 spare = 2;}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00855}00855                                 \textcolor{keywordflow}{goto} search;}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00856}00856                         \} \textcolor{keywordflow}{else} \{}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00857}00857                                 \mbox{\hyperlink{g__raid_8h_a4333fbd8d0899facf171aee7b60697f6}{G\_RAID\_DEBUG}}(1,}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00858}00858                                     \textcolor{stringliteral}{"{}JMicron vendor mismatch 0x\%04x != 0x197b"{}},}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00859}00859                                     vendor);}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00860}00860                         \}}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00861}00861                 \}}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00862}00862                 \textcolor{keywordflow}{return} (\mbox{\hyperlink{g__raid__md__if_8m_ae3e40a1a8689841d6d6f54a441d53d43}{G\_RAID\_MD\_TASTE\_FAIL}});}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00863}00863         \}}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00864}00864 }
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00865}00865         \textcolor{comment}{/* Check this disk position in obtained metadata. */}}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00866}00866         disk\_pos = \mbox{\hyperlink{md__jmicron_8c_a1a9e27fa92871a229492bccdae9ec7eb}{jmicron\_meta\_find\_disk}}(meta, meta-\/>\mbox{\hyperlink{structjmicron__raid__conf_aeccbf0f339ffb5dc10d2489d3d154e80}{disk\_id}});}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00867}00867         \textcolor{keywordflow}{if} (disk\_pos == -\/1) \{}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00868}00868                 \mbox{\hyperlink{g__raid_8h_a4333fbd8d0899facf171aee7b60697f6}{G\_RAID\_DEBUG}}(1, \textcolor{stringliteral}{"{}JMicron disk\_id \%08x not found"{}},}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00869}00869                     meta-\/>\mbox{\hyperlink{structjmicron__raid__conf_aeccbf0f339ffb5dc10d2489d3d154e80}{disk\_id}});}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00870}00870                 \textcolor{keywordflow}{goto} fail1;}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00871}00871         \}}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00872}00872 }
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00873}00873         \textcolor{comment}{/* Metadata valid. Print it. */}}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00874}00874         \mbox{\hyperlink{md__jmicron_8c_a48fd6da4e42cb60e7476439913eb743a}{g\_raid\_md\_jmicron\_print}}(meta);}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00875}00875         \mbox{\hyperlink{g__raid_8h_a4333fbd8d0899facf171aee7b60697f6}{G\_RAID\_DEBUG}}(1, \textcolor{stringliteral}{"{}JMicron disk position \%d"{}}, disk\_pos);}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00876}00876         spare = (disk\_pos == -\/2) ? 1 : 0;}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00877}00877 }
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00878}00878 search:}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00879}00879         \textcolor{comment}{/* Search for matching node. */}}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00880}00880         sc = NULL;}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00881}00881         mdi1 = NULL;}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00882}00882         LIST\_FOREACH(geom, \&\mbox{\hyperlink{g__raid__md__if_8m_a4f7502795edfd2493d3d223d0df33e1d}{mp}}-\/>geom, geom) \{}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00883}00883                 sc = geom-\/>\mbox{\hyperlink{structg__geom_aa83c08c83459420f6cbcfe64c6099466}{softc}};}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00884}00884                 \textcolor{keywordflow}{if} (sc == NULL)}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00885}00885                         \textcolor{keywordflow}{continue};}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00886}00886                 \textcolor{keywordflow}{if} (sc-\/>\mbox{\hyperlink{structg__raid__softc_a92d7a08f5e32fa07a7b8769b5b3ca4f4}{sc\_stopping}} != 0)}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00887}00887                         \textcolor{keywordflow}{continue};}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00888}00888                 \textcolor{keywordflow}{if} (sc-\/>\mbox{\hyperlink{structg__raid__softc_a5bf7421452e0a324fc4f8b954b57314b}{sc\_md}}-\/>\mbox{\hyperlink{structg__raid__md__object_ab622ae7b27ee826f1117caaf7fc38f48}{mdo\_class}} != md-\/>\mbox{\hyperlink{structg__raid__md__object_ab622ae7b27ee826f1117caaf7fc38f48}{mdo\_class}})}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00889}00889                         \textcolor{keywordflow}{continue};}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00890}00890                 mdi1 = (\textcolor{keyword}{struct }\mbox{\hyperlink{structg__raid__md__jmicron__object}{g\_raid\_md\_jmicron\_object}} *)sc-\/>\mbox{\hyperlink{structg__raid__softc_a5bf7421452e0a324fc4f8b954b57314b}{sc\_md}};}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00891}00891                 if (spare == 2) \{}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00892}00892                         \textcolor{keywordflow}{if} (mdi1-\/>\mbox{\hyperlink{structg__raid__md__jmicron__object_a03a05cb696e82019951d9641fb7568ae}{mdio\_incomplete}})}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00893}00893                                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00894}00894                 \} \textcolor{keywordflow}{else} \{}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00895}00895                         \textcolor{keywordflow}{if} (mdi1-\/>\mbox{\hyperlink{structg__raid__md__jmicron__object_afc55c88b5b58ee08c5c7a5be6801156a}{mdio\_config\_id}} ==}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00896}00896                             \mbox{\hyperlink{md__jmicron_8c_ac180f9de75252335b3b8a565a66cb91b}{jmicron\_meta\_config\_id}}(meta))}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00897}00897                                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00898}00898                 \}}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00899}00899         \}}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00900}00900 }
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00901}00901         \textcolor{comment}{/* Found matching node. */}}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00902}00902         \textcolor{keywordflow}{if} (geom != NULL) \{}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00903}00903                 \mbox{\hyperlink{g__raid_8h_a4333fbd8d0899facf171aee7b60697f6}{G\_RAID\_DEBUG}}(1, \textcolor{stringliteral}{"{}Found matching array \%s"{}}, sc-\/>sc\_name);}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00904}00904                 result = \mbox{\hyperlink{g__raid__md__if_8m_a462421bd5367102456b64943db520823}{G\_RAID\_MD\_TASTE\_EXISTING}};}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00905}00905 }
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00906}00906         \} \textcolor{keywordflow}{else} \textcolor{keywordflow}{if} (spare) \{ \textcolor{comment}{/* Not found needy node -\/-\/ left for later. */}}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00907}00907                 \mbox{\hyperlink{g__raid_8h_a4333fbd8d0899facf171aee7b60697f6}{G\_RAID\_DEBUG}}(1, \textcolor{stringliteral}{"{}Spare is not needed at this time"{}});}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00908}00908                 \textcolor{keywordflow}{goto} fail1;}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00909}00909 }
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00910}00910         \} \textcolor{keywordflow}{else} \{ \textcolor{comment}{/* Not found matching node -\/-\/ create one. */}}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00911}00911                 result = \mbox{\hyperlink{g__raid__md__if_8m_aa5340dcca98f524650a3aa3675073120}{G\_RAID\_MD\_TASTE\_NEW}};}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00912}00912                 mdi-\/>\mbox{\hyperlink{structg__raid__md__jmicron__object_afc55c88b5b58ee08c5c7a5be6801156a}{mdio\_config\_id}} = \mbox{\hyperlink{md__jmicron_8c_ac180f9de75252335b3b8a565a66cb91b}{jmicron\_meta\_config\_id}}(meta);}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00913}00913                 snprintf(\mbox{\hyperlink{g__part__if_8m_aff5d3acc33944ecb11914d04ef06bb54}{name}}, \textcolor{keyword}{sizeof}(\mbox{\hyperlink{g__part__if_8m_aff5d3acc33944ecb11914d04ef06bb54}{name}}), \textcolor{stringliteral}{"{}JMicron-\/\%08x"{}},}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00914}00914                     mdi-\/>\mbox{\hyperlink{structg__raid__md__jmicron__object_afc55c88b5b58ee08c5c7a5be6801156a}{mdio\_config\_id}});}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00915}00915                 sc = \mbox{\hyperlink{g__raid_8c_aee6d4bf64b6c670eda4a8033cb968ae7}{g\_raid\_create\_node}}(\mbox{\hyperlink{g__raid__md__if_8m_a4f7502795edfd2493d3d223d0df33e1d}{mp}}, \mbox{\hyperlink{g__part__if_8m_aff5d3acc33944ecb11914d04ef06bb54}{name}}, md);}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00916}00916                 md-\/>\mbox{\hyperlink{structg__raid__md__object_a4acc92ca2582509c74947d83b258e31d}{mdo\_softc}} = sc;}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00917}00917                 geom = sc-\/>\mbox{\hyperlink{structg__raid__softc_aaaffc18ac5f4ad54f823080cf1842943}{sc\_geom}};}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00918}00918                 callout\_init(\&mdi-\/>\mbox{\hyperlink{structg__raid__md__jmicron__object_af59f91509fa472e35ba85b4e78d99b07}{mdio\_start\_co}}, 1);}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00919}00919                 callout\_reset(\&mdi-\/>\mbox{\hyperlink{structg__raid__md__jmicron__object_af59f91509fa472e35ba85b4e78d99b07}{mdio\_start\_co}}, \mbox{\hyperlink{g__raid_8c_afcfadaaafd5305ba6550313e2cac825b}{g\_raid\_start\_timeout}} * hz,}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00920}00920                     \mbox{\hyperlink{md__jmicron_8c_a56cda4711cce240064b7024805378714}{g\_raid\_jmicron\_go}}, sc);}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00921}00921                 mdi-\/>\mbox{\hyperlink{structg__raid__md__jmicron__object_ae5ddd50412f23f4106c7a7760a91e3db}{mdio\_rootmount}} = root\_mount\_hold(\textcolor{stringliteral}{"{}GRAID-\/JMicron"{}});}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00922}00922                 \mbox{\hyperlink{g__raid_8h_ace7234f8197b96e1b636f9376de8d7ea}{G\_RAID\_DEBUG1}}(1, sc, \textcolor{stringliteral}{"{}root\_mount\_hold \%p"{}}, mdi-\/>\mbox{\hyperlink{structg__raid__md__jmicron__object_ae5ddd50412f23f4106c7a7760a91e3db}{mdio\_rootmount}});}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00923}00923         \}}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00924}00924 }
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00925}00925         \textcolor{comment}{/* There is no return after this point, so we close passed consumer. */}}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00926}00926         \mbox{\hyperlink{geom_8h_a27b7c72cc3bc5a4d07ce5976e1aa1b58}{g\_access}}(\mbox{\hyperlink{g__part__if_8m_a294f18324585ff37641fb8aa1c9ccd82}{cp}}, -\/1, 0, 0);}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00927}00927 }
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00928}00928         rcp = \mbox{\hyperlink{geom_8h_aef9ca3f0eecc1b245c3c9cd0bac1cdc4}{g\_new\_consumer}}(geom);}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00929}00929         rcp-\/>\mbox{\hyperlink{structg__consumer_acf792357913c0445233b71f8259764d9}{flags}} |= \mbox{\hyperlink{geom_8h_a2184f2512ddb7a67ddbb71409cdd953f}{G\_CF\_DIRECT\_RECEIVE}};}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00930}00930         \mbox{\hyperlink{geom_8h_a7f6ee69db47bae6ff5284f6a9cfceb91}{g\_attach}}(rcp, \mbox{\hyperlink{g__part__if_8m_a9bc7638f295763b77465c5ebebbd3442}{pp}});}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00931}00931         \textcolor{keywordflow}{if} (\mbox{\hyperlink{geom_8h_a27b7c72cc3bc5a4d07ce5976e1aa1b58}{g\_access}}(rcp, 1, 1, 1) != 0)}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00932}00932                 ; \textcolor{comment}{//goto fail1;}}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00933}00933 }
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00934}00934         \mbox{\hyperlink{geom_8h_a4628d4de49ba84e7a6126cc30d23b83a}{g\_topology\_unlock}}();}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00935}00935         sx\_xlock(\&sc-\/>\mbox{\hyperlink{structg__raid__softc_a6242ad65da243c1107889ace908799fd}{sc\_lock}});}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00936}00936 }
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00937}00937         pd = malloc(\textcolor{keyword}{sizeof}(*pd), M\_MD\_JMICRON, M\_WAITOK | M\_ZERO);}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00938}00938         pd-\/>\mbox{\hyperlink{structg__raid__md__jmicron__perdisk_ac2b4421d277ebd509be1854f4c1e1f53}{pd\_meta}} = meta;}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00939}00939         \textcolor{keywordflow}{if} (spare == 2) \{}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00940}00940                 pd-\/>\mbox{\hyperlink{structg__raid__md__jmicron__perdisk_a65960334e7c32b993e9ea104819243b9}{pd\_disk\_pos}} = -\/3;}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00941}00941                 pd-\/>\mbox{\hyperlink{structg__raid__md__jmicron__perdisk_a46a598fbfa7cbd51384eb2ea86325455}{pd\_disk\_id}} = arc4random() \& \mbox{\hyperlink{md__jmicron_8c_ae5a6c6dc90a396412a801d5e62abf05f}{JMICRON\_DISK\_MASK}};}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00942}00942         \} \textcolor{keywordflow}{else} \{}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00943}00943                 pd-\/>\mbox{\hyperlink{structg__raid__md__jmicron__perdisk_a65960334e7c32b993e9ea104819243b9}{pd\_disk\_pos}} = -\/1;}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00944}00944                 pd-\/>\mbox{\hyperlink{structg__raid__md__jmicron__perdisk_a46a598fbfa7cbd51384eb2ea86325455}{pd\_disk\_id}} = meta-\/>\mbox{\hyperlink{structjmicron__raid__conf_aeccbf0f339ffb5dc10d2489d3d154e80}{disk\_id}};}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00945}00945         \}}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00946}00946         pd-\/>\mbox{\hyperlink{structg__raid__md__jmicron__perdisk_a1a732ac096c218a73964b0bbecb9b236}{pd\_disk\_size}} = \mbox{\hyperlink{g__part__if_8m_a9bc7638f295763b77465c5ebebbd3442}{pp}}-\/>\mbox{\hyperlink{structg__provider_a8f47c464c78aa91fa4ca5143ed3cd15e}{mediasize}};}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00947}00947         \mbox{\hyperlink{structdisk}{disk}} = \mbox{\hyperlink{g__raid_8c_a7d896eb1612c17408eedbdda2032e897}{g\_raid\_create\_disk}}(sc);}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00948}00948         \mbox{\hyperlink{structdisk}{disk}}-\/>d\_md\_data = (\textcolor{keywordtype}{void} *)pd;}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00949}00949         \mbox{\hyperlink{structdisk}{disk}}-\/>d\_consumer = rcp;}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00950}00950         rcp-\/>\mbox{\hyperlink{structg__consumer_a11273c1281d0cffbc3383eb4e49e7010}{private}} = \mbox{\hyperlink{g__raid__md__if_8m_a9508e997a57ea259d6ecc0e563261993}{disk}};}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00951}00951 }
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00952}00952         \mbox{\hyperlink{g__raid_8c_afbb51abcd221460c50c23ecc69be3114}{g\_raid\_get\_disk\_info}}(\mbox{\hyperlink{structdisk}{disk}});}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00953}00953 }
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00954}00954         \mbox{\hyperlink{md__jmicron_8c_ac76ea44eb639756c5ca1247b782aeff6}{g\_raid\_md\_jmicron\_new\_disk}}(\mbox{\hyperlink{structdisk}{disk}});}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00955}00955 }
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00956}00956         sx\_xunlock(\&sc-\/>\mbox{\hyperlink{structg__raid__softc_a6242ad65da243c1107889ace908799fd}{sc\_lock}});}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00957}00957         \mbox{\hyperlink{geom_8h_a232419d2cfa06ff3f4ff7551041aed31}{g\_topology\_lock}}();}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00958}00958         *\mbox{\hyperlink{g__part__if_8m_abdc908a08b24cd2e589de2f44e40eeb9}{gp}} = geom;}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00959}00959         \textcolor{keywordflow}{return} (result);}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00960}00960 fail1:}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00961}00961         \mbox{\hyperlink{g__raid__md__if_8m_a4df9edb2717b3f7e4c3c903878577a54}{free}}(meta, M\_MD\_JMICRON);}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00962}00962         \textcolor{keywordflow}{return} (\mbox{\hyperlink{g__raid__md__if_8m_ae3e40a1a8689841d6d6f54a441d53d43}{G\_RAID\_MD\_TASTE\_FAIL}});}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00963}00963 \}}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00964}00964 }
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00965}00965 \textcolor{keyword}{static} \textcolor{keywordtype}{int}}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00966}\mbox{\hyperlink{md__jmicron_8c_a55faff06b3c04396966c0e04e454473b}{00966}} \mbox{\hyperlink{md__jmicron_8c_a665c28ad395d21228359429d66fe759f}{g\_raid\_md\_event\_jmicron}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structg__raid__md__object}{g\_raid\_md\_object}} *md,}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00967}00967     \textcolor{keyword}{struct} \mbox{\hyperlink{structg__raid__disk}{g\_raid\_disk}} *\mbox{\hyperlink{structdisk}{disk}}, u\_int \mbox{\hyperlink{g__raid__md__if_8m_a683a43faabf5ffc974caacd425b678d0}{event}})}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00968}00968 \{}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00969}00969         \textcolor{keyword}{struct }\mbox{\hyperlink{structg__raid__softc}{g\_raid\_softc}} *sc;}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00970}00970         \textcolor{keyword}{struct }\mbox{\hyperlink{structg__raid__subdisk}{g\_raid\_subdisk}} *\mbox{\hyperlink{g__raid__md__if_8m_a910062273088d146e8533398780701eb}{sd}};}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00971}00971         \textcolor{keyword}{struct }\mbox{\hyperlink{structg__raid__md__jmicron__object}{g\_raid\_md\_jmicron\_object}} *mdi;}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00972}00972         \textcolor{keyword}{struct }\mbox{\hyperlink{structg__raid__md__jmicron__perdisk}{g\_raid\_md\_jmicron\_perdisk}} *pd;}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00973}00973 }
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00974}00974         sc = md-\/>\mbox{\hyperlink{structg__raid__md__object_a4acc92ca2582509c74947d83b258e31d}{mdo\_softc}};}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00975}00975         mdi = (\textcolor{keyword}{struct }\mbox{\hyperlink{structg__raid__md__jmicron__object}{g\_raid\_md\_jmicron\_object}} *)md;}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00976}00976         \textcolor{keywordflow}{if} (\mbox{\hyperlink{structdisk}{disk}} == NULL) \{}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00977}00977                 \textcolor{keywordflow}{switch} (\mbox{\hyperlink{g__raid__md__if_8m_a683a43faabf5ffc974caacd425b678d0}{event}}) \{}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00978}00978                 \textcolor{keywordflow}{case} \mbox{\hyperlink{g__raid_8h_a24e4a89ebdc2516aa17a2d4c804b38a0}{G\_RAID\_NODE\_E\_START}}:}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00979}00979                         \textcolor{keywordflow}{if} (!mdi-\/>\mbox{\hyperlink{structg__raid__md__jmicron__object_adeedb342e0d17d9db3bce7dfc408b72c}{mdio\_started}})}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00980}00980                                 \mbox{\hyperlink{md__jmicron_8c_a81255a64e1eeb188fb9a297ca4926eb2}{g\_raid\_md\_jmicron\_start}}(sc);}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00981}00981                         \textcolor{keywordflow}{return} (0);}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00982}00982                 \}}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00983}00983                 \textcolor{keywordflow}{return} (-\/1);}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00984}00984         \}}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00985}00985         pd = (\textcolor{keyword}{struct }\mbox{\hyperlink{structg__raid__md__jmicron__perdisk}{g\_raid\_md\_jmicron\_perdisk}} *)\mbox{\hyperlink{structdisk}{disk}}-\/>d\_md\_data;}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00986}00986         switch (\mbox{\hyperlink{g__raid__md__if_8m_a683a43faabf5ffc974caacd425b678d0}{event}}) \{}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00987}00987         \textcolor{keywordflow}{case} \mbox{\hyperlink{g__raid_8h_aa6e0d41a9b7f63b694bd95805efd6137}{G\_RAID\_DISK\_E\_DISCONNECTED}}:}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00988}00988                 \textcolor{comment}{/* If disk was assigned, just update statuses. */}}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00989}00989                 \textcolor{keywordflow}{if} (pd-\/>\mbox{\hyperlink{structg__raid__md__jmicron__perdisk_a65960334e7c32b993e9ea104819243b9}{pd\_disk\_pos}} >= 0) \{}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00990}00990                         \mbox{\hyperlink{g__raid_8c_a342da571518e21e0521b6416c838d00e}{g\_raid\_change\_disk\_state}}(\mbox{\hyperlink{structdisk}{disk}}, \mbox{\hyperlink{g__raid_8h_aee552862c97f7442835d7c81b3399ac2}{G\_RAID\_DISK\_S\_OFFLINE}});}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00991}00991                         \textcolor{keywordflow}{if} (\mbox{\hyperlink{structdisk}{disk}}-\/>d\_consumer) \{}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00992}00992                                 \mbox{\hyperlink{g__raid_8c_abedf322bff3060596a6f822db290b9f3}{g\_raid\_kill\_consumer}}(sc, \mbox{\hyperlink{structdisk}{disk}}-\/>d\_consumer);}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00993}00993                                 \mbox{\hyperlink{structdisk}{disk}}-\/>d\_consumer = NULL;}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00994}00994                         \}}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00995}00995                         TAILQ\_FOREACH(\mbox{\hyperlink{g__raid__md__if_8m_a910062273088d146e8533398780701eb}{sd}}, \&\mbox{\hyperlink{structdisk}{disk}}-\/>d\_subdisks, sd\_next) \{}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00996}00996                                 \mbox{\hyperlink{g__raid_8c_a058db459d5349d2130fda3a02dd2af29}{g\_raid\_change\_subdisk\_state}}(\mbox{\hyperlink{g__raid__md__if_8m_a910062273088d146e8533398780701eb}{sd}},}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00997}00997                                     \mbox{\hyperlink{g__raid_8h_af37111ba44cfc01a98d97bed8f60d964}{G\_RAID\_SUBDISK\_S\_NONE}});}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00998}00998                                 \mbox{\hyperlink{g__raid_8c_ac49cc1991dccaeef0743e0bc4f64e0b5}{g\_raid\_event\_send}}(\mbox{\hyperlink{g__raid__md__if_8m_a910062273088d146e8533398780701eb}{sd}}, \mbox{\hyperlink{g__raid_8h_a1323466893d4ab83ea4c87e89e02fd06}{G\_RAID\_SUBDISK\_E\_DISCONNECTED}},}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l00999}00999                                     \mbox{\hyperlink{g__raid_8h_ae6ac3f8d5dcaa73174e3e8bb9dd12f1c}{G\_RAID\_EVENT\_SUBDISK}});}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l01000}01000                         \}}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l01001}01001                 \} \textcolor{keywordflow}{else} \{}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l01002}01002                         \textcolor{comment}{/* Otherwise -\/-\/ delete. */}}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l01003}01003                         \mbox{\hyperlink{g__raid_8c_a342da571518e21e0521b6416c838d00e}{g\_raid\_change\_disk\_state}}(\mbox{\hyperlink{structdisk}{disk}}, \mbox{\hyperlink{g__raid_8h_ad090f72fa79be3f1a59687ba60f85510}{G\_RAID\_DISK\_S\_NONE}});}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l01004}01004                         \mbox{\hyperlink{g__raid_8c_ac1e32d950d9354f1dca5d2ca34244adc}{g\_raid\_destroy\_disk}}(\mbox{\hyperlink{structdisk}{disk}});}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l01005}01005                 \}}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l01006}01006 }
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l01007}01007                 \textcolor{comment}{/* Write updated metadata to all disks. */}}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l01008}01008                 \mbox{\hyperlink{md__jmicron_8c_aaf5dc9d91eb1d2ddad515c7844468905}{g\_raid\_md\_write\_jmicron}}(md, NULL, NULL, NULL);}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l01009}01009 }
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l01010}01010                 \textcolor{comment}{/* Check if anything left except placeholders. */}}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l01011}01011                 \textcolor{keywordflow}{if} (\mbox{\hyperlink{g__raid_8c_ad1004201fc232c60faacd7bd3f3b604f}{g\_raid\_ndisks}}(sc, -\/1) ==}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l01012}01012                     \mbox{\hyperlink{g__raid_8c_ad1004201fc232c60faacd7bd3f3b604f}{g\_raid\_ndisks}}(sc, \mbox{\hyperlink{g__raid_8h_aee552862c97f7442835d7c81b3399ac2}{G\_RAID\_DISK\_S\_OFFLINE}}))}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l01013}01013                         \mbox{\hyperlink{g__raid_8c_a99807e6db37e78d1738e46dfd48b7b5c}{g\_raid\_destroy\_node}}(sc, 0);}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l01014}01014                 \textcolor{keywordflow}{else}}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l01015}01015                         \mbox{\hyperlink{md__jmicron_8c_ac7259021f21724898e2922acc5e087ca}{g\_raid\_md\_jmicron\_refill}}(sc);}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l01016}01016                 \textcolor{keywordflow}{return} (0);}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l01017}01017         \}}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l01018}01018         \textcolor{keywordflow}{return} (-\/2);}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l01019}01019 \}}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l01020}01020 }
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l01021}01021 \textcolor{keyword}{static} \textcolor{keywordtype}{int}}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l01022}\mbox{\hyperlink{md__jmicron_8c_a0503b21423088b7f06de1f15e48b1475}{01022}} \mbox{\hyperlink{md__jmicron_8c_af925716ea4c409c9bab6d9c060de7805}{g\_raid\_md\_ctl\_jmicron}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structg__raid__md__object}{g\_raid\_md\_object}} *md,}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l01023}01023     \textcolor{keyword}{struct} \mbox{\hyperlink{structgctl__req}{gctl\_req}} *\mbox{\hyperlink{g__part__if_8m_a7a9f20c97e75f805eb506910bd3e70d3}{req}})}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l01024}01024 \{}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l01025}01025         \textcolor{keyword}{struct }\mbox{\hyperlink{structg__raid__softc}{g\_raid\_softc}} *sc;}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l01026}01026         \textcolor{keyword}{struct }\mbox{\hyperlink{structg__raid__volume}{g\_raid\_volume}} *\mbox{\hyperlink{g__raid__md__if_8m_aaa46aabd2a891668d71cec64e90b4848}{vol}};}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l01027}01027         \textcolor{keyword}{struct }\mbox{\hyperlink{structg__raid__subdisk}{g\_raid\_subdisk}} *\mbox{\hyperlink{g__raid__md__if_8m_a910062273088d146e8533398780701eb}{sd}};}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l01028}01028         \textcolor{keyword}{struct }\mbox{\hyperlink{structg__raid__disk}{g\_raid\_disk}} *\mbox{\hyperlink{g__raid__md__if_8m_a9508e997a57ea259d6ecc0e563261993}{disk}};}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l01029}01029         \textcolor{keyword}{struct }\mbox{\hyperlink{structg__raid__md__jmicron__object}{g\_raid\_md\_jmicron\_object}} *mdi;}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l01030}01030         \textcolor{keyword}{struct }\mbox{\hyperlink{structg__raid__md__jmicron__perdisk}{g\_raid\_md\_jmicron\_perdisk}} *pd;}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l01031}01031         \textcolor{keyword}{struct }\mbox{\hyperlink{structg__consumer}{g\_consumer}} *\mbox{\hyperlink{g__part__if_8m_a294f18324585ff37641fb8aa1c9ccd82}{cp}};}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l01032}01032         \textcolor{keyword}{struct }\mbox{\hyperlink{structg__provider}{g\_provider}} *\mbox{\hyperlink{g__part__if_8m_a9bc7638f295763b77465c5ebebbd3442}{pp}};}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l01033}01033         \textcolor{keywordtype}{char} arg[16];}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l01034}01034         \textcolor{keyword}{const} \textcolor{keywordtype}{char} *verb, *volname, *levelname, *diskname;}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l01035}01035         \textcolor{keywordtype}{int} *nargs, *force;}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l01036}01036         off\_t size, \mbox{\hyperlink{structg__provider_aea3cd43d41461790b8d0afcd8c49a355}{sectorsize}}, strip;}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l01037}01037         intmax\_t *sizearg, *striparg;}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l01038}01038         \textcolor{keywordtype}{int} numdisks, i, len, level, qual, update;}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l01039}01039         \textcolor{keywordtype}{int} \mbox{\hyperlink{structg__provider_acacf1ee18cb6edbcfedc185846696e7f}{error}};}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l01040}01040 }
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l01041}01041         sc = md-\/>\mbox{\hyperlink{structg__raid__md__object_a4acc92ca2582509c74947d83b258e31d}{mdo\_softc}};}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l01042}01042         mdi = (\textcolor{keyword}{struct }\mbox{\hyperlink{structg__raid__md__jmicron__object}{g\_raid\_md\_jmicron\_object}} *)md;}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l01043}01043         verb = \mbox{\hyperlink{geom_8h_a3e3d6786258b3336d55a96607f9b8eb8}{gctl\_get\_param}}(\mbox{\hyperlink{g__part__if_8m_a7a9f20c97e75f805eb506910bd3e70d3}{req}}, \textcolor{stringliteral}{"{}verb"{}}, NULL);}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l01044}01044         nargs = \mbox{\hyperlink{geom_8h_ab762d12640f528d8f1f60eee92bf5f3b}{gctl\_get\_paraml}}(\mbox{\hyperlink{g__part__if_8m_a7a9f20c97e75f805eb506910bd3e70d3}{req}}, \textcolor{stringliteral}{"{}nargs"{}}, \textcolor{keyword}{sizeof}(*nargs));}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l01045}01045         error = 0;}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l01046}01046         \textcolor{keywordflow}{if} (strcmp(verb, \textcolor{stringliteral}{"{}label"{}}) == 0) \{}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l01047}01047                 \textcolor{keywordflow}{if} (*nargs < 4) \{}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l01048}01048                         \mbox{\hyperlink{geom_8h_a1d51201471b52be7e19a98b0fcb144de}{gctl\_error}}(\mbox{\hyperlink{g__part__if_8m_a7a9f20c97e75f805eb506910bd3e70d3}{req}}, \textcolor{stringliteral}{"{}Invalid number of arguments."{}});}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l01049}01049                         \textcolor{keywordflow}{return} (-\/1);}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l01050}01050                 \}}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l01051}01051                 volname = \mbox{\hyperlink{geom_8h_ada33526012aac8ee446617bb3749a07c}{gctl\_get\_asciiparam}}(\mbox{\hyperlink{g__part__if_8m_a7a9f20c97e75f805eb506910bd3e70d3}{req}}, \textcolor{stringliteral}{"{}arg1"{}});}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l01052}01052                 \textcolor{keywordflow}{if} (volname == NULL) \{}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l01053}01053                         \mbox{\hyperlink{geom_8h_a1d51201471b52be7e19a98b0fcb144de}{gctl\_error}}(\mbox{\hyperlink{g__part__if_8m_a7a9f20c97e75f805eb506910bd3e70d3}{req}}, \textcolor{stringliteral}{"{}No volume name."{}});}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l01054}01054                         \textcolor{keywordflow}{return} (-\/2);}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l01055}01055                 \}}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l01056}01056                 levelname = \mbox{\hyperlink{geom_8h_ada33526012aac8ee446617bb3749a07c}{gctl\_get\_asciiparam}}(\mbox{\hyperlink{g__part__if_8m_a7a9f20c97e75f805eb506910bd3e70d3}{req}}, \textcolor{stringliteral}{"{}arg2"{}});}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l01057}01057                 \textcolor{keywordflow}{if} (levelname == NULL) \{}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l01058}01058                         \mbox{\hyperlink{geom_8h_a1d51201471b52be7e19a98b0fcb144de}{gctl\_error}}(\mbox{\hyperlink{g__part__if_8m_a7a9f20c97e75f805eb506910bd3e70d3}{req}}, \textcolor{stringliteral}{"{}No RAID level."{}});}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l01059}01059                         \textcolor{keywordflow}{return} (-\/3);}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l01060}01060                 \}}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l01061}01061                 \textcolor{keywordflow}{if} (strcasecmp(levelname, \textcolor{stringliteral}{"{}RAID5"{}}) == 0)}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l01062}01062                         levelname = \textcolor{stringliteral}{"{}RAID5-\/LA"{}};}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l01063}01063                 \textcolor{keywordflow}{if} (\mbox{\hyperlink{g__raid_8c_a54f71ba156f1c4128a0c379435d79f3a}{g\_raid\_volume\_str2level}}(levelname, \&level, \&qual)) \{}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l01064}01064                         \mbox{\hyperlink{geom_8h_a1d51201471b52be7e19a98b0fcb144de}{gctl\_error}}(\mbox{\hyperlink{g__part__if_8m_a7a9f20c97e75f805eb506910bd3e70d3}{req}}, \textcolor{stringliteral}{"{}Unknown RAID level '\%s'."{}}, levelname);}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l01065}01065                         \textcolor{keywordflow}{return} (-\/4);}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l01066}01066                 \}}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l01067}01067                 numdisks = *nargs -\/ 3;}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l01068}01068                 force = \mbox{\hyperlink{geom_8h_ab762d12640f528d8f1f60eee92bf5f3b}{gctl\_get\_paraml}}(\mbox{\hyperlink{g__part__if_8m_a7a9f20c97e75f805eb506910bd3e70d3}{req}}, \textcolor{stringliteral}{"{}force"{}}, \textcolor{keyword}{sizeof}(*force));}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l01069}01069                 \textcolor{keywordflow}{if} (!\mbox{\hyperlink{md__jmicron_8c_a964ba0e9c5f5a188478cceb14f1b4bd9}{g\_raid\_md\_jmicron\_supported}}(level, qual, numdisks,}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l01070}01070                     force ? *force : 0)) \{}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l01071}01071                         \mbox{\hyperlink{geom_8h_a1d51201471b52be7e19a98b0fcb144de}{gctl\_error}}(\mbox{\hyperlink{g__part__if_8m_a7a9f20c97e75f805eb506910bd3e70d3}{req}}, \textcolor{stringliteral}{"{}Unsupported RAID level "{}}}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l01072}01072                             \textcolor{stringliteral}{"{}(0x\%02x/0x\%02x), or number of disks (\%d)."{}},}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l01073}01073                             level, qual, numdisks);}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l01074}01074                         \textcolor{keywordflow}{return} (-\/5);}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l01075}01075                 \}}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l01076}01076 }
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l01077}01077                 \textcolor{comment}{/* Search for disks, connect them and probe. */}}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l01078}01078                 size = 0x7fffffffffffffffllu;}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l01079}01079                 sectorsize = 0;}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l01080}01080                 \textcolor{keywordflow}{for} (i = 0; i < numdisks; i++) \{}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l01081}01081                         snprintf(arg, \textcolor{keyword}{sizeof}(arg), \textcolor{stringliteral}{"{}arg\%d"{}}, i + 3);}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l01082}01082                         diskname = \mbox{\hyperlink{geom_8h_ada33526012aac8ee446617bb3749a07c}{gctl\_get\_asciiparam}}(\mbox{\hyperlink{g__part__if_8m_a7a9f20c97e75f805eb506910bd3e70d3}{req}}, arg);}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l01083}01083                         \textcolor{keywordflow}{if} (diskname == NULL) \{}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l01084}01084                                 \mbox{\hyperlink{geom_8h_a1d51201471b52be7e19a98b0fcb144de}{gctl\_error}}(\mbox{\hyperlink{g__part__if_8m_a7a9f20c97e75f805eb506910bd3e70d3}{req}}, \textcolor{stringliteral}{"{}No disk name (\%s)."{}}, arg);}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l01085}01085                                 error = -\/6;}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l01086}01086                                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l01087}01087                         \}}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l01088}01088                         \textcolor{keywordflow}{if} (strcmp(diskname, \textcolor{stringliteral}{"{}NONE"{}}) == 0) \{}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l01089}01089                                 \mbox{\hyperlink{g__part__if_8m_a294f18324585ff37641fb8aa1c9ccd82}{cp}} = NULL;}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l01090}01090                                 \mbox{\hyperlink{g__part__if_8m_a9bc7638f295763b77465c5ebebbd3442}{pp}} = NULL;}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l01091}01091                         \} \textcolor{keywordflow}{else} \{}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l01092}01092                                 \mbox{\hyperlink{geom_8h_a232419d2cfa06ff3f4ff7551041aed31}{g\_topology\_lock}}();}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l01093}01093                                 \mbox{\hyperlink{g__part__if_8m_a294f18324585ff37641fb8aa1c9ccd82}{cp}} = \mbox{\hyperlink{g__raid_8c_acc4d5f993651e14eb607d9efe39061c8}{g\_raid\_open\_consumer}}(sc, diskname);}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l01094}01094                                 \textcolor{keywordflow}{if} (\mbox{\hyperlink{g__part__if_8m_a294f18324585ff37641fb8aa1c9ccd82}{cp}} == NULL) \{}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l01095}01095                                         \mbox{\hyperlink{geom_8h_a1d51201471b52be7e19a98b0fcb144de}{gctl\_error}}(\mbox{\hyperlink{g__part__if_8m_a7a9f20c97e75f805eb506910bd3e70d3}{req}}, \textcolor{stringliteral}{"{}Can't open '\%s'."{}},}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l01096}01096                                             diskname);}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l01097}01097                                         \mbox{\hyperlink{geom_8h_a4628d4de49ba84e7a6126cc30d23b83a}{g\_topology\_unlock}}();}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l01098}01098                                         error = -\/7;}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l01099}01099                                         \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l01100}01100                                 \}}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l01101}01101                                 \mbox{\hyperlink{g__part__if_8m_a9bc7638f295763b77465c5ebebbd3442}{pp}} = \mbox{\hyperlink{g__part__if_8m_a294f18324585ff37641fb8aa1c9ccd82}{cp}}-\/>\mbox{\hyperlink{structg__consumer_a6435d5aec0376e995dce3131fd3beb52}{provider}};}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l01102}01102                         \}}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l01103}01103                         pd = malloc(\textcolor{keyword}{sizeof}(*pd), M\_MD\_JMICRON, M\_WAITOK | M\_ZERO);}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l01104}01104                         pd-\/>\mbox{\hyperlink{structg__raid__md__jmicron__perdisk_a65960334e7c32b993e9ea104819243b9}{pd\_disk\_pos}} = i;}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l01105}01105                         pd-\/>\mbox{\hyperlink{structg__raid__md__jmicron__perdisk_a46a598fbfa7cbd51384eb2ea86325455}{pd\_disk\_id}} = arc4random() \& \mbox{\hyperlink{md__jmicron_8c_ae5a6c6dc90a396412a801d5e62abf05f}{JMICRON\_DISK\_MASK}};}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l01106}01106                         \mbox{\hyperlink{structdisk}{disk}} = \mbox{\hyperlink{g__raid_8c_a7d896eb1612c17408eedbdda2032e897}{g\_raid\_create\_disk}}(sc);}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l01107}01107                         \mbox{\hyperlink{structdisk}{disk}}-\/>d\_md\_data = (\textcolor{keywordtype}{void} *)pd;}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l01108}01108                         \mbox{\hyperlink{structdisk}{disk}}-\/>d\_consumer = \mbox{\hyperlink{g__part__if_8m_a294f18324585ff37641fb8aa1c9ccd82}{cp}};}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l01109}01109                         \textcolor{keywordflow}{if} (\mbox{\hyperlink{g__part__if_8m_a294f18324585ff37641fb8aa1c9ccd82}{cp}} == NULL)}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l01110}01110                                 \textcolor{keywordflow}{continue};}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l01111}01111                         \mbox{\hyperlink{g__part__if_8m_a294f18324585ff37641fb8aa1c9ccd82}{cp}}-\/>\mbox{\hyperlink{structg__consumer_a11273c1281d0cffbc3383eb4e49e7010}{private}} = \mbox{\hyperlink{g__raid__md__if_8m_a9508e997a57ea259d6ecc0e563261993}{disk}};}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l01112}01112                         \mbox{\hyperlink{geom_8h_a4628d4de49ba84e7a6126cc30d23b83a}{g\_topology\_unlock}}();}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l01113}01113 }
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l01114}01114                         \mbox{\hyperlink{g__raid_8c_afbb51abcd221460c50c23ecc69be3114}{g\_raid\_get\_disk\_info}}(\mbox{\hyperlink{structdisk}{disk}});}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l01115}01115 }
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l01116}01116                         pd-\/>\mbox{\hyperlink{structg__raid__md__jmicron__perdisk_a1a732ac096c218a73964b0bbecb9b236}{pd\_disk\_size}} = \mbox{\hyperlink{g__part__if_8m_a9bc7638f295763b77465c5ebebbd3442}{pp}}-\/>\mbox{\hyperlink{structg__provider_a8f47c464c78aa91fa4ca5143ed3cd15e}{mediasize}};}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l01117}01117                         \textcolor{keywordflow}{if} (size > \mbox{\hyperlink{g__part__if_8m_a9bc7638f295763b77465c5ebebbd3442}{pp}}-\/>\mbox{\hyperlink{structg__provider_a8f47c464c78aa91fa4ca5143ed3cd15e}{mediasize}})}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l01118}01118                                 size = \mbox{\hyperlink{g__part__if_8m_a9bc7638f295763b77465c5ebebbd3442}{pp}}-\/>\mbox{\hyperlink{structg__provider_a8f47c464c78aa91fa4ca5143ed3cd15e}{mediasize}};}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l01119}01119                         \textcolor{keywordflow}{if} (sectorsize < pp-\/>sectorsize)}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l01120}01120                                 sectorsize = \mbox{\hyperlink{g__part__if_8m_a9bc7638f295763b77465c5ebebbd3442}{pp}}-\/>\mbox{\hyperlink{structg__provider_aea3cd43d41461790b8d0afcd8c49a355}{sectorsize}};}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l01121}01121                 \}}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l01122}01122                 \textcolor{keywordflow}{if} (error != 0)}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l01123}01123                         \textcolor{keywordflow}{return} (error);}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l01124}01124 }
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l01125}01125                 \textcolor{keywordflow}{if} (sectorsize <= 0) \{}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l01126}01126                         \mbox{\hyperlink{geom_8h_a1d51201471b52be7e19a98b0fcb144de}{gctl\_error}}(\mbox{\hyperlink{g__part__if_8m_a7a9f20c97e75f805eb506910bd3e70d3}{req}}, \textcolor{stringliteral}{"{}Can't get sector size."{}});}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l01127}01127                         \textcolor{keywordflow}{return} (-\/8);}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l01128}01128                 \}}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l01129}01129 }
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l01130}01130                 \textcolor{comment}{/* Reserve space for metadata. */}}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l01131}01131                 size -\/= sectorsize;}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l01132}01132 }
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l01133}01133                 \textcolor{comment}{/* Handle size argument. */}}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l01134}01134                 len = \textcolor{keyword}{sizeof}(*sizearg);}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l01135}01135                 sizearg = \mbox{\hyperlink{geom_8h_a3e3d6786258b3336d55a96607f9b8eb8}{gctl\_get\_param}}(\mbox{\hyperlink{g__part__if_8m_a7a9f20c97e75f805eb506910bd3e70d3}{req}}, \textcolor{stringliteral}{"{}size"{}}, \&len);}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l01136}01136                 \textcolor{keywordflow}{if} (sizearg != NULL \&\& len == \textcolor{keyword}{sizeof}(*sizearg) \&\&}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l01137}01137                     *sizearg > 0) \{}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l01138}01138                         \textcolor{keywordflow}{if} (*sizearg > size) \{}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l01139}01139                                 \mbox{\hyperlink{geom_8h_a1d51201471b52be7e19a98b0fcb144de}{gctl\_error}}(\mbox{\hyperlink{g__part__if_8m_a7a9f20c97e75f805eb506910bd3e70d3}{req}}, \textcolor{stringliteral}{"{}Size too big \%lld > \%lld."{}},}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l01140}01140                                     (\textcolor{keywordtype}{long} \textcolor{keywordtype}{long})*sizearg, (\textcolor{keywordtype}{long} \textcolor{keywordtype}{long})size);}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l01141}01141                                 \textcolor{keywordflow}{return} (-\/9);}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l01142}01142                         \}}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l01143}01143                         size = *sizearg;}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l01144}01144                 \}}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l01145}01145 }
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l01146}01146                 \textcolor{comment}{/* Handle strip argument. */}}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l01147}01147                 strip = 131072;}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l01148}01148                 len = \textcolor{keyword}{sizeof}(*striparg);}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l01149}01149                 striparg = \mbox{\hyperlink{geom_8h_a3e3d6786258b3336d55a96607f9b8eb8}{gctl\_get\_param}}(\mbox{\hyperlink{g__part__if_8m_a7a9f20c97e75f805eb506910bd3e70d3}{req}}, \textcolor{stringliteral}{"{}strip"{}}, \&len);}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l01150}01150                 \textcolor{keywordflow}{if} (striparg != NULL \&\& len == \textcolor{keyword}{sizeof}(*striparg) \&\&}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l01151}01151                     *striparg > 0) \{}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l01152}01152                         \textcolor{keywordflow}{if} (*striparg < sectorsize) \{}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l01153}01153                                 \mbox{\hyperlink{geom_8h_a1d51201471b52be7e19a98b0fcb144de}{gctl\_error}}(\mbox{\hyperlink{g__part__if_8m_a7a9f20c97e75f805eb506910bd3e70d3}{req}}, \textcolor{stringliteral}{"{}Strip size too small."{}});}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l01154}01154                                 \textcolor{keywordflow}{return} (-\/10);}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l01155}01155                         \}}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l01156}01156                         \textcolor{keywordflow}{if} (*striparg \% sectorsize != 0) \{}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l01157}01157                                 \mbox{\hyperlink{geom_8h_a1d51201471b52be7e19a98b0fcb144de}{gctl\_error}}(\mbox{\hyperlink{g__part__if_8m_a7a9f20c97e75f805eb506910bd3e70d3}{req}}, \textcolor{stringliteral}{"{}Incorrect strip size."{}});}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l01158}01158                                 \textcolor{keywordflow}{return} (-\/11);}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l01159}01159                         \}}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l01160}01160                         \textcolor{keywordflow}{if} (strip > 65535 * sectorsize) \{}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l01161}01161                                 \mbox{\hyperlink{geom_8h_a1d51201471b52be7e19a98b0fcb144de}{gctl\_error}}(\mbox{\hyperlink{g__part__if_8m_a7a9f20c97e75f805eb506910bd3e70d3}{req}}, \textcolor{stringliteral}{"{}Strip size too big."{}});}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l01162}01162                                 \textcolor{keywordflow}{return} (-\/12);}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l01163}01163                         \}}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l01164}01164                         strip = *striparg;}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l01165}01165                 \}}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l01166}01166 }
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l01167}01167                 \textcolor{comment}{/* Round size down to strip or sector. */}}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l01168}01168                 \textcolor{keywordflow}{if} (level == \mbox{\hyperlink{g__raid_8h_a270bdf6b61fc7d810795e08ebbe60931}{G\_RAID\_VOLUME\_RL\_RAID1}})}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l01169}01169                         size -\/= (size \% sectorsize);}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l01170}01170                 \textcolor{keywordflow}{else} \textcolor{keywordflow}{if} (level == \mbox{\hyperlink{g__raid_8h_ad0ef2cd50760a49759a6cbaf2afeb286}{G\_RAID\_VOLUME\_RL\_RAID1E}} \&\&}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l01171}01171                     (numdisks \& 1) != 0)}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l01172}01172                         size -\/= (size \% (2 * strip));}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l01173}01173                 \textcolor{keywordflow}{else}}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l01174}01174                         size -\/= (size \% strip);}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l01175}01175                 \textcolor{keywordflow}{if} (size <= 0) \{}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l01176}01176                         \mbox{\hyperlink{geom_8h_a1d51201471b52be7e19a98b0fcb144de}{gctl\_error}}(\mbox{\hyperlink{g__part__if_8m_a7a9f20c97e75f805eb506910bd3e70d3}{req}}, \textcolor{stringliteral}{"{}Size too small."{}});}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l01177}01177                         \textcolor{keywordflow}{return} (-\/13);}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l01178}01178                 \}}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l01179}01179                 \textcolor{keywordflow}{if} (size > 0xffffffffffffllu * sectorsize) \{}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l01180}01180                         \mbox{\hyperlink{geom_8h_a1d51201471b52be7e19a98b0fcb144de}{gctl\_error}}(\mbox{\hyperlink{g__part__if_8m_a7a9f20c97e75f805eb506910bd3e70d3}{req}}, \textcolor{stringliteral}{"{}Size too big."{}});}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l01181}01181                         \textcolor{keywordflow}{return} (-\/14);}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l01182}01182                 \}}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l01183}01183 }
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l01184}01184                 \textcolor{comment}{/* We have all we need, create things: volume, ... */}}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l01185}01185                 mdi-\/>\mbox{\hyperlink{structg__raid__md__jmicron__object_a736479d42184be44bcb41f9176594ee3}{mdio\_total\_disks}} = numdisks;}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l01186}01186                 mdi-\/>\mbox{\hyperlink{structg__raid__md__jmicron__object_adeedb342e0d17d9db3bce7dfc408b72c}{mdio\_started}} = 1;}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l01187}01187                 \mbox{\hyperlink{g__raid__md__if_8m_aaa46aabd2a891668d71cec64e90b4848}{vol}} = \mbox{\hyperlink{g__raid_8c_a582a2f56fe635a9f1d2783b9342126ee}{g\_raid\_create\_volume}}(sc, volname, -\/1);}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l01188}01188                 \mbox{\hyperlink{g__raid__md__if_8m_aaa46aabd2a891668d71cec64e90b4848}{vol}}-\/>\mbox{\hyperlink{structg__raid__volume_a1f432fb732072f5b196b570dd1d1e998}{v\_md\_data}} = (\textcolor{keywordtype}{void} *)(intptr\_t)0;}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l01189}01189                 \mbox{\hyperlink{g__raid__md__if_8m_aaa46aabd2a891668d71cec64e90b4848}{vol}}-\/>\mbox{\hyperlink{structg__raid__volume_ab7c2840f8398e5a91b560d7644957a57}{v\_raid\_level}} = level;}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l01190}01190                 \mbox{\hyperlink{g__raid__md__if_8m_aaa46aabd2a891668d71cec64e90b4848}{vol}}-\/>\mbox{\hyperlink{structg__raid__volume_ad17bb2da7eadd462f1f27551cb1da76f}{v\_raid\_level\_qualifier}} = qual;}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l01191}01191                 \mbox{\hyperlink{g__raid__md__if_8m_aaa46aabd2a891668d71cec64e90b4848}{vol}}-\/>\mbox{\hyperlink{structg__raid__volume_af0ca6a1c61e893f02a43ca29953c8e39}{v\_strip\_size}} = strip;}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l01192}01192                 \mbox{\hyperlink{g__raid__md__if_8m_aaa46aabd2a891668d71cec64e90b4848}{vol}}-\/>\mbox{\hyperlink{structg__raid__volume_a21482a5ac78a397faf4e95eb1ebef431}{v\_disks\_count}} = numdisks;}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l01193}01193                 \textcolor{keywordflow}{if} (level == \mbox{\hyperlink{g__raid_8h_a6a49f4ddd0b45eb4210ce72528786a32}{G\_RAID\_VOLUME\_RL\_RAID0}} ||}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l01194}01194                     level == \mbox{\hyperlink{g__raid_8h_abc695e94a9e4eff0f657ec01d1f19607}{G\_RAID\_VOLUME\_RL\_CONCAT}} ||}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l01195}01195                     level == \mbox{\hyperlink{g__raid_8h_acb418af006a1d84e0dd912c58cec6f57}{G\_RAID\_VOLUME\_RL\_SINGLE}})}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l01196}01196                         \mbox{\hyperlink{g__raid__md__if_8m_aaa46aabd2a891668d71cec64e90b4848}{vol}}-\/>\mbox{\hyperlink{structg__raid__volume_ad81a0903c26424634b555fa29c0cd400}{v\_mediasize}} = size * numdisks;}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l01197}01197                 \textcolor{keywordflow}{else} \textcolor{keywordflow}{if} (level == \mbox{\hyperlink{g__raid_8h_a270bdf6b61fc7d810795e08ebbe60931}{G\_RAID\_VOLUME\_RL\_RAID1}})}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l01198}01198                         \mbox{\hyperlink{g__raid__md__if_8m_aaa46aabd2a891668d71cec64e90b4848}{vol}}-\/>\mbox{\hyperlink{structg__raid__volume_ad81a0903c26424634b555fa29c0cd400}{v\_mediasize}} = size;}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l01199}01199                 \textcolor{keywordflow}{else} \textcolor{keywordflow}{if} (level == \mbox{\hyperlink{g__raid_8h_af6db015b03ea390243f2df897eb1189d}{G\_RAID\_VOLUME\_RL\_RAID5}})}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l01200}01200                         \mbox{\hyperlink{g__raid__md__if_8m_aaa46aabd2a891668d71cec64e90b4848}{vol}}-\/>\mbox{\hyperlink{structg__raid__volume_ad81a0903c26424634b555fa29c0cd400}{v\_mediasize}} = size * (numdisks -\/ 1);}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l01201}01201                 \textcolor{keywordflow}{else} \{ \textcolor{comment}{/* RAID1E */}}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l01202}01202                         \mbox{\hyperlink{g__raid__md__if_8m_aaa46aabd2a891668d71cec64e90b4848}{vol}}-\/>\mbox{\hyperlink{structg__raid__volume_ad81a0903c26424634b555fa29c0cd400}{v\_mediasize}} = ((size * numdisks) / strip / 2) *}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l01203}01203                             strip;}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l01204}01204                 \}}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l01205}01205                 \mbox{\hyperlink{g__raid__md__if_8m_aaa46aabd2a891668d71cec64e90b4848}{vol}}-\/>\mbox{\hyperlink{structg__raid__volume_af7b9dcf6621dc8d66be12ba187d5f34b}{v\_sectorsize}} = sectorsize;}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l01206}01206                 \mbox{\hyperlink{g__raid_8c_a7e6ffb9d11de08e7eaa3e36d1028aa28}{g\_raid\_start\_volume}}(\mbox{\hyperlink{g__raid__md__if_8m_aaa46aabd2a891668d71cec64e90b4848}{vol}});}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l01207}01207 }
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l01208}01208                 \textcolor{comment}{/* , and subdisks. */}}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l01209}01209                 TAILQ\_FOREACH(\mbox{\hyperlink{structdisk}{disk}}, \&sc-\/>sc\_disks, d\_next) \{}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l01210}01210                         pd = (\textcolor{keyword}{struct }\mbox{\hyperlink{structg__raid__md__jmicron__perdisk}{g\_raid\_md\_jmicron\_perdisk}} *)\mbox{\hyperlink{structdisk}{disk}}-\/>d\_md\_data;}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l01211}01211                         \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}}[pd-\/>\mbox{\hyperlink{structg__raid__md__jmicron__perdisk_a65960334e7c32b993e9ea104819243b9}{pd\_disk\_pos}}];}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l01212}01212                         \mbox{\hyperlink{g__raid__md__if_8m_a910062273088d146e8533398780701eb}{sd}}-\/>\mbox{\hyperlink{structg__raid__subdisk_a5570ab684f57213078d94750e63354e1}{sd\_disk}} = \mbox{\hyperlink{structdisk}{disk}};}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l01213}01213                         \mbox{\hyperlink{g__raid__md__if_8m_a910062273088d146e8533398780701eb}{sd}}-\/>\mbox{\hyperlink{structg__raid__subdisk_a9b4e12573b26ee18473a16408044819f}{sd\_offset}} = 0;}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l01214}01214                         \mbox{\hyperlink{g__raid__md__if_8m_a910062273088d146e8533398780701eb}{sd}}-\/>\mbox{\hyperlink{structg__raid__subdisk_abc4da1103e29e3a8e2bbadb18fbccbf6}{sd\_size}} = size;}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l01215}01215                         TAILQ\_INSERT\_TAIL(\&\mbox{\hyperlink{structdisk}{disk}}-\/>d\_subdisks, \mbox{\hyperlink{g__raid__md__if_8m_a910062273088d146e8533398780701eb}{sd}}, sd\_next);}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l01216}01216                         \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_a830f6bd55251c14ca26a7f8fceb06a89}{d\_consumer}} != NULL) \{}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l01217}01217                                 \mbox{\hyperlink{g__raid_8c_a342da571518e21e0521b6416c838d00e}{g\_raid\_change\_disk\_state}}(\mbox{\hyperlink{structdisk}{disk}},}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l01218}01218                                     \mbox{\hyperlink{g__raid_8h_aaf46a21394a57a2fcac34b1b7b52701c}{G\_RAID\_DISK\_S\_ACTIVE}});}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l01219}01219                                 \mbox{\hyperlink{g__raid_8c_a058db459d5349d2130fda3a02dd2af29}{g\_raid\_change\_subdisk\_state}}(\mbox{\hyperlink{g__raid__md__if_8m_a910062273088d146e8533398780701eb}{sd}},}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l01220}01220                                     \mbox{\hyperlink{g__raid_8h_a498effa0ffa87b75f6c40381c6d4eb39}{G\_RAID\_SUBDISK\_S\_ACTIVE}});}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l01221}01221                                 \mbox{\hyperlink{g__raid_8c_ac49cc1991dccaeef0743e0bc4f64e0b5}{g\_raid\_event\_send}}(\mbox{\hyperlink{g__raid__md__if_8m_a910062273088d146e8533398780701eb}{sd}}, \mbox{\hyperlink{g__raid_8h_ae59b963d99efabe56d8173f3ad914a07}{G\_RAID\_SUBDISK\_E\_NEW}},}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l01222}01222                                     \mbox{\hyperlink{g__raid_8h_ae6ac3f8d5dcaa73174e3e8bb9dd12f1c}{G\_RAID\_EVENT\_SUBDISK}});}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l01223}01223                         \} \textcolor{keywordflow}{else} \{}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l01224}01224                                 \mbox{\hyperlink{g__raid_8c_a342da571518e21e0521b6416c838d00e}{g\_raid\_change\_disk\_state}}(\mbox{\hyperlink{structdisk}{disk}}, \mbox{\hyperlink{g__raid_8h_aee552862c97f7442835d7c81b3399ac2}{G\_RAID\_DISK\_S\_OFFLINE}});}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l01225}01225                         \}}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l01226}01226                 \}}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l01227}01227 }
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l01228}01228                 \textcolor{comment}{/* Write metadata based on created entities. */}}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l01229}01229                 \mbox{\hyperlink{g__raid_8h_ace7234f8197b96e1b636f9376de8d7ea}{G\_RAID\_DEBUG1}}(0, sc, \textcolor{stringliteral}{"{}Array started."{}});}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l01230}01230                 \mbox{\hyperlink{md__jmicron_8c_aaf5dc9d91eb1d2ddad515c7844468905}{g\_raid\_md\_write\_jmicron}}(md, NULL, NULL, NULL);}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l01231}01231 }
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l01232}01232                 \textcolor{comment}{/* Pickup any STALE/SPARE disks to refill array if needed. */}}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l01233}01233                 \mbox{\hyperlink{md__jmicron_8c_ac7259021f21724898e2922acc5e087ca}{g\_raid\_md\_jmicron\_refill}}(sc);}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l01234}01234 }
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l01235}01235                 \mbox{\hyperlink{g__raid_8c_ac49cc1991dccaeef0743e0bc4f64e0b5}{g\_raid\_event\_send}}(\mbox{\hyperlink{g__raid__md__if_8m_aaa46aabd2a891668d71cec64e90b4848}{vol}}, \mbox{\hyperlink{g__raid_8h_ab4cc6f1792faa0f90f83ebf0f7217a9b}{G\_RAID\_VOLUME\_E\_START}},}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l01236}01236                     \mbox{\hyperlink{g__raid_8h_aa6f84af705b9b366dcb0e4aabd807667}{G\_RAID\_EVENT\_VOLUME}});}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l01237}01237                 \textcolor{keywordflow}{return} (0);}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l01238}01238         \}}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l01239}01239         \textcolor{keywordflow}{if} (strcmp(verb, \textcolor{stringliteral}{"{}delete"{}}) == 0) \{}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l01240}01240                 \textcolor{comment}{/* Check if some volume is still open. */}}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l01241}01241                 force = \mbox{\hyperlink{geom_8h_ab762d12640f528d8f1f60eee92bf5f3b}{gctl\_get\_paraml}}(\mbox{\hyperlink{g__part__if_8m_a7a9f20c97e75f805eb506910bd3e70d3}{req}}, \textcolor{stringliteral}{"{}force"{}}, \textcolor{keyword}{sizeof}(*force));}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l01242}01242                 \textcolor{keywordflow}{if} (force != NULL \&\& *force == 0 \&\&}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l01243}01243                     \mbox{\hyperlink{g__raid_8c_a58ee15b5e8995450f68f052f5fe277bd}{g\_raid\_nopens}}(sc) != 0) \{}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l01244}01244                         \mbox{\hyperlink{geom_8h_a1d51201471b52be7e19a98b0fcb144de}{gctl\_error}}(\mbox{\hyperlink{g__part__if_8m_a7a9f20c97e75f805eb506910bd3e70d3}{req}}, \textcolor{stringliteral}{"{}Some volume is still open."{}});}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l01245}01245                         \textcolor{keywordflow}{return} (-\/4);}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l01246}01246                 \}}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l01247}01247 }
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l01248}01248                 TAILQ\_FOREACH(\mbox{\hyperlink{structdisk}{disk}}, \&sc-\/>sc\_disks, d\_next) \{}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l01249}01249                         \textcolor{keywordflow}{if} (\mbox{\hyperlink{structdisk}{disk}}-\/>d\_consumer)}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l01250}01250                                 \mbox{\hyperlink{md__jmicron_8c_a5698e75f0b5354588271d5d4e0550bfc}{jmicron\_meta\_erase}}(\mbox{\hyperlink{structdisk}{disk}}-\/>d\_consumer);}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l01251}01251                 \}}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l01252}01252                 \mbox{\hyperlink{g__raid_8c_a99807e6db37e78d1738e46dfd48b7b5c}{g\_raid\_destroy\_node}}(sc, 0);}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l01253}01253                 \textcolor{keywordflow}{return} (0);}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l01254}01254         \}}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l01255}01255         \textcolor{keywordflow}{if} (strcmp(verb, \textcolor{stringliteral}{"{}remove"{}}) == 0 ||}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l01256}01256             strcmp(verb, \textcolor{stringliteral}{"{}fail"{}}) == 0) \{}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l01257}01257                 \textcolor{keywordflow}{if} (*nargs < 2) \{}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l01258}01258                         \mbox{\hyperlink{geom_8h_a1d51201471b52be7e19a98b0fcb144de}{gctl\_error}}(\mbox{\hyperlink{g__part__if_8m_a7a9f20c97e75f805eb506910bd3e70d3}{req}}, \textcolor{stringliteral}{"{}Invalid number of arguments."{}});}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l01259}01259                         \textcolor{keywordflow}{return} (-\/1);}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l01260}01260                 \}}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l01261}01261                 \textcolor{keywordflow}{for} (i = 1; i < *nargs; i++) \{}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l01262}01262                         snprintf(arg, \textcolor{keyword}{sizeof}(arg), \textcolor{stringliteral}{"{}arg\%d"{}}, i);}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l01263}01263                         diskname = \mbox{\hyperlink{geom_8h_ada33526012aac8ee446617bb3749a07c}{gctl\_get\_asciiparam}}(\mbox{\hyperlink{g__part__if_8m_a7a9f20c97e75f805eb506910bd3e70d3}{req}}, arg);}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l01264}01264                         \textcolor{keywordflow}{if} (diskname == NULL) \{}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l01265}01265                                 \mbox{\hyperlink{geom_8h_a1d51201471b52be7e19a98b0fcb144de}{gctl\_error}}(\mbox{\hyperlink{g__part__if_8m_a7a9f20c97e75f805eb506910bd3e70d3}{req}}, \textcolor{stringliteral}{"{}No disk name (\%s)."{}}, arg);}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l01266}01266                                 error = -\/2;}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l01267}01267                                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l01268}01268                         \}}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l01269}01269                         \textcolor{keywordflow}{if} (strncmp(diskname, \mbox{\hyperlink{geom_8h_a9e429780e6e3bb32284b54630bc60a0d}{\_PATH\_DEV}}, 5) == 0)}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l01270}01270                                 diskname += 5;}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l01271}01271 }
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l01272}01272                         TAILQ\_FOREACH(\mbox{\hyperlink{structdisk}{disk}}, \&sc-\/>sc\_disks, d\_next) \{}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l01273}01273                                 \textcolor{keywordflow}{if} (\mbox{\hyperlink{structdisk}{disk}}-\/>d\_consumer != NULL \&\& }
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l01274}01274                                     \mbox{\hyperlink{structdisk}{disk}}-\/>d\_consumer-\/>provider != NULL \&\&}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l01275}01275                                     strcmp(\mbox{\hyperlink{structdisk}{disk}}-\/>d\_consumer-\/>provider-\/>name,}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l01276}01276                                      diskname) == 0)}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l01277}01277                                         \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l01278}01278                         \}}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l01279}01279                         \textcolor{keywordflow}{if} (\mbox{\hyperlink{structdisk}{disk}} == NULL) \{}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l01280}01280                                 \mbox{\hyperlink{geom_8h_a1d51201471b52be7e19a98b0fcb144de}{gctl\_error}}(\mbox{\hyperlink{g__part__if_8m_a7a9f20c97e75f805eb506910bd3e70d3}{req}}, \textcolor{stringliteral}{"{}Disk '\%s' not found."{}},}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l01281}01281                                     diskname);}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l01282}01282                                 error = -\/3;}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l01283}01283                                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l01284}01284                         \}}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l01285}01285 }
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l01286}01286                         \textcolor{keywordflow}{if} (strcmp(verb, \textcolor{stringliteral}{"{}fail"{}}) == 0) \{}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l01287}01287                                 \mbox{\hyperlink{md__jmicron_8c_aa81b7896dc923ed3557af65493e17a9d}{g\_raid\_md\_fail\_disk\_jmicron}}(md, NULL, \mbox{\hyperlink{structdisk}{disk}});}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l01288}01288                                 \textcolor{keywordflow}{continue};}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l01289}01289                         \}}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l01290}01290 }
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l01291}01291                         pd = (\textcolor{keyword}{struct }\mbox{\hyperlink{structg__raid__md__jmicron__perdisk}{g\_raid\_md\_jmicron\_perdisk}} *)\mbox{\hyperlink{structdisk}{disk}}-\/>d\_md\_data;}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l01292}01292 }
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l01293}01293                         \textcolor{comment}{/* Erase metadata on deleting disk. */}}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l01294}01294                         \mbox{\hyperlink{md__jmicron_8c_a5698e75f0b5354588271d5d4e0550bfc}{jmicron\_meta\_erase}}(\mbox{\hyperlink{structdisk}{disk}}-\/>d\_consumer);}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l01295}01295 }
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l01296}01296                         \textcolor{comment}{/* If disk was assigned, just update statuses. */}}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l01297}01297                         \textcolor{keywordflow}{if} (pd-\/>\mbox{\hyperlink{structg__raid__md__jmicron__perdisk_a65960334e7c32b993e9ea104819243b9}{pd\_disk\_pos}} >= 0) \{}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l01298}01298                                 \mbox{\hyperlink{g__raid_8c_a342da571518e21e0521b6416c838d00e}{g\_raid\_change\_disk\_state}}(\mbox{\hyperlink{structdisk}{disk}}, \mbox{\hyperlink{g__raid_8h_aee552862c97f7442835d7c81b3399ac2}{G\_RAID\_DISK\_S\_OFFLINE}});}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l01299}01299                                 \mbox{\hyperlink{g__raid_8c_abedf322bff3060596a6f822db290b9f3}{g\_raid\_kill\_consumer}}(sc, \mbox{\hyperlink{structdisk}{disk}}-\/>d\_consumer);}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l01300}01300                                 \mbox{\hyperlink{structdisk}{disk}}-\/>d\_consumer = NULL;}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l01301}01301                                 TAILQ\_FOREACH(\mbox{\hyperlink{g__raid__md__if_8m_a910062273088d146e8533398780701eb}{sd}}, \&\mbox{\hyperlink{structdisk}{disk}}-\/>d\_subdisks, sd\_next) \{}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l01302}01302                                         \mbox{\hyperlink{g__raid_8c_a058db459d5349d2130fda3a02dd2af29}{g\_raid\_change\_subdisk\_state}}(\mbox{\hyperlink{g__raid__md__if_8m_a910062273088d146e8533398780701eb}{sd}},}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l01303}01303                                             \mbox{\hyperlink{g__raid_8h_af37111ba44cfc01a98d97bed8f60d964}{G\_RAID\_SUBDISK\_S\_NONE}});}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l01304}01304                                         \mbox{\hyperlink{g__raid_8c_ac49cc1991dccaeef0743e0bc4f64e0b5}{g\_raid\_event\_send}}(\mbox{\hyperlink{g__raid__md__if_8m_a910062273088d146e8533398780701eb}{sd}}, \mbox{\hyperlink{g__raid_8h_a1323466893d4ab83ea4c87e89e02fd06}{G\_RAID\_SUBDISK\_E\_DISCONNECTED}},}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l01305}01305                                             \mbox{\hyperlink{g__raid_8h_ae6ac3f8d5dcaa73174e3e8bb9dd12f1c}{G\_RAID\_EVENT\_SUBDISK}});}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l01306}01306                                 \}}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l01307}01307                         \} \textcolor{keywordflow}{else} \{}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l01308}01308                                 \textcolor{comment}{/* Otherwise -\/-\/ delete. */}}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l01309}01309                                 \mbox{\hyperlink{g__raid_8c_a342da571518e21e0521b6416c838d00e}{g\_raid\_change\_disk\_state}}(\mbox{\hyperlink{structdisk}{disk}}, \mbox{\hyperlink{g__raid_8h_ad090f72fa79be3f1a59687ba60f85510}{G\_RAID\_DISK\_S\_NONE}});}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l01310}01310                                 \mbox{\hyperlink{g__raid_8c_ac1e32d950d9354f1dca5d2ca34244adc}{g\_raid\_destroy\_disk}}(\mbox{\hyperlink{structdisk}{disk}});}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l01311}01311                         \}}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l01312}01312                 \}}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l01313}01313 }
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l01314}01314                 \textcolor{comment}{/* Write updated metadata to remaining disks. */}}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l01315}01315                 \mbox{\hyperlink{md__jmicron_8c_aaf5dc9d91eb1d2ddad515c7844468905}{g\_raid\_md\_write\_jmicron}}(md, NULL, NULL, NULL);}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l01316}01316 }
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l01317}01317                 \textcolor{comment}{/* Check if anything left except placeholders. */}}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l01318}01318                 \textcolor{keywordflow}{if} (\mbox{\hyperlink{g__raid_8c_ad1004201fc232c60faacd7bd3f3b604f}{g\_raid\_ndisks}}(sc, -\/1) ==}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l01319}01319                     \mbox{\hyperlink{g__raid_8c_ad1004201fc232c60faacd7bd3f3b604f}{g\_raid\_ndisks}}(sc, \mbox{\hyperlink{g__raid_8h_aee552862c97f7442835d7c81b3399ac2}{G\_RAID\_DISK\_S\_OFFLINE}}))}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l01320}01320                         \mbox{\hyperlink{g__raid_8c_a99807e6db37e78d1738e46dfd48b7b5c}{g\_raid\_destroy\_node}}(sc, 0);}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l01321}01321                 \textcolor{keywordflow}{else}}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l01322}01322                         \mbox{\hyperlink{md__jmicron_8c_ac7259021f21724898e2922acc5e087ca}{g\_raid\_md\_jmicron\_refill}}(sc);}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l01323}01323                 \textcolor{keywordflow}{return} (error);}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l01324}01324         \}}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l01325}01325         \textcolor{keywordflow}{if} (strcmp(verb, \textcolor{stringliteral}{"{}insert"{}}) == 0) \{}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l01326}01326                 \textcolor{keywordflow}{if} (*nargs < 2) \{}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l01327}01327                         \mbox{\hyperlink{geom_8h_a1d51201471b52be7e19a98b0fcb144de}{gctl\_error}}(\mbox{\hyperlink{g__part__if_8m_a7a9f20c97e75f805eb506910bd3e70d3}{req}}, \textcolor{stringliteral}{"{}Invalid number of arguments."{}});}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l01328}01328                         \textcolor{keywordflow}{return} (-\/1);}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l01329}01329                 \}}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l01330}01330                 update = 0;}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l01331}01331                 \textcolor{keywordflow}{for} (i = 1; i < *nargs; i++) \{}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l01332}01332                         \textcolor{comment}{/* Get disk name. */}}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l01333}01333                         snprintf(arg, \textcolor{keyword}{sizeof}(arg), \textcolor{stringliteral}{"{}arg\%d"{}}, i);}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l01334}01334                         diskname = \mbox{\hyperlink{geom_8h_ada33526012aac8ee446617bb3749a07c}{gctl\_get\_asciiparam}}(\mbox{\hyperlink{g__part__if_8m_a7a9f20c97e75f805eb506910bd3e70d3}{req}}, arg);}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l01335}01335                         \textcolor{keywordflow}{if} (diskname == NULL) \{}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l01336}01336                                 \mbox{\hyperlink{geom_8h_a1d51201471b52be7e19a98b0fcb144de}{gctl\_error}}(\mbox{\hyperlink{g__part__if_8m_a7a9f20c97e75f805eb506910bd3e70d3}{req}}, \textcolor{stringliteral}{"{}No disk name (\%s)."{}}, arg);}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l01337}01337                                 error = -\/3;}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l01338}01338                                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l01339}01339                         \}}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l01340}01340 }
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l01341}01341                         \textcolor{comment}{/* Try to find provider with specified name. */}}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l01342}01342                         \mbox{\hyperlink{geom_8h_a232419d2cfa06ff3f4ff7551041aed31}{g\_topology\_lock}}();}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l01343}01343                         \mbox{\hyperlink{g__part__if_8m_a294f18324585ff37641fb8aa1c9ccd82}{cp}} = \mbox{\hyperlink{g__raid_8c_acc4d5f993651e14eb607d9efe39061c8}{g\_raid\_open\_consumer}}(sc, diskname);}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l01344}01344                         \textcolor{keywordflow}{if} (\mbox{\hyperlink{g__part__if_8m_a294f18324585ff37641fb8aa1c9ccd82}{cp}} == NULL) \{}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l01345}01345                                 \mbox{\hyperlink{geom_8h_a1d51201471b52be7e19a98b0fcb144de}{gctl\_error}}(\mbox{\hyperlink{g__part__if_8m_a7a9f20c97e75f805eb506910bd3e70d3}{req}}, \textcolor{stringliteral}{"{}Can't open disk '\%s'."{}},}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l01346}01346                                     diskname);}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l01347}01347                                 \mbox{\hyperlink{geom_8h_a4628d4de49ba84e7a6126cc30d23b83a}{g\_topology\_unlock}}();}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l01348}01348                                 error = -\/4;}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l01349}01349                                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l01350}01350                         \}}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l01351}01351                         \mbox{\hyperlink{g__part__if_8m_a9bc7638f295763b77465c5ebebbd3442}{pp}} = \mbox{\hyperlink{g__part__if_8m_a294f18324585ff37641fb8aa1c9ccd82}{cp}}-\/>\mbox{\hyperlink{structg__consumer_a6435d5aec0376e995dce3131fd3beb52}{provider}};}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l01352}01352 }
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l01353}01353                         pd = malloc(\textcolor{keyword}{sizeof}(*pd), M\_MD\_JMICRON, M\_WAITOK | M\_ZERO);}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l01354}01354                         pd-\/>\mbox{\hyperlink{structg__raid__md__jmicron__perdisk_a65960334e7c32b993e9ea104819243b9}{pd\_disk\_pos}} = -\/3;}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l01355}01355                         pd-\/>\mbox{\hyperlink{structg__raid__md__jmicron__perdisk_a46a598fbfa7cbd51384eb2ea86325455}{pd\_disk\_id}} = arc4random() \& \mbox{\hyperlink{md__jmicron_8c_ae5a6c6dc90a396412a801d5e62abf05f}{JMICRON\_DISK\_MASK}};}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l01356}01356                         pd-\/>\mbox{\hyperlink{structg__raid__md__jmicron__perdisk_a1a732ac096c218a73964b0bbecb9b236}{pd\_disk\_size}} = \mbox{\hyperlink{g__part__if_8m_a9bc7638f295763b77465c5ebebbd3442}{pp}}-\/>\mbox{\hyperlink{structg__provider_a8f47c464c78aa91fa4ca5143ed3cd15e}{mediasize}};}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l01357}01357 }
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l01358}01358                         \mbox{\hyperlink{structdisk}{disk}} = \mbox{\hyperlink{g__raid_8c_a7d896eb1612c17408eedbdda2032e897}{g\_raid\_create\_disk}}(sc);}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l01359}01359                         \mbox{\hyperlink{structdisk}{disk}}-\/>d\_consumer = \mbox{\hyperlink{g__part__if_8m_a294f18324585ff37641fb8aa1c9ccd82}{cp}};}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l01360}01360                         \mbox{\hyperlink{structdisk}{disk}}-\/>d\_md\_data = (\textcolor{keywordtype}{void} *)pd;}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l01361}01361                         \mbox{\hyperlink{g__part__if_8m_a294f18324585ff37641fb8aa1c9ccd82}{cp}}-\/>\mbox{\hyperlink{structg__consumer_a11273c1281d0cffbc3383eb4e49e7010}{private}} = \mbox{\hyperlink{g__raid__md__if_8m_a9508e997a57ea259d6ecc0e563261993}{disk}};}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l01362}01362                         \mbox{\hyperlink{geom_8h_a4628d4de49ba84e7a6126cc30d23b83a}{g\_topology\_unlock}}();}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l01363}01363 }
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l01364}01364                         \mbox{\hyperlink{g__raid_8c_afbb51abcd221460c50c23ecc69be3114}{g\_raid\_get\_disk\_info}}(\mbox{\hyperlink{structdisk}{disk}});}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l01365}01365 }
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l01366}01366                         \textcolor{comment}{/* Welcome the "{}new"{} disk. */}}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l01367}01367                         update += \mbox{\hyperlink{md__jmicron_8c_ac0f68e614510a006ddebb34dc929f1af}{g\_raid\_md\_jmicron\_start\_disk}}(\mbox{\hyperlink{structdisk}{disk}});}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l01368}01368                         \textcolor{keywordflow}{if} (\mbox{\hyperlink{structdisk}{disk}}-\/>d\_state != \mbox{\hyperlink{g__raid_8h_aaf46a21394a57a2fcac34b1b7b52701c}{G\_RAID\_DISK\_S\_ACTIVE}} \&\&}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l01369}01369                             \mbox{\hyperlink{structdisk}{disk}}-\/>d\_state != \mbox{\hyperlink{g__raid_8h_a53208a3eca6d67917c6fdf6321292c99}{G\_RAID\_DISK\_S\_SPARE}}) \{}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l01370}01370                                 \mbox{\hyperlink{geom_8h_a1d51201471b52be7e19a98b0fcb144de}{gctl\_error}}(\mbox{\hyperlink{g__part__if_8m_a7a9f20c97e75f805eb506910bd3e70d3}{req}}, \textcolor{stringliteral}{"{}Disk '\%s' doesn't fit."{}},}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l01371}01371                                     diskname);}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l01372}01372                                 \mbox{\hyperlink{g__raid_8c_ac1e32d950d9354f1dca5d2ca34244adc}{g\_raid\_destroy\_disk}}(\mbox{\hyperlink{structdisk}{disk}});}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l01373}01373                                 error = -\/8;}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l01374}01374                                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l01375}01375                         \}}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l01376}01376                 \}}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l01377}01377 }
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l01378}01378                 \textcolor{comment}{/* Write new metadata if we changed something. */}}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l01379}01379                 \textcolor{keywordflow}{if} (update)}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l01380}01380                         \mbox{\hyperlink{md__jmicron_8c_aaf5dc9d91eb1d2ddad515c7844468905}{g\_raid\_md\_write\_jmicron}}(md, NULL, NULL, NULL);}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l01381}01381                 \textcolor{keywordflow}{return} (error);}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l01382}01382         \}}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l01383}01383         \mbox{\hyperlink{geom_8h_a1d51201471b52be7e19a98b0fcb144de}{gctl\_error}}(\mbox{\hyperlink{g__part__if_8m_a7a9f20c97e75f805eb506910bd3e70d3}{req}}, \textcolor{stringliteral}{"{}Command '\%s' is not supported."{}}, verb);}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l01384}01384         \textcolor{keywordflow}{return} (-\/100);}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l01385}01385 \}}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l01386}01386 }
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l01387}01387 \textcolor{keyword}{static} \textcolor{keywordtype}{int}}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l01388}\mbox{\hyperlink{md__jmicron_8c_a244a7e73b444a07346fed9e8adf350d0}{01388}} \mbox{\hyperlink{md__jmicron_8c_aaf5dc9d91eb1d2ddad515c7844468905}{g\_raid\_md\_write\_jmicron}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structg__raid__md__object}{g\_raid\_md\_object}} *md, \textcolor{keyword}{struct} \mbox{\hyperlink{structg__raid__volume}{g\_raid\_volume}} *tvol,}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l01389}01389     \textcolor{keyword}{struct} \mbox{\hyperlink{structg__raid__subdisk}{g\_raid\_subdisk}} *tsd, \textcolor{keyword}{struct} \mbox{\hyperlink{structg__raid__disk}{g\_raid\_disk}} *tdisk)}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l01390}01390 \{}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l01391}01391         \textcolor{keyword}{struct }\mbox{\hyperlink{structg__raid__softc}{g\_raid\_softc}} *sc;}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l01392}01392         \textcolor{keyword}{struct }\mbox{\hyperlink{structg__raid__volume}{g\_raid\_volume}} *\mbox{\hyperlink{g__raid__md__if_8m_aaa46aabd2a891668d71cec64e90b4848}{vol}};}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l01393}01393         \textcolor{keyword}{struct }\mbox{\hyperlink{structg__raid__subdisk}{g\_raid\_subdisk}} *\mbox{\hyperlink{g__raid__md__if_8m_a910062273088d146e8533398780701eb}{sd}};}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l01394}01394         \textcolor{keyword}{struct }\mbox{\hyperlink{structg__raid__disk}{g\_raid\_disk}} *\mbox{\hyperlink{g__raid__md__if_8m_a9508e997a57ea259d6ecc0e563261993}{disk}};}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l01395}01395         \textcolor{keyword}{struct }\mbox{\hyperlink{structg__raid__md__jmicron__object}{g\_raid\_md\_jmicron\_object}} *mdi;}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l01396}01396         \textcolor{keyword}{struct }\mbox{\hyperlink{structg__raid__md__jmicron__perdisk}{g\_raid\_md\_jmicron\_perdisk}} *pd;}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l01397}01397         \textcolor{keyword}{struct }\mbox{\hyperlink{structjmicron__raid__conf}{jmicron\_raid\_conf}} *meta;}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l01398}01398         \textcolor{keywordtype}{int} i, spares;}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l01399}01399 }
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l01400}01400         sc = md-\/>\mbox{\hyperlink{structg__raid__md__object_a4acc92ca2582509c74947d83b258e31d}{mdo\_softc}};}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l01401}01401         mdi = (\textcolor{keyword}{struct }\mbox{\hyperlink{structg__raid__md__jmicron__object}{g\_raid\_md\_jmicron\_object}} *)md;}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l01402}01402 }
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l01403}01403         \textcolor{keywordflow}{if} (sc-\/>\mbox{\hyperlink{structg__raid__softc_a92d7a08f5e32fa07a7b8769b5b3ca4f4}{sc\_stopping}} == \mbox{\hyperlink{g__raid_8h_ae019bb639a31951ab4cf8dad7f68e46a}{G\_RAID\_DESTROY\_HARD}})}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l01404}01404                 \textcolor{keywordflow}{return} (0);}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l01405}01405 }
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l01406}01406         \textcolor{comment}{/* There is only one volume. */}}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l01407}01407         \mbox{\hyperlink{g__raid__md__if_8m_aaa46aabd2a891668d71cec64e90b4848}{vol}} = TAILQ\_FIRST(\&sc-\/>sc\_volumes);}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l01408}01408 }
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l01409}01409         \textcolor{comment}{/* Fill global fields. */}}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l01410}01410         meta = malloc(\textcolor{keyword}{sizeof}(*meta), M\_MD\_JMICRON, M\_WAITOK | M\_ZERO);}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l01411}01411         strncpy(meta-\/>\mbox{\hyperlink{structjmicron__raid__conf_a31dabc190b0678711e27f5c2edcee307}{signature}}, \mbox{\hyperlink{md__jmicron_8c_addff85c305efbce93d954c396f7a9469}{JMICRON\_MAGIC}}, 2);}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l01412}01412         meta-\/>\mbox{\hyperlink{structjmicron__raid__conf_ad13be346660399b7d0027f1b9011158d}{version}} = \mbox{\hyperlink{md__jmicron_8c_add07c2bcc8c2b7ecbcf66c887b6d8064}{JMICRON\_VERSION}};}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l01413}01413         \mbox{\hyperlink{md__jmicron_8c_a66e01e79614d404aad6e1b25d0ed22c7}{jmicron\_meta\_put\_name}}(meta, \mbox{\hyperlink{g__raid__md__if_8m_aaa46aabd2a891668d71cec64e90b4848}{vol}}-\/>\mbox{\hyperlink{structg__raid__volume_abdedb24b3ca3f4d3020f94e62d63fa05}{v\_name}});}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l01414}01414         \textcolor{keywordflow}{if} (\mbox{\hyperlink{g__raid__md__if_8m_aaa46aabd2a891668d71cec64e90b4848}{vol}}-\/>\mbox{\hyperlink{structg__raid__volume_ab7c2840f8398e5a91b560d7644957a57}{v\_raid\_level}} == \mbox{\hyperlink{g__raid_8h_a6a49f4ddd0b45eb4210ce72528786a32}{G\_RAID\_VOLUME\_RL\_RAID0}})}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l01415}01415                 meta-\/>\mbox{\hyperlink{structjmicron__raid__conf_a076e01c2fe3b5654d104b77c45fc55da}{type}} = \mbox{\hyperlink{md__jmicron_8c_a1f2855e53c0606e6acadc2296d44c5dc}{JMICRON\_T\_RAID0}};}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l01416}01416         \textcolor{keywordflow}{else} \textcolor{keywordflow}{if} (\mbox{\hyperlink{g__raid__md__if_8m_aaa46aabd2a891668d71cec64e90b4848}{vol}}-\/>\mbox{\hyperlink{structg__raid__volume_ab7c2840f8398e5a91b560d7644957a57}{v\_raid\_level}} == \mbox{\hyperlink{g__raid_8h_a270bdf6b61fc7d810795e08ebbe60931}{G\_RAID\_VOLUME\_RL\_RAID1}})}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l01417}01417                 meta-\/>\mbox{\hyperlink{structjmicron__raid__conf_a076e01c2fe3b5654d104b77c45fc55da}{type}} = \mbox{\hyperlink{md__jmicron_8c_af37a98d5205a0567ca4348bd1d009ae3}{JMICRON\_T\_RAID1}};}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l01418}01418         \textcolor{keywordflow}{else} \textcolor{keywordflow}{if} (\mbox{\hyperlink{g__raid__md__if_8m_aaa46aabd2a891668d71cec64e90b4848}{vol}}-\/>\mbox{\hyperlink{structg__raid__volume_ab7c2840f8398e5a91b560d7644957a57}{v\_raid\_level}} == \mbox{\hyperlink{g__raid_8h_ad0ef2cd50760a49759a6cbaf2afeb286}{G\_RAID\_VOLUME\_RL\_RAID1E}})}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l01419}01419                 meta-\/>\mbox{\hyperlink{structjmicron__raid__conf_a076e01c2fe3b5654d104b77c45fc55da}{type}} = \mbox{\hyperlink{md__jmicron_8c_acefecc0e95e211d13000451fa8ef8737}{JMICRON\_T\_RAID01}};}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l01420}01420         \textcolor{keywordflow}{else} \textcolor{keywordflow}{if} (\mbox{\hyperlink{g__raid__md__if_8m_aaa46aabd2a891668d71cec64e90b4848}{vol}}-\/>\mbox{\hyperlink{structg__raid__volume_ab7c2840f8398e5a91b560d7644957a57}{v\_raid\_level}} == \mbox{\hyperlink{g__raid_8h_abc695e94a9e4eff0f657ec01d1f19607}{G\_RAID\_VOLUME\_RL\_CONCAT}} ||}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l01421}01421             \mbox{\hyperlink{g__raid__md__if_8m_aaa46aabd2a891668d71cec64e90b4848}{vol}}-\/>\mbox{\hyperlink{structg__raid__volume_ab7c2840f8398e5a91b560d7644957a57}{v\_raid\_level}} == \mbox{\hyperlink{g__raid_8h_acb418af006a1d84e0dd912c58cec6f57}{G\_RAID\_VOLUME\_RL\_SINGLE}})}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l01422}01422                 meta-\/>\mbox{\hyperlink{structjmicron__raid__conf_a076e01c2fe3b5654d104b77c45fc55da}{type}} = \mbox{\hyperlink{md__jmicron_8c_a3985571252d6b7de9ca4faa7e1c0529c}{JMICRON\_T\_CONCAT}};}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l01423}01423         \textcolor{keywordflow}{else}}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l01424}01424                 meta-\/>\mbox{\hyperlink{structjmicron__raid__conf_a076e01c2fe3b5654d104b77c45fc55da}{type}} = \mbox{\hyperlink{md__jmicron_8c_a21789928e250aa273d03b1c2f9dee985}{JMICRON\_T\_RAID5}};}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l01425}01425         meta-\/>\mbox{\hyperlink{structjmicron__raid__conf_a3d27c760d3541ed0dda17ea03c65b987}{stripe\_shift}} = fls(\mbox{\hyperlink{g__raid__md__if_8m_aaa46aabd2a891668d71cec64e90b4848}{vol}}-\/>\mbox{\hyperlink{structg__raid__volume_af0ca6a1c61e893f02a43ca29953c8e39}{v\_strip\_size}} / 2048);}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l01426}01426         meta-\/>\mbox{\hyperlink{structjmicron__raid__conf_a6bd3f9f2cf164a45a43c2519edfab653}{flags}} = \mbox{\hyperlink{md__jmicron_8c_a463dfe2e77c2c4fec9436159c5c35597}{JMICRON\_F\_READY}} | \mbox{\hyperlink{md__jmicron_8c_a3e2e37f75591c68c2a7d7eddbf7821ba}{JMICRON\_F\_BOOTABLE}};}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l01427}01427         \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{md__jmicron_8c_source_l01428}01428                 \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{md__jmicron_8c_source_l01429}01429                 \textcolor{keywordflow}{if} (\mbox{\hyperlink{g__raid__md__if_8m_a910062273088d146e8533398780701eb}{sd}}-\/>\mbox{\hyperlink{structg__raid__subdisk_a5570ab684f57213078d94750e63354e1}{sd\_disk}} == NULL || \mbox{\hyperlink{g__raid__md__if_8m_a910062273088d146e8533398780701eb}{sd}}-\/>\mbox{\hyperlink{structg__raid__subdisk_a5570ab684f57213078d94750e63354e1}{sd\_disk}}-\/>\mbox{\hyperlink{structg__raid__disk_ab6681cb16ceeb79b9e88d639eca0bd9e}{d\_md\_data}} == NULL)}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l01430}01430                         meta-\/>\mbox{\hyperlink{structjmicron__raid__conf_a1b06fd2819bf2a863f9b8115413bc47a}{disks}}[i] = 0xffffffff;}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l01431}01431                 \textcolor{keywordflow}{else} \{}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l01432}01432                         pd = (\textcolor{keyword}{struct }\mbox{\hyperlink{structg__raid__md__jmicron__perdisk}{g\_raid\_md\_jmicron\_perdisk}} *)}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l01433}01433                             \mbox{\hyperlink{g__raid__md__if_8m_a910062273088d146e8533398780701eb}{sd}}-\/>\mbox{\hyperlink{structg__raid__subdisk_a5570ab684f57213078d94750e63354e1}{sd\_disk}}-\/>\mbox{\hyperlink{structg__raid__disk_ab6681cb16ceeb79b9e88d639eca0bd9e}{d\_md\_data}};}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l01434}01434                         meta-\/>\mbox{\hyperlink{structjmicron__raid__conf_a1b06fd2819bf2a863f9b8115413bc47a}{disks}}[i] = pd-\/>\mbox{\hyperlink{structg__raid__md__jmicron__perdisk_a46a598fbfa7cbd51384eb2ea86325455}{pd\_disk\_id}};}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l01435}01435                 \}}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l01436}01436                 \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_a41bff35bee21218d2aba7a261eb2e83c}{G\_RAID\_SUBDISK\_S\_STALE}})}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l01437}01437                         meta-\/>\mbox{\hyperlink{structjmicron__raid__conf_a6bd3f9f2cf164a45a43c2519edfab653}{flags}} |= \mbox{\hyperlink{md__jmicron_8c_a82560a77e932e075c6f4b87eda94c7d9}{JMICRON\_F\_BADSEC}};}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l01438}01438                 \textcolor{keywordflow}{if} (\mbox{\hyperlink{g__raid__md__if_8m_aaa46aabd2a891668d71cec64e90b4848}{vol}}-\/>\mbox{\hyperlink{structg__raid__volume_a1c672df93d899cfd72dc0f9b1f4e7139}{v\_dirty}})}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l01439}01439                         meta-\/>\mbox{\hyperlink{structjmicron__raid__conf_a6bd3f9f2cf164a45a43c2519edfab653}{flags}} |= \mbox{\hyperlink{md__jmicron_8c_a858950190a80ad6c735e15d5cb2ddfa8}{JMICRON\_F\_UNSYNC}};}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l01440}01440         \}}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l01441}01441 }
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l01442}01442         \textcolor{comment}{/* Put spares to their slots. */}}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l01443}01443         spares = 0;}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l01444}01444         TAILQ\_FOREACH(\mbox{\hyperlink{structdisk}{disk}}, \&sc-\/>sc\_disks, d\_next) \{}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l01445}01445                 pd = (\textcolor{keyword}{struct }\mbox{\hyperlink{structg__raid__md__jmicron__perdisk}{g\_raid\_md\_jmicron\_perdisk}} *)\mbox{\hyperlink{structdisk}{disk}}-\/>d\_md\_data;}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l01446}01446                 if (\mbox{\hyperlink{structdisk}{disk}}-\/>d\_state != \mbox{\hyperlink{g__raid_8h_a53208a3eca6d67917c6fdf6321292c99}{G\_RAID\_DISK\_S\_SPARE}})}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l01447}01447                         \textcolor{keywordflow}{continue};}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l01448}01448                 meta-\/>\mbox{\hyperlink{structjmicron__raid__conf_acf1f91a97139967cb07ef752a6cc993d}{spare}}[spares] = pd-\/>\mbox{\hyperlink{structg__raid__md__jmicron__perdisk_a46a598fbfa7cbd51384eb2ea86325455}{pd\_disk\_id}};}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l01449}01449                 \textcolor{keywordflow}{if} (++spares >= 2)}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l01450}01450                         \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l01451}01451         \}}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l01452}01452 }
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l01453}01453         \textcolor{comment}{/* We are done. Print meta data and store them to disks. */}}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l01454}01454         \textcolor{keywordflow}{if} (mdi-\/>\mbox{\hyperlink{structg__raid__md__jmicron__object_a99dfc14fc8a6fe56d6822564249c3a54}{mdio\_meta}} != NULL)}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l01455}01455                 \mbox{\hyperlink{g__raid__md__if_8m_a4df9edb2717b3f7e4c3c903878577a54}{free}}(mdi-\/>\mbox{\hyperlink{structg__raid__md__jmicron__object_a99dfc14fc8a6fe56d6822564249c3a54}{mdio\_meta}}, M\_MD\_JMICRON);}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l01456}01456         mdi-\/>\mbox{\hyperlink{structg__raid__md__jmicron__object_a99dfc14fc8a6fe56d6822564249c3a54}{mdio\_meta}} = meta;}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l01457}01457         TAILQ\_FOREACH(\mbox{\hyperlink{structdisk}{disk}}, \&sc-\/>sc\_disks, d\_next) \{}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l01458}01458                 pd = (\textcolor{keyword}{struct }\mbox{\hyperlink{structg__raid__md__jmicron__perdisk}{g\_raid\_md\_jmicron\_perdisk}} *)\mbox{\hyperlink{structdisk}{disk}}-\/>d\_md\_data;}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l01459}01459                 if (\mbox{\hyperlink{structdisk}{disk}}-\/>d\_state != \mbox{\hyperlink{g__raid_8h_aaf46a21394a57a2fcac34b1b7b52701c}{G\_RAID\_DISK\_S\_ACTIVE}} \&\&}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l01460}01460                     \mbox{\hyperlink{structdisk}{disk}}-\/>d\_state != \mbox{\hyperlink{g__raid_8h_a53208a3eca6d67917c6fdf6321292c99}{G\_RAID\_DISK\_S\_SPARE}})}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l01461}01461                         \textcolor{keywordflow}{continue};}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l01462}01462                 \textcolor{keywordflow}{if} (pd-\/>\mbox{\hyperlink{structg__raid__md__jmicron__perdisk_ac2b4421d277ebd509be1854f4c1e1f53}{pd\_meta}} != NULL) \{}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l01463}01463                         \mbox{\hyperlink{g__raid__md__if_8m_a4df9edb2717b3f7e4c3c903878577a54}{free}}(pd-\/>\mbox{\hyperlink{structg__raid__md__jmicron__perdisk_ac2b4421d277ebd509be1854f4c1e1f53}{pd\_meta}}, M\_MD\_JMICRON);}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l01464}01464                         pd-\/>\mbox{\hyperlink{structg__raid__md__jmicron__perdisk_ac2b4421d277ebd509be1854f4c1e1f53}{pd\_meta}} = NULL;}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l01465}01465                 \}}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l01466}01466                 pd-\/>\mbox{\hyperlink{structg__raid__md__jmicron__perdisk_ac2b4421d277ebd509be1854f4c1e1f53}{pd\_meta}} = \mbox{\hyperlink{md__jmicron_8c_a975b1371f2b98518ecbd2994d7a4b607}{jmicron\_meta\_copy}}(meta);}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l01467}01467                 pd-\/>\mbox{\hyperlink{structg__raid__md__jmicron__perdisk_ac2b4421d277ebd509be1854f4c1e1f53}{pd\_meta}}-\/>\mbox{\hyperlink{structjmicron__raid__conf_aeccbf0f339ffb5dc10d2489d3d154e80}{disk\_id}} = pd-\/>\mbox{\hyperlink{structg__raid__md__jmicron__perdisk_a46a598fbfa7cbd51384eb2ea86325455}{pd\_disk\_id}};}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l01468}01468                 \textcolor{keywordflow}{if} ((\mbox{\hyperlink{g__raid__md__if_8m_a910062273088d146e8533398780701eb}{sd}} = TAILQ\_FIRST(\&\mbox{\hyperlink{structdisk}{disk}}-\/>d\_subdisks)) != NULL) \{}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l01469}01469                         pd-\/>\mbox{\hyperlink{structg__raid__md__jmicron__perdisk_ac2b4421d277ebd509be1854f4c1e1f53}{pd\_meta}}-\/>\mbox{\hyperlink{structjmicron__raid__conf_a47970969ccfc7aa96a0a076e5bd7dae8}{offset}} =}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l01470}01470                             (\mbox{\hyperlink{g__raid__md__if_8m_a910062273088d146e8533398780701eb}{sd}}-\/>\mbox{\hyperlink{structg__raid__subdisk_a9b4e12573b26ee18473a16408044819f}{sd\_offset}} / 512) / 16;}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l01471}01471                         pd-\/>\mbox{\hyperlink{structg__raid__md__jmicron__perdisk_ac2b4421d277ebd509be1854f4c1e1f53}{pd\_meta}}-\/>\mbox{\hyperlink{structjmicron__raid__conf_a53cb3d8a2e58df232b2ba5d6e27811dd}{disk\_sectors\_high}} =}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l01472}01472                             (\mbox{\hyperlink{g__raid__md__if_8m_a910062273088d146e8533398780701eb}{sd}}-\/>\mbox{\hyperlink{structg__raid__subdisk_abc4da1103e29e3a8e2bbadb18fbccbf6}{sd\_size}} / 512) >> 16;}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l01473}01473                         pd-\/>\mbox{\hyperlink{structg__raid__md__jmicron__perdisk_ac2b4421d277ebd509be1854f4c1e1f53}{pd\_meta}}-\/>\mbox{\hyperlink{structjmicron__raid__conf_a8e4cfaa514a26b0a4b701041cb7e4198}{disk\_sectors\_low}} =}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l01474}01474                             (\mbox{\hyperlink{g__raid__md__if_8m_a910062273088d146e8533398780701eb}{sd}}-\/>\mbox{\hyperlink{structg__raid__subdisk_abc4da1103e29e3a8e2bbadb18fbccbf6}{sd\_size}} / 512) \& 0xffff;}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l01475}01475                         \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_a41bff35bee21218d2aba7a261eb2e83c}{G\_RAID\_SUBDISK\_S\_STALE}})}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l01476}01476                                 pd-\/>\mbox{\hyperlink{structg__raid__md__jmicron__perdisk_ac2b4421d277ebd509be1854f4c1e1f53}{pd\_meta}}-\/>\mbox{\hyperlink{structjmicron__raid__conf_a6bd3f9f2cf164a45a43c2519edfab653}{flags}} \&= \string~JMICRON\_F\_BADSEC;}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l01477}01477                         \textcolor{keywordflow}{else} \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{md__jmicron_8c_source_l01478}01478                                 pd-\/>\mbox{\hyperlink{structg__raid__md__jmicron__perdisk_ac2b4421d277ebd509be1854f4c1e1f53}{pd\_meta}}-\/>\mbox{\hyperlink{structjmicron__raid__conf_a6bd3f9f2cf164a45a43c2519edfab653}{flags}} |= \mbox{\hyperlink{md__jmicron_8c_a858950190a80ad6c735e15d5cb2ddfa8}{JMICRON\_F\_UNSYNC}};}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l01479}01479                 \}}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l01480}01480                 \mbox{\hyperlink{g__raid_8h_a4333fbd8d0899facf171aee7b60697f6}{G\_RAID\_DEBUG}}(1, \textcolor{stringliteral}{"{}Writing JMicron metadata to \%s"{}},}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l01481}01481                     \mbox{\hyperlink{g__raid_8c_a8ceaeb12952563e6fe9869ed6b8daa5d}{g\_raid\_get\_diskname}}(\mbox{\hyperlink{structdisk}{disk}}));}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l01482}01482                 \mbox{\hyperlink{md__jmicron_8c_a48fd6da4e42cb60e7476439913eb743a}{g\_raid\_md\_jmicron\_print}}(pd-\/>\mbox{\hyperlink{structg__raid__md__jmicron__perdisk_ac2b4421d277ebd509be1854f4c1e1f53}{pd\_meta}});}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l01483}01483                 \mbox{\hyperlink{md__jmicron_8c_a9b7efe879cf8a743b11dc8e18effb5b0}{jmicron\_meta\_write}}(\mbox{\hyperlink{structdisk}{disk}}-\/>d\_consumer, pd-\/>\mbox{\hyperlink{structg__raid__md__jmicron__perdisk_ac2b4421d277ebd509be1854f4c1e1f53}{pd\_meta}});}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l01484}01484         \}}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l01485}01485         \textcolor{keywordflow}{return} (0);}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l01486}01486 \}}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l01487}01487 }
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l01488}01488 \textcolor{keyword}{static} \textcolor{keywordtype}{int}}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l01489}\mbox{\hyperlink{md__jmicron_8c_a4b1f4dc1c970c9adab174496846eb414}{01489}} \mbox{\hyperlink{md__jmicron_8c_aa81b7896dc923ed3557af65493e17a9d}{g\_raid\_md\_fail\_disk\_jmicron}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structg__raid__md__object}{g\_raid\_md\_object}} *md,}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l01490}01490     \textcolor{keyword}{struct} \mbox{\hyperlink{structg__raid__subdisk}{g\_raid\_subdisk}} *tsd, \textcolor{keyword}{struct} \mbox{\hyperlink{structg__raid__disk}{g\_raid\_disk}} *tdisk)}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l01491}01491 \{}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l01492}01492         \textcolor{keyword}{struct }\mbox{\hyperlink{structg__raid__softc}{g\_raid\_softc}} *sc;}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l01493}01493         \textcolor{keyword}{struct }\mbox{\hyperlink{structg__raid__md__jmicron__perdisk}{g\_raid\_md\_jmicron\_perdisk}} *pd;}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l01494}01494         \textcolor{keyword}{struct }\mbox{\hyperlink{structg__raid__subdisk}{g\_raid\_subdisk}} *\mbox{\hyperlink{g__raid__md__if_8m_a910062273088d146e8533398780701eb}{sd}};}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l01495}01495 }
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l01496}01496         sc = md-\/>\mbox{\hyperlink{structg__raid__md__object_a4acc92ca2582509c74947d83b258e31d}{mdo\_softc}};}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l01497}01497         pd = (\textcolor{keyword}{struct }\mbox{\hyperlink{structg__raid__md__jmicron__perdisk}{g\_raid\_md\_jmicron\_perdisk}} *)tdisk-\/>\mbox{\hyperlink{structg__raid__disk_ab6681cb16ceeb79b9e88d639eca0bd9e}{d\_md\_data}};}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l01498}01498 }
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l01499}01499         \textcolor{comment}{/* We can't fail disk that is not a part of array now. */}}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l01500}01500         if (pd-\/>\mbox{\hyperlink{structg__raid__md__jmicron__perdisk_a65960334e7c32b993e9ea104819243b9}{pd\_disk\_pos}} < 0)}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l01501}01501                 \textcolor{keywordflow}{return} (-\/1);}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l01502}01502 }
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l01503}01503         \textcolor{keywordflow}{if} (tdisk-\/>\mbox{\hyperlink{structg__raid__disk_a830f6bd55251c14ca26a7f8fceb06a89}{d\_consumer}})}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l01504}01504                 \mbox{\hyperlink{md__jmicron_8c_a5698e75f0b5354588271d5d4e0550bfc}{jmicron\_meta\_erase}}(tdisk-\/>\mbox{\hyperlink{structg__raid__disk_a830f6bd55251c14ca26a7f8fceb06a89}{d\_consumer}});}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l01505}01505 }
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l01506}01506         \textcolor{comment}{/* Change states. */}}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l01507}01507         \mbox{\hyperlink{g__raid_8c_a342da571518e21e0521b6416c838d00e}{g\_raid\_change\_disk\_state}}(tdisk, \mbox{\hyperlink{g__raid_8h_a2135c7d2f628dbf559cad6d4ea1b5c8f}{G\_RAID\_DISK\_S\_FAILED}});}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l01508}01508         TAILQ\_FOREACH(\mbox{\hyperlink{g__raid__md__if_8m_a910062273088d146e8533398780701eb}{sd}}, \&tdisk-\/>d\_subdisks, sd\_next) \{}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l01509}01509                 \mbox{\hyperlink{g__raid_8c_a058db459d5349d2130fda3a02dd2af29}{g\_raid\_change\_subdisk\_state}}(\mbox{\hyperlink{g__raid__md__if_8m_a910062273088d146e8533398780701eb}{sd}},}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l01510}01510                     \mbox{\hyperlink{g__raid_8h_a2e56fb1cd5fdab097052e38c28a8c92f}{G\_RAID\_SUBDISK\_S\_FAILED}});}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l01511}01511                 \mbox{\hyperlink{g__raid_8c_ac49cc1991dccaeef0743e0bc4f64e0b5}{g\_raid\_event\_send}}(\mbox{\hyperlink{g__raid__md__if_8m_a910062273088d146e8533398780701eb}{sd}}, \mbox{\hyperlink{g__raid_8h_a11e4d6f6fe0cb9ecaceeb81d2b30a125}{G\_RAID\_SUBDISK\_E\_FAILED}},}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l01512}01512                     \mbox{\hyperlink{g__raid_8h_ae6ac3f8d5dcaa73174e3e8bb9dd12f1c}{G\_RAID\_EVENT\_SUBDISK}});}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l01513}01513         \}}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l01514}01514 }
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l01515}01515         \textcolor{comment}{/* Write updated metadata to remaining disks. */}}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l01516}01516         \mbox{\hyperlink{md__jmicron_8c_aaf5dc9d91eb1d2ddad515c7844468905}{g\_raid\_md\_write\_jmicron}}(md, NULL, NULL, tdisk);}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l01517}01517 }
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l01518}01518         \textcolor{comment}{/* Check if anything left except placeholders. */}}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l01519}01519         \textcolor{keywordflow}{if} (\mbox{\hyperlink{g__raid_8c_ad1004201fc232c60faacd7bd3f3b604f}{g\_raid\_ndisks}}(sc, -\/1) ==}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l01520}01520             \mbox{\hyperlink{g__raid_8c_ad1004201fc232c60faacd7bd3f3b604f}{g\_raid\_ndisks}}(sc, \mbox{\hyperlink{g__raid_8h_aee552862c97f7442835d7c81b3399ac2}{G\_RAID\_DISK\_S\_OFFLINE}}))}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l01521}01521                 \mbox{\hyperlink{g__raid_8c_a99807e6db37e78d1738e46dfd48b7b5c}{g\_raid\_destroy\_node}}(sc, 0);}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l01522}01522         \textcolor{keywordflow}{else}}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l01523}01523                 \mbox{\hyperlink{md__jmicron_8c_ac7259021f21724898e2922acc5e087ca}{g\_raid\_md\_jmicron\_refill}}(sc);}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l01524}01524         \textcolor{keywordflow}{return} (0);}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l01525}01525 \}}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l01526}01526 }
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l01527}01527 \textcolor{keyword}{static} \textcolor{keywordtype}{int}}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l01528}\mbox{\hyperlink{md__jmicron_8c_aedf6e68b3d20a52cfd7cc09f82eaba3d}{01528}} \mbox{\hyperlink{md__jmicron_8c_a6eb57f4798a84f27857fbb9edf3e4532}{g\_raid\_md\_free\_disk\_jmicron}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structg__raid__md__object}{g\_raid\_md\_object}} *md,}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l01529}01529     \textcolor{keyword}{struct} \mbox{\hyperlink{structg__raid__disk}{g\_raid\_disk}} *\mbox{\hyperlink{structdisk}{disk}})}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l01530}01530 \{}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l01531}01531         \textcolor{keyword}{struct }\mbox{\hyperlink{structg__raid__md__jmicron__perdisk}{g\_raid\_md\_jmicron\_perdisk}} *pd;}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l01532}01532 }
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l01533}01533         pd = (\textcolor{keyword}{struct }\mbox{\hyperlink{structg__raid__md__jmicron__perdisk}{g\_raid\_md\_jmicron\_perdisk}} *)\mbox{\hyperlink{structdisk}{disk}}-\/>d\_md\_data;}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l01534}01534         if (pd-\/>\mbox{\hyperlink{structg__raid__md__jmicron__perdisk_ac2b4421d277ebd509be1854f4c1e1f53}{pd\_meta}} != NULL) \{}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l01535}01535                 \mbox{\hyperlink{g__raid__md__if_8m_a4df9edb2717b3f7e4c3c903878577a54}{free}}(pd-\/>\mbox{\hyperlink{structg__raid__md__jmicron__perdisk_ac2b4421d277ebd509be1854f4c1e1f53}{pd\_meta}}, M\_MD\_JMICRON);}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l01536}01536                 pd-\/>\mbox{\hyperlink{structg__raid__md__jmicron__perdisk_ac2b4421d277ebd509be1854f4c1e1f53}{pd\_meta}} = NULL;}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l01537}01537         \}}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l01538}01538         \mbox{\hyperlink{g__raid__md__if_8m_a4df9edb2717b3f7e4c3c903878577a54}{free}}(pd, M\_MD\_JMICRON);}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l01539}01539         \mbox{\hyperlink{structdisk}{disk}}-\/>d\_md\_data = NULL;}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l01540}01540         \textcolor{keywordflow}{return} (0);}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l01541}01541 \}}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l01542}01542 }
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l01543}01543 \textcolor{keyword}{static} \textcolor{keywordtype}{int}}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l01544}\mbox{\hyperlink{md__jmicron_8c_a97b31e2b01d97c6231096eaa47211c36}{01544}} \mbox{\hyperlink{md__jmicron_8c_ae7cf97461cbdb8342e28daa6e21e0ce4}{g\_raid\_md\_free\_jmicron}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structg__raid__md__object}{g\_raid\_md\_object}} *md)}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l01545}01545 \{}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l01546}01546         \textcolor{keyword}{struct }\mbox{\hyperlink{structg__raid__md__jmicron__object}{g\_raid\_md\_jmicron\_object}} *mdi;}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l01547}01547 }
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l01548}01548         mdi = (\textcolor{keyword}{struct }\mbox{\hyperlink{structg__raid__md__jmicron__object}{g\_raid\_md\_jmicron\_object}} *)md;}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l01549}01549         \textcolor{keywordflow}{if} (!mdi-\/>\mbox{\hyperlink{structg__raid__md__jmicron__object_adeedb342e0d17d9db3bce7dfc408b72c}{mdio\_started}}) \{}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l01550}01550                 mdi-\/>\mbox{\hyperlink{structg__raid__md__jmicron__object_adeedb342e0d17d9db3bce7dfc408b72c}{mdio\_started}} = 0;}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l01551}01551                 callout\_stop(\&mdi-\/>\mbox{\hyperlink{structg__raid__md__jmicron__object_af59f91509fa472e35ba85b4e78d99b07}{mdio\_start\_co}});}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l01552}01552                 \mbox{\hyperlink{g__raid_8h_ace7234f8197b96e1b636f9376de8d7ea}{G\_RAID\_DEBUG1}}(1, md-\/>\mbox{\hyperlink{structg__raid__md__object_a4acc92ca2582509c74947d83b258e31d}{mdo\_softc}},}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l01553}01553                     \textcolor{stringliteral}{"{}root\_mount\_rel \%p"{}}, mdi-\/>\mbox{\hyperlink{structg__raid__md__jmicron__object_ae5ddd50412f23f4106c7a7760a91e3db}{mdio\_rootmount}});}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l01554}01554                 root\_mount\_rel(mdi-\/>\mbox{\hyperlink{structg__raid__md__jmicron__object_ae5ddd50412f23f4106c7a7760a91e3db}{mdio\_rootmount}});}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l01555}01555                 mdi-\/>\mbox{\hyperlink{structg__raid__md__jmicron__object_ae5ddd50412f23f4106c7a7760a91e3db}{mdio\_rootmount}} = NULL;}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l01556}01556         \}}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l01557}01557         \textcolor{keywordflow}{if} (mdi-\/>\mbox{\hyperlink{structg__raid__md__jmicron__object_a99dfc14fc8a6fe56d6822564249c3a54}{mdio\_meta}} != NULL) \{}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l01558}01558                 \mbox{\hyperlink{g__raid__md__if_8m_a4df9edb2717b3f7e4c3c903878577a54}{free}}(mdi-\/>\mbox{\hyperlink{structg__raid__md__jmicron__object_a99dfc14fc8a6fe56d6822564249c3a54}{mdio\_meta}}, M\_MD\_JMICRON);}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l01559}01559                 mdi-\/>\mbox{\hyperlink{structg__raid__md__jmicron__object_a99dfc14fc8a6fe56d6822564249c3a54}{mdio\_meta}} = NULL;}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l01560}01560         \}}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l01561}01561         \textcolor{keywordflow}{return} (0);}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l01562}01562 \}}
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l01563}01563 }
\DoxyCodeLine{\Hypertarget{md__jmicron_8c_source_l01564}\mbox{\hyperlink{md__jmicron_8c_a028702e1bea7a92aa430d74b72c053ab}{01564}} \mbox{\hyperlink{md__jmicron_8c_a028702e1bea7a92aa430d74b72c053ab}{G\_RAID\_MD\_DECLARE}}(jmicron, \textcolor{stringliteral}{"{}JMicron"{}});}

\end{DoxyCode}
