\hypertarget{geom__vinum__drive_8c_source}{}\doxysection{geom\+\_\+vinum\+\_\+drive.\+c}
\label{geom__vinum__drive_8c_source}\index{geom/vinum/geom\_vinum\_drive.c@{geom/vinum/geom\_vinum\_drive.c}}
\mbox{\hyperlink{geom__vinum__drive_8c}{Go to the documentation of this file.}}
\begin{DoxyCode}{0}
\DoxyCodeLine{\Hypertarget{geom__vinum__drive_8c_source_l00001}00001 \textcolor{comment}{/*-\/}}
\DoxyCodeLine{\Hypertarget{geom__vinum__drive_8c_source_l00002}00002 \textcolor{comment}{ * SPDX-\/License-\/Identifier: BSD-\/2-\/Clause-\/FreeBSD}}
\DoxyCodeLine{\Hypertarget{geom__vinum__drive_8c_source_l00003}00003 \textcolor{comment}{ *}}
\DoxyCodeLine{\Hypertarget{geom__vinum__drive_8c_source_l00004}00004 \textcolor{comment}{ * Copyright (c) 2004, 2005, 2007 Lukas Ertl}}
\DoxyCodeLine{\Hypertarget{geom__vinum__drive_8c_source_l00005}00005 \textcolor{comment}{ * All rights reserved.}}
\DoxyCodeLine{\Hypertarget{geom__vinum__drive_8c_source_l00006}00006 \textcolor{comment}{ *}}
\DoxyCodeLine{\Hypertarget{geom__vinum__drive_8c_source_l00007}00007 \textcolor{comment}{ * Redistribution and use in source and binary forms, with or without}}
\DoxyCodeLine{\Hypertarget{geom__vinum__drive_8c_source_l00008}00008 \textcolor{comment}{ * modification, are permitted provided that the following conditions}}
\DoxyCodeLine{\Hypertarget{geom__vinum__drive_8c_source_l00009}00009 \textcolor{comment}{ * are met:}}
\DoxyCodeLine{\Hypertarget{geom__vinum__drive_8c_source_l00010}00010 \textcolor{comment}{ * 1. Redistributions of source code must retain the above copyright}}
\DoxyCodeLine{\Hypertarget{geom__vinum__drive_8c_source_l00011}00011 \textcolor{comment}{ *    notice, this list of conditions and the following disclaimer.}}
\DoxyCodeLine{\Hypertarget{geom__vinum__drive_8c_source_l00012}00012 \textcolor{comment}{ * 2. Redistributions in binary form must reproduce the above copyright}}
\DoxyCodeLine{\Hypertarget{geom__vinum__drive_8c_source_l00013}00013 \textcolor{comment}{ *    notice, this list of conditions and the following disclaimer in the}}
\DoxyCodeLine{\Hypertarget{geom__vinum__drive_8c_source_l00014}00014 \textcolor{comment}{ *    documentation and/or other materials provided with the distribution.}}
\DoxyCodeLine{\Hypertarget{geom__vinum__drive_8c_source_l00015}00015 \textcolor{comment}{ *}}
\DoxyCodeLine{\Hypertarget{geom__vinum__drive_8c_source_l00016}00016 \textcolor{comment}{ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND}}
\DoxyCodeLine{\Hypertarget{geom__vinum__drive_8c_source_l00017}00017 \textcolor{comment}{ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE}}
\DoxyCodeLine{\Hypertarget{geom__vinum__drive_8c_source_l00018}00018 \textcolor{comment}{ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE}}
\DoxyCodeLine{\Hypertarget{geom__vinum__drive_8c_source_l00019}00019 \textcolor{comment}{ * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE}}
\DoxyCodeLine{\Hypertarget{geom__vinum__drive_8c_source_l00020}00020 \textcolor{comment}{ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL}}
\DoxyCodeLine{\Hypertarget{geom__vinum__drive_8c_source_l00021}00021 \textcolor{comment}{ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS}}
\DoxyCodeLine{\Hypertarget{geom__vinum__drive_8c_source_l00022}00022 \textcolor{comment}{ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)}}
\DoxyCodeLine{\Hypertarget{geom__vinum__drive_8c_source_l00023}00023 \textcolor{comment}{ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT}}
\DoxyCodeLine{\Hypertarget{geom__vinum__drive_8c_source_l00024}00024 \textcolor{comment}{ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY}}
\DoxyCodeLine{\Hypertarget{geom__vinum__drive_8c_source_l00025}00025 \textcolor{comment}{ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF}}
\DoxyCodeLine{\Hypertarget{geom__vinum__drive_8c_source_l00026}00026 \textcolor{comment}{ * SUCH DAMAGE.}}
\DoxyCodeLine{\Hypertarget{geom__vinum__drive_8c_source_l00027}00027 \textcolor{comment}{ */}}
\DoxyCodeLine{\Hypertarget{geom__vinum__drive_8c_source_l00028}00028 }
\DoxyCodeLine{\Hypertarget{geom__vinum__drive_8c_source_l00029}00029 \textcolor{preprocessor}{\#include <sys/cdefs.h>}}
\DoxyCodeLine{\Hypertarget{geom__vinum__drive_8c_source_l00030}\mbox{\hyperlink{geom__vinum__drive_8c_a8c3ef283470a68cd30afe9b8a72cb60f}{00030}} \mbox{\hyperlink{geom__vinum__drive_8c_a8c3ef283470a68cd30afe9b8a72cb60f}{\_\_FBSDID}}(\textcolor{stringliteral}{"{}\$FreeBSD\$"{}});}
\DoxyCodeLine{\Hypertarget{geom__vinum__drive_8c_source_l00031}00031 }
\DoxyCodeLine{\Hypertarget{geom__vinum__drive_8c_source_l00032}00032 \textcolor{preprocessor}{\#include <sys/types.h>}}
\DoxyCodeLine{\Hypertarget{geom__vinum__drive_8c_source_l00033}00033 \textcolor{preprocessor}{\#include <sys/endian.h>}}
\DoxyCodeLine{\Hypertarget{geom__vinum__drive_8c_source_l00034}00034 \textcolor{preprocessor}{\#include <sys/malloc.h>}}
\DoxyCodeLine{\Hypertarget{geom__vinum__drive_8c_source_l00035}00035 \textcolor{preprocessor}{\#include <sys/sbuf.h>}}
\DoxyCodeLine{\Hypertarget{geom__vinum__drive_8c_source_l00036}00036 \textcolor{preprocessor}{\#include <sys/systm.h>}}
\DoxyCodeLine{\Hypertarget{geom__vinum__drive_8c_source_l00037}00037 }
\DoxyCodeLine{\Hypertarget{geom__vinum__drive_8c_source_l00038}00038 \textcolor{preprocessor}{\#include <\mbox{\hyperlink{geom_8h}{geom/geom.h}}>}}
\DoxyCodeLine{\Hypertarget{geom__vinum__drive_8c_source_l00039}00039 \textcolor{preprocessor}{\#include <\mbox{\hyperlink{geom__dbg_8h}{geom/geom\_dbg.h}}>}}
\DoxyCodeLine{\Hypertarget{geom__vinum__drive_8c_source_l00040}00040 \textcolor{preprocessor}{\#include <\mbox{\hyperlink{geom__vinum__var_8h}{geom/vinum/geom\_vinum\_var.h}}>}}
\DoxyCodeLine{\Hypertarget{geom__vinum__drive_8c_source_l00041}00041 \textcolor{preprocessor}{\#include <\mbox{\hyperlink{geom__vinum_8h}{geom/vinum/geom\_vinum.h}}>}}
\DoxyCodeLine{\Hypertarget{geom__vinum__drive_8c_source_l00042}00042 }
\DoxyCodeLine{\Hypertarget{geom__vinum__drive_8c_source_l00043}\mbox{\hyperlink{geom__vinum__drive_8c_a76d75c960d05f3940664a264de8ad557}{00043}} \textcolor{preprocessor}{\#define GV\_LEGACY\_I386  0}}
\DoxyCodeLine{\Hypertarget{geom__vinum__drive_8c_source_l00044}\mbox{\hyperlink{geom__vinum__drive_8c_a5402bc52655cc629624c78f81bf3bf4a}{00044}} \textcolor{preprocessor}{\#define GV\_LEGACY\_AMD64 1}}
\DoxyCodeLine{\Hypertarget{geom__vinum__drive_8c_source_l00045}\mbox{\hyperlink{geom__vinum__drive_8c_ae13c272dab4e657343d4a8e85363c061}{00045}} \textcolor{preprocessor}{\#define GV\_LEGACY\_SPARC64 2}}
\DoxyCodeLine{\Hypertarget{geom__vinum__drive_8c_source_l00046}\mbox{\hyperlink{geom__vinum__drive_8c_adb70fccbe32679db925e5288b5128dad}{00046}} \textcolor{preprocessor}{\#define GV\_LEGACY\_POWERPC 3}}
\DoxyCodeLine{\Hypertarget{geom__vinum__drive_8c_source_l00047}00047 }
\DoxyCodeLine{\Hypertarget{geom__vinum__drive_8c_source_l00048}00048 \textcolor{keyword}{static} \textcolor{keywordtype}{int}      \mbox{\hyperlink{geom__vinum__drive_8c_a828ea06052039d3009966317c6b369f3}{gv\_legacy\_header\_type}}(\mbox{\hyperlink{binstream_8h_ab077fa1127453be2bd9d4c3c8a768fa7}{uint8\_t}} *, \textcolor{keywordtype}{int});}
\DoxyCodeLine{\Hypertarget{geom__vinum__drive_8c_source_l00049}00049 }
\DoxyCodeLine{\Hypertarget{geom__vinum__drive_8c_source_l00050}00050 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{geom__vinum__drive_8c_source_l00051}00051 \textcolor{comment}{ * Here are the "{}offset (size)"{} for the various struct gv\_hdr fields,}}
\DoxyCodeLine{\Hypertarget{geom__vinum__drive_8c_source_l00052}00052 \textcolor{comment}{ * for the legacy i386 (or 32-\/bit powerpc), legacy amd64 (or sparc64), and}}
\DoxyCodeLine{\Hypertarget{geom__vinum__drive_8c_source_l00053}00053 \textcolor{comment}{ * current (cpu \& endian agnostic) versions of the on-\/disk format of the vinum}}
\DoxyCodeLine{\Hypertarget{geom__vinum__drive_8c_source_l00054}00054 \textcolor{comment}{ * header structure:}}
\DoxyCodeLine{\Hypertarget{geom__vinum__drive_8c_source_l00055}00055 \textcolor{comment}{ *}}
\DoxyCodeLine{\Hypertarget{geom__vinum__drive_8c_source_l00056}00056 \textcolor{comment}{ *       i386    amd64   current   field}}
\DoxyCodeLine{\Hypertarget{geom__vinum__drive_8c_source_l00057}00057 \textcolor{comment}{ *     -\/-\/-\/-\/-\/-\/-\/-\/ -\/-\/-\/-\/-\/-\/-\/-\/ -\/-\/-\/-\/-\/-\/-\/-\/  -\/-\/-\/-\/-\/}}
\DoxyCodeLine{\Hypertarget{geom__vinum__drive_8c_source_l00058}00058 \textcolor{comment}{ *       0 ( 8)   0 ( 8)   0 ( 8)  magic}}
\DoxyCodeLine{\Hypertarget{geom__vinum__drive_8c_source_l00059}00059 \textcolor{comment}{ *       8 ( 4)   8 ( 8)   8 ( 8)  config\_length}}
\DoxyCodeLine{\Hypertarget{geom__vinum__drive_8c_source_l00060}00060 \textcolor{comment}{ *      12 (32)  16 (32)  16 (32)  label.sysname}}
\DoxyCodeLine{\Hypertarget{geom__vinum__drive_8c_source_l00061}00061 \textcolor{comment}{ *      44 (32)  48 (32)  48 (32)  label.name}}
\DoxyCodeLine{\Hypertarget{geom__vinum__drive_8c_source_l00062}00062 \textcolor{comment}{ *      76 ( 4)  80 ( 8)  80 ( 8)  label.date\_of\_birth.tv\_sec}}
\DoxyCodeLine{\Hypertarget{geom__vinum__drive_8c_source_l00063}00063 \textcolor{comment}{ *      80 ( 4)  88 ( 8)  88 ( 8)  label.date\_of\_birth.tv\_usec}}
\DoxyCodeLine{\Hypertarget{geom__vinum__drive_8c_source_l00064}00064 \textcolor{comment}{ *      84 ( 4)  96 ( 8)  96 ( 8)  label.last\_update.tv\_sec}}
\DoxyCodeLine{\Hypertarget{geom__vinum__drive_8c_source_l00065}00065 \textcolor{comment}{ *      88 ( 4) 104 ( 8) 104 ( 8)  label.last\_update.tv\_usec}}
\DoxyCodeLine{\Hypertarget{geom__vinum__drive_8c_source_l00066}00066 \textcolor{comment}{ *      92 ( 8) 112 ( 8) 112 ( 8)  label.drive\_size}}
\DoxyCodeLine{\Hypertarget{geom__vinum__drive_8c_source_l00067}00067 \textcolor{comment}{ *     ======== ======== ========}}
\DoxyCodeLine{\Hypertarget{geom__vinum__drive_8c_source_l00068}00068 \textcolor{comment}{ *     100      120      120       total size}}
\DoxyCodeLine{\Hypertarget{geom__vinum__drive_8c_source_l00069}00069 \textcolor{comment}{ *}}
\DoxyCodeLine{\Hypertarget{geom__vinum__drive_8c_source_l00070}00070 \textcolor{comment}{ * NOTE: i386 and amd64 formats are stored as little-\/endian; the current}}
\DoxyCodeLine{\Hypertarget{geom__vinum__drive_8c_source_l00071}00071 \textcolor{comment}{ * format uses big-\/endian (network order).}}
\DoxyCodeLine{\Hypertarget{geom__vinum__drive_8c_source_l00072}00072 \textcolor{comment}{ */}}
\DoxyCodeLine{\Hypertarget{geom__vinum__drive_8c_source_l00073}00073 }
\DoxyCodeLine{\Hypertarget{geom__vinum__drive_8c_source_l00074}00074 \textcolor{comment}{/* Checks for legacy format depending on platform. */}}
\DoxyCodeLine{\Hypertarget{geom__vinum__drive_8c_source_l00075}00075 \textcolor{keyword}{static} \textcolor{keywordtype}{int}}
\DoxyCodeLine{\Hypertarget{geom__vinum__drive_8c_source_l00076}\mbox{\hyperlink{geom__vinum__drive_8c_a828ea06052039d3009966317c6b369f3}{00076}} \mbox{\hyperlink{geom__vinum__drive_8c_a828ea06052039d3009966317c6b369f3}{gv\_legacy\_header\_type}}(\mbox{\hyperlink{binstream_8h_ab077fa1127453be2bd9d4c3c8a768fa7}{uint8\_t}} *hdr, \textcolor{keywordtype}{int} bigendian)}
\DoxyCodeLine{\Hypertarget{geom__vinum__drive_8c_source_l00077}00077 \{}
\DoxyCodeLine{\Hypertarget{geom__vinum__drive_8c_source_l00078}00078         uint32\_t *i32;}
\DoxyCodeLine{\Hypertarget{geom__vinum__drive_8c_source_l00079}00079         \textcolor{keywordtype}{int} arch\_32, arch\_64, i;}
\DoxyCodeLine{\Hypertarget{geom__vinum__drive_8c_source_l00080}00080 }
\DoxyCodeLine{\Hypertarget{geom__vinum__drive_8c_source_l00081}00081         \textcolor{comment}{/* Set arch according to endianness. */}}
\DoxyCodeLine{\Hypertarget{geom__vinum__drive_8c_source_l00082}00082         \textcolor{keywordflow}{if} (bigendian) \{}
\DoxyCodeLine{\Hypertarget{geom__vinum__drive_8c_source_l00083}00083                 arch\_32 = \mbox{\hyperlink{geom__vinum__drive_8c_adb70fccbe32679db925e5288b5128dad}{GV\_LEGACY\_POWERPC}};}
\DoxyCodeLine{\Hypertarget{geom__vinum__drive_8c_source_l00084}00084                 arch\_64 = \mbox{\hyperlink{geom__vinum__drive_8c_ae13c272dab4e657343d4a8e85363c061}{GV\_LEGACY\_SPARC64}};}
\DoxyCodeLine{\Hypertarget{geom__vinum__drive_8c_source_l00085}00085         \} \textcolor{keywordflow}{else} \{}
\DoxyCodeLine{\Hypertarget{geom__vinum__drive_8c_source_l00086}00086                 arch\_32 = \mbox{\hyperlink{geom__vinum__drive_8c_a76d75c960d05f3940664a264de8ad557}{GV\_LEGACY\_I386}};}
\DoxyCodeLine{\Hypertarget{geom__vinum__drive_8c_source_l00087}00087                 arch\_64 = \mbox{\hyperlink{geom__vinum__drive_8c_a5402bc52655cc629624c78f81bf3bf4a}{GV\_LEGACY\_AMD64}};}
\DoxyCodeLine{\Hypertarget{geom__vinum__drive_8c_source_l00088}00088         \}}
\DoxyCodeLine{\Hypertarget{geom__vinum__drive_8c_source_l00089}00089 }
\DoxyCodeLine{\Hypertarget{geom__vinum__drive_8c_source_l00090}00090         \textcolor{comment}{/* if non-\/empty hostname overlaps 64-\/bit config\_length */}}
\DoxyCodeLine{\Hypertarget{geom__vinum__drive_8c_source_l00091}00091         i32 = (uint32\_t *)(hdr + 12);}
\DoxyCodeLine{\Hypertarget{geom__vinum__drive_8c_source_l00092}00092         \textcolor{keywordflow}{if} (*i32 != 0)}
\DoxyCodeLine{\Hypertarget{geom__vinum__drive_8c_source_l00093}00093                 \textcolor{keywordflow}{return} (arch\_32);}
\DoxyCodeLine{\Hypertarget{geom__vinum__drive_8c_source_l00094}00094         \textcolor{comment}{/* check for non-\/empty hostname */}}
\DoxyCodeLine{\Hypertarget{geom__vinum__drive_8c_source_l00095}00095         \textcolor{keywordflow}{if} (hdr[16] != 0)}
\DoxyCodeLine{\Hypertarget{geom__vinum__drive_8c_source_l00096}00096                 \textcolor{keywordflow}{return} (arch\_64);}
\DoxyCodeLine{\Hypertarget{geom__vinum__drive_8c_source_l00097}00097         \textcolor{comment}{/* check bytes past 32-\/bit structure */}}
\DoxyCodeLine{\Hypertarget{geom__vinum__drive_8c_source_l00098}00098         \textcolor{keywordflow}{for} (i = 100; i < 120; i++)}
\DoxyCodeLine{\Hypertarget{geom__vinum__drive_8c_source_l00099}00099                 \textcolor{keywordflow}{if} (hdr[i] != 0)}
\DoxyCodeLine{\Hypertarget{geom__vinum__drive_8c_source_l00100}00100                         \textcolor{keywordflow}{return} (arch\_32);}
\DoxyCodeLine{\Hypertarget{geom__vinum__drive_8c_source_l00101}00101         \textcolor{comment}{/* check for overlapping timestamp */}}
\DoxyCodeLine{\Hypertarget{geom__vinum__drive_8c_source_l00102}00102         i32 = (uint32\_t *)(hdr + 84);}
\DoxyCodeLine{\Hypertarget{geom__vinum__drive_8c_source_l00103}00103 }
\DoxyCodeLine{\Hypertarget{geom__vinum__drive_8c_source_l00104}00104         \textcolor{keywordflow}{if} (*i32 == 0)}
\DoxyCodeLine{\Hypertarget{geom__vinum__drive_8c_source_l00105}00105                 \textcolor{keywordflow}{return} (arch\_64);}
\DoxyCodeLine{\Hypertarget{geom__vinum__drive_8c_source_l00106}00106         \textcolor{keywordflow}{return} (arch\_32);}
\DoxyCodeLine{\Hypertarget{geom__vinum__drive_8c_source_l00107}00107 \}}
\DoxyCodeLine{\Hypertarget{geom__vinum__drive_8c_source_l00108}00108 }
\DoxyCodeLine{\Hypertarget{geom__vinum__drive_8c_source_l00109}00109 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{geom__vinum__drive_8c_source_l00110}00110 \textcolor{comment}{ * Read the header while taking magic number into account, and write it to}}
\DoxyCodeLine{\Hypertarget{geom__vinum__drive_8c_source_l00111}00111 \textcolor{comment}{ * destination pointer.}}
\DoxyCodeLine{\Hypertarget{geom__vinum__drive_8c_source_l00112}00112 \textcolor{comment}{ */}}
\DoxyCodeLine{\Hypertarget{geom__vinum__drive_8c_source_l00113}00113 \textcolor{keywordtype}{int}}
\DoxyCodeLine{\Hypertarget{geom__vinum__drive_8c_source_l00114}\mbox{\hyperlink{geom__vinum_8h_af76d712056b52012f77cbecc2925e52b}{00114}} \mbox{\hyperlink{geom__vinum__drive_8c_ab1b7f1dab86a822375dd4443ba394888}{gv\_read\_header}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structg__consumer}{g\_consumer}} *\mbox{\hyperlink{g__part__if_8m_a294f18324585ff37641fb8aa1c9ccd82}{cp}}, \textcolor{keyword}{struct} \mbox{\hyperlink{structgv__hdr}{gv\_hdr}} *m\_hdr)}
\DoxyCodeLine{\Hypertarget{geom__vinum__drive_8c_source_l00115}00115 \{}
\DoxyCodeLine{\Hypertarget{geom__vinum__drive_8c_source_l00116}00116         \textcolor{keyword}{struct }\mbox{\hyperlink{structg__provider}{g\_provider}} *\mbox{\hyperlink{g__part__if_8m_a9bc7638f295763b77465c5ebebbd3442}{pp}};}
\DoxyCodeLine{\Hypertarget{geom__vinum__drive_8c_source_l00117}00117         uint64\_t magic\_machdep;}
\DoxyCodeLine{\Hypertarget{geom__vinum__drive_8c_source_l00118}00118         \mbox{\hyperlink{binstream_8h_ab077fa1127453be2bd9d4c3c8a768fa7}{uint8\_t}} *d\_hdr;}
\DoxyCodeLine{\Hypertarget{geom__vinum__drive_8c_source_l00119}00119         \textcolor{keywordtype}{int} be, off;}
\DoxyCodeLine{\Hypertarget{geom__vinum__drive_8c_source_l00120}00120 }
\DoxyCodeLine{\Hypertarget{geom__vinum__drive_8c_source_l00121}00121 \textcolor{preprocessor}{\#define GV\_GET32(endian)                                        \(\backslash\)}}
\DoxyCodeLine{\Hypertarget{geom__vinum__drive_8c_source_l00122}00122 \textcolor{preprocessor}{                endian\#\#32toh(*((uint32\_t *)\&d\_hdr[off]));      \(\backslash\)}}
\DoxyCodeLine{\Hypertarget{geom__vinum__drive_8c_source_l00123}00123 \textcolor{preprocessor}{                off += 4}}
\DoxyCodeLine{\Hypertarget{geom__vinum__drive_8c_source_l00124}00124 \textcolor{preprocessor}{\#define GV\_GET64(endian)                                        \(\backslash\)}}
\DoxyCodeLine{\Hypertarget{geom__vinum__drive_8c_source_l00125}00125 \textcolor{preprocessor}{                endian\#\#64toh(*((uint64\_t *)\&d\_hdr[off]));      \(\backslash\)}}
\DoxyCodeLine{\Hypertarget{geom__vinum__drive_8c_source_l00126}00126 \textcolor{preprocessor}{                off += 8}}
\DoxyCodeLine{\Hypertarget{geom__vinum__drive_8c_source_l00127}00127 }
\DoxyCodeLine{\Hypertarget{geom__vinum__drive_8c_source_l00128}00128         KASSERT(m\_hdr != NULL, (\textcolor{stringliteral}{"{}gv\_read\_header: null m\_hdr"{}}));}
\DoxyCodeLine{\Hypertarget{geom__vinum__drive_8c_source_l00129}00129         KASSERT(\mbox{\hyperlink{g__part__if_8m_a294f18324585ff37641fb8aa1c9ccd82}{cp}} != NULL, (\textcolor{stringliteral}{"{}gv\_read\_header: null cp"{}}));}
\DoxyCodeLine{\Hypertarget{geom__vinum__drive_8c_source_l00130}00130         \mbox{\hyperlink{g__part__if_8m_a9bc7638f295763b77465c5ebebbd3442}{pp}} = \mbox{\hyperlink{g__part__if_8m_a294f18324585ff37641fb8aa1c9ccd82}{cp}}-\/>\mbox{\hyperlink{structg__consumer_a6435d5aec0376e995dce3131fd3beb52}{provider}};}
\DoxyCodeLine{\Hypertarget{geom__vinum__drive_8c_source_l00131}00131         KASSERT(\mbox{\hyperlink{g__part__if_8m_a9bc7638f295763b77465c5ebebbd3442}{pp}} != NULL, (\textcolor{stringliteral}{"{}gv\_read\_header: null pp"{}}));}
\DoxyCodeLine{\Hypertarget{geom__vinum__drive_8c_source_l00132}00132 }
\DoxyCodeLine{\Hypertarget{geom__vinum__drive_8c_source_l00133}00133         \textcolor{keywordflow}{if} ((\mbox{\hyperlink{geom__vinum__var_8h_adb0ec2b339a204b6ff15f4928e9d58a1}{GV\_HDR\_OFFSET}} \% \mbox{\hyperlink{g__part__if_8m_a9bc7638f295763b77465c5ebebbd3442}{pp}}-\/>\mbox{\hyperlink{structg__provider_aea3cd43d41461790b8d0afcd8c49a355}{sectorsize}}) != 0 ||}
\DoxyCodeLine{\Hypertarget{geom__vinum__drive_8c_source_l00134}00134             (\mbox{\hyperlink{geom__vinum__var_8h_a1be1fbdcd7d6587989a4f92a552ab05a}{GV\_HDR\_LEN}} \% \mbox{\hyperlink{g__part__if_8m_a9bc7638f295763b77465c5ebebbd3442}{pp}}-\/>\mbox{\hyperlink{structg__provider_aea3cd43d41461790b8d0afcd8c49a355}{sectorsize}}) != 0)}
\DoxyCodeLine{\Hypertarget{geom__vinum__drive_8c_source_l00135}00135                 \textcolor{keywordflow}{return} (ENODEV);}
\DoxyCodeLine{\Hypertarget{geom__vinum__drive_8c_source_l00136}00136 }
\DoxyCodeLine{\Hypertarget{geom__vinum__drive_8c_source_l00137}00137         d\_hdr = \mbox{\hyperlink{geom_8h_a550c2071f79908eea3d1ccbf821c4e4f}{g\_read\_data}}(\mbox{\hyperlink{g__part__if_8m_a294f18324585ff37641fb8aa1c9ccd82}{cp}}, \mbox{\hyperlink{geom__vinum__var_8h_adb0ec2b339a204b6ff15f4928e9d58a1}{GV\_HDR\_OFFSET}}, \mbox{\hyperlink{g__part__if_8m_a9bc7638f295763b77465c5ebebbd3442}{pp}}-\/>\mbox{\hyperlink{structg__provider_aea3cd43d41461790b8d0afcd8c49a355}{sectorsize}}, NULL);}
\DoxyCodeLine{\Hypertarget{geom__vinum__drive_8c_source_l00138}00138         \textcolor{keywordflow}{if} (d\_hdr == NULL)}
\DoxyCodeLine{\Hypertarget{geom__vinum__drive_8c_source_l00139}00139                 \textcolor{keywordflow}{return} (-\/1);}
\DoxyCodeLine{\Hypertarget{geom__vinum__drive_8c_source_l00140}00140         off = 0;}
\DoxyCodeLine{\Hypertarget{geom__vinum__drive_8c_source_l00141}00141         m\_hdr-\/>\mbox{\hyperlink{structgv__hdr_a959aa1edaed399d2b4ba914ccecad4f4}{magic}} = \mbox{\hyperlink{geom__vinum__drive_8c_a253645243e48596c94cacb58e77f8467}{GV\_GET64}}(be);}
\DoxyCodeLine{\Hypertarget{geom__vinum__drive_8c_source_l00142}00142         magic\_machdep = *((uint64\_t *)\&d\_hdr[0]);}
\DoxyCodeLine{\Hypertarget{geom__vinum__drive_8c_source_l00143}00143         \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{geom__vinum__drive_8c_source_l00144}00144 \textcolor{comment}{         * The big endian machines will have a reverse of GV\_OLD\_MAGIC, so we}}
\DoxyCodeLine{\Hypertarget{geom__vinum__drive_8c_source_l00145}00145 \textcolor{comment}{         * need to decide if we are running on a big endian machine as well as}}
\DoxyCodeLine{\Hypertarget{geom__vinum__drive_8c_source_l00146}00146 \textcolor{comment}{         * checking the magic against the reverse of GV\_OLD\_MAGIC.}}
\DoxyCodeLine{\Hypertarget{geom__vinum__drive_8c_source_l00147}00147 \textcolor{comment}{         */}}
\DoxyCodeLine{\Hypertarget{geom__vinum__drive_8c_source_l00148}00148         be = (m\_hdr-\/>\mbox{\hyperlink{structgv__hdr_a959aa1edaed399d2b4ba914ccecad4f4}{magic}} == magic\_machdep);}
\DoxyCodeLine{\Hypertarget{geom__vinum__drive_8c_source_l00149}00149         \textcolor{keywordflow}{if} (m\_hdr-\/>\mbox{\hyperlink{structgv__hdr_a959aa1edaed399d2b4ba914ccecad4f4}{magic}} == \mbox{\hyperlink{geom__vinum__var_8h_a64cef7148ef7b5300d837c41ebb2a043}{GV\_MAGIC}}) \{}
\DoxyCodeLine{\Hypertarget{geom__vinum__drive_8c_source_l00150}00150                 m\_hdr-\/>\mbox{\hyperlink{structgv__hdr_aa9578dadf76608e34735a67562883257}{config\_length}} = \mbox{\hyperlink{geom__vinum__drive_8c_a253645243e48596c94cacb58e77f8467}{GV\_GET64}}(be);}
\DoxyCodeLine{\Hypertarget{geom__vinum__drive_8c_source_l00151}00151                 off = 16;}
\DoxyCodeLine{\Hypertarget{geom__vinum__drive_8c_source_l00152}00152                 bcopy(d\_hdr + off, m\_hdr-\/>\mbox{\hyperlink{structgv__hdr_a1b79d91c9f053afaf4f3b2c484d86ad6}{label}}.\mbox{\hyperlink{structgv__label_a2d6f939131335ca1ab0f2353e7574145}{sysname}}, \mbox{\hyperlink{geom__vinum__var_8h_ab5d4f058f58781a3a1c0a4d9818ec2b7}{GV\_HOSTNAME\_LEN}});}
\DoxyCodeLine{\Hypertarget{geom__vinum__drive_8c_source_l00153}00153                 off += \mbox{\hyperlink{geom__vinum__var_8h_ab5d4f058f58781a3a1c0a4d9818ec2b7}{GV\_HOSTNAME\_LEN}};}
\DoxyCodeLine{\Hypertarget{geom__vinum__drive_8c_source_l00154}00154                 bcopy(d\_hdr + off, m\_hdr-\/>\mbox{\hyperlink{structgv__hdr_a1b79d91c9f053afaf4f3b2c484d86ad6}{label}}.\mbox{\hyperlink{structgv__label_ad9f1874fb38fc9ebfc9962588757f0bc}{name}}, \mbox{\hyperlink{geom__vinum__var_8h_a5b0ca71b395a8780c1056041a4a3f56c}{GV\_MAXDRIVENAME}});}
\DoxyCodeLine{\Hypertarget{geom__vinum__drive_8c_source_l00155}00155                 off += \mbox{\hyperlink{geom__vinum__var_8h_a5b0ca71b395a8780c1056041a4a3f56c}{GV\_MAXDRIVENAME}};}
\DoxyCodeLine{\Hypertarget{geom__vinum__drive_8c_source_l00156}00156                 m\_hdr-\/>\mbox{\hyperlink{structgv__hdr_a1b79d91c9f053afaf4f3b2c484d86ad6}{label}}.\mbox{\hyperlink{structgv__label_aba23425e488a0b6a143b982ccc38e608}{date\_of\_birth}}.tv\_sec = \mbox{\hyperlink{geom__vinum__drive_8c_a253645243e48596c94cacb58e77f8467}{GV\_GET64}}(be);}
\DoxyCodeLine{\Hypertarget{geom__vinum__drive_8c_source_l00157}00157                 m\_hdr-\/>\mbox{\hyperlink{structgv__hdr_a1b79d91c9f053afaf4f3b2c484d86ad6}{label}}.\mbox{\hyperlink{structgv__label_aba23425e488a0b6a143b982ccc38e608}{date\_of\_birth}}.tv\_usec = \mbox{\hyperlink{geom__vinum__drive_8c_a253645243e48596c94cacb58e77f8467}{GV\_GET64}}(be);}
\DoxyCodeLine{\Hypertarget{geom__vinum__drive_8c_source_l00158}00158                 m\_hdr-\/>\mbox{\hyperlink{structgv__hdr_a1b79d91c9f053afaf4f3b2c484d86ad6}{label}}.\mbox{\hyperlink{structgv__label_ab9734ccbc7a3a4f46ffbbff40c4a41c4}{last\_update}}.tv\_sec = \mbox{\hyperlink{geom__vinum__drive_8c_a253645243e48596c94cacb58e77f8467}{GV\_GET64}}(be);}
\DoxyCodeLine{\Hypertarget{geom__vinum__drive_8c_source_l00159}00159                 m\_hdr-\/>\mbox{\hyperlink{structgv__hdr_a1b79d91c9f053afaf4f3b2c484d86ad6}{label}}.\mbox{\hyperlink{structgv__label_ab9734ccbc7a3a4f46ffbbff40c4a41c4}{last\_update}}.tv\_usec = \mbox{\hyperlink{geom__vinum__drive_8c_a253645243e48596c94cacb58e77f8467}{GV\_GET64}}(be);}
\DoxyCodeLine{\Hypertarget{geom__vinum__drive_8c_source_l00160}00160                 m\_hdr-\/>\mbox{\hyperlink{structgv__hdr_a1b79d91c9f053afaf4f3b2c484d86ad6}{label}}.\mbox{\hyperlink{structgv__label_abec50855cb03cff9fa2cfc19947e5e5e}{drive\_size}} = \mbox{\hyperlink{geom__vinum__drive_8c_a253645243e48596c94cacb58e77f8467}{GV\_GET64}}(be);}
\DoxyCodeLine{\Hypertarget{geom__vinum__drive_8c_source_l00161}00161         \} \textcolor{keywordflow}{else} \textcolor{keywordflow}{if} (m\_hdr-\/>\mbox{\hyperlink{structgv__hdr_a959aa1edaed399d2b4ba914ccecad4f4}{magic}} != \mbox{\hyperlink{geom__vinum__var_8h_acedf054504b600dbb465cdfd4b3546a4}{GV\_OLD\_MAGIC}} \&\&}
\DoxyCodeLine{\Hypertarget{geom__vinum__drive_8c_source_l00162}00162             m\_hdr-\/>\mbox{\hyperlink{structgv__hdr_a959aa1edaed399d2b4ba914ccecad4f4}{magic}} != le64toh(\mbox{\hyperlink{geom__vinum__var_8h_acedf054504b600dbb465cdfd4b3546a4}{GV\_OLD\_MAGIC}})) \{}
\DoxyCodeLine{\Hypertarget{geom__vinum__drive_8c_source_l00163}00163                 \textcolor{comment}{/* Not a gvinum drive. */}}
\DoxyCodeLine{\Hypertarget{geom__vinum__drive_8c_source_l00164}00164                 \mbox{\hyperlink{geom_8h_ad9924deb20de7b40cb6cf06e5ae28855}{g\_free}}(d\_hdr);}
\DoxyCodeLine{\Hypertarget{geom__vinum__drive_8c_source_l00165}00165                 \textcolor{keywordflow}{return} (-\/1);}
\DoxyCodeLine{\Hypertarget{geom__vinum__drive_8c_source_l00166}00166         \} \textcolor{keywordflow}{else} \textcolor{keywordflow}{if} (\mbox{\hyperlink{geom__vinum__drive_8c_a828ea06052039d3009966317c6b369f3}{gv\_legacy\_header\_type}}(d\_hdr, be) == \mbox{\hyperlink{geom__vinum__drive_8c_ae13c272dab4e657343d4a8e85363c061}{GV\_LEGACY\_SPARC64}}) \{}
\DoxyCodeLine{\Hypertarget{geom__vinum__drive_8c_source_l00167}00167                 \mbox{\hyperlink{geom__vinum_8h_a28cdbd7c30e435ff9ec8676f493593a0}{G\_VINUM\_DEBUG}}(1, \textcolor{stringliteral}{"{}detected legacy sparc64 header"{}});}
\DoxyCodeLine{\Hypertarget{geom__vinum__drive_8c_source_l00168}00168                 m\_hdr-\/>\mbox{\hyperlink{structgv__hdr_a959aa1edaed399d2b4ba914ccecad4f4}{magic}} = \mbox{\hyperlink{geom__vinum__var_8h_a64cef7148ef7b5300d837c41ebb2a043}{GV\_MAGIC}};}
\DoxyCodeLine{\Hypertarget{geom__vinum__drive_8c_source_l00169}00169                 \textcolor{comment}{/* Legacy sparc64 on-\/disk header */}}
\DoxyCodeLine{\Hypertarget{geom__vinum__drive_8c_source_l00170}00170                 m\_hdr-\/>\mbox{\hyperlink{structgv__hdr_aa9578dadf76608e34735a67562883257}{config\_length}} = \mbox{\hyperlink{geom__vinum__drive_8c_a253645243e48596c94cacb58e77f8467}{GV\_GET64}}(be);}
\DoxyCodeLine{\Hypertarget{geom__vinum__drive_8c_source_l00171}00171                 bcopy(d\_hdr + 16, m\_hdr-\/>\mbox{\hyperlink{structgv__hdr_a1b79d91c9f053afaf4f3b2c484d86ad6}{label}}.\mbox{\hyperlink{structgv__label_a2d6f939131335ca1ab0f2353e7574145}{sysname}}, \mbox{\hyperlink{geom__vinum__var_8h_ab5d4f058f58781a3a1c0a4d9818ec2b7}{GV\_HOSTNAME\_LEN}});}
\DoxyCodeLine{\Hypertarget{geom__vinum__drive_8c_source_l00172}00172                 off += \mbox{\hyperlink{geom__vinum__var_8h_ab5d4f058f58781a3a1c0a4d9818ec2b7}{GV\_HOSTNAME\_LEN}};}
\DoxyCodeLine{\Hypertarget{geom__vinum__drive_8c_source_l00173}00173                 bcopy(d\_hdr + 48, m\_hdr-\/>\mbox{\hyperlink{structgv__hdr_a1b79d91c9f053afaf4f3b2c484d86ad6}{label}}.\mbox{\hyperlink{structgv__label_ad9f1874fb38fc9ebfc9962588757f0bc}{name}}, \mbox{\hyperlink{geom__vinum__var_8h_a5b0ca71b395a8780c1056041a4a3f56c}{GV\_MAXDRIVENAME}});}
\DoxyCodeLine{\Hypertarget{geom__vinum__drive_8c_source_l00174}00174                 off += \mbox{\hyperlink{geom__vinum__var_8h_a5b0ca71b395a8780c1056041a4a3f56c}{GV\_MAXDRIVENAME}};}
\DoxyCodeLine{\Hypertarget{geom__vinum__drive_8c_source_l00175}00175                 m\_hdr-\/>\mbox{\hyperlink{structgv__hdr_a1b79d91c9f053afaf4f3b2c484d86ad6}{label}}.\mbox{\hyperlink{structgv__label_aba23425e488a0b6a143b982ccc38e608}{date\_of\_birth}}.tv\_sec = \mbox{\hyperlink{geom__vinum__drive_8c_a253645243e48596c94cacb58e77f8467}{GV\_GET64}}(be);}
\DoxyCodeLine{\Hypertarget{geom__vinum__drive_8c_source_l00176}00176                 m\_hdr-\/>\mbox{\hyperlink{structgv__hdr_a1b79d91c9f053afaf4f3b2c484d86ad6}{label}}.\mbox{\hyperlink{structgv__label_aba23425e488a0b6a143b982ccc38e608}{date\_of\_birth}}.tv\_usec = \mbox{\hyperlink{geom__vinum__drive_8c_a253645243e48596c94cacb58e77f8467}{GV\_GET64}}(be);}
\DoxyCodeLine{\Hypertarget{geom__vinum__drive_8c_source_l00177}00177                 m\_hdr-\/>\mbox{\hyperlink{structgv__hdr_a1b79d91c9f053afaf4f3b2c484d86ad6}{label}}.\mbox{\hyperlink{structgv__label_ab9734ccbc7a3a4f46ffbbff40c4a41c4}{last\_update}}.tv\_sec = \mbox{\hyperlink{geom__vinum__drive_8c_a253645243e48596c94cacb58e77f8467}{GV\_GET64}}(be);}
\DoxyCodeLine{\Hypertarget{geom__vinum__drive_8c_source_l00178}00178                 m\_hdr-\/>\mbox{\hyperlink{structgv__hdr_a1b79d91c9f053afaf4f3b2c484d86ad6}{label}}.\mbox{\hyperlink{structgv__label_ab9734ccbc7a3a4f46ffbbff40c4a41c4}{last\_update}}.tv\_usec = \mbox{\hyperlink{geom__vinum__drive_8c_a253645243e48596c94cacb58e77f8467}{GV\_GET64}}(be);}
\DoxyCodeLine{\Hypertarget{geom__vinum__drive_8c_source_l00179}00179                 m\_hdr-\/>\mbox{\hyperlink{structgv__hdr_a1b79d91c9f053afaf4f3b2c484d86ad6}{label}}.\mbox{\hyperlink{structgv__label_abec50855cb03cff9fa2cfc19947e5e5e}{drive\_size}} = \mbox{\hyperlink{geom__vinum__drive_8c_a253645243e48596c94cacb58e77f8467}{GV\_GET64}}(be);}
\DoxyCodeLine{\Hypertarget{geom__vinum__drive_8c_source_l00180}00180         \} \textcolor{keywordflow}{else} \textcolor{keywordflow}{if} (\mbox{\hyperlink{geom__vinum__drive_8c_a828ea06052039d3009966317c6b369f3}{gv\_legacy\_header\_type}}(d\_hdr, be) == \mbox{\hyperlink{geom__vinum__drive_8c_adb70fccbe32679db925e5288b5128dad}{GV\_LEGACY\_POWERPC}}) \{}
\DoxyCodeLine{\Hypertarget{geom__vinum__drive_8c_source_l00181}00181                 \mbox{\hyperlink{geom__vinum_8h_a28cdbd7c30e435ff9ec8676f493593a0}{G\_VINUM\_DEBUG}}(1, \textcolor{stringliteral}{"{}detected legacy PowerPC header"{}});}
\DoxyCodeLine{\Hypertarget{geom__vinum__drive_8c_source_l00182}00182                 m\_hdr-\/>\mbox{\hyperlink{structgv__hdr_a959aa1edaed399d2b4ba914ccecad4f4}{magic}} = \mbox{\hyperlink{geom__vinum__var_8h_a64cef7148ef7b5300d837c41ebb2a043}{GV\_MAGIC}};}
\DoxyCodeLine{\Hypertarget{geom__vinum__drive_8c_source_l00183}00183                 \textcolor{comment}{/* legacy 32-\/bit big endian on-\/disk header */}}
\DoxyCodeLine{\Hypertarget{geom__vinum__drive_8c_source_l00184}00184                 m\_hdr-\/>\mbox{\hyperlink{structgv__hdr_aa9578dadf76608e34735a67562883257}{config\_length}} = \mbox{\hyperlink{geom__vinum__drive_8c_a69186680bab5f2de674370ed7c7ba336}{GV\_GET32}}(be);}
\DoxyCodeLine{\Hypertarget{geom__vinum__drive_8c_source_l00185}00185                 bcopy(d\_hdr + off, m\_hdr-\/>\mbox{\hyperlink{structgv__hdr_a1b79d91c9f053afaf4f3b2c484d86ad6}{label}}.\mbox{\hyperlink{structgv__label_a2d6f939131335ca1ab0f2353e7574145}{sysname}}, \mbox{\hyperlink{geom__vinum__var_8h_ab5d4f058f58781a3a1c0a4d9818ec2b7}{GV\_HOSTNAME\_LEN}});}
\DoxyCodeLine{\Hypertarget{geom__vinum__drive_8c_source_l00186}00186                 off += \mbox{\hyperlink{geom__vinum__var_8h_ab5d4f058f58781a3a1c0a4d9818ec2b7}{GV\_HOSTNAME\_LEN}};}
\DoxyCodeLine{\Hypertarget{geom__vinum__drive_8c_source_l00187}00187                 bcopy(d\_hdr + off, m\_hdr-\/>\mbox{\hyperlink{structgv__hdr_a1b79d91c9f053afaf4f3b2c484d86ad6}{label}}.\mbox{\hyperlink{structgv__label_ad9f1874fb38fc9ebfc9962588757f0bc}{name}}, \mbox{\hyperlink{geom__vinum__var_8h_a5b0ca71b395a8780c1056041a4a3f56c}{GV\_MAXDRIVENAME}});}
\DoxyCodeLine{\Hypertarget{geom__vinum__drive_8c_source_l00188}00188                 off += \mbox{\hyperlink{geom__vinum__var_8h_a5b0ca71b395a8780c1056041a4a3f56c}{GV\_MAXDRIVENAME}};}
\DoxyCodeLine{\Hypertarget{geom__vinum__drive_8c_source_l00189}00189                 m\_hdr-\/>\mbox{\hyperlink{structgv__hdr_a1b79d91c9f053afaf4f3b2c484d86ad6}{label}}.\mbox{\hyperlink{structgv__label_aba23425e488a0b6a143b982ccc38e608}{date\_of\_birth}}.tv\_sec = \mbox{\hyperlink{geom__vinum__drive_8c_a69186680bab5f2de674370ed7c7ba336}{GV\_GET32}}(be);}
\DoxyCodeLine{\Hypertarget{geom__vinum__drive_8c_source_l00190}00190                 m\_hdr-\/>\mbox{\hyperlink{structgv__hdr_a1b79d91c9f053afaf4f3b2c484d86ad6}{label}}.\mbox{\hyperlink{structgv__label_aba23425e488a0b6a143b982ccc38e608}{date\_of\_birth}}.tv\_usec = \mbox{\hyperlink{geom__vinum__drive_8c_a69186680bab5f2de674370ed7c7ba336}{GV\_GET32}}(be);}
\DoxyCodeLine{\Hypertarget{geom__vinum__drive_8c_source_l00191}00191                 m\_hdr-\/>\mbox{\hyperlink{structgv__hdr_a1b79d91c9f053afaf4f3b2c484d86ad6}{label}}.\mbox{\hyperlink{structgv__label_ab9734ccbc7a3a4f46ffbbff40c4a41c4}{last\_update}}.tv\_sec = \mbox{\hyperlink{geom__vinum__drive_8c_a69186680bab5f2de674370ed7c7ba336}{GV\_GET32}}(be);}
\DoxyCodeLine{\Hypertarget{geom__vinum__drive_8c_source_l00192}00192                 m\_hdr-\/>\mbox{\hyperlink{structgv__hdr_a1b79d91c9f053afaf4f3b2c484d86ad6}{label}}.\mbox{\hyperlink{structgv__label_ab9734ccbc7a3a4f46ffbbff40c4a41c4}{last\_update}}.tv\_usec = \mbox{\hyperlink{geom__vinum__drive_8c_a69186680bab5f2de674370ed7c7ba336}{GV\_GET32}}(be);}
\DoxyCodeLine{\Hypertarget{geom__vinum__drive_8c_source_l00193}00193                 m\_hdr-\/>\mbox{\hyperlink{structgv__hdr_a1b79d91c9f053afaf4f3b2c484d86ad6}{label}}.\mbox{\hyperlink{structgv__label_abec50855cb03cff9fa2cfc19947e5e5e}{drive\_size}} = \mbox{\hyperlink{geom__vinum__drive_8c_a253645243e48596c94cacb58e77f8467}{GV\_GET64}}(be);}
\DoxyCodeLine{\Hypertarget{geom__vinum__drive_8c_source_l00194}00194         \} \textcolor{keywordflow}{else} \textcolor{keywordflow}{if} (\mbox{\hyperlink{geom__vinum__drive_8c_a828ea06052039d3009966317c6b369f3}{gv\_legacy\_header\_type}}(d\_hdr, be) == \mbox{\hyperlink{geom__vinum__drive_8c_a76d75c960d05f3940664a264de8ad557}{GV\_LEGACY\_I386}}) \{}
\DoxyCodeLine{\Hypertarget{geom__vinum__drive_8c_source_l00195}00195                 \mbox{\hyperlink{geom__vinum_8h_a28cdbd7c30e435ff9ec8676f493593a0}{G\_VINUM\_DEBUG}}(1, \textcolor{stringliteral}{"{}detected legacy i386 header"{}});}
\DoxyCodeLine{\Hypertarget{geom__vinum__drive_8c_source_l00196}00196                 m\_hdr-\/>\mbox{\hyperlink{structgv__hdr_a959aa1edaed399d2b4ba914ccecad4f4}{magic}} = \mbox{\hyperlink{geom__vinum__var_8h_a64cef7148ef7b5300d837c41ebb2a043}{GV\_MAGIC}};}
\DoxyCodeLine{\Hypertarget{geom__vinum__drive_8c_source_l00197}00197                 \textcolor{comment}{/* legacy i386 on-\/disk header */}}
\DoxyCodeLine{\Hypertarget{geom__vinum__drive_8c_source_l00198}00198                 m\_hdr-\/>\mbox{\hyperlink{structgv__hdr_aa9578dadf76608e34735a67562883257}{config\_length}} = \mbox{\hyperlink{geom__vinum__drive_8c_a69186680bab5f2de674370ed7c7ba336}{GV\_GET32}}(le);}
\DoxyCodeLine{\Hypertarget{geom__vinum__drive_8c_source_l00199}00199                 bcopy(d\_hdr + off, m\_hdr-\/>\mbox{\hyperlink{structgv__hdr_a1b79d91c9f053afaf4f3b2c484d86ad6}{label}}.\mbox{\hyperlink{structgv__label_a2d6f939131335ca1ab0f2353e7574145}{sysname}}, \mbox{\hyperlink{geom__vinum__var_8h_ab5d4f058f58781a3a1c0a4d9818ec2b7}{GV\_HOSTNAME\_LEN}});}
\DoxyCodeLine{\Hypertarget{geom__vinum__drive_8c_source_l00200}00200                 off += \mbox{\hyperlink{geom__vinum__var_8h_ab5d4f058f58781a3a1c0a4d9818ec2b7}{GV\_HOSTNAME\_LEN}};}
\DoxyCodeLine{\Hypertarget{geom__vinum__drive_8c_source_l00201}00201                 bcopy(d\_hdr + off, m\_hdr-\/>\mbox{\hyperlink{structgv__hdr_a1b79d91c9f053afaf4f3b2c484d86ad6}{label}}.\mbox{\hyperlink{structgv__label_ad9f1874fb38fc9ebfc9962588757f0bc}{name}}, \mbox{\hyperlink{geom__vinum__var_8h_a5b0ca71b395a8780c1056041a4a3f56c}{GV\_MAXDRIVENAME}});}
\DoxyCodeLine{\Hypertarget{geom__vinum__drive_8c_source_l00202}00202                 off += \mbox{\hyperlink{geom__vinum__var_8h_a5b0ca71b395a8780c1056041a4a3f56c}{GV\_MAXDRIVENAME}};}
\DoxyCodeLine{\Hypertarget{geom__vinum__drive_8c_source_l00203}00203                 m\_hdr-\/>\mbox{\hyperlink{structgv__hdr_a1b79d91c9f053afaf4f3b2c484d86ad6}{label}}.\mbox{\hyperlink{structgv__label_aba23425e488a0b6a143b982ccc38e608}{date\_of\_birth}}.tv\_sec = \mbox{\hyperlink{geom__vinum__drive_8c_a69186680bab5f2de674370ed7c7ba336}{GV\_GET32}}(le);}
\DoxyCodeLine{\Hypertarget{geom__vinum__drive_8c_source_l00204}00204                 m\_hdr-\/>\mbox{\hyperlink{structgv__hdr_a1b79d91c9f053afaf4f3b2c484d86ad6}{label}}.\mbox{\hyperlink{structgv__label_aba23425e488a0b6a143b982ccc38e608}{date\_of\_birth}}.tv\_usec = \mbox{\hyperlink{geom__vinum__drive_8c_a69186680bab5f2de674370ed7c7ba336}{GV\_GET32}}(le);}
\DoxyCodeLine{\Hypertarget{geom__vinum__drive_8c_source_l00205}00205                 m\_hdr-\/>\mbox{\hyperlink{structgv__hdr_a1b79d91c9f053afaf4f3b2c484d86ad6}{label}}.\mbox{\hyperlink{structgv__label_ab9734ccbc7a3a4f46ffbbff40c4a41c4}{last\_update}}.tv\_sec = \mbox{\hyperlink{geom__vinum__drive_8c_a69186680bab5f2de674370ed7c7ba336}{GV\_GET32}}(le);}
\DoxyCodeLine{\Hypertarget{geom__vinum__drive_8c_source_l00206}00206                 m\_hdr-\/>\mbox{\hyperlink{structgv__hdr_a1b79d91c9f053afaf4f3b2c484d86ad6}{label}}.\mbox{\hyperlink{structgv__label_ab9734ccbc7a3a4f46ffbbff40c4a41c4}{last\_update}}.tv\_usec = \mbox{\hyperlink{geom__vinum__drive_8c_a69186680bab5f2de674370ed7c7ba336}{GV\_GET32}}(le);}
\DoxyCodeLine{\Hypertarget{geom__vinum__drive_8c_source_l00207}00207                 m\_hdr-\/>\mbox{\hyperlink{structgv__hdr_a1b79d91c9f053afaf4f3b2c484d86ad6}{label}}.\mbox{\hyperlink{structgv__label_abec50855cb03cff9fa2cfc19947e5e5e}{drive\_size}} = \mbox{\hyperlink{geom__vinum__drive_8c_a253645243e48596c94cacb58e77f8467}{GV\_GET64}}(le);}
\DoxyCodeLine{\Hypertarget{geom__vinum__drive_8c_source_l00208}00208         \} \textcolor{keywordflow}{else} \{}
\DoxyCodeLine{\Hypertarget{geom__vinum__drive_8c_source_l00209}00209                 \mbox{\hyperlink{geom__vinum_8h_a28cdbd7c30e435ff9ec8676f493593a0}{G\_VINUM\_DEBUG}}(1, \textcolor{stringliteral}{"{}detected legacy amd64 header"{}});}
\DoxyCodeLine{\Hypertarget{geom__vinum__drive_8c_source_l00210}00210                 m\_hdr-\/>\mbox{\hyperlink{structgv__hdr_a959aa1edaed399d2b4ba914ccecad4f4}{magic}} = \mbox{\hyperlink{geom__vinum__var_8h_a64cef7148ef7b5300d837c41ebb2a043}{GV\_MAGIC}};}
\DoxyCodeLine{\Hypertarget{geom__vinum__drive_8c_source_l00211}00211                 \textcolor{comment}{/* legacy amd64 on-\/disk header */}}
\DoxyCodeLine{\Hypertarget{geom__vinum__drive_8c_source_l00212}00212                 m\_hdr-\/>\mbox{\hyperlink{structgv__hdr_aa9578dadf76608e34735a67562883257}{config\_length}} = \mbox{\hyperlink{geom__vinum__drive_8c_a253645243e48596c94cacb58e77f8467}{GV\_GET64}}(le);}
\DoxyCodeLine{\Hypertarget{geom__vinum__drive_8c_source_l00213}00213                 bcopy(d\_hdr + 16, m\_hdr-\/>\mbox{\hyperlink{structgv__hdr_a1b79d91c9f053afaf4f3b2c484d86ad6}{label}}.\mbox{\hyperlink{structgv__label_a2d6f939131335ca1ab0f2353e7574145}{sysname}}, \mbox{\hyperlink{geom__vinum__var_8h_ab5d4f058f58781a3a1c0a4d9818ec2b7}{GV\_HOSTNAME\_LEN}});}
\DoxyCodeLine{\Hypertarget{geom__vinum__drive_8c_source_l00214}00214                 off += \mbox{\hyperlink{geom__vinum__var_8h_ab5d4f058f58781a3a1c0a4d9818ec2b7}{GV\_HOSTNAME\_LEN}};}
\DoxyCodeLine{\Hypertarget{geom__vinum__drive_8c_source_l00215}00215                 bcopy(d\_hdr + 48, m\_hdr-\/>\mbox{\hyperlink{structgv__hdr_a1b79d91c9f053afaf4f3b2c484d86ad6}{label}}.\mbox{\hyperlink{structgv__label_ad9f1874fb38fc9ebfc9962588757f0bc}{name}}, \mbox{\hyperlink{geom__vinum__var_8h_a5b0ca71b395a8780c1056041a4a3f56c}{GV\_MAXDRIVENAME}});}
\DoxyCodeLine{\Hypertarget{geom__vinum__drive_8c_source_l00216}00216                 off += \mbox{\hyperlink{geom__vinum__var_8h_a5b0ca71b395a8780c1056041a4a3f56c}{GV\_MAXDRIVENAME}};}
\DoxyCodeLine{\Hypertarget{geom__vinum__drive_8c_source_l00217}00217                 m\_hdr-\/>\mbox{\hyperlink{structgv__hdr_a1b79d91c9f053afaf4f3b2c484d86ad6}{label}}.\mbox{\hyperlink{structgv__label_aba23425e488a0b6a143b982ccc38e608}{date\_of\_birth}}.tv\_sec = \mbox{\hyperlink{geom__vinum__drive_8c_a253645243e48596c94cacb58e77f8467}{GV\_GET64}}(le);}
\DoxyCodeLine{\Hypertarget{geom__vinum__drive_8c_source_l00218}00218                 m\_hdr-\/>\mbox{\hyperlink{structgv__hdr_a1b79d91c9f053afaf4f3b2c484d86ad6}{label}}.\mbox{\hyperlink{structgv__label_aba23425e488a0b6a143b982ccc38e608}{date\_of\_birth}}.tv\_usec = \mbox{\hyperlink{geom__vinum__drive_8c_a253645243e48596c94cacb58e77f8467}{GV\_GET64}}(le);}
\DoxyCodeLine{\Hypertarget{geom__vinum__drive_8c_source_l00219}00219                 m\_hdr-\/>\mbox{\hyperlink{structgv__hdr_a1b79d91c9f053afaf4f3b2c484d86ad6}{label}}.\mbox{\hyperlink{structgv__label_ab9734ccbc7a3a4f46ffbbff40c4a41c4}{last\_update}}.tv\_sec = \mbox{\hyperlink{geom__vinum__drive_8c_a253645243e48596c94cacb58e77f8467}{GV\_GET64}}(le);}
\DoxyCodeLine{\Hypertarget{geom__vinum__drive_8c_source_l00220}00220                 m\_hdr-\/>\mbox{\hyperlink{structgv__hdr_a1b79d91c9f053afaf4f3b2c484d86ad6}{label}}.\mbox{\hyperlink{structgv__label_ab9734ccbc7a3a4f46ffbbff40c4a41c4}{last\_update}}.tv\_usec = \mbox{\hyperlink{geom__vinum__drive_8c_a253645243e48596c94cacb58e77f8467}{GV\_GET64}}(le);}
\DoxyCodeLine{\Hypertarget{geom__vinum__drive_8c_source_l00221}00221                 m\_hdr-\/>\mbox{\hyperlink{structgv__hdr_a1b79d91c9f053afaf4f3b2c484d86ad6}{label}}.\mbox{\hyperlink{structgv__label_abec50855cb03cff9fa2cfc19947e5e5e}{drive\_size}} = \mbox{\hyperlink{geom__vinum__drive_8c_a253645243e48596c94cacb58e77f8467}{GV\_GET64}}(le);}
\DoxyCodeLine{\Hypertarget{geom__vinum__drive_8c_source_l00222}00222         \}}
\DoxyCodeLine{\Hypertarget{geom__vinum__drive_8c_source_l00223}00223 }
\DoxyCodeLine{\Hypertarget{geom__vinum__drive_8c_source_l00224}00224         \mbox{\hyperlink{geom_8h_ad9924deb20de7b40cb6cf06e5ae28855}{g\_free}}(d\_hdr);}
\DoxyCodeLine{\Hypertarget{geom__vinum__drive_8c_source_l00225}00225         \textcolor{keywordflow}{return} (0);}
\DoxyCodeLine{\Hypertarget{geom__vinum__drive_8c_source_l00226}00226 \}}
\DoxyCodeLine{\Hypertarget{geom__vinum__drive_8c_source_l00227}00227 }
\DoxyCodeLine{\Hypertarget{geom__vinum__drive_8c_source_l00228}00228 \textcolor{comment}{/* Write out the gvinum header. */}}
\DoxyCodeLine{\Hypertarget{geom__vinum__drive_8c_source_l00229}00229 \textcolor{keywordtype}{int}}
\DoxyCodeLine{\Hypertarget{geom__vinum__drive_8c_source_l00230}\mbox{\hyperlink{geom__vinum_8h_af58328361d459df23c7f699bf193ff7c}{00230}} \mbox{\hyperlink{geom__vinum__drive_8c_a651cce3d7d64094a9e8b38a9004ad81c}{gv\_write\_header}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structg__consumer}{g\_consumer}} *\mbox{\hyperlink{g__part__if_8m_a294f18324585ff37641fb8aa1c9ccd82}{cp}}, \textcolor{keyword}{struct} \mbox{\hyperlink{structgv__hdr}{gv\_hdr}} *m\_hdr)}
\DoxyCodeLine{\Hypertarget{geom__vinum__drive_8c_source_l00231}00231 \{}
\DoxyCodeLine{\Hypertarget{geom__vinum__drive_8c_source_l00232}00232         \mbox{\hyperlink{binstream_8h_ab077fa1127453be2bd9d4c3c8a768fa7}{uint8\_t}} d\_hdr[\mbox{\hyperlink{geom__vinum__var_8h_a1be1fbdcd7d6587989a4f92a552ab05a}{GV\_HDR\_LEN}}];}
\DoxyCodeLine{\Hypertarget{geom__vinum__drive_8c_source_l00233}00233         \textcolor{keywordtype}{int} off, ret;}
\DoxyCodeLine{\Hypertarget{geom__vinum__drive_8c_source_l00234}00234 }
\DoxyCodeLine{\Hypertarget{geom__vinum__drive_8c_source_l00235}00235 \textcolor{preprocessor}{\#define GV\_SET64BE(field)                                       \(\backslash\)}}
\DoxyCodeLine{\Hypertarget{geom__vinum__drive_8c_source_l00236}00236 \textcolor{preprocessor}{        do \{                                                    \(\backslash\)}}
\DoxyCodeLine{\Hypertarget{geom__vinum__drive_8c_source_l00237}00237 \textcolor{preprocessor}{                *((uint64\_t *)\&d\_hdr[off]) = htobe64(field);    \(\backslash\)}}
\DoxyCodeLine{\Hypertarget{geom__vinum__drive_8c_source_l00238}00238 \textcolor{preprocessor}{                off += 8;                                       \(\backslash\)}}
\DoxyCodeLine{\Hypertarget{geom__vinum__drive_8c_source_l00239}00239 \textcolor{preprocessor}{        \} while (0)}}
\DoxyCodeLine{\Hypertarget{geom__vinum__drive_8c_source_l00240}00240 }
\DoxyCodeLine{\Hypertarget{geom__vinum__drive_8c_source_l00241}00241         KASSERT(m\_hdr != NULL, (\textcolor{stringliteral}{"{}gv\_write\_header: null m\_hdr"{}}));}
\DoxyCodeLine{\Hypertarget{geom__vinum__drive_8c_source_l00242}00242 }
\DoxyCodeLine{\Hypertarget{geom__vinum__drive_8c_source_l00243}00243         off = 0;}
\DoxyCodeLine{\Hypertarget{geom__vinum__drive_8c_source_l00244}00244         memset(d\_hdr, 0, \mbox{\hyperlink{geom__vinum__var_8h_a1be1fbdcd7d6587989a4f92a552ab05a}{GV\_HDR\_LEN}});}
\DoxyCodeLine{\Hypertarget{geom__vinum__drive_8c_source_l00245}00245         \mbox{\hyperlink{geom__vinum__drive_8c_a9c4acd760c44d5ee2f25d3b3b0c1df9f}{GV\_SET64BE}}(m\_hdr-\/>\mbox{\hyperlink{structgv__hdr_a959aa1edaed399d2b4ba914ccecad4f4}{magic}});}
\DoxyCodeLine{\Hypertarget{geom__vinum__drive_8c_source_l00246}00246         \mbox{\hyperlink{geom__vinum__drive_8c_a9c4acd760c44d5ee2f25d3b3b0c1df9f}{GV\_SET64BE}}(m\_hdr-\/>\mbox{\hyperlink{structgv__hdr_aa9578dadf76608e34735a67562883257}{config\_length}});}
\DoxyCodeLine{\Hypertarget{geom__vinum__drive_8c_source_l00247}00247         off = 16;}
\DoxyCodeLine{\Hypertarget{geom__vinum__drive_8c_source_l00248}00248         bcopy(m\_hdr-\/>\mbox{\hyperlink{structgv__hdr_a1b79d91c9f053afaf4f3b2c484d86ad6}{label}}.\mbox{\hyperlink{structgv__label_a2d6f939131335ca1ab0f2353e7574145}{sysname}}, d\_hdr + off, \mbox{\hyperlink{geom__vinum__var_8h_ab5d4f058f58781a3a1c0a4d9818ec2b7}{GV\_HOSTNAME\_LEN}});}
\DoxyCodeLine{\Hypertarget{geom__vinum__drive_8c_source_l00249}00249         off += \mbox{\hyperlink{geom__vinum__var_8h_ab5d4f058f58781a3a1c0a4d9818ec2b7}{GV\_HOSTNAME\_LEN}};}
\DoxyCodeLine{\Hypertarget{geom__vinum__drive_8c_source_l00250}00250         bcopy(m\_hdr-\/>\mbox{\hyperlink{structgv__hdr_a1b79d91c9f053afaf4f3b2c484d86ad6}{label}}.\mbox{\hyperlink{structgv__label_ad9f1874fb38fc9ebfc9962588757f0bc}{name}}, d\_hdr + off, \mbox{\hyperlink{geom__vinum__var_8h_a5b0ca71b395a8780c1056041a4a3f56c}{GV\_MAXDRIVENAME}});}
\DoxyCodeLine{\Hypertarget{geom__vinum__drive_8c_source_l00251}00251         off += \mbox{\hyperlink{geom__vinum__var_8h_a5b0ca71b395a8780c1056041a4a3f56c}{GV\_MAXDRIVENAME}};}
\DoxyCodeLine{\Hypertarget{geom__vinum__drive_8c_source_l00252}00252         \mbox{\hyperlink{geom__vinum__drive_8c_a9c4acd760c44d5ee2f25d3b3b0c1df9f}{GV\_SET64BE}}(m\_hdr-\/>\mbox{\hyperlink{structgv__hdr_a1b79d91c9f053afaf4f3b2c484d86ad6}{label}}.\mbox{\hyperlink{structgv__label_aba23425e488a0b6a143b982ccc38e608}{date\_of\_birth}}.tv\_sec);}
\DoxyCodeLine{\Hypertarget{geom__vinum__drive_8c_source_l00253}00253         \mbox{\hyperlink{geom__vinum__drive_8c_a9c4acd760c44d5ee2f25d3b3b0c1df9f}{GV\_SET64BE}}(m\_hdr-\/>\mbox{\hyperlink{structgv__hdr_a1b79d91c9f053afaf4f3b2c484d86ad6}{label}}.\mbox{\hyperlink{structgv__label_aba23425e488a0b6a143b982ccc38e608}{date\_of\_birth}}.tv\_usec);}
\DoxyCodeLine{\Hypertarget{geom__vinum__drive_8c_source_l00254}00254         \mbox{\hyperlink{geom__vinum__drive_8c_a9c4acd760c44d5ee2f25d3b3b0c1df9f}{GV\_SET64BE}}(m\_hdr-\/>\mbox{\hyperlink{structgv__hdr_a1b79d91c9f053afaf4f3b2c484d86ad6}{label}}.\mbox{\hyperlink{structgv__label_ab9734ccbc7a3a4f46ffbbff40c4a41c4}{last\_update}}.tv\_sec);}
\DoxyCodeLine{\Hypertarget{geom__vinum__drive_8c_source_l00255}00255         \mbox{\hyperlink{geom__vinum__drive_8c_a9c4acd760c44d5ee2f25d3b3b0c1df9f}{GV\_SET64BE}}(m\_hdr-\/>\mbox{\hyperlink{structgv__hdr_a1b79d91c9f053afaf4f3b2c484d86ad6}{label}}.\mbox{\hyperlink{structgv__label_ab9734ccbc7a3a4f46ffbbff40c4a41c4}{last\_update}}.tv\_usec);}
\DoxyCodeLine{\Hypertarget{geom__vinum__drive_8c_source_l00256}00256         \mbox{\hyperlink{geom__vinum__drive_8c_a9c4acd760c44d5ee2f25d3b3b0c1df9f}{GV\_SET64BE}}(m\_hdr-\/>\mbox{\hyperlink{structgv__hdr_a1b79d91c9f053afaf4f3b2c484d86ad6}{label}}.\mbox{\hyperlink{structgv__label_abec50855cb03cff9fa2cfc19947e5e5e}{drive\_size}});}
\DoxyCodeLine{\Hypertarget{geom__vinum__drive_8c_source_l00257}00257 }
\DoxyCodeLine{\Hypertarget{geom__vinum__drive_8c_source_l00258}00258         ret = \mbox{\hyperlink{geom_8h_a9b87ecbd812c109546b077da483baada}{g\_write\_data}}(\mbox{\hyperlink{g__part__if_8m_a294f18324585ff37641fb8aa1c9ccd82}{cp}}, \mbox{\hyperlink{geom__vinum__var_8h_adb0ec2b339a204b6ff15f4928e9d58a1}{GV\_HDR\_OFFSET}}, d\_hdr, \mbox{\hyperlink{geom__vinum__var_8h_a1be1fbdcd7d6587989a4f92a552ab05a}{GV\_HDR\_LEN}});}
\DoxyCodeLine{\Hypertarget{geom__vinum__drive_8c_source_l00259}00259         \textcolor{keywordflow}{return} (ret);}
\DoxyCodeLine{\Hypertarget{geom__vinum__drive_8c_source_l00260}00260 \}}
\DoxyCodeLine{\Hypertarget{geom__vinum__drive_8c_source_l00261}00261 }
\DoxyCodeLine{\Hypertarget{geom__vinum__drive_8c_source_l00262}00262 \textcolor{comment}{/* Save the vinum configuration back to each involved disk. */}}
\DoxyCodeLine{\Hypertarget{geom__vinum__drive_8c_source_l00263}00263 \textcolor{keywordtype}{void}}
\DoxyCodeLine{\Hypertarget{geom__vinum__drive_8c_source_l00264}\mbox{\hyperlink{geom__vinum_8h_a893e3b157c798b3f925d71151d284dd9}{00264}} \mbox{\hyperlink{geom__vinum__drive_8c_a1bf3f6e64a701267a37c6f6077dc0d0e}{gv\_save\_config}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structgv__softc}{gv\_softc}} *sc)}
\DoxyCodeLine{\Hypertarget{geom__vinum__drive_8c_source_l00265}00265 \{}
\DoxyCodeLine{\Hypertarget{geom__vinum__drive_8c_source_l00266}00266         \textcolor{keyword}{struct }\mbox{\hyperlink{structg__consumer}{g\_consumer}} *\mbox{\hyperlink{g__part__if_8m_a294f18324585ff37641fb8aa1c9ccd82}{cp}};}
\DoxyCodeLine{\Hypertarget{geom__vinum__drive_8c_source_l00267}00267         \textcolor{keyword}{struct }\mbox{\hyperlink{structgv__drive}{gv\_drive}} *d;}
\DoxyCodeLine{\Hypertarget{geom__vinum__drive_8c_source_l00268}00268         \textcolor{keyword}{struct }\mbox{\hyperlink{structgv__hdr}{gv\_hdr}} *vhdr, *hdr;}
\DoxyCodeLine{\Hypertarget{geom__vinum__drive_8c_source_l00269}00269         \textcolor{keyword}{struct }sbuf *\mbox{\hyperlink{g__part__if_8m_a4c23eb4bab5aa5d69bd84384b94d1f79}{sb}};}
\DoxyCodeLine{\Hypertarget{geom__vinum__drive_8c_source_l00270}00270         \textcolor{keyword}{struct }timeval last\_update;}
\DoxyCodeLine{\Hypertarget{geom__vinum__drive_8c_source_l00271}00271         \textcolor{keywordtype}{int} error;}
\DoxyCodeLine{\Hypertarget{geom__vinum__drive_8c_source_l00272}00272 }
\DoxyCodeLine{\Hypertarget{geom__vinum__drive_8c_source_l00273}00273         KASSERT(sc != NULL, (\textcolor{stringliteral}{"{}gv\_save\_config: null sc"{}}));}
\DoxyCodeLine{\Hypertarget{geom__vinum__drive_8c_source_l00274}00274 }
\DoxyCodeLine{\Hypertarget{geom__vinum__drive_8c_source_l00275}00275         vhdr = \mbox{\hyperlink{geom_8h_a0f190247baa73dc863a79fea9d5f6b4f}{g\_malloc}}(\mbox{\hyperlink{geom__vinum__var_8h_a1be1fbdcd7d6587989a4f92a552ab05a}{GV\_HDR\_LEN}}, M\_WAITOK | M\_ZERO);}
\DoxyCodeLine{\Hypertarget{geom__vinum__drive_8c_source_l00276}00276         vhdr-\/>\mbox{\hyperlink{structgv__hdr_a959aa1edaed399d2b4ba914ccecad4f4}{magic}} = \mbox{\hyperlink{geom__vinum__var_8h_a64cef7148ef7b5300d837c41ebb2a043}{GV\_MAGIC}};}
\DoxyCodeLine{\Hypertarget{geom__vinum__drive_8c_source_l00277}00277         vhdr-\/>\mbox{\hyperlink{structgv__hdr_aa9578dadf76608e34735a67562883257}{config\_length}} = \mbox{\hyperlink{geom__vinum__var_8h_a6c3c83ed812a770435735ffed804e98f}{GV\_CFG\_LEN}};}
\DoxyCodeLine{\Hypertarget{geom__vinum__drive_8c_source_l00278}00278         microtime(\&last\_update);}
\DoxyCodeLine{\Hypertarget{geom__vinum__drive_8c_source_l00279}00279 }
\DoxyCodeLine{\Hypertarget{geom__vinum__drive_8c_source_l00280}00280         \mbox{\hyperlink{g__part__if_8m_a4c23eb4bab5aa5d69bd84384b94d1f79}{sb}} = sbuf\_new(NULL, NULL, \mbox{\hyperlink{geom__vinum__var_8h_a6c3c83ed812a770435735ffed804e98f}{GV\_CFG\_LEN}}, SBUF\_FIXEDLEN);}
\DoxyCodeLine{\Hypertarget{geom__vinum__drive_8c_source_l00281}00281         \mbox{\hyperlink{geom__vinum_8h_a648dad3068f6e60194ff25666b30da72}{gv\_format\_config}}(sc, \mbox{\hyperlink{g__part__if_8m_a4c23eb4bab5aa5d69bd84384b94d1f79}{sb}}, 1, NULL);}
\DoxyCodeLine{\Hypertarget{geom__vinum__drive_8c_source_l00282}00282         sbuf\_finish(\mbox{\hyperlink{g__part__if_8m_a4c23eb4bab5aa5d69bd84384b94d1f79}{sb}});}
\DoxyCodeLine{\Hypertarget{geom__vinum__drive_8c_source_l00283}00283 }
\DoxyCodeLine{\Hypertarget{geom__vinum__drive_8c_source_l00284}00284         LIST\_FOREACH(d, \&sc-\/>drives, drive) \{}
\DoxyCodeLine{\Hypertarget{geom__vinum__drive_8c_source_l00285}00285                 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{geom__vinum__drive_8c_source_l00286}00286 \textcolor{comment}{                 * We can't save the config on a drive that isn't up, but}}
\DoxyCodeLine{\Hypertarget{geom__vinum__drive_8c_source_l00287}00287 \textcolor{comment}{                 * drives that were just created aren't officially up yet, so}}
\DoxyCodeLine{\Hypertarget{geom__vinum__drive_8c_source_l00288}00288 \textcolor{comment}{                 * we check a special flag.}}
\DoxyCodeLine{\Hypertarget{geom__vinum__drive_8c_source_l00289}00289 \textcolor{comment}{                 */}}
\DoxyCodeLine{\Hypertarget{geom__vinum__drive_8c_source_l00290}00290                 \textcolor{keywordflow}{if} (d-\/>\mbox{\hyperlink{structgv__drive_af2b798d0717a723c580025dc04416ce7}{state}} != \mbox{\hyperlink{geom__vinum__var_8h_a8a76c535d700d8c84cb573b43fd010f7}{GV\_DRIVE\_UP}})}
\DoxyCodeLine{\Hypertarget{geom__vinum__drive_8c_source_l00291}00291                         \textcolor{keywordflow}{continue};}
\DoxyCodeLine{\Hypertarget{geom__vinum__drive_8c_source_l00292}00292 }
\DoxyCodeLine{\Hypertarget{geom__vinum__drive_8c_source_l00293}00293                 \mbox{\hyperlink{g__part__if_8m_a294f18324585ff37641fb8aa1c9ccd82}{cp}} = d-\/>\mbox{\hyperlink{structgv__drive_a69dfc95c0bafb10b4239b5d45059e85d}{consumer}};}
\DoxyCodeLine{\Hypertarget{geom__vinum__drive_8c_source_l00294}00294                 \textcolor{keywordflow}{if} (\mbox{\hyperlink{g__part__if_8m_a294f18324585ff37641fb8aa1c9ccd82}{cp}} == NULL) \{}
\DoxyCodeLine{\Hypertarget{geom__vinum__drive_8c_source_l00295}00295                         \mbox{\hyperlink{geom__vinum_8h_a28cdbd7c30e435ff9ec8676f493593a0}{G\_VINUM\_DEBUG}}(0, \textcolor{stringliteral}{"{}drive '\%s' has no consumer!"{}},}
\DoxyCodeLine{\Hypertarget{geom__vinum__drive_8c_source_l00296}00296                             d-\/>\mbox{\hyperlink{structgv__drive_a69e5c72365075804074d21c056111ebf}{name}});}
\DoxyCodeLine{\Hypertarget{geom__vinum__drive_8c_source_l00297}00297                         \textcolor{keywordflow}{continue};}
\DoxyCodeLine{\Hypertarget{geom__vinum__drive_8c_source_l00298}00298                 \}}
\DoxyCodeLine{\Hypertarget{geom__vinum__drive_8c_source_l00299}00299 }
\DoxyCodeLine{\Hypertarget{geom__vinum__drive_8c_source_l00300}00300                 hdr = d-\/>\mbox{\hyperlink{structgv__drive_a22fd8c09eb90dd896835874d2a0c2601}{hdr}};}
\DoxyCodeLine{\Hypertarget{geom__vinum__drive_8c_source_l00301}00301                 \textcolor{keywordflow}{if} (hdr == NULL) \{}
\DoxyCodeLine{\Hypertarget{geom__vinum__drive_8c_source_l00302}00302                         \mbox{\hyperlink{geom__vinum_8h_a28cdbd7c30e435ff9ec8676f493593a0}{G\_VINUM\_DEBUG}}(0, \textcolor{stringliteral}{"{}drive '\%s' has no header"{}},}
\DoxyCodeLine{\Hypertarget{geom__vinum__drive_8c_source_l00303}00303                             d-\/>\mbox{\hyperlink{structgv__drive_a69e5c72365075804074d21c056111ebf}{name}});}
\DoxyCodeLine{\Hypertarget{geom__vinum__drive_8c_source_l00304}00304                         \mbox{\hyperlink{geom_8h_ad9924deb20de7b40cb6cf06e5ae28855}{g\_free}}(vhdr);}
\DoxyCodeLine{\Hypertarget{geom__vinum__drive_8c_source_l00305}00305                         \textcolor{keywordflow}{continue};}
\DoxyCodeLine{\Hypertarget{geom__vinum__drive_8c_source_l00306}00306                 \}}
\DoxyCodeLine{\Hypertarget{geom__vinum__drive_8c_source_l00307}00307                 bcopy(\&last\_update, \&hdr-\/>\mbox{\hyperlink{structgv__hdr_a1b79d91c9f053afaf4f3b2c484d86ad6}{label}}.\mbox{\hyperlink{structgv__label_ab9734ccbc7a3a4f46ffbbff40c4a41c4}{last\_update}},}
\DoxyCodeLine{\Hypertarget{geom__vinum__drive_8c_source_l00308}00308                     \textcolor{keyword}{sizeof}(\textcolor{keyword}{struct} timeval));}
\DoxyCodeLine{\Hypertarget{geom__vinum__drive_8c_source_l00309}00309                 bcopy(\&hdr-\/>\mbox{\hyperlink{structgv__hdr_a1b79d91c9f053afaf4f3b2c484d86ad6}{label}}, \&vhdr-\/>\mbox{\hyperlink{structgv__hdr_a1b79d91c9f053afaf4f3b2c484d86ad6}{label}}, \textcolor{keyword}{sizeof}(\textcolor{keyword}{struct} \mbox{\hyperlink{structgv__label}{gv\_label}}));}
\DoxyCodeLine{\Hypertarget{geom__vinum__drive_8c_source_l00310}00310                 \mbox{\hyperlink{geom_8h_a232419d2cfa06ff3f4ff7551041aed31}{g\_topology\_lock}}();}
\DoxyCodeLine{\Hypertarget{geom__vinum__drive_8c_source_l00311}00311                 error = \mbox{\hyperlink{geom_8h_a27b7c72cc3bc5a4d07ce5976e1aa1b58}{g\_access}}(\mbox{\hyperlink{g__part__if_8m_a294f18324585ff37641fb8aa1c9ccd82}{cp}}, 0, 1, 0);}
\DoxyCodeLine{\Hypertarget{geom__vinum__drive_8c_source_l00312}00312                 \textcolor{keywordflow}{if} (error) \{}
\DoxyCodeLine{\Hypertarget{geom__vinum__drive_8c_source_l00313}00313                         \mbox{\hyperlink{geom__vinum_8h_a28cdbd7c30e435ff9ec8676f493593a0}{G\_VINUM\_DEBUG}}(0, \textcolor{stringliteral}{"{}g\_access failed on "{}}}
\DoxyCodeLine{\Hypertarget{geom__vinum__drive_8c_source_l00314}00314                             \textcolor{stringliteral}{"{}drive \%s, errno \%d"{}}, d-\/>\mbox{\hyperlink{structgv__drive_a69e5c72365075804074d21c056111ebf}{name}}, error);}
\DoxyCodeLine{\Hypertarget{geom__vinum__drive_8c_source_l00315}00315                         \mbox{\hyperlink{geom_8h_a4628d4de49ba84e7a6126cc30d23b83a}{g\_topology\_unlock}}();}
\DoxyCodeLine{\Hypertarget{geom__vinum__drive_8c_source_l00316}00316                         \textcolor{keywordflow}{continue};}
\DoxyCodeLine{\Hypertarget{geom__vinum__drive_8c_source_l00317}00317                 \}}
\DoxyCodeLine{\Hypertarget{geom__vinum__drive_8c_source_l00318}00318                 \mbox{\hyperlink{geom_8h_a4628d4de49ba84e7a6126cc30d23b83a}{g\_topology\_unlock}}();}
\DoxyCodeLine{\Hypertarget{geom__vinum__drive_8c_source_l00319}00319 }
\DoxyCodeLine{\Hypertarget{geom__vinum__drive_8c_source_l00320}00320                 error = \mbox{\hyperlink{geom__vinum__drive_8c_a651cce3d7d64094a9e8b38a9004ad81c}{gv\_write\_header}}(\mbox{\hyperlink{g__part__if_8m_a294f18324585ff37641fb8aa1c9ccd82}{cp}}, vhdr);}
\DoxyCodeLine{\Hypertarget{geom__vinum__drive_8c_source_l00321}00321                 \textcolor{keywordflow}{if} (error) \{}
\DoxyCodeLine{\Hypertarget{geom__vinum__drive_8c_source_l00322}00322                         \mbox{\hyperlink{geom__vinum_8h_a28cdbd7c30e435ff9ec8676f493593a0}{G\_VINUM\_DEBUG}}(0, \textcolor{stringliteral}{"{}writing vhdr failed on drive \%s, "{}}}
\DoxyCodeLine{\Hypertarget{geom__vinum__drive_8c_source_l00323}00323                             \textcolor{stringliteral}{"{}errno \%d"{}}, d-\/>\mbox{\hyperlink{structgv__drive_a69e5c72365075804074d21c056111ebf}{name}}, error);}
\DoxyCodeLine{\Hypertarget{geom__vinum__drive_8c_source_l00324}00324                         \mbox{\hyperlink{geom_8h_a232419d2cfa06ff3f4ff7551041aed31}{g\_topology\_lock}}();}
\DoxyCodeLine{\Hypertarget{geom__vinum__drive_8c_source_l00325}00325                         \mbox{\hyperlink{geom_8h_a27b7c72cc3bc5a4d07ce5976e1aa1b58}{g\_access}}(\mbox{\hyperlink{g__part__if_8m_a294f18324585ff37641fb8aa1c9ccd82}{cp}}, 0, -\/1, 0);}
\DoxyCodeLine{\Hypertarget{geom__vinum__drive_8c_source_l00326}00326                         \mbox{\hyperlink{geom_8h_a4628d4de49ba84e7a6126cc30d23b83a}{g\_topology\_unlock}}();}
\DoxyCodeLine{\Hypertarget{geom__vinum__drive_8c_source_l00327}00327                         \textcolor{keywordflow}{continue};}
\DoxyCodeLine{\Hypertarget{geom__vinum__drive_8c_source_l00328}00328                 \}}
\DoxyCodeLine{\Hypertarget{geom__vinum__drive_8c_source_l00329}00329                 \textcolor{comment}{/* First config copy. */}}
\DoxyCodeLine{\Hypertarget{geom__vinum__drive_8c_source_l00330}00330                 error = \mbox{\hyperlink{geom_8h_a9b87ecbd812c109546b077da483baada}{g\_write\_data}}(\mbox{\hyperlink{g__part__if_8m_a294f18324585ff37641fb8aa1c9ccd82}{cp}}, \mbox{\hyperlink{geom__vinum__var_8h_a4370be27acf9dd153cf01d582d533834}{GV\_CFG\_OFFSET}}, sbuf\_data(\mbox{\hyperlink{g__part__if_8m_a4c23eb4bab5aa5d69bd84384b94d1f79}{sb}}),}
\DoxyCodeLine{\Hypertarget{geom__vinum__drive_8c_source_l00331}00331                     \mbox{\hyperlink{geom__vinum__var_8h_a6c3c83ed812a770435735ffed804e98f}{GV\_CFG\_LEN}});}
\DoxyCodeLine{\Hypertarget{geom__vinum__drive_8c_source_l00332}00332                 \textcolor{keywordflow}{if} (error) \{}
\DoxyCodeLine{\Hypertarget{geom__vinum__drive_8c_source_l00333}00333                         \mbox{\hyperlink{geom__vinum_8h_a28cdbd7c30e435ff9ec8676f493593a0}{G\_VINUM\_DEBUG}}(0, \textcolor{stringliteral}{"{}writing first config copy failed on "{}}}
\DoxyCodeLine{\Hypertarget{geom__vinum__drive_8c_source_l00334}00334                             \textcolor{stringliteral}{"{}drive \%s, errno \%d"{}}, d-\/>\mbox{\hyperlink{structgv__drive_a69e5c72365075804074d21c056111ebf}{name}}, error);}
\DoxyCodeLine{\Hypertarget{geom__vinum__drive_8c_source_l00335}00335                         \mbox{\hyperlink{geom_8h_a232419d2cfa06ff3f4ff7551041aed31}{g\_topology\_lock}}();}
\DoxyCodeLine{\Hypertarget{geom__vinum__drive_8c_source_l00336}00336                         \mbox{\hyperlink{geom_8h_a27b7c72cc3bc5a4d07ce5976e1aa1b58}{g\_access}}(\mbox{\hyperlink{g__part__if_8m_a294f18324585ff37641fb8aa1c9ccd82}{cp}}, 0, -\/1, 0);}
\DoxyCodeLine{\Hypertarget{geom__vinum__drive_8c_source_l00337}00337                         \mbox{\hyperlink{geom_8h_a4628d4de49ba84e7a6126cc30d23b83a}{g\_topology\_unlock}}();}
\DoxyCodeLine{\Hypertarget{geom__vinum__drive_8c_source_l00338}00338                         \textcolor{keywordflow}{continue};}
\DoxyCodeLine{\Hypertarget{geom__vinum__drive_8c_source_l00339}00339                 \}}
\DoxyCodeLine{\Hypertarget{geom__vinum__drive_8c_source_l00340}00340                 \textcolor{comment}{/* Second config copy. */}}
\DoxyCodeLine{\Hypertarget{geom__vinum__drive_8c_source_l00341}00341                 error = \mbox{\hyperlink{geom_8h_a9b87ecbd812c109546b077da483baada}{g\_write\_data}}(\mbox{\hyperlink{g__part__if_8m_a294f18324585ff37641fb8aa1c9ccd82}{cp}}, \mbox{\hyperlink{geom__vinum__var_8h_a4370be27acf9dd153cf01d582d533834}{GV\_CFG\_OFFSET}} + \mbox{\hyperlink{geom__vinum__var_8h_a6c3c83ed812a770435735ffed804e98f}{GV\_CFG\_LEN}},}
\DoxyCodeLine{\Hypertarget{geom__vinum__drive_8c_source_l00342}00342                     sbuf\_data(\mbox{\hyperlink{g__part__if_8m_a4c23eb4bab5aa5d69bd84384b94d1f79}{sb}}), \mbox{\hyperlink{geom__vinum__var_8h_a6c3c83ed812a770435735ffed804e98f}{GV\_CFG\_LEN}});}
\DoxyCodeLine{\Hypertarget{geom__vinum__drive_8c_source_l00343}00343                 \textcolor{keywordflow}{if} (error)}
\DoxyCodeLine{\Hypertarget{geom__vinum__drive_8c_source_l00344}00344                         \mbox{\hyperlink{geom__vinum_8h_a28cdbd7c30e435ff9ec8676f493593a0}{G\_VINUM\_DEBUG}}(0, \textcolor{stringliteral}{"{}writing second config copy failed on "{}}}
\DoxyCodeLine{\Hypertarget{geom__vinum__drive_8c_source_l00345}00345                             \textcolor{stringliteral}{"{}drive \%s, errno \%d"{}}, d-\/>\mbox{\hyperlink{structgv__drive_a69e5c72365075804074d21c056111ebf}{name}}, error);}
\DoxyCodeLine{\Hypertarget{geom__vinum__drive_8c_source_l00346}00346 }
\DoxyCodeLine{\Hypertarget{geom__vinum__drive_8c_source_l00347}00347                 \mbox{\hyperlink{geom_8h_a232419d2cfa06ff3f4ff7551041aed31}{g\_topology\_lock}}();}
\DoxyCodeLine{\Hypertarget{geom__vinum__drive_8c_source_l00348}00348                 \mbox{\hyperlink{geom_8h_a27b7c72cc3bc5a4d07ce5976e1aa1b58}{g\_access}}(\mbox{\hyperlink{g__part__if_8m_a294f18324585ff37641fb8aa1c9ccd82}{cp}}, 0, -\/1, 0);}
\DoxyCodeLine{\Hypertarget{geom__vinum__drive_8c_source_l00349}00349                 \mbox{\hyperlink{geom_8h_a4628d4de49ba84e7a6126cc30d23b83a}{g\_topology\_unlock}}();}
\DoxyCodeLine{\Hypertarget{geom__vinum__drive_8c_source_l00350}00350         \}}
\DoxyCodeLine{\Hypertarget{geom__vinum__drive_8c_source_l00351}00351 }
\DoxyCodeLine{\Hypertarget{geom__vinum__drive_8c_source_l00352}00352         sbuf\_delete(\mbox{\hyperlink{g__part__if_8m_a4c23eb4bab5aa5d69bd84384b94d1f79}{sb}});}
\DoxyCodeLine{\Hypertarget{geom__vinum__drive_8c_source_l00353}00353         \mbox{\hyperlink{geom_8h_ad9924deb20de7b40cb6cf06e5ae28855}{g\_free}}(vhdr);}
\DoxyCodeLine{\Hypertarget{geom__vinum__drive_8c_source_l00354}00354 \}}

\end{DoxyCode}
