Newer
Older
ubixos / doc / xml / ufs_8c.xml
<?xml version='1.0' encoding='iso-8859-1' standalone='no'?>
<doxygen xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="compound.xsd" version="1.4.7">
  <compounddef id="ufs_8c" kind="file">
    <compoundname>ufs.c</compoundname>
    <includes refid="vfs_8h" local="no">vfs/vfs.h</includes>
    <includes refid="ufs_8h" local="no">ufs/ufs.h</includes>
    <includes refid="ffs_8h" local="no">ufs/ffs.h</includes>
    <includes refid="kprintf_8h" local="no">lib/kprintf.h</includes>
    <includes refid="kmalloc_8h" local="no">lib/kmalloc.h</includes>
    <includes refid="kpanic_8h" local="no">ubixos/kpanic.h</includes>
    <includes refid="lib_2string_8h" local="no">lib/string.h</includes>
    <incdepgraph>
      <node id="6027">
        <label>ufs/ufs.h</label>
        <link refid="ufs_8h"/>
        <childnode refid="6019" relation="include">
        </childnode>
        <childnode refid="6018" relation="include">
        </childnode>
        <childnode refid="6028" relation="include">
        </childnode>
      </node>
      <node id="6026">
        <label>sys/thread.h</label>
        <link refid="thread_8h"/>
        <childnode refid="6019" relation="include">
        </childnode>
      </node>
      <node id="6032">
        <label>ubixos/kpanic.h</label>
        <link refid="kpanic_8h"/>
      </node>
      <node id="6029">
        <label>ufs/ffs.h</label>
        <link refid="ffs_8h"/>
        <childnode refid="6019" relation="include">
        </childnode>
        <childnode refid="6018" relation="include">
        </childnode>
        <childnode refid="6028" relation="include">
        </childnode>
      </node>
      <node id="6017">
        <label>src/sys/ufs/ufs.c</label>
        <link refid="ufs.c"/>
        <childnode refid="6018" relation="include">
        </childnode>
        <childnode refid="6027" relation="include">
        </childnode>
        <childnode refid="6029" relation="include">
        </childnode>
        <childnode refid="6030" relation="include">
        </childnode>
        <childnode refid="6031" relation="include">
        </childnode>
        <childnode refid="6032" relation="include">
        </childnode>
        <childnode refid="6033" relation="include">
        </childnode>
      </node>
      <node id="6019">
        <label>ubixos/types.h</label>
        <link refid="types_8h"/>
        <childnode refid="6020" relation="include">
        </childnode>
      </node>
      <node id="6020">
        <label>sys/_types.h</label>
        <link refid="__types_8h"/>
      </node>
      <node id="6033">
        <label>lib/string.h</label>
        <link refid="lib_2string_8h"/>
        <childnode refid="6019" relation="include">
        </childnode>
      </node>
      <node id="6021">
        <label>vfs/file.h</label>
        <link refid="file_8h"/>
        <childnode refid="6019" relation="include">
        </childnode>
        <childnode refid="6022" relation="include">
        </childnode>
        <childnode refid="6023" relation="include">
        </childnode>
      </node>
      <node id="6031">
        <label>lib/kmalloc.h</label>
        <link refid="kmalloc_8h"/>
        <childnode refid="6019" relation="include">
        </childnode>
      </node>
      <node id="6018">
        <label>vfs/vfs.h</label>
        <link refid="vfs_8h"/>
        <childnode refid="6019" relation="include">
        </childnode>
        <childnode refid="6021" relation="include">
        </childnode>
        <childnode refid="6023" relation="include">
        </childnode>
        <childnode refid="6024" relation="include">
        </childnode>
        <childnode refid="6026" relation="include">
        </childnode>
      </node>
      <node id="6023">
        <label>vfs/mount.h</label>
        <link refid="mount_8h"/>
        <childnode refid="6019" relation="include">
        </childnode>
      </node>
      <node id="6030">
        <label>lib/kprintf.h</label>
        <link refid="kprintf_8h"/>
        <childnode refid="6019" relation="include">
        </childnode>
      </node>
      <node id="6022">
        <label>ubixfs/dirCache.h</label>
        <link refid="dirCache_8h"/>
        <childnode refid="6019" relation="include">
        </childnode>
      </node>
      <node id="6024">
        <label>sys/sysproto.h</label>
        <link refid="sysproto_8h"/>
        <childnode refid="6025" relation="include">
        </childnode>
        <childnode refid="6026" relation="include">
        </childnode>
      </node>
      <node id="6025">
        <label>sys/signal.h</label>
        <link refid="signal_8h"/>
        <childnode refid="6019" relation="include">
        </childnode>
      </node>
      <node id="6028">
        <label>sys/device.h</label>
        <link refid="device_8h"/>
        <childnode refid="6019" relation="include">
        </childnode>
      </node>
    </incdepgraph>
      <sectiondef kind="define">
      <memberdef kind="define" id="ufs_8c_1e977f66f7be1f87abd0d0603e3852a06" prot="public" static="no">
        <name>DBPERVBLK</name>
        <initializer>(VBLKSIZE / DEV_BSIZE)</initializer>
        <briefdescription>
        </briefdescription>
        <detaileddescription>
        </detaileddescription>
        <inbodydescription>
        </inbodydescription>
        <location file="/usr/home/reddawg/source/ubix2/src/sys/ufs/ufs.c" line="41" bodyfile="/usr/home/reddawg/source/ubix2/src/sys/ufs/ufs.c" bodystart="41" bodyend="-1"/>
        <referencedby refid="ufs_8c_103b001870aa568dcdcc44c1dc79a49dd" compoundref="ufs_8c" startline="77" endline="209">fsread</referencedby>
      </memberdef>
      <memberdef kind="define" id="ufs_8c_1a5a59d37ee7a73e41be17638269b06a9" prot="public" static="no">
        <name>DIP</name>
        <param><defname>field</defname></param>
        <initializer><ref refid="structfs" kindref="compound">fs</ref>-&gt;fs_magic == FS_UFS1_MAGIC ? dp1.field : dp2.field</initializer>
        <briefdescription>
        </briefdescription>
        <detaileddescription>
        </detaileddescription>
        <inbodydescription>
        </inbodydescription>
        <location file="/usr/home/reddawg/source/ubix2/src/sys/ufs/ufs.c" line="73" bodyfile="/usr/home/reddawg/source/ubix2/src/sys/ufs/ufs.c" bodystart="73" bodyend="-1"/>
        <referencedby refid="ufs_8c_103b001870aa568dcdcc44c1dc79a49dd" compoundref="ufs_8c" startline="77" endline="209">fsread</referencedby>
      </memberdef>
      <memberdef kind="define" id="ufs_8c_1e4524da6e4d6ec5c11dbe5cf4559adf3" prot="public" static="no">
        <name>INDIRPERVBLK</name>
        <param><defname>fs</defname></param>
        <initializer>(NINDIR(<ref refid="structfs" kindref="compound">fs</ref>) / ((<ref refid="structfs" kindref="compound">fs</ref>)-&gt;fs_bsize &gt;&gt; VBLKSHIFT))</initializer>
        <briefdescription>
        </briefdescription>
        <detaileddescription>
        </detaileddescription>
        <inbodydescription>
        </inbodydescription>
        <location file="/usr/home/reddawg/source/ubix2/src/sys/ufs/ufs.c" line="42" bodyfile="/usr/home/reddawg/source/ubix2/src/sys/ufs/ufs.c" bodystart="42" bodyend="-1"/>
        <referencedby refid="ufs_8c_103b001870aa568dcdcc44c1dc79a49dd" compoundref="ufs_8c" startline="77" endline="209">fsread</referencedby>
      </memberdef>
      <memberdef kind="define" id="ufs_8c_11b76f991135322a54450c8604038d12b" prot="public" static="no">
        <name>INO_TO_VBA</name>
        <param><defname>fs</defname></param>
        <param><defname>ipervblk</defname></param>
        <param><defname>x</defname></param>
        <initializer>(fsbtodb(<ref refid="structfs" kindref="compound">fs</ref>, cgimin(<ref refid="structfs" kindref="compound">fs</ref>, ino_to_cg(<ref refid="structfs" kindref="compound">fs</ref>, x))) + \
    (((x) % (<ref refid="structfs" kindref="compound">fs</ref>)-&gt;fs_ipg) / (ipervblk) * DBPERVBLK))</initializer>
        <briefdescription>
        </briefdescription>
        <detaileddescription>
        </detaileddescription>
        <inbodydescription>
        </inbodydescription>
        <location file="/usr/home/reddawg/source/ubix2/src/sys/ufs/ufs.c" line="47" bodyfile="/usr/home/reddawg/source/ubix2/src/sys/ufs/ufs.c" bodystart="45" bodyend="-1"/>
        <referencedby refid="ufs_8c_103b001870aa568dcdcc44c1dc79a49dd" compoundref="ufs_8c" startline="77" endline="209">fsread</referencedby>
      </memberdef>
      <memberdef kind="define" id="ufs_8c_1dd0c55395013d386f53627b02e0cf27a" prot="public" static="no">
        <name>INO_TO_VBO</name>
        <param><defname>ipervblk</defname></param>
        <param><defname>x</defname></param>
        <initializer>((x) % ipervblk)</initializer>
        <briefdescription>
        </briefdescription>
        <detaileddescription>
        </detaileddescription>
        <inbodydescription>
        </inbodydescription>
        <location file="/usr/home/reddawg/source/ubix2/src/sys/ufs/ufs.c" line="48" bodyfile="/usr/home/reddawg/source/ubix2/src/sys/ufs/ufs.c" bodystart="48" bodyend="-1"/>
        <referencedby refid="ufs_8c_103b001870aa568dcdcc44c1dc79a49dd" compoundref="ufs_8c" startline="77" endline="209">fsread</referencedby>
      </memberdef>
      <memberdef kind="define" id="ufs_8c_1093aab4d88e8ac7dacc93d9cb6cc58ee" prot="public" static="no">
        <name>INOPB</name>
        <param><defname>fs</defname></param>
        <initializer>((<ref refid="structfs" kindref="compound">fs</ref>)-&gt;fs_inopb)</initializer>
        <briefdescription>
        </briefdescription>
        <detaileddescription>
        </detaileddescription>
        <inbodydescription>
        </inbodydescription>
        <location file="/usr/home/reddawg/source/ubix2/src/sys/ufs/ufs.c" line="44" bodyfile="/usr/home/reddawg/source/ubix2/src/sys/ufs/ufs.c" bodystart="44" bodyend="-1"/>
      </memberdef>
      <memberdef kind="define" id="ufs_8c_13fe028b32899dee05ea1b48efb73fe33" prot="public" static="no">
        <name>IPERVBLK</name>
        <param><defname>fs</defname></param>
        <initializer>(INOPB(<ref refid="structfs" kindref="compound">fs</ref>) / ((<ref refid="structfs" kindref="compound">fs</ref>)-&gt;fs_bsize &gt;&gt; VBLKSHIFT))</initializer>
        <briefdescription>
        </briefdescription>
        <detaileddescription>
        </detaileddescription>
        <inbodydescription>
        </inbodydescription>
        <location file="/usr/home/reddawg/source/ubix2/src/sys/ufs/ufs.c" line="43" bodyfile="/usr/home/reddawg/source/ubix2/src/sys/ufs/ufs.c" bodystart="43" bodyend="-1"/>
        <referencedby refid="ufs_8c_103b001870aa568dcdcc44c1dc79a49dd" compoundref="ufs_8c" startline="77" endline="209">fsread</referencedby>
      </memberdef>
      <memberdef kind="define" id="ufs_8c_18c3f8bc1aebec0e57f9e9a6b2ffa640e" prot="public" static="no">
        <name>VBLKMASK</name>
        <initializer>(VBLKSIZE - 1)</initializer>
        <briefdescription>
        </briefdescription>
        <detaileddescription>
        </detaileddescription>
        <inbodydescription>
        </inbodydescription>
        <location file="/usr/home/reddawg/source/ubix2/src/sys/ufs/ufs.c" line="40" bodyfile="/usr/home/reddawg/source/ubix2/src/sys/ufs/ufs.c" bodystart="40" bodyend="-1"/>
        <referencedby refid="ufs_8c_103b001870aa568dcdcc44c1dc79a49dd" compoundref="ufs_8c" startline="77" endline="209">fsread</referencedby>
      </memberdef>
      <memberdef kind="define" id="ufs_8c_11f8f4eabaf5119f68bfc6ee1ff715952" prot="public" static="no">
        <name>VBLKSHIFT</name>
        <initializer>12</initializer>
        <briefdescription>
        </briefdescription>
        <detaileddescription>
        </detaileddescription>
        <inbodydescription>
        </inbodydescription>
        <location file="/usr/home/reddawg/source/ubix2/src/sys/ufs/ufs.c" line="38" bodyfile="/usr/home/reddawg/source/ubix2/src/sys/ufs/ufs.c" bodystart="38" bodyend="-1"/>
      </memberdef>
      <memberdef kind="define" id="ufs_8c_1df63a6145c73332883effc7746beffc2" prot="public" static="no">
        <name>VBLKSIZE</name>
        <initializer>(1 &lt;&lt; VBLKSHIFT)</initializer>
        <briefdescription>
        </briefdescription>
        <detaileddescription>
        </detaileddescription>
        <inbodydescription>
        </inbodydescription>
        <location file="/usr/home/reddawg/source/ubix2/src/sys/ufs/ufs.c" line="39" bodyfile="/usr/home/reddawg/source/ubix2/src/sys/ufs/ufs.c" bodystart="39" bodyend="-1"/>
      </memberdef>
      </sectiondef>
      <sectiondef kind="func">
      <memberdef kind="function" id="ufs_8c_127a0276d7cf729f1a89bd46dac8a9650" prot="public" static="yes" const="no" explicit="no" inline="no" virt="non-virtual">
        <type>int</type>
        <definition>static int dskread</definition>
        <argsstring>(void *buf, u_int64_t block, size_t count, fileDescriptor *fd)</argsstring>
        <name>dskread</name>
        <param>
          <type>void *</type>
          <declname>buf</declname>
        </param>
        <param>
          <type><ref refid="types_8h_1250ac047bf3984b5dae755276a305d64" kindref="member">u_int64_t</ref></type>
          <declname>block</declname>
        </param>
        <param>
          <type><ref refid="types_8h_17619b847aeded8a6d14cbfa212b2cdfb" kindref="member">size_t</ref></type>
          <declname>count</declname>
        </param>
        <param>
          <type><ref refid="structfileDescriptorStruct" kindref="compound">fileDescriptor</ref> *</type>
          <declname>fd</declname>
        </param>
        <briefdescription>
        </briefdescription>
        <detaileddescription>
        </detaileddescription>
        <inbodydescription>
        </inbodydescription>
        <location file="/usr/home/reddawg/source/ubix2/src/sys/ufs/ufs.c" line="51" bodyfile="/usr/home/reddawg/source/ubix2/src/sys/ufs/ufs.c" bodystart="51" bodyend="54"/>
        <references refid="structvfs__mountPoint_15683a99774aaf81116e1765eb2509df5" compoundref="mount_8h" startline="39">vfs_mountPoint::device</references>
        <references refid="structdevice__node_1588d09d5dabf1c8866d359aaac799b1c" compoundref="device_8h" startline="38">device_node::devInfo</references>
        <references refid="structdevice__interface_1eacb2f431b14ddd1e9fe34db278dfc9e" compoundref="device_8h" startline="52">device_interface::info</references>
        <references refid="structfileDescriptorStruct_1f8abeb5da4a430885db51246db1356f9" compoundref="file_8h" startline="49">fileDescriptorStruct::mp</references>
        <references refid="structdevice__interface_16caf84418059d0121e76d873e305ddcb">device_interface::read</references>
        <referencedby refid="ufs_8c_103b001870aa568dcdcc44c1dc79a49dd" compoundref="ufs_8c" startline="77" endline="209">fsread</referencedby>
      </memberdef>
      <memberdef kind="function" id="ufs_8c_1ccfc6cc8f916e7f58db4ac350bdc1e9b" prot="public" static="yes" const="no" explicit="no" inline="no" virt="non-virtual">
        <type>__inline int</type>
        <definition>static __inline int fsfind</definition>
        <argsstring>(const char *name, ino_t *ino, fileDescriptor *fd)</argsstring>
        <name>fsfind</name>
        <param>
          <type>const char *</type>
          <declname>name</declname>
        </param>
        <param>
          <type><ref refid="types_8h_173341b7381d39d6e5b80ff9f23379dbd" kindref="member">ino_t</ref> *</type>
          <declname>ino</declname>
        </param>
        <param>
          <type><ref refid="structfileDescriptorStruct" kindref="compound">fileDescriptor</ref> *</type>
          <declname>fd</declname>
        </param>
        <briefdescription>
        </briefdescription>
        <detaileddescription>
        </detaileddescription>
        <inbodydescription>
        </inbodydescription>
        <location file="/usr/home/reddawg/source/ubix2/src/sys/ufs/ufs.c" line="214" bodyfile="/usr/home/reddawg/source/ubix2/src/sys/ufs/ufs.c" bodystart="214" bodyend="233"/>
        <references refid="structdirent_10aa21d56704896b87f8a39ecba4f3731" compoundref="ufs_8h" startline="113">dirent::d_fileno</references>
        <references refid="structdirent_18cb13e39a90c43e6b180ff4f1614e4da" compoundref="ufs_8h" startline="117">dirent::d_name</references>
        <references refid="structdirent_16ca250ead8b04b71ea787acbd29b6b75" compoundref="ufs_8h" startline="114">dirent::d_reclen</references>
        <references refid="structdirent_1a850909d0a98e07d0ccd6232d28ed133" compoundref="ufs_8h" startline="115">dirent::d_type</references>
        <references refid="ufs_8h_19c8466b6111a11195a5cd2478c648e32" compoundref="ufs_8h" startline="43">DEV_BSIZE</references>
        <references refid="ufs_8c_103b001870aa568dcdcc44c1dc79a49dd" compoundref="ufs_8c" startline="77" endline="209">fsread</references>
        <references refid="structfileDescriptorStruct_1eedbb6c79fc5a34c4b8cf4ebbf6a0658" compoundref="file_8h" startline="52">fileDescriptorStruct::offset</references>
        <references refid="lib_2string_8h_16f3dcb20ff11ff9db5904c3cfb61a38c" compoundref="string_8c" startline="32" endline="46">strcmp</references>
        <referencedby refid="ufs_8c_18b14c49128395a8745bc83cfcce7b9cf" compoundref="ufs_8c" startline="236" endline="269">lookup</referencedby>
      </memberdef>
      <memberdef kind="function" id="ufs_8c_103b001870aa568dcdcc44c1dc79a49dd" prot="public" static="yes" const="no" explicit="no" inline="no" virt="non-virtual">
        <type><ref refid="types_8h_187bd983bf349d8b86901f3200d559e8e" kindref="member">ssize_t</ref></type>
        <definition>static ssize_t fsread</definition>
        <argsstring>(ino_t inode, void *buf, size_t nbyte, fileDescriptor *fd)</argsstring>
        <name>fsread</name>
        <param>
          <type><ref refid="types_8h_173341b7381d39d6e5b80ff9f23379dbd" kindref="member">ino_t</ref></type>
          <declname>inode</declname>
        </param>
        <param>
          <type>void *</type>
          <declname>buf</declname>
        </param>
        <param>
          <type><ref refid="types_8h_17619b847aeded8a6d14cbfa212b2cdfb" kindref="member">size_t</ref></type>
          <declname>nbyte</declname>
        </param>
        <param>
          <type><ref refid="structfileDescriptorStruct" kindref="compound">fileDescriptor</ref> *</type>
          <declname>fd</declname>
        </param>
        <briefdescription>
        </briefdescription>
        <detaileddescription>
        </detaileddescription>
        <inbodydescription>
        </inbodydescription>
        <location file="/usr/home/reddawg/source/ubix2/src/sys/ufs/ufs.c" line="77" bodyfile="/usr/home/reddawg/source/ubix2/src/sys/ufs/ufs.c" bodystart="77" bodyend="209"/>
        <references refid="structdmadat_1d134ba5a7290b627a60d5fd83fc2f204" compoundref="file_8h" startline="40">dmadat::blkbuf</references>
        <references refid="ufs_8h_1cd9d1b3e1eed7fc3850f8a78636dd5a7" compoundref="ufs_8h" startline="90">blkoff</references>
        <references refid="ufs_8c_1e977f66f7be1f87abd0d0603e3852a06" compoundref="ufs_8c" startline="41">DBPERVBLK</references>
        <references refid="ufs_8h_19734470bf89968d142073fd334bf9cb6" compoundref="ufs_8h" startline="42">DEV_BSHIFT</references>
        <references refid="ufs_8h_19c8466b6111a11195a5cd2478c648e32" compoundref="ufs_8h" startline="43">DEV_BSIZE</references>
        <references refid="structufs2__dinode_1667ab9837a0fd21d51108ca9dfd85f66" compoundref="ufs_8h" startline="145">ufs2_dinode::di_db</references>
        <references refid="structufs2__dinode_19eb4d981d19dd77fbde21e84fd4e2d5d" compoundref="ufs_8h" startline="146">ufs2_dinode::di_ib</references>
        <references refid="structufs2__dinode_1d5993494c57c494293c25dc81ec3b154" compoundref="ufs_8h" startline="130">ufs2_dinode::di_size</references>
        <references refid="ufs_8c_1a5a59d37ee7a73e41be17638269b06a9" compoundref="ufs_8c" startline="73">DIP</references>
        <references refid="structfileDescriptorStruct_162c52d66a6baff1f91fec689b624e3b3" compoundref="file_8h" startline="61">fileDescriptorStruct::dmadat</references>
        <references refid="structfileDescriptorStruct_1c4a0e558e819f84243070ac2adaa6b11" compoundref="file_8h" startline="62">fileDescriptorStruct::dsk_meta</references>
        <references refid="ufs_8c_127a0276d7cf729f1a89bd46dac8a9650" compoundref="ufs_8c" startline="51" endline="54">dskread</references>
        <references refid="structfs_1acc2f0aa6f3902f165c563ce5ba76373" compoundref="ufs_8h" startline="289">fs::fs_magic</references>
        <references refid="ufs_8h_1ce25c7a73c514a8e575e1ba8c15c9a9e" compoundref="ufs_8h" startline="51">FS_UFS1_MAGIC</references>
        <references refid="ufs_8h_10b73b7456fc1dee932dc0c1056c613fc" compoundref="ufs_8h" startline="52">FS_UFS2_MAGIC</references>
        <references refid="ufs_8h_1e26526d0ac7505aae7345f0288c17fe6" compoundref="ufs_8h" startline="74">fsbtodb</references>
        <references refid="structdmadat_1e1f8eab27e979807a50dbf2d54ec1476" compoundref="file_8h" startline="41">dmadat::indbuf</references>
        <references refid="ufs_8c_1e4524da6e4d6ec5c11dbe5cf4559adf3" compoundref="ufs_8c" startline="42">INDIRPERVBLK</references>
        <references refid="ufs_8c_11b76f991135322a54450c8604038d12b" compoundref="ufs_8c" startline="45">INO_TO_VBA</references>
        <references refid="ufs_8c_1dd0c55395013d386f53627b02e0cf27a" compoundref="ufs_8c" startline="48">INO_TO_VBO</references>
        <references refid="ufs_8c_13fe028b32899dee05ea1b48efb73fe33" compoundref="ufs_8c" startline="43">IPERVBLK</references>
        <references refid="kprint_8h_1b2761bdf0cca73ad0fb5880895210cd8" compoundref="kprintf_8c" startline="38" endline="49">kprintf</references>
        <references refid="ufs_8h_11ea09415cf1bc5de0d0d4a7158a5c736" compoundref="ufs_8h" startline="92">lblkno</references>
        <references refid="ufs_8h_16e852e863e63ab118ec196d1157a1dbd" compoundref="ufs_8h" startline="57">MAXBSIZE</references>
        <references refid="lib_2string_8h_1e33b18edb618c656b9b795b9fce2316c">memcpy</references>
        <references refid="ufs_8h_10c136d7ef3223bdd2b6e7c83c65bb508" compoundref="ufs_8h" startline="121">NDADDR</references>
        <references refid="ufs_8h_16d58397786421684bb8db78f01e13ae6" compoundref="ufs_8h" startline="58">NINDIR</references>
        <references refid="structfileDescriptorStruct_1eedbb6c79fc5a34c4b8cf4ebbf6a0658" compoundref="file_8h" startline="52">fileDescriptorStruct::offset</references>
        <references refid="structdmadat_1b267db93faadfbb8c65f16ca4df76055" compoundref="file_8h" startline="42">dmadat::sbbuf</references>
        <references refid="ufs_8h_1d35c4c33dc54a0b8db742e0b3b5f64aa" compoundref="ufs_8h" startline="98">sblksize</references>
        <references refid="ufs_8c_18d5779eb674b28e517275bda58b7c041" compoundref="ufs_8c" startline="66">sblock_try</references>
        <references refid="structfileDescriptorStruct_197eb3dcefe53610658dc341ca449e290" compoundref="file_8h" startline="53">fileDescriptorStruct::size</references>
        <references refid="ufs_8c_18c3f8bc1aebec0e57f9e9a6b2ffa640e" compoundref="ufs_8c" startline="40">VBLKMASK</references>
        <references refid="file_8h_11f8f4eabaf5119f68bfc6ee1ff715952" compoundref="file_8h" startline="33">VBLKSHIFT</references>
        <references refid="file_8h_1df63a6145c73332883effc7746beffc2" compoundref="file_8h" startline="34">VBLKSIZE</references>
        <referencedby refid="ufs_8c_1ccfc6cc8f916e7f58db4ac350bdc1e9b" compoundref="ufs_8c" startline="214" endline="233">fsfind</referencedby>
        <referencedby refid="ufs_8c_1e5b71ba2291b2d2ef07ece9e0de74a5d" compoundref="ufs_8c" startline="272" endline="289">ufs_openFile</referencedby>
        <referencedby refid="ufs_8c_19272216384babc589471d4a8e538d372" compoundref="ufs_8c" startline="291" endline="293">ufs_readFile</referencedby>
      </memberdef>
      <memberdef kind="function" id="ufs_8c_18b14c49128395a8745bc83cfcce7b9cf" prot="public" static="yes" const="no" explicit="no" inline="no" virt="non-virtual">
        <type><ref refid="types_8h_173341b7381d39d6e5b80ff9f23379dbd" kindref="member">ino_t</ref></type>
        <definition>static ino_t lookup</definition>
        <argsstring>(const char *path, fileDescriptor *fd)</argsstring>
        <name>lookup</name>
        <param>
          <type>const char *</type>
          <declname>path</declname>
        </param>
        <param>
          <type><ref refid="structfileDescriptorStruct" kindref="compound">fileDescriptor</ref> *</type>
          <declname>fd</declname>
        </param>
        <briefdescription>
        </briefdescription>
        <detaileddescription>
        </detaileddescription>
        <inbodydescription>
        </inbodydescription>
        <location file="/usr/home/reddawg/source/ubix2/src/sys/ufs/ufs.c" line="236" bodyfile="/usr/home/reddawg/source/ubix2/src/sys/ufs/ufs.c" bodystart="236" bodyend="269"/>
        <references refid="ufs_8h_11dcee67486bc4238096ecb61e2d9ffd1" compoundref="ufs_8h" startline="41">DT_DIR</references>
        <references refid="ufs_8h_19973595cf6775b1b29d7274ab4c0d623" compoundref="ufs_8h" startline="38">DT_REG</references>
        <references refid="ufs_8c_1ccfc6cc8f916e7f58db4ac350bdc1e9b" compoundref="ufs_8c" startline="214" endline="233">fsfind</references>
        <references refid="kprint_8h_1b2761bdf0cca73ad0fb5880895210cd8" compoundref="kprintf_8c" startline="38" endline="49">kprintf</references>
        <references refid="ufs_8h_1b347d7e5c2fdca2d28e693b2a508d76a" compoundref="ufs_8h" startline="39">MAXNAMLEN</references>
        <references refid="lib_2string_8h_1e33b18edb618c656b9b795b9fce2316c">memcpy</references>
        <references refid="pci_8c_18f8f80d37794cde9472343e4487ba3eb" compoundref="pci_8c" startline="39">name</references>
        <references refid="ufs_8h_122c8ea96d09283ed6496347806cc72a0" compoundref="ufs_8h" startline="40">ROOTINO</references>
        <referencedby refid="ufs_8c_1e5b71ba2291b2d2ef07ece9e0de74a5d" compoundref="ufs_8c" startline="272" endline="289">ufs_openFile</referencedby>
      </memberdef>
      <memberdef kind="function" id="ufs_8c_1349e4b7ceea770cd630e0297b693d59e" prot="public" static="no" const="no" explicit="no" inline="no" virt="non-virtual">
        <type>int</type>
        <definition>int ufs_init</definition>
        <argsstring>()</argsstring>
        <name>ufs_init</name>
        <briefdescription>
        </briefdescription>
        <detaileddescription>
        </detaileddescription>
        <inbodydescription>
        </inbodydescription>
        <location file="/usr/home/reddawg/source/ubix2/src/sys/ufs/ufs.c" line="314" bodyfile="/usr/home/reddawg/source/ubix2/src/sys/ufs/ufs.c" bodystart="314" bodyend="337"/>
        <references refid="kpanic_8h_1db9a182aa071791a306163d50d653deb" compoundref="kpanic_8c" startline="42" endline="60">kpanic</references>
        <references refid="types_8h_1070d2ce7b6bb7e5c05602aa8c308d0c4" compoundref="types_8h" startline="36">NULL</references>
        <references refid="ufs_8h_1b72f6c6236410bf9a029e7bc810eb609">ufs_initialize</references>
        <references refid="ufs_8c_1e5b71ba2291b2d2ef07ece9e0de74a5d" compoundref="ufs_8c" startline="272" endline="289">ufs_openFile</references>
        <references refid="ufs_8c_19272216384babc589471d4a8e538d372" compoundref="ufs_8c" startline="291" endline="293">ufs_readFile</references>
        <references refid="ufs_8c_1c7d4e2f2c573b3657d8a7680131ba068" compoundref="ufs_8c" startline="295" endline="298">ufs_writeFile</references>
        <references refid="vfs_8h_18652b1ccbcf7d2a872c5781640f7d59a" compoundref="vfs_8c" startline="81" endline="138">vfsRegisterFS</references>
        <references refid="ap-boot_8S_11a3ac2137e21f6f0d400f1996914dd19" compoundref="ap-boot_8S" startline="6">x1</references>
      </memberdef>
      <memberdef kind="function" id="ufs_8c_1c2f26ec05df38049821476d41aeb1038" prot="public" static="no" const="no" explicit="no" inline="no" virt="non-virtual">
        <type>int</type>
        <definition>int ufs_initialize</definition>
        <argsstring>(struct vfs_mountPoint *mp)</argsstring>
        <name>ufs_initialize</name>
        <param>
          <type>struct <ref refid="structvfs__mountPoint" kindref="compound">vfs_mountPoint</ref> *</type>
          <declname>mp</declname>
        </param>
        <briefdescription>
        </briefdescription>
        <detaileddescription>
        </detaileddescription>
        <inbodydescription>
        </inbodydescription>
        <location file="/usr/home/reddawg/source/ubix2/src/sys/ufs/ufs.c" line="309" bodyfile="/usr/home/reddawg/source/ubix2/src/sys/ufs/ufs.c" bodystart="309" bodyend="312"/>
        <references refid="ap-boot_8S_11a3ac2137e21f6f0d400f1996914dd19" compoundref="ap-boot_8S" startline="6">x1</references>
      </memberdef>
      <memberdef kind="function" id="ufs_8c_1e5b71ba2291b2d2ef07ece9e0de74a5d" prot="public" static="yes" const="no" explicit="no" inline="no" virt="non-virtual">
        <type>int</type>
        <definition>static int ufs_openFile</definition>
        <argsstring>(const char *file, fileDescriptor *fd)</argsstring>
        <name>ufs_openFile</name>
        <param>
          <type>const char *</type>
          <declname>file</declname>
        </param>
        <param>
          <type><ref refid="structfileDescriptorStruct" kindref="compound">fileDescriptor</ref> *</type>
          <declname>fd</declname>
        </param>
        <briefdescription>
        </briefdescription>
        <detaileddescription>
        </detaileddescription>
        <inbodydescription>
        </inbodydescription>
        <location file="/usr/home/reddawg/source/ubix2/src/sys/ufs/ufs.c" line="272" bodyfile="/usr/home/reddawg/source/ubix2/src/sys/ufs/ufs.c" bodystart="272" bodyend="289"/>
        <references refid="structfileDescriptorStruct_162c52d66a6baff1f91fec689b624e3b3" compoundref="file_8h" startline="61">fileDescriptorStruct::dmadat</references>
        <references refid="ufs_8c_103b001870aa568dcdcc44c1dc79a49dd" compoundref="ufs_8c" startline="77" endline="209">fsread</references>
        <references refid="structfileDescriptorStruct_1fc289229a1011c71cde06dce77dadd7e" compoundref="file_8h" startline="58">fileDescriptorStruct::ino</references>
        <references refid="kmalloc_8h_1150eab2ac4ce4553e21ca10e7f441762" compoundref="kmalloc_8c" startline="247" endline="339">kmalloc</references>
        <references refid="ufs_8c_18b14c49128395a8745bc83cfcce7b9cf" compoundref="ufs_8c" startline="236" endline="269">lookup</references>
        <references refid="structfileDescriptorStruct_1eedbb6c79fc5a34c4b8cf4ebbf6a0658" compoundref="file_8h" startline="52">fileDescriptorStruct::offset</references>
        <references refid="structfileDescriptorStruct_111626b5d99a5da968f43bc37d2591c5c" compoundref="file_8h" startline="60">fileDescriptorStruct::perms</references>
        <references refid="ap-boot_8S_11a3ac2137e21f6f0d400f1996914dd19" compoundref="ap-boot_8S" startline="6">x1</references>
        <referencedby refid="ufs_8c_1349e4b7ceea770cd630e0297b693d59e" compoundref="ufs_8c" startline="314" endline="337">ufs_init</referencedby>
      </memberdef>
      <memberdef kind="function" id="ufs_8c_19272216384babc589471d4a8e538d372" prot="public" static="no" const="no" explicit="no" inline="no" virt="non-virtual">
        <type>int</type>
        <definition>int ufs_readFile</definition>
        <argsstring>(fileDescriptor *fd, char *data, uInt32 offset, long size)</argsstring>
        <name>ufs_readFile</name>
        <param>
          <type><ref refid="structfileDescriptorStruct" kindref="compound">fileDescriptor</ref> *</type>
          <declname>fd</declname>
        </param>
        <param>
          <type>char *</type>
          <declname>data</declname>
        </param>
        <param>
          <type><ref refid="types_8h_15847ea0262a5aa61eee48cbe95544a78" kindref="member">uInt32</ref></type>
          <declname>offset</declname>
        </param>
        <param>
          <type>long</type>
          <declname>size</declname>
        </param>
        <briefdescription>
        </briefdescription>
        <detaileddescription>
        </detaileddescription>
        <inbodydescription>
        </inbodydescription>
        <location file="/usr/home/reddawg/source/ubix2/src/sys/ufs/ufs.c" line="291" bodyfile="/usr/home/reddawg/source/ubix2/src/sys/ufs/ufs.c" bodystart="291" bodyend="293"/>
        <references refid="ufs_8c_103b001870aa568dcdcc44c1dc79a49dd" compoundref="ufs_8c" startline="77" endline="209">fsread</references>
        <references refid="structfileDescriptorStruct_1fc289229a1011c71cde06dce77dadd7e" compoundref="file_8h" startline="58">fileDescriptorStruct::ino</references>
        <referencedby refid="ufs_8c_1349e4b7ceea770cd630e0297b693d59e" compoundref="ufs_8c" startline="314" endline="337">ufs_init</referencedby>
      </memberdef>
      <memberdef kind="function" id="ufs_8c_1c7d4e2f2c573b3657d8a7680131ba068" prot="public" static="no" const="no" explicit="no" inline="no" virt="non-virtual">
        <type>int</type>
        <definition>int ufs_writeFile</definition>
        <argsstring>(fileDescriptor *fd, char *data, uInt32 offset, long size)</argsstring>
        <name>ufs_writeFile</name>
        <param>
          <type><ref refid="structfileDescriptorStruct" kindref="compound">fileDescriptor</ref> *</type>
          <declname>fd</declname>
        </param>
        <param>
          <type>char *</type>
          <declname>data</declname>
        </param>
        <param>
          <type><ref refid="types_8h_15847ea0262a5aa61eee48cbe95544a78" kindref="member">uInt32</ref></type>
          <declname>offset</declname>
        </param>
        <param>
          <type>long</type>
          <declname>size</declname>
        </param>
        <briefdescription>
        </briefdescription>
        <detaileddescription>
        </detaileddescription>
        <inbodydescription>
        </inbodydescription>
        <location file="/usr/home/reddawg/source/ubix2/src/sys/ufs/ufs.c" line="295" bodyfile="/usr/home/reddawg/source/ubix2/src/sys/ufs/ufs.c" bodystart="295" bodyend="298"/>
        <references refid="kprint_8h_1b2761bdf0cca73ad0fb5880895210cd8" compoundref="kprintf_8c" startline="38" endline="49">kprintf</references>
        <referencedby refid="ufs_8c_1349e4b7ceea770cd630e0297b693d59e" compoundref="ufs_8c" startline="314" endline="337">ufs_init</referencedby>
      </memberdef>
      </sectiondef>
      <sectiondef kind="var">
      <memberdef kind="variable" id="ufs_8c_18d5779eb674b28e517275bda58b7c041" prot="public" static="yes" mutable="no">
        <type>int</type>
        <definition>int sblock_try[]</definition>
        <argsstring>[]</argsstring>
        <name>sblock_try</name>
        <initializer> SBLOCKSEARCH</initializer>
        <briefdescription>
        </briefdescription>
        <detaileddescription>
        </detaileddescription>
        <inbodydescription>
        </inbodydescription>
        <location file="/usr/home/reddawg/source/ubix2/src/sys/ufs/ufs.c" line="66" bodyfile="/usr/home/reddawg/source/ubix2/src/sys/ufs/ufs.c" bodystart="66" bodyend="-1"/>
        <referencedby refid="ufs_8c_103b001870aa568dcdcc44c1dc79a49dd" compoundref="ufs_8c" startline="77" endline="209">fsread</referencedby>
      </memberdef>
      </sectiondef>
    <briefdescription>
    </briefdescription>
    <detaileddescription>
    </detaileddescription>
    <programlisting>
<codeline lineno="1"><highlight class="comment">/*****************************************************************************************</highlight></codeline>
<codeline lineno="2"><highlight class="comment"><sp/>Copyright<sp/>(c)<sp/>2002-2004<sp/>The<sp/>UbixOS<sp/>Project</highlight></codeline>
<codeline lineno="3"><highlight class="comment"><sp/>All<sp/>rights<sp/>reserved.</highlight></codeline>
<codeline lineno="4"><highlight class="comment"></highlight></codeline>
<codeline lineno="5"><highlight class="comment"><sp/>Redistribution<sp/>and<sp/>use<sp/>in<sp/>source<sp/>and<sp/>binary<sp/>forms,<sp/>with<sp/>or<sp/>without<sp/>modification,<sp/>are</highlight></codeline>
<codeline lineno="6"><highlight class="comment"><sp/>permitted<sp/>provided<sp/>that<sp/>the<sp/>following<sp/>conditions<sp/>are<sp/>met:</highlight></codeline>
<codeline lineno="7"><highlight class="comment"></highlight></codeline>
<codeline lineno="8"><highlight class="comment"><sp/>Redistributions<sp/>of<sp/>source<sp/>code<sp/>must<sp/>retain<sp/>the<sp/>above<sp/>copyright<sp/>notice,<sp/>this<sp/>list<sp/>of</highlight></codeline>
<codeline lineno="9"><highlight class="comment"><sp/>conditions,<sp/>the<sp/>following<sp/>disclaimer<sp/>and<sp/>the<sp/>list<sp/>of<sp/>authors.<sp/><sp/>Redistributions<sp/>in<sp/>binary</highlight></codeline>
<codeline lineno="10"><highlight class="comment"><sp/>form<sp/>must<sp/>reproduce<sp/>the<sp/>above<sp/>copyright<sp/>notice,<sp/>this<sp/>list<sp/>of<sp/>conditions,<sp/>the<sp/>following</highlight></codeline>
<codeline lineno="11"><highlight class="comment"><sp/>disclaimer<sp/>and<sp/>the<sp/>list<sp/>of<sp/>authors<sp/>in<sp/>the<sp/>documentation<sp/>and/or<sp/>other<sp/>materials<sp/>provided</highlight></codeline>
<codeline lineno="12"><highlight class="comment"><sp/>with<sp/>the<sp/>distribution.<sp/>Neither<sp/>the<sp/>name<sp/>of<sp/>the<sp/>UbixOS<sp/>Project<sp/>nor<sp/>the<sp/>names<sp/>of<sp/>its</highlight></codeline>
<codeline lineno="13"><highlight class="comment"><sp/>contributors<sp/>may<sp/>be<sp/>used<sp/>to<sp/>endorse<sp/>or<sp/>promote<sp/>products<sp/>derived<sp/>from<sp/>this<sp/>software</highlight></codeline>
<codeline lineno="14"><highlight class="comment"><sp/>without<sp/>specific<sp/>prior<sp/>written<sp/>permission.</highlight></codeline>
<codeline lineno="15"><highlight class="comment"></highlight></codeline>
<codeline lineno="16"><highlight class="comment"><sp/>THIS<sp/>SOFTWARE<sp/>IS<sp/>PROVIDED<sp/>BY<sp/>THE<sp/>COPYRIGHT<sp/>HOLDERS<sp/>AND<sp/>CONTRIBUTORS<sp/>&quot;AS<sp/>IS&quot;<sp/>AND<sp/>ANY</highlight></codeline>
<codeline lineno="17"><highlight class="comment"><sp/>EXPRESS<sp/>OR<sp/>IMPLIED<sp/>WARRANTIES,<sp/>INCLUDING,<sp/>BUT<sp/>NOT<sp/>LIMITED<sp/>TO,<sp/>THE<sp/>IMPLIED<sp/>WARRANTIES<sp/>OF</highlight></codeline>
<codeline lineno="18"><highlight class="comment"><sp/>MERCHANTABILITY<sp/>AND<sp/>FITNESS<sp/>FOR<sp/>A<sp/>PARTICULAR<sp/>PURPOSE<sp/>ARE<sp/>DISCLAIMED.<sp/>IN<sp/>NO<sp/>EVENT<sp/>SHALL</highlight></codeline>
<codeline lineno="19"><highlight class="comment"><sp/>THE<sp/>COPYRIGHT<sp/>OWNER<sp/>OR<sp/>CONTRIBUTORS<sp/>BE<sp/>LIABLE<sp/>FOR<sp/>ANY<sp/>DIRECT,<sp/>INDIRECT,<sp/>INCIDENTAL,</highlight></codeline>
<codeline lineno="20"><highlight class="comment"><sp/>SPECIAL,<sp/>EXEMPLARY,<sp/>OR<sp/>CONSEQUENTIAL<sp/>DAMAGES<sp/>(INCLUDING,<sp/>BUT<sp/>NOT<sp/>LIMITED<sp/>TO,<sp/>PROCUREMENT</highlight></codeline>
<codeline lineno="21"><highlight class="comment"><sp/>OF<sp/>SUBSTITUTE<sp/>GOODS<sp/>OR<sp/>SERVICES;<sp/>LOSS<sp/>OF<sp/>USE,<sp/>DATA,<sp/>OR<sp/>PROFITS;<sp/>OR<sp/>BUSINESS<sp/>INTERRUPTION)</highlight></codeline>
<codeline lineno="22"><highlight class="comment"><sp/>HOWEVER<sp/>CAUSED<sp/>AND<sp/>ON<sp/>ANY<sp/>THEORY<sp/>OF<sp/>LIABILITY,<sp/>WHETHER<sp/>IN<sp/>CONTRACT,<sp/>STRICT<sp/>LIABILITY,<sp/>OR</highlight></codeline>
<codeline lineno="23"><highlight class="comment"><sp/>TORT<sp/>(INCLUDING<sp/>NEGLIGENCE<sp/>OR<sp/>OTHERWISE)<sp/>ARISING<sp/>IN<sp/>ANY<sp/>WAY<sp/>OUT<sp/>OF<sp/>THE<sp/>USE<sp/>OF<sp/>THIS</highlight></codeline>
<codeline lineno="24"><highlight class="comment"><sp/>SOFTWARE,<sp/>EVEN<sp/>IF<sp/>ADVISED<sp/>OF<sp/>THE<sp/>POSSIBILITY<sp/>OF<sp/>SUCH<sp/>DAMAGE.</highlight></codeline>
<codeline lineno="25"><highlight class="comment"></highlight></codeline>
<codeline lineno="26"><highlight class="comment"><sp/>$Id: ufs_8c.xml 88 2016-01-12 00:11:29Z reddawg $</highlight></codeline>
<codeline lineno="27"><highlight class="comment"></highlight></codeline>
<codeline lineno="28"><highlight class="comment">*****************************************************************************************/</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="29"><highlight class="normal"></highlight></codeline>
<codeline lineno="30"><highlight class="normal"></highlight><highlight class="preprocessor">#include<sp/>&lt;<ref refid="vfs_8h" kindref="compound">vfs/vfs.h</ref>&gt;</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="31"><highlight class="normal"></highlight><highlight class="preprocessor">#include<sp/>&lt;<ref refid="ufs_8h" kindref="compound">ufs/ufs.h</ref>&gt;</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="32"><highlight class="normal"></highlight><highlight class="preprocessor">#include<sp/>&lt;<ref refid="ffs_8h" kindref="compound">ufs/ffs.h</ref>&gt;</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="33"><highlight class="normal"></highlight><highlight class="preprocessor">#include<sp/>&lt;<ref refid="kprintf_8h" kindref="compound">lib/kprintf.h</ref>&gt;</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="34"><highlight class="normal"></highlight><highlight class="preprocessor">#include<sp/>&lt;<ref refid="kmalloc_8h" kindref="compound">lib/kmalloc.h</ref>&gt;</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="35"><highlight class="normal"></highlight><highlight class="preprocessor">#include<sp/>&lt;<ref refid="kpanic_8h" kindref="compound">ubixos/kpanic.h</ref>&gt;</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="36"><highlight class="normal"></highlight><highlight class="preprocessor">#include<sp/>&lt;<ref refid="lib_2string_8h" kindref="compound">lib/string.h</ref>&gt;</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="37"><highlight class="normal"></highlight></codeline>
<codeline lineno="38" refid="ufs_8c_11f8f4eabaf5119f68bfc6ee1ff715952" refkind="member"><highlight class="normal"></highlight><highlight class="preprocessor">#define<sp/>VBLKSHIFT<sp/><sp/><sp/><sp/><sp/><sp/><sp/>12</highlight></codeline>
<codeline lineno="39" refid="ufs_8c_1df63a6145c73332883effc7746beffc2" refkind="member"><highlight class="preprocessor"></highlight><highlight class="preprocessor">#define<sp/>VBLKSIZE<sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>(1<sp/>&lt;&lt;<sp/>VBLKSHIFT)</highlight></codeline>
<codeline lineno="40" refid="ufs_8c_18c3f8bc1aebec0e57f9e9a6b2ffa640e" refkind="member"><highlight class="preprocessor"></highlight><highlight class="preprocessor">#define<sp/>VBLKMASK<sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>(VBLKSIZE<sp/>-<sp/>1)</highlight></codeline>
<codeline lineno="41" refid="ufs_8c_1e977f66f7be1f87abd0d0603e3852a06" refkind="member"><highlight class="preprocessor"></highlight><highlight class="preprocessor">#define<sp/>DBPERVBLK<sp/><sp/><sp/><sp/><sp/><sp/><sp/>(VBLKSIZE<sp/>/<sp/>DEV_BSIZE)</highlight></codeline>
<codeline lineno="42" refid="ufs_8c_1e4524da6e4d6ec5c11dbe5cf4559adf3" refkind="member"><highlight class="preprocessor"></highlight><highlight class="preprocessor">#define<sp/>INDIRPERVBLK(fs)<sp/>(NINDIR(fs)<sp/>/<sp/>((fs)-&gt;fs_bsize<sp/>&gt;&gt;<sp/>VBLKSHIFT))</highlight></codeline>
<codeline lineno="43" refid="ufs_8c_13fe028b32899dee05ea1b48efb73fe33" refkind="member"><highlight class="preprocessor"></highlight><highlight class="preprocessor">#define<sp/>IPERVBLK(fs)<sp/><sp/><sp/><sp/>(INOPB(fs)<sp/>/<sp/>((fs)-&gt;fs_bsize<sp/>&gt;&gt;<sp/>VBLKSHIFT))</highlight></codeline>
<codeline lineno="44" refid="ufs_8c_1093aab4d88e8ac7dacc93d9cb6cc58ee" refkind="member"><highlight class="preprocessor"></highlight><highlight class="preprocessor">#define<sp/><sp/><sp/><sp/><sp/><sp/><sp/>INOPB(fs)<sp/><sp/><sp/><sp/><sp/><sp/><sp/>((fs)-&gt;fs_inopb)</highlight></codeline>
<codeline lineno="45" refid="ufs_8c_11b76f991135322a54450c8604038d12b" refkind="member"><highlight class="preprocessor"></highlight><highlight class="preprocessor">#define<sp/>INO_TO_VBA(fs,<sp/>ipervblk,<sp/>x)<sp/>\</highlight></codeline>
<codeline lineno="46"><highlight class="preprocessor"><sp/><sp/><sp/><sp/>(fsbtodb(fs,<sp/>cgimin(fs,<sp/>ino_to_cg(fs,<sp/>x)))<sp/>+<sp/>\</highlight></codeline>
<codeline lineno="47"><highlight class="preprocessor"><sp/><sp/><sp/><sp/>(((x)<sp/>%<sp/>(fs)-&gt;fs_ipg)<sp/>/<sp/>(ipervblk)<sp/>*<sp/>DBPERVBLK))</highlight></codeline>
<codeline lineno="48" refid="ufs_8c_1dd0c55395013d386f53627b02e0cf27a" refkind="member"><highlight class="preprocessor"></highlight><highlight class="preprocessor">#define<sp/>INO_TO_VBO(ipervblk,<sp/>x)<sp/>((x)<sp/>%<sp/>ipervblk)</highlight></codeline>
<codeline lineno="49"><highlight class="preprocessor"></highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="50"><highlight class="normal"></highlight></codeline>
<codeline lineno="51" refid="ufs_8c_127a0276d7cf729f1a89bd46dac8a9650" refkind="member"><highlight class="normal"></highlight><highlight class="keyword">static</highlight><highlight class="normal"><sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/><ref refid="ufs_8c_127a0276d7cf729f1a89bd46dac8a9650" kindref="member">dskread</ref>(</highlight><highlight class="keywordtype">void</highlight><highlight class="normal"><sp/>*<ref refid="structbuf" kindref="compound">buf</ref>,<sp/><ref refid="types_8h_1250ac047bf3984b5dae755276a305d64" kindref="member">u_int64_t</ref><sp/>block,<ref refid="types_8h_17619b847aeded8a6d14cbfa212b2cdfb" kindref="member">size_t</ref><sp/>count,<ref refid="structfileDescriptorStruct" kindref="compound">fileDescriptor</ref><sp/>*fd)<sp/>{</highlight></codeline>
<codeline lineno="52"><highlight class="normal"><sp/><sp/>fd-&gt;<ref refid="structfileDescriptorStruct_1f8abeb5da4a430885db51246db1356f9" kindref="member">mp</ref>-&gt;<ref refid="structvfs__mountPoint_15683a99774aaf81116e1765eb2509df5" kindref="member">device</ref>-&gt;<ref refid="structdevice__node_1588d09d5dabf1c8866d359aaac799b1c" kindref="member">devInfo</ref>-&gt;<ref refid="structdevice__interface_16caf84418059d0121e76d873e305ddcb" kindref="member">read</ref>(fd-&gt;<ref refid="structfileDescriptorStruct_1f8abeb5da4a430885db51246db1356f9" kindref="member">mp</ref>-&gt;<ref refid="structvfs__mountPoint_15683a99774aaf81116e1765eb2509df5" kindref="member">device</ref>-&gt;<ref refid="structdevice__node_1588d09d5dabf1c8866d359aaac799b1c" kindref="member">devInfo</ref>-&gt;<ref refid="structdevice__interface_1eacb2f431b14ddd1e9fe34db278dfc9e" kindref="member">info</ref>,buf,block,count);</highlight></codeline>
<codeline lineno="53"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordflow">return</highlight><highlight class="normal">(0x0);</highlight></codeline>
<codeline lineno="54"><highlight class="normal"><sp/><sp/>}</highlight></codeline>
<codeline lineno="55"><highlight class="normal"></highlight></codeline>
<codeline lineno="56"><highlight class="normal"></highlight><highlight class="comment">//struct<sp/>dmadat<sp/>{</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="57"><highlight class="normal"></highlight><highlight class="comment">//<sp/><sp/>char<sp/>blkbuf[VBLKSIZE];<sp/><sp/>/*<sp/>filesystem<sp/>blocks<sp/>*/</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="58"><highlight class="normal"></highlight><highlight class="comment">//<sp/><sp/>char<sp/>indbuf[VBLKSIZE];<sp/><sp/>/*<sp/>indir<sp/>blocks<sp/>*/</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="59"><highlight class="normal"></highlight><highlight class="comment">//<sp/><sp/>char<sp/>sbbuf[SBLOCKSIZE];<sp/>/*<sp/>superblock<sp/>*/</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="60"><highlight class="normal"></highlight><highlight class="comment">//<sp/><sp/>char<sp/>secbuf[DEV_BSIZE];<sp/>/*<sp/>for<sp/>MBR/disklabel<sp/>*/</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="61"><highlight class="normal"></highlight><highlight class="comment">//<sp/><sp/>};</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="62"><highlight class="normal"></highlight><highlight class="comment">//static<sp/>struct<sp/>dmadat<sp/>*dmadat;</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="63"><highlight class="normal"></highlight></codeline>
<codeline lineno="64"><highlight class="normal"></highlight><highlight class="comment">//static<sp/>int<sp/>ls,dsk_meta;</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="65"><highlight class="normal"></highlight></codeline>
<codeline lineno="66" refid="ufs_8c_18d5779eb674b28e517275bda58b7c041" refkind="member"><highlight class="normal"></highlight><highlight class="keyword">static</highlight><highlight class="normal"><sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/><ref refid="ufs_8c_18d5779eb674b28e517275bda58b7c041" kindref="member">sblock_try</ref>[]<sp/>=<sp/><ref refid="ufs_8h_163f5b70b0dfe26fd775e89713f552e23" kindref="member">SBLOCKSEARCH</ref>;</highlight></codeline>
<codeline lineno="67"><highlight class="normal"></highlight></codeline>
<codeline lineno="68"><highlight class="normal"></highlight><highlight class="preprocessor">#if<sp/>defined(UFS2_ONLY)</highlight></codeline>
<codeline lineno="69"><highlight class="preprocessor"></highlight><highlight class="preprocessor">#define<sp/>DIP(field)<sp/>dp2.field</highlight></codeline>
<codeline lineno="70"><highlight class="preprocessor"></highlight><highlight class="preprocessor">#elif<sp/>defined(UFS1_ONLY)</highlight></codeline>
<codeline lineno="71"><highlight class="preprocessor"></highlight><highlight class="preprocessor">#define<sp/>DIP(field)<sp/>dp1.field</highlight></codeline>
<codeline lineno="72"><highlight class="preprocessor"></highlight><highlight class="preprocessor">#else</highlight></codeline>
<codeline lineno="73" refid="ufs_8c_1a5a59d37ee7a73e41be17638269b06a9" refkind="member"><highlight class="preprocessor"></highlight><highlight class="preprocessor">#define<sp/>DIP(field)<sp/>fs-&gt;fs_magic<sp/>==<sp/>FS_UFS1_MAGIC<sp/>?<sp/>dp1.field<sp/>:<sp/>dp2.field</highlight></codeline>
<codeline lineno="74"><highlight class="preprocessor"></highlight><highlight class="preprocessor">#endif</highlight></codeline>
<codeline lineno="75"><highlight class="preprocessor"></highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="76"><highlight class="normal"></highlight></codeline>
<codeline lineno="77" refid="ufs_8c_103b001870aa568dcdcc44c1dc79a49dd" refkind="member"><highlight class="normal"></highlight><highlight class="keyword">static</highlight><highlight class="normal"><sp/><ref refid="types_8h_187bd983bf349d8b86901f3200d559e8e" kindref="member">ssize_t</ref><sp/><ref refid="ufs_8c_103b001870aa568dcdcc44c1dc79a49dd" kindref="member">fsread</ref>(<ref refid="types_8h_173341b7381d39d6e5b80ff9f23379dbd" kindref="member">ino_t</ref><sp/>inode,<sp/></highlight><highlight class="keywordtype">void</highlight><highlight class="normal"><sp/>*<ref refid="structbuf" kindref="compound">buf</ref>,<sp/><ref refid="types_8h_17619b847aeded8a6d14cbfa212b2cdfb" kindref="member">size_t</ref><sp/>nbyte,<ref refid="structfileDescriptorStruct" kindref="compound">fileDescriptor</ref><sp/>*fd)<sp/>{</highlight></codeline>
<codeline lineno="78"><highlight class="normal"></highlight><highlight class="preprocessor">#ifndef<sp/>UFS2_ONLY</highlight></codeline>
<codeline lineno="79"><highlight class="preprocessor"></highlight><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keyword">static</highlight><highlight class="normal"><sp/></highlight><highlight class="keyword">struct<sp/></highlight><highlight class="normal"><ref refid="structufs1__dinode" kindref="compound">ufs1_dinode</ref><sp/>dp1;</highlight></codeline>
<codeline lineno="80"><highlight class="normal"></highlight><highlight class="preprocessor">#endif</highlight></codeline>
<codeline lineno="81"><highlight class="preprocessor"></highlight><highlight class="preprocessor">#ifndef<sp/>UFS1_ONLY</highlight></codeline>
<codeline lineno="82"><highlight class="preprocessor"></highlight><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keyword">static</highlight><highlight class="normal"><sp/></highlight><highlight class="keyword">struct<sp/></highlight><highlight class="normal"><ref refid="structufs2__dinode" kindref="compound">ufs2_dinode</ref><sp/>dp2;</highlight></codeline>
<codeline lineno="83"><highlight class="normal"></highlight><highlight class="preprocessor">#endif</highlight></codeline>
<codeline lineno="84"><highlight class="preprocessor"></highlight><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keyword">static</highlight><highlight class="normal"><sp/><ref refid="types_8h_173341b7381d39d6e5b80ff9f23379dbd" kindref="member">ino_t</ref><sp/>inomap;</highlight></codeline>
<codeline lineno="85"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordtype">char</highlight><highlight class="normal"><sp/>*blkbuf;</highlight></codeline>
<codeline lineno="86"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordtype">void</highlight><highlight class="normal"><sp/>*indbuf;</highlight></codeline>
<codeline lineno="87"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keyword">struct<sp/></highlight><highlight class="normal"><ref refid="structfs" kindref="compound">fs</ref><sp/>*<ref refid="structfs" kindref="compound">fs</ref>;</highlight></codeline>
<codeline lineno="88"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordtype">char</highlight><highlight class="normal"><sp/>*s;</highlight></codeline>
<codeline lineno="89"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><ref refid="types_8h_17619b847aeded8a6d14cbfa212b2cdfb" kindref="member">size_t</ref><sp/>n,<sp/>nb,<sp/>size,<sp/>off,<sp/>vboff;</highlight></codeline>
<codeline lineno="90"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><ref refid="ufs_8h_1cfdbacc42c74f81152f66f8f81316513" kindref="member">ufs_lbn_t</ref><sp/>lbn;</highlight></codeline>
<codeline lineno="91"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><ref refid="ufs_8h_1d1d47f60518d845f7e798fa0f3458753" kindref="member">ufs2_daddr_t</ref><sp/>addr,<sp/>vbaddr;</highlight></codeline>
<codeline lineno="92"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keyword">static</highlight><highlight class="normal"><sp/><ref refid="ufs_8h_1d1d47f60518d845f7e798fa0f3458753" kindref="member">ufs2_daddr_t</ref><sp/>blkmap,<sp/>indmap;</highlight></codeline>
<codeline lineno="93"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><ref refid="types_8h_1c319c165d52643e43249fe003e18bdf3" kindref="member">u_int</ref><sp/>u;</highlight></codeline>
<codeline lineno="94"><highlight class="normal"></highlight></codeline>
<codeline lineno="95"><highlight class="normal"></highlight></codeline>
<codeline lineno="96"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>blkbuf<sp/>=<sp/>fd-&gt;<ref refid="structfileDescriptorStruct_162c52d66a6baff1f91fec689b624e3b3" kindref="member">dmadat</ref>-&gt;<ref refid="structdmadat_1d134ba5a7290b627a60d5fd83fc2f204" kindref="member">blkbuf</ref>;</highlight></codeline>
<codeline lineno="97"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>indbuf<sp/>=<sp/>fd-&gt;<ref refid="structfileDescriptorStruct_162c52d66a6baff1f91fec689b624e3b3" kindref="member">dmadat</ref>-&gt;<ref refid="structdmadat_1e1f8eab27e979807a50dbf2d54ec1476" kindref="member">indbuf</ref>;</highlight></codeline>
<codeline lineno="98"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>fs<sp/>=<sp/>(</highlight><highlight class="keyword">struct<sp/></highlight><highlight class="normal">fs<sp/>*)fd-&gt;<ref refid="structfileDescriptorStruct_162c52d66a6baff1f91fec689b624e3b3" kindref="member">dmadat</ref>-&gt;<ref refid="structdmadat_1b267db93faadfbb8c65f16ca4df76055" kindref="member">sbbuf</ref>;</highlight></codeline>
<codeline lineno="99"><highlight class="normal"></highlight></codeline>
<codeline lineno="100"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>if<sp/>(!fd-&gt;<ref refid="structfileDescriptorStruct_1c4a0e558e819f84243070ac2adaa6b11" kindref="member">dsk_meta</ref>)<sp/>{</highlight></codeline>
<codeline lineno="101"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>inomap<sp/>=<sp/>0;</highlight></codeline>
<codeline lineno="102"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">for</highlight><highlight class="normal"><sp/>(n<sp/>=<sp/>0;<sp/><ref refid="ufs_8c_18d5779eb674b28e517275bda58b7c041" kindref="member">sblock_try</ref>[n]<sp/>!=<sp/>-1;<sp/>n++)<sp/>{</highlight></codeline>
<codeline lineno="103"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(<ref refid="ufs_8c_127a0276d7cf729f1a89bd46dac8a9650" kindref="member">dskread</ref>(fs,<sp/><ref refid="ufs_8c_18d5779eb674b28e517275bda58b7c041" kindref="member">sblock_try</ref>[n]<sp/>/<sp/><ref refid="ufs_8h_19c8466b6111a11195a5cd2478c648e32" kindref="member">DEV_BSIZE</ref>,<sp/>16,fd))</highlight></codeline>
<codeline lineno="104"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">return</highlight><highlight class="normal"><sp/>-1;</highlight></codeline>
<codeline lineno="105"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>((</highlight></codeline>
<codeline lineno="106"><highlight class="normal">#</highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>defined(UFS1_ONLY)</highlight></codeline>
<codeline lineno="107"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>fs-&gt;fs_magic<sp/>==<sp/><ref refid="ufs_8h_1ce25c7a73c514a8e575e1ba8c15c9a9e" kindref="member">FS_UFS1_MAGIC</ref></highlight></codeline>
<codeline lineno="108"><highlight class="normal">#elif<sp/>defined(UFS2_ONLY)</highlight></codeline>
<codeline lineno="109"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>(fs-&gt;fs_magic<sp/>==<sp/><ref refid="ufs_8h_10b73b7456fc1dee932dc0c1056c613fc" kindref="member">FS_UFS2_MAGIC</ref><sp/>&amp;&amp;</highlight></codeline>
<codeline lineno="110"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>fs-&gt;fs_sblockloc<sp/>==<sp/><ref refid="ufs_8c_18d5779eb674b28e517275bda58b7c041" kindref="member">sblock_try</ref>[n])</highlight></codeline>
<codeline lineno="111"><highlight class="normal">#</highlight><highlight class="keywordflow">else</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="112"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>fs-&gt;fs_magic<sp/>==<sp/><ref refid="ufs_8h_1ce25c7a73c514a8e575e1ba8c15c9a9e" kindref="member">FS_UFS1_MAGIC</ref><sp/>||</highlight></codeline>
<codeline lineno="113"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>(fs-&gt;fs_magic<sp/>==<sp/><ref refid="ufs_8h_10b73b7456fc1dee932dc0c1056c613fc" kindref="member">FS_UFS2_MAGIC</ref><sp/>&amp;&amp;</highlight></codeline>
<codeline lineno="114"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>fs-&gt;fs_sblockloc<sp/>==<sp/><ref refid="ufs_8c_18d5779eb674b28e517275bda58b7c041" kindref="member">sblock_try</ref>[n])</highlight></codeline>
<codeline lineno="115"><highlight class="normal">#endif</highlight></codeline>
<codeline lineno="116"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>)<sp/>&amp;&amp;</highlight></codeline>
<codeline lineno="117"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>fs-&gt;fs_bsize<sp/>&lt;=<sp/><ref refid="ufs_8h_16e852e863e63ab118ec196d1157a1dbd" kindref="member">MAXBSIZE</ref><sp/>&amp;&amp;</highlight></codeline>
<codeline lineno="118"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>fs-&gt;fs_bsize<sp/>&gt;=<sp/></highlight><highlight class="keyword">sizeof</highlight><highlight class="normal">(</highlight><highlight class="keyword">struct</highlight><highlight class="normal"><sp/>fs))</highlight></codeline>
<codeline lineno="119"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">break</highlight><highlight class="normal">;</highlight></codeline>
<codeline lineno="120"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="121"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(<ref refid="ufs_8c_18d5779eb674b28e517275bda58b7c041" kindref="member">sblock_try</ref>[n]<sp/>==<sp/>-1)<sp/>{</highlight></codeline>
<codeline lineno="122"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><ref refid="kprint_8h_1b2761bdf0cca73ad0fb5880895210cd8" kindref="member">kprintf</ref>(</highlight><highlight class="stringliteral">&quot;Not<sp/>ufs\n&quot;</highlight><highlight class="normal">);</highlight></codeline>
<codeline lineno="123"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">return</highlight><highlight class="normal"><sp/>-1;</highlight></codeline>
<codeline lineno="124"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="125"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>fd-&gt;<ref refid="structfileDescriptorStruct_1c4a0e558e819f84243070ac2adaa6b11" kindref="member">dsk_meta</ref>++;</highlight></codeline>
<codeline lineno="126"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="127"><highlight class="normal"></highlight></codeline>
<codeline lineno="128"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(!inode)</highlight></codeline>
<codeline lineno="129"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">return</highlight><highlight class="normal">(0x0);</highlight></codeline>
<codeline lineno="130"><highlight class="normal"></highlight></codeline>
<codeline lineno="131"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(inomap<sp/>!=<sp/>inode)<sp/>{</highlight></codeline>
<codeline lineno="132"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>n<sp/>=<sp/><ref refid="ufs_8c_13fe028b32899dee05ea1b48efb73fe33" kindref="member">IPERVBLK</ref>(fs);</highlight></codeline>
<codeline lineno="133"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(<ref refid="ufs_8c_127a0276d7cf729f1a89bd46dac8a9650" kindref="member">dskread</ref>(blkbuf,<sp/><ref refid="ufs_8c_11b76f991135322a54450c8604038d12b" kindref="member">INO_TO_VBA</ref>(fs,<sp/>n,<sp/>inode),<sp/><ref refid="ufs_8c_1e977f66f7be1f87abd0d0603e3852a06" kindref="member">DBPERVBLK</ref>,fd))</highlight></codeline>
<codeline lineno="134"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">return</highlight><highlight class="normal"><sp/>-1;</highlight></codeline>
<codeline lineno="135"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>n<sp/>=<sp/><ref refid="ufs_8c_1dd0c55395013d386f53627b02e0cf27a" kindref="member">INO_TO_VBO</ref>(n,<sp/>inode);</highlight></codeline>
<codeline lineno="136"><highlight class="normal"></highlight><highlight class="preprocessor">#if<sp/>defined(UFS1_ONLY)</highlight></codeline>
<codeline lineno="137"><highlight class="preprocessor"></highlight><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>dp1<sp/>=<sp/>((</highlight><highlight class="keyword">struct<sp/></highlight><highlight class="normal"><ref refid="structufs1__dinode" kindref="compound">ufs1_dinode</ref><sp/>*)blkbuf)[n];</highlight></codeline>
<codeline lineno="138"><highlight class="normal"></highlight><highlight class="preprocessor">#elif<sp/>defined(UFS2_ONLY)</highlight></codeline>
<codeline lineno="139"><highlight class="preprocessor"></highlight><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>dp2<sp/>=<sp/>((</highlight><highlight class="keyword">struct<sp/></highlight><highlight class="normal"><ref refid="structufs2__dinode" kindref="compound">ufs2_dinode</ref><sp/>*)blkbuf)[n];</highlight></codeline>
<codeline lineno="140"><highlight class="normal"></highlight><highlight class="preprocessor">#else</highlight></codeline>
<codeline lineno="141"><highlight class="preprocessor"></highlight><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(fs-&gt;<ref refid="structfs_1acc2f0aa6f3902f165c563ce5ba76373" kindref="member">fs_magic</ref><sp/>==<sp/><ref refid="ufs_8h_1ce25c7a73c514a8e575e1ba8c15c9a9e" kindref="member">FS_UFS1_MAGIC</ref>)</highlight></codeline>
<codeline lineno="142"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>dp1<sp/>=<sp/>((</highlight><highlight class="keyword">struct<sp/></highlight><highlight class="normal"><ref refid="structufs1__dinode" kindref="compound">ufs1_dinode</ref><sp/>*)blkbuf)[n];</highlight></codeline>
<codeline lineno="143"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">else</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="144"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>dp2<sp/>=<sp/>((</highlight><highlight class="keyword">struct<sp/></highlight><highlight class="normal"><ref refid="structufs2__dinode" kindref="compound">ufs2_dinode</ref><sp/>*)blkbuf)[n];</highlight></codeline>
<codeline lineno="145"><highlight class="normal"></highlight><highlight class="preprocessor">#endif</highlight></codeline>
<codeline lineno="146"><highlight class="preprocessor"></highlight><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>inomap<sp/>=<sp/>inode;</highlight></codeline>
<codeline lineno="147"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>fd-&gt;<ref refid="structfileDescriptorStruct_1eedbb6c79fc5a34c4b8cf4ebbf6a0658" kindref="member">offset</ref><sp/>=<sp/>0;</highlight></codeline>
<codeline lineno="148"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>blkmap<sp/>=<sp/>indmap<sp/>=<sp/>0;</highlight></codeline>
<codeline lineno="149"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="150"><highlight class="normal"></highlight></codeline>
<codeline lineno="151"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>s<sp/>=<sp/>buf;</highlight></codeline>
<codeline lineno="152"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>size<sp/>=<sp/><ref refid="ufs_8c_1a5a59d37ee7a73e41be17638269b06a9" kindref="member">DIP</ref>(<ref refid="structufs2__dinode_1d5993494c57c494293c25dc81ec3b154" kindref="member">di_size</ref>);</highlight></codeline>
<codeline lineno="153"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>fd-&gt;<ref refid="structfileDescriptorStruct_197eb3dcefe53610658dc341ca449e290" kindref="member">size</ref><sp/>=<sp/>size;</highlight></codeline>
<codeline lineno="154"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>n<sp/>=<sp/>size<sp/>-<sp/>fd-&gt;<ref refid="structfileDescriptorStruct_1eedbb6c79fc5a34c4b8cf4ebbf6a0658" kindref="member">offset</ref>;</highlight></codeline>
<codeline lineno="155"><highlight class="normal"><sp/></highlight><highlight class="comment">//Why?</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="156"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(n<sp/>&lt;<sp/>0)</highlight></codeline>
<codeline lineno="157"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">return</highlight><highlight class="normal">(0x0);</highlight></codeline>
<codeline lineno="158"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(nbyte<sp/>&gt;<sp/>n)</highlight></codeline>
<codeline lineno="159"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>nbyte<sp/>=<sp/>n;</highlight></codeline>
<codeline lineno="160"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>nb<sp/>=<sp/>nbyte;</highlight></codeline>
<codeline lineno="161"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">while</highlight><highlight class="normal"><sp/>(nb)<sp/>{</highlight></codeline>
<codeline lineno="162"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>lbn<sp/>=<sp/><ref refid="ufs_8h_11ea09415cf1bc5de0d0d4a7158a5c736" kindref="member">lblkno</ref>(fs,<sp/>fd-&gt;<ref refid="structfileDescriptorStruct_1eedbb6c79fc5a34c4b8cf4ebbf6a0658" kindref="member">offset</ref>);</highlight></codeline>
<codeline lineno="163"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>off<sp/>=<sp/><ref refid="ufs_8h_1cd9d1b3e1eed7fc3850f8a78636dd5a7" kindref="member">blkoff</ref>(fs,<sp/>fd-&gt;<ref refid="structfileDescriptorStruct_1eedbb6c79fc5a34c4b8cf4ebbf6a0658" kindref="member">offset</ref>);</highlight></codeline>
<codeline lineno="164"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(lbn<sp/>&lt;<sp/><ref refid="ufs_8h_10c136d7ef3223bdd2b6e7c83c65bb508" kindref="member">NDADDR</ref>)<sp/>{</highlight></codeline>
<codeline lineno="165"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>addr<sp/>=<sp/><ref refid="ufs_8c_1a5a59d37ee7a73e41be17638269b06a9" kindref="member">DIP</ref>(<ref refid="structufs2__dinode_1667ab9837a0fd21d51108ca9dfd85f66" kindref="member">di_db</ref>[lbn]);</highlight></codeline>
<codeline lineno="166"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>}<sp/></highlight><highlight class="keywordflow">else</highlight><highlight class="normal"><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(lbn<sp/>&lt;<sp/><ref refid="ufs_8h_10c136d7ef3223bdd2b6e7c83c65bb508" kindref="member">NDADDR</ref><sp/>+<sp/><ref refid="ufs_8h_16d58397786421684bb8db78f01e13ae6" kindref="member">NINDIR</ref>(fs))<sp/>{</highlight></codeline>
<codeline lineno="167"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>n<sp/>=<sp/><ref refid="ufs_8c_1e4524da6e4d6ec5c11dbe5cf4559adf3" kindref="member">INDIRPERVBLK</ref>(fs);</highlight></codeline>
<codeline lineno="168"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>addr<sp/>=<sp/><ref refid="ufs_8c_1a5a59d37ee7a73e41be17638269b06a9" kindref="member">DIP</ref>(<ref refid="structufs2__dinode_19eb4d981d19dd77fbde21e84fd4e2d5d" kindref="member">di_ib</ref>[0]);</highlight></codeline>
<codeline lineno="169"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>u<sp/>=<sp/>(<ref refid="types_8h_1c319c165d52643e43249fe003e18bdf3" kindref="member">u_int</ref>)(lbn<sp/>-<sp/><ref refid="ufs_8h_10c136d7ef3223bdd2b6e7c83c65bb508" kindref="member">NDADDR</ref>)<sp/>/<sp/>(n<sp/>*<sp/><ref refid="ufs_8c_1e977f66f7be1f87abd0d0603e3852a06" kindref="member">DBPERVBLK</ref>);</highlight></codeline>
<codeline lineno="170"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>vbaddr<sp/>=<sp/><ref refid="ufs_8h_1e26526d0ac7505aae7345f0288c17fe6" kindref="member">fsbtodb</ref>(fs,<sp/>addr)<sp/>+<sp/>u;</highlight></codeline>
<codeline lineno="171"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(indmap<sp/>!=<sp/>vbaddr)<sp/>{</highlight></codeline>
<codeline lineno="172"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(<ref refid="ufs_8c_127a0276d7cf729f1a89bd46dac8a9650" kindref="member">dskread</ref>(indbuf,<sp/>vbaddr,<sp/><ref refid="ufs_8c_1e977f66f7be1f87abd0d0603e3852a06" kindref="member">DBPERVBLK</ref>,fd))</highlight></codeline>
<codeline lineno="173"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">return</highlight><highlight class="normal"><sp/>-1;</highlight></codeline>
<codeline lineno="174"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>indmap<sp/>=<sp/>vbaddr;</highlight></codeline>
<codeline lineno="175"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="176"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>n<sp/>=<sp/>(lbn<sp/>-<sp/><ref refid="ufs_8h_10c136d7ef3223bdd2b6e7c83c65bb508" kindref="member">NDADDR</ref>)<sp/>&amp;<sp/>(n<sp/>-<sp/>1);</highlight></codeline>
<codeline lineno="177"><highlight class="normal"></highlight><highlight class="preprocessor">#if<sp/>defined(UFS1_ONLY)</highlight></codeline>
<codeline lineno="178"><highlight class="preprocessor"></highlight><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>addr<sp/>=<sp/>((<ref refid="ufs_8h_16c4d2453c62592d30d9c981e4ee01323" kindref="member">ufs1_daddr_t</ref><sp/>*)indbuf)[n];</highlight></codeline>
<codeline lineno="179"><highlight class="normal"></highlight><highlight class="preprocessor">#elif<sp/>defined(UFS2_ONLY)</highlight></codeline>
<codeline lineno="180"><highlight class="preprocessor"></highlight><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>addr<sp/>=<sp/>((<ref refid="ufs_8h_1d1d47f60518d845f7e798fa0f3458753" kindref="member">ufs2_daddr_t</ref><sp/>*)indbuf)[n];</highlight></codeline>
<codeline lineno="181"><highlight class="normal"></highlight><highlight class="preprocessor">#else</highlight></codeline>
<codeline lineno="182"><highlight class="preprocessor"></highlight><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(fs-&gt;<ref refid="structfs_1acc2f0aa6f3902f165c563ce5ba76373" kindref="member">fs_magic</ref><sp/>==<sp/><ref refid="ufs_8h_1ce25c7a73c514a8e575e1ba8c15c9a9e" kindref="member">FS_UFS1_MAGIC</ref>)</highlight></codeline>
<codeline lineno="183"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>addr<sp/>=<sp/>((<ref refid="ufs_8h_16c4d2453c62592d30d9c981e4ee01323" kindref="member">ufs1_daddr_t</ref><sp/>*)indbuf)[n];</highlight></codeline>
<codeline lineno="184"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">else</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="185"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>addr<sp/>=<sp/>((<ref refid="ufs_8h_1d1d47f60518d845f7e798fa0f3458753" kindref="member">ufs2_daddr_t</ref><sp/>*)indbuf)[n];</highlight></codeline>
<codeline lineno="186"><highlight class="normal"></highlight><highlight class="preprocessor">#endif</highlight></codeline>
<codeline lineno="187"><highlight class="preprocessor"></highlight><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>}<sp/></highlight><highlight class="keywordflow">else</highlight><highlight class="normal"><sp/>{</highlight></codeline>
<codeline lineno="188"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">return</highlight><highlight class="normal"><sp/>-1;</highlight></codeline>
<codeline lineno="189"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="190"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>vbaddr<sp/>=<sp/><ref refid="ufs_8h_1e26526d0ac7505aae7345f0288c17fe6" kindref="member">fsbtodb</ref>(fs,<sp/>addr)<sp/>+<sp/>(off<sp/>&gt;&gt;<sp/><ref refid="file_8h_11f8f4eabaf5119f68bfc6ee1ff715952" kindref="member">VBLKSHIFT</ref>)<sp/>*<sp/><ref refid="ufs_8c_1e977f66f7be1f87abd0d0603e3852a06" kindref="member">DBPERVBLK</ref>;</highlight></codeline>
<codeline lineno="191"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>vboff<sp/>=<sp/>off<sp/>&amp;<sp/><ref refid="ufs_8c_18c3f8bc1aebec0e57f9e9a6b2ffa640e" kindref="member">VBLKMASK</ref>;</highlight></codeline>
<codeline lineno="192"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>n<sp/>=<sp/><ref refid="ufs_8h_1d35c4c33dc54a0b8db742e0b3b5f64aa" kindref="member">sblksize</ref>(fs,<sp/>size,<sp/>lbn)<sp/>-<sp/>(off<sp/>&amp;<sp/>~VBLKMASK);</highlight></codeline>
<codeline lineno="193"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(n<sp/>&gt;<sp/><ref refid="file_8h_1df63a6145c73332883effc7746beffc2" kindref="member">VBLKSIZE</ref>)</highlight></codeline>
<codeline lineno="194"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>n<sp/>=<sp/><ref refid="file_8h_1df63a6145c73332883effc7746beffc2" kindref="member">VBLKSIZE</ref>;</highlight></codeline>
<codeline lineno="195"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(blkmap<sp/>!=<sp/>vbaddr)<sp/>{</highlight></codeline>
<codeline lineno="196"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(<ref refid="ufs_8c_127a0276d7cf729f1a89bd46dac8a9650" kindref="member">dskread</ref>(blkbuf,<sp/>vbaddr,<sp/>n<sp/>&gt;&gt;<sp/><ref refid="ufs_8h_19734470bf89968d142073fd334bf9cb6" kindref="member">DEV_BSHIFT</ref>,fd))</highlight></codeline>
<codeline lineno="197"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">return</highlight><highlight class="normal"><sp/>-1;</highlight></codeline>
<codeline lineno="198"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>blkmap<sp/>=<sp/>vbaddr;</highlight></codeline>
<codeline lineno="199"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="200"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>n<sp/>-=<sp/>vboff;</highlight></codeline>
<codeline lineno="201"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(n<sp/>&gt;<sp/>nb)</highlight></codeline>
<codeline lineno="202"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>n<sp/>=<sp/>nb;</highlight></codeline>
<codeline lineno="203"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><ref refid="lib_2string_8h_1e33b18edb618c656b9b795b9fce2316c" kindref="member">memcpy</ref>(s,<sp/>blkbuf<sp/>+<sp/>vboff,<sp/>n);</highlight></codeline>
<codeline lineno="204"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>s<sp/>+=<sp/>n;</highlight></codeline>
<codeline lineno="205"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>fd-&gt;<ref refid="structfileDescriptorStruct_1eedbb6c79fc5a34c4b8cf4ebbf6a0658" kindref="member">offset</ref><sp/>+=<sp/>n;</highlight></codeline>
<codeline lineno="206"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>nb<sp/>-=<sp/>n;</highlight></codeline>
<codeline lineno="207"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="208"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">return</highlight><highlight class="normal"><sp/>nbyte;</highlight></codeline>
<codeline lineno="209"><highlight class="normal">}</highlight></codeline>
<codeline lineno="210"><highlight class="normal"></highlight></codeline>
<codeline lineno="211"><highlight class="normal"></highlight></codeline>
<codeline lineno="212"><highlight class="normal"></highlight></codeline>
<codeline lineno="213"><highlight class="normal"></highlight></codeline>
<codeline lineno="214" refid="ufs_8c_1ccfc6cc8f916e7f58db4ac350bdc1e9b" refkind="member"><highlight class="normal"></highlight><highlight class="keyword">static</highlight><highlight class="normal"><sp/>__inline<sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/><ref refid="ufs_8c_1ccfc6cc8f916e7f58db4ac350bdc1e9b" kindref="member">fsfind</ref>(</highlight><highlight class="keyword">const</highlight><highlight class="normal"><sp/></highlight><highlight class="keywordtype">char</highlight><highlight class="normal"><sp/>*<ref refid="pci_8c_18f8f80d37794cde9472343e4487ba3eb" kindref="member">name</ref>,<sp/><ref refid="types_8h_173341b7381d39d6e5b80ff9f23379dbd" kindref="member">ino_t</ref><sp/>*<sp/>ino,<ref refid="structfileDescriptorStruct" kindref="compound">fileDescriptor</ref><sp/>*fd)<sp/>{</highlight></codeline>
<codeline lineno="215"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordtype">char</highlight><highlight class="normal"><sp/><ref refid="structbuf" kindref="compound">buf</ref>[<ref refid="ufs_8h_19c8466b6111a11195a5cd2478c648e32" kindref="member">DEV_BSIZE</ref>];</highlight></codeline>
<codeline lineno="216"><highlight class="normal"><sp/><sp/></highlight><highlight class="keyword">struct<sp/></highlight><highlight class="normal"><ref refid="structdirent" kindref="compound">dirent</ref><sp/>*d;</highlight></codeline>
<codeline lineno="217"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordtype">char</highlight><highlight class="normal"><sp/>*s;</highlight></codeline>
<codeline lineno="218"><highlight class="normal"><sp/><sp/><ref refid="types_8h_187bd983bf349d8b86901f3200d559e8e" kindref="member">ssize_t</ref><sp/>n;</highlight></codeline>
<codeline lineno="219"><highlight class="normal"></highlight></codeline>
<codeline lineno="220"><highlight class="normal"><sp/><sp/>fd-&gt;<ref refid="structfileDescriptorStruct_1eedbb6c79fc5a34c4b8cf4ebbf6a0658" kindref="member">offset</ref><sp/>=<sp/>0;</highlight></codeline>
<codeline lineno="221"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordflow">while</highlight><highlight class="normal"><sp/>((n<sp/>=<sp/><ref refid="ufs_8c_103b001870aa568dcdcc44c1dc79a49dd" kindref="member">fsread</ref>(*ino,<sp/>buf,<sp/><ref refid="ufs_8h_19c8466b6111a11195a5cd2478c648e32" kindref="member">DEV_BSIZE</ref>,fd))<sp/>&gt;<sp/>0)</highlight></codeline>
<codeline lineno="222"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">for</highlight><highlight class="normal"><sp/>(s<sp/>=<sp/>buf;<sp/>s<sp/>&lt;<sp/>buf<sp/>+<sp/><ref refid="ufs_8h_19c8466b6111a11195a5cd2478c648e32" kindref="member">DEV_BSIZE</ref>;)<sp/>{</highlight></codeline>
<codeline lineno="223"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/>d<sp/>=<sp/>(</highlight><highlight class="keywordtype">void</highlight><highlight class="normal"><sp/>*)s;</highlight></codeline>
<codeline lineno="224"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(!<ref refid="lib_2string_8h_16f3dcb20ff11ff9db5904c3cfb61a38c" kindref="member">strcmp</ref>(name,<sp/>d-&gt;<ref refid="structdirent_18cb13e39a90c43e6b180ff4f1614e4da" kindref="member">d_name</ref>))<sp/>{</highlight></codeline>
<codeline lineno="225"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>*ino<sp/>=<sp/>d-&gt;<ref refid="structdirent_10aa21d56704896b87f8a39ecba4f3731" kindref="member">d_fileno</ref>;</highlight></codeline>
<codeline lineno="226"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">return</highlight><highlight class="normal"><sp/>d-&gt;<ref refid="structdirent_1a850909d0a98e07d0ccd6232d28ed133" kindref="member">d_type</ref>;</highlight></codeline>
<codeline lineno="227"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="228"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/>s<sp/>+=<sp/>d-&gt;<ref refid="structdirent_16ca250ead8b04b71ea787acbd29b6b75" kindref="member">d_reclen</ref>;</highlight></codeline>
<codeline lineno="229"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="230"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="comment">//if<sp/>(n<sp/>!=<sp/>-1<sp/>&amp;&amp;<sp/>ls)</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="231"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="comment">//kprintf(&quot;\n&quot;);</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="232"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">return</highlight><highlight class="normal"><sp/>0;</highlight></codeline>
<codeline lineno="233"><highlight class="normal"><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="234"><highlight class="normal"></highlight></codeline>
<codeline lineno="235"><highlight class="normal"></highlight></codeline>
<codeline lineno="236" refid="ufs_8c_18b14c49128395a8745bc83cfcce7b9cf" refkind="member"><highlight class="normal"></highlight><highlight class="keyword">static</highlight><highlight class="normal"><sp/><ref refid="types_8h_173341b7381d39d6e5b80ff9f23379dbd" kindref="member">ino_t</ref><sp/><ref refid="ufs_8c_18b14c49128395a8745bc83cfcce7b9cf" kindref="member">lookup</ref>(</highlight><highlight class="keyword">const</highlight><highlight class="normal"><sp/></highlight><highlight class="keywordtype">char</highlight><highlight class="normal"><sp/>*path,<ref refid="structfileDescriptorStruct" kindref="compound">fileDescriptor</ref><sp/>*fd)<sp/>{</highlight></codeline>
<codeline lineno="237"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordtype">char</highlight><highlight class="normal"><sp/><ref refid="pci_8c_18f8f80d37794cde9472343e4487ba3eb" kindref="member">name</ref>[<ref refid="ufs_8h_1b347d7e5c2fdca2d28e693b2a508d76a" kindref="member">MAXNAMLEN</ref><sp/>+<sp/>1];</highlight></codeline>
<codeline lineno="238"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keyword">const</highlight><highlight class="normal"><sp/></highlight><highlight class="keywordtype">char</highlight><highlight class="normal"><sp/>*s;</highlight></codeline>
<codeline lineno="239"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><ref refid="types_8h_173341b7381d39d6e5b80ff9f23379dbd" kindref="member">ino_t</ref><sp/>ino;</highlight></codeline>
<codeline lineno="240"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><ref refid="types_8h_187bd983bf349d8b86901f3200d559e8e" kindref="member">ssize_t</ref><sp/>n;</highlight></codeline>
<codeline lineno="241"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>dt;</highlight></codeline>
<codeline lineno="242"><highlight class="normal"></highlight></codeline>
<codeline lineno="243"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>ino<sp/>=<sp/><ref refid="ufs_8h_122c8ea96d09283ed6496347806cc72a0" kindref="member">ROOTINO</ref>;</highlight></codeline>
<codeline lineno="244"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>dt<sp/>=<sp/><ref refid="ufs_8h_11dcee67486bc4238096ecb61e2d9ffd1" kindref="member">DT_DIR</ref>;</highlight></codeline>
<codeline lineno="245"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>name[0]<sp/>=<sp/></highlight><highlight class="charliteral">&apos;/&apos;</highlight><highlight class="normal">;</highlight></codeline>
<codeline lineno="246"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>name[1]<sp/>=<sp/></highlight><highlight class="charliteral">&apos;\0&apos;</highlight><highlight class="normal">;</highlight></codeline>
<codeline lineno="247"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">for</highlight><highlight class="normal"><sp/>(;;)<sp/>{</highlight></codeline>
<codeline lineno="248"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(*path<sp/>==<sp/></highlight><highlight class="charliteral">&apos;/&apos;</highlight><highlight class="normal">)</highlight></codeline>
<codeline lineno="249"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>path++;</highlight></codeline>
<codeline lineno="250"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(!*path)</highlight></codeline>
<codeline lineno="251"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">break</highlight><highlight class="normal">;</highlight></codeline>
<codeline lineno="252"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">for</highlight><highlight class="normal"><sp/>(s<sp/>=<sp/>path;<sp/>*s<sp/>&amp;&amp;<sp/>*s<sp/>!=<sp/></highlight><highlight class="charliteral">&apos;/&apos;</highlight><highlight class="normal">;<sp/>s++);</highlight></codeline>
<codeline lineno="253"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>((n<sp/>=<sp/>s<sp/>-<sp/>path)<sp/>&gt;<sp/><ref refid="ufs_8h_1b347d7e5c2fdca2d28e693b2a508d76a" kindref="member">MAXNAMLEN</ref>)</highlight></codeline>
<codeline lineno="254"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">return</highlight><highlight class="normal"><sp/>0;</highlight></codeline>
<codeline lineno="255"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="comment">//ls<sp/>=<sp/>*path<sp/>==<sp/>&apos;?&apos;<sp/>&amp;&amp;<sp/>n<sp/>==<sp/>1<sp/>&amp;&amp;<sp/>!*s;</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="256"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><ref refid="lib_2string_8h_1e33b18edb618c656b9b795b9fce2316c" kindref="member">memcpy</ref>(name,<sp/>path,<sp/>n);</highlight></codeline>
<codeline lineno="257"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>name[n]<sp/>=<sp/>0;</highlight></codeline>
<codeline lineno="258"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(dt<sp/>!=<sp/><ref refid="ufs_8h_11dcee67486bc4238096ecb61e2d9ffd1" kindref="member">DT_DIR</ref>)<sp/>{</highlight></codeline>
<codeline lineno="259"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><ref refid="kprint_8h_1b2761bdf0cca73ad0fb5880895210cd8" kindref="member">kprintf</ref>(</highlight><highlight class="stringliteral">&quot;%s:<sp/>not<sp/>a<sp/>directory.\n&quot;</highlight><highlight class="normal">,<sp/>name);</highlight></codeline>
<codeline lineno="260"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">return</highlight><highlight class="normal"><sp/>(0);</highlight></codeline>
<codeline lineno="261"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="262"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>((dt<sp/>=<sp/><ref refid="ufs_8c_1ccfc6cc8f916e7f58db4ac350bdc1e9b" kindref="member">fsfind</ref>(name,<sp/>&amp;ino,fd))<sp/>&lt;=<sp/>0)</highlight></codeline>
<codeline lineno="263"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">break</highlight><highlight class="normal">;</highlight></codeline>
<codeline lineno="264"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>path<sp/>=<sp/>s;</highlight></codeline>
<codeline lineno="265"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="266"><highlight class="normal"></highlight></codeline>
<codeline lineno="267"><highlight class="normal"></highlight></codeline>
<codeline lineno="268"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordflow">return</highlight><highlight class="normal"><sp/>dt<sp/>==<sp/><ref refid="ufs_8h_19973595cf6775b1b29d7274ab4c0d623" kindref="member">DT_REG</ref><sp/>?<sp/>ino<sp/>:<sp/>0;</highlight></codeline>
<codeline lineno="269"><highlight class="normal"><sp/><sp/>}</highlight></codeline>
<codeline lineno="270"><highlight class="normal"></highlight></codeline>
<codeline lineno="271"><highlight class="normal"></highlight></codeline>
<codeline lineno="272" refid="ufs_8c_1e5b71ba2291b2d2ef07ece9e0de74a5d" refkind="member"><highlight class="normal"></highlight><highlight class="keyword">static</highlight><highlight class="normal"><sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/><ref refid="ufs_8c_1e5b71ba2291b2d2ef07ece9e0de74a5d" kindref="member">ufs_openFile</ref>(</highlight><highlight class="keyword">const</highlight><highlight class="normal"><sp/></highlight><highlight class="keywordtype">char</highlight><highlight class="normal"><sp/>*<ref refid="structfile" kindref="compound">file</ref>,<sp/><ref refid="structfileDescriptorStruct" kindref="compound">fileDescriptor</ref><sp/>*fd)<sp/>{</highlight></codeline>
<codeline lineno="273"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordtype">char</highlight><highlight class="normal"><sp/>tmp[2];</highlight></codeline>
<codeline lineno="274"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>ino<sp/>=<sp/>0;</highlight></codeline>
<codeline lineno="275"><highlight class="normal"><sp/><sp/>fd-&gt;<ref refid="structfileDescriptorStruct_162c52d66a6baff1f91fec689b624e3b3" kindref="member">dmadat</ref><sp/>=<sp/>(</highlight><highlight class="keyword">struct<sp/></highlight><highlight class="normal"><ref refid="structdmadat" kindref="compound">dmadat</ref><sp/>*)<ref refid="kmalloc_8h_1150eab2ac4ce4553e21ca10e7f441762" kindref="member">kmalloc</ref>(</highlight><highlight class="keyword">sizeof</highlight><highlight class="normal">(</highlight><highlight class="keyword">struct</highlight><highlight class="normal"><sp/><ref refid="structdmadat" kindref="compound">dmadat</ref>));</highlight></codeline>
<codeline lineno="276"><highlight class="normal"><sp/><sp/>ino<sp/>=<sp/><ref refid="ufs_8c_18b14c49128395a8745bc83cfcce7b9cf" kindref="member">lookup</ref>(file,fd);</highlight></codeline>
<codeline lineno="277"><highlight class="normal"><sp/><sp/>fd-&gt;<ref refid="structfileDescriptorStruct_1eedbb6c79fc5a34c4b8cf4ebbf6a0658" kindref="member">offset</ref><sp/>=<sp/>0x0;</highlight></codeline>
<codeline lineno="278"><highlight class="normal"><sp/><sp/>fd-&gt;<ref refid="structfileDescriptorStruct_1fc289229a1011c71cde06dce77dadd7e" kindref="member">ino</ref><sp/>=<sp/>ino;</highlight></codeline>
<codeline lineno="279"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(ino<sp/>==<sp/>0x0)<sp/>{</highlight></codeline>
<codeline lineno="280"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">return</highlight><highlight class="normal">(-1);</highlight></codeline>
<codeline lineno="281"><highlight class="normal"><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="282"><highlight class="normal"></highlight></codeline>
<codeline lineno="283"><highlight class="normal"><sp/><sp/></highlight><highlight class="comment">/*<sp/>Quick<sp/>Hack<sp/>for<sp/>file<sp/>size<sp/>*/</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="284"><highlight class="normal"><sp/><sp/><ref refid="ufs_8c_103b001870aa568dcdcc44c1dc79a49dd" kindref="member">fsread</ref>(fd-&gt;<ref refid="structfileDescriptorStruct_1fc289229a1011c71cde06dce77dadd7e" kindref="member">ino</ref>,&amp;tmp,1,fd);</highlight></codeline>
<codeline lineno="285"><highlight class="normal"><sp/><sp/>fd-&gt;<ref refid="structfileDescriptorStruct_1eedbb6c79fc5a34c4b8cf4ebbf6a0658" kindref="member">offset</ref><sp/>=<sp/>0;</highlight></codeline>
<codeline lineno="286"><highlight class="normal"><sp/><sp/></highlight><highlight class="comment">/*<sp/>Return<sp/>*/</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="287"><highlight class="normal"><sp/><sp/>fd-&gt;<ref refid="structfileDescriptorStruct_111626b5d99a5da968f43bc37d2591c5c" kindref="member">perms</ref><sp/>=<sp/>0x1;</highlight></codeline>
<codeline lineno="288"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordflow">return</highlight><highlight class="normal">(0<ref refid="ap-boot_8S_11a3ac2137e21f6f0d400f1996914dd19" kindref="member">x1</ref>);</highlight></codeline>
<codeline lineno="289"><highlight class="normal"><sp/><sp/>}</highlight></codeline>
<codeline lineno="290"><highlight class="normal"></highlight></codeline>
<codeline lineno="291" refid="ufs_8c_19272216384babc589471d4a8e538d372" refkind="member"><highlight class="normal"></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/><ref refid="ufs_8c_19272216384babc589471d4a8e538d372" kindref="member">ufs_readFile</ref>(<ref refid="structfileDescriptorStruct" kindref="compound">fileDescriptor</ref><sp/>*fd,</highlight><highlight class="keywordtype">char</highlight><highlight class="normal"><sp/>*data,<ref refid="types_8h_15847ea0262a5aa61eee48cbe95544a78" kindref="member">uInt32</ref><sp/>offset,</highlight><highlight class="keywordtype">long</highlight><highlight class="normal"><sp/>size)<sp/>{</highlight></codeline>
<codeline lineno="292"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordflow">return</highlight><highlight class="normal">(<ref refid="ufs_8c_103b001870aa568dcdcc44c1dc79a49dd" kindref="member">fsread</ref>(fd-&gt;<ref refid="structfileDescriptorStruct_1fc289229a1011c71cde06dce77dadd7e" kindref="member">ino</ref>,data,size,fd));</highlight></codeline>
<codeline lineno="293"><highlight class="normal"><sp/><sp/>}</highlight></codeline>
<codeline lineno="294"><highlight class="normal"></highlight></codeline>
<codeline lineno="295" refid="ufs_8c_1c7d4e2f2c573b3657d8a7680131ba068" refkind="member"><highlight class="normal"></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/><ref refid="ufs_8c_1c7d4e2f2c573b3657d8a7680131ba068" kindref="member">ufs_writeFile</ref>(<ref refid="structfileDescriptorStruct" kindref="compound">fileDescriptor</ref><sp/>*fd,<sp/></highlight><highlight class="keywordtype">char</highlight><highlight class="normal"><sp/>*data,<ref refid="types_8h_15847ea0262a5aa61eee48cbe95544a78" kindref="member">uInt32</ref><sp/>offset,</highlight><highlight class="keywordtype">long</highlight><highlight class="normal"><sp/>size)<sp/>{</highlight></codeline>
<codeline lineno="296"><highlight class="normal"><sp/><sp/><ref refid="kprint_8h_1b2761bdf0cca73ad0fb5880895210cd8" kindref="member">kprintf</ref>(</highlight><highlight class="stringliteral">&quot;Writing<sp/>:)\n&quot;</highlight><highlight class="normal">);</highlight></codeline>
<codeline lineno="297"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordflow">return</highlight><highlight class="normal">(0x0);</highlight></codeline>
<codeline lineno="298"><highlight class="normal"><sp/><sp/>}</highlight></codeline>
<codeline lineno="299"><highlight class="normal"></highlight></codeline>
<codeline lineno="300"><highlight class="normal"></highlight><highlight class="comment">/*****************************************************************************************</highlight></codeline>
<codeline lineno="301"><highlight class="comment"></highlight></codeline>
<codeline lineno="302"><highlight class="comment">Function:<sp/>int<sp/>ufs_initialize()</highlight></codeline>
<codeline lineno="303"><highlight class="comment"></highlight></codeline>
<codeline lineno="304"><highlight class="comment">Description:<sp/>This<sp/>will<sp/>initialize<sp/>a<sp/>mount<sp/>point<sp/>it<sp/>loads<sp/>the<sp/>BAT<sp/>and<sp/>Caches<sp/>the<sp/>rootDir</highlight></codeline>
<codeline lineno="305"><highlight class="comment"></highlight></codeline>
<codeline lineno="306"><highlight class="comment">Notes:</highlight></codeline>
<codeline lineno="307"><highlight class="comment"></highlight></codeline>
<codeline lineno="308"><highlight class="comment">*****************************************************************************************/</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="309" refid="ufs_8c_1c2f26ec05df38049821476d41aeb1038" refkind="member"><highlight class="normal"></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/><ref refid="ufs_8h_1b72f6c6236410bf9a029e7bc810eb609" kindref="member">ufs_initialize</ref>(</highlight><highlight class="keyword">struct</highlight><highlight class="normal"><sp/><ref refid="structvfs__mountPoint" kindref="compound">vfs_mountPoint</ref><sp/>*mp)<sp/>{</highlight></codeline>
<codeline lineno="310"><highlight class="normal"><sp/><sp/></highlight><highlight class="comment">/*<sp/>Return<sp/>*/</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="311"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordflow">return</highlight><highlight class="normal">(0<ref refid="ap-boot_8S_11a3ac2137e21f6f0d400f1996914dd19" kindref="member">x1</ref>);</highlight></codeline>
<codeline lineno="312"><highlight class="normal"><sp/><sp/>}</highlight></codeline>
<codeline lineno="313"><highlight class="normal"></highlight></codeline>
<codeline lineno="314" refid="ufs_8c_1349e4b7ceea770cd630e0297b693d59e" refkind="member"><highlight class="normal"></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/><ref refid="ufs_8h_1349e4b7ceea770cd630e0297b693d59e" kindref="member">ufs_init</ref>()<sp/>{</highlight></codeline>
<codeline lineno="315"><highlight class="normal"><sp/><sp/></highlight><highlight class="comment">/*<sp/>Build<sp/>our<sp/>ufs<sp/>struct<sp/>*/</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="316"><highlight class="normal"><sp/><sp/></highlight><highlight class="keyword">struct<sp/></highlight><highlight class="normal"><ref refid="structfileSystem" kindref="compound">fileSystem</ref><sp/>ufs<sp/>=</highlight></codeline>
<codeline lineno="317"><highlight class="normal"><sp/><sp/><sp/>{<ref refid="types_8h_1070d2ce7b6bb7e5c05602aa8c308d0c4" kindref="member">NULL</ref>,<sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="comment">/*<sp/>prev<sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>*/</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="318"><highlight class="normal"><sp/><sp/><sp/><sp/><ref refid="types_8h_1070d2ce7b6bb7e5c05602aa8c308d0c4" kindref="member">NULL</ref>,<sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="comment">/*<sp/>next<sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>*/</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="319"><highlight class="normal"><sp/><sp/><sp/><sp/>(</highlight><highlight class="keywordtype">void</highlight><highlight class="normal"><sp/>*)<ref refid="ufs_8h_1b72f6c6236410bf9a029e7bc810eb609" kindref="member">ufs_initialize</ref>,<sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="comment">/*<sp/>vfsInitFS<sp/><sp/><sp/>*/</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="320"><highlight class="normal"><sp/><sp/><sp/><sp/>(</highlight><highlight class="keywordtype">void</highlight><highlight class="normal"><sp/>*)<ref refid="ufs_8c_19272216384babc589471d4a8e538d372" kindref="member">ufs_readFile</ref>,<sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="comment">/*<sp/>vfsRead<sp/><sp/><sp/><sp/><sp/>*/</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="321"><highlight class="normal"><sp/><sp/><sp/><sp/>(</highlight><highlight class="keywordtype">void</highlight><highlight class="normal"><sp/>*)<ref refid="ufs_8c_1c7d4e2f2c573b3657d8a7680131ba068" kindref="member">ufs_writeFile</ref>,<sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="comment">/*<sp/>vfsWrite<sp/><sp/><sp/><sp/>*/</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="322"><highlight class="normal"><sp/><sp/><sp/><sp/>(</highlight><highlight class="keywordtype">void</highlight><highlight class="normal"><sp/>*)<ref refid="ufs_8c_1e5b71ba2291b2d2ef07ece9e0de74a5d" kindref="member">ufs_openFile</ref>,<sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="comment">/*<sp/>vfsOpenFile<sp/>*/</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="323"><highlight class="normal"><sp/><sp/><sp/><sp/>NULL,<sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="comment">/*<sp/>vfsUnlink<sp/><sp/><sp/>*/</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="324"><highlight class="normal"><sp/><sp/><sp/><sp/>NULL,<sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="comment">/*<sp/>vfsMakeDir<sp/><sp/>*/</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="325"><highlight class="normal"><sp/><sp/><sp/><sp/>NULL,<sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="comment">/*<sp/>vfsRemDir<sp/><sp/><sp/>*/</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="326"><highlight class="normal"><sp/><sp/><sp/><sp/>NULL,<sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="comment">/*<sp/>vfsSync<sp/><sp/><sp/><sp/><sp/>*/</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="327"><highlight class="normal"><sp/><sp/><sp/><sp/>0xAA,<sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="comment">/*<sp/>vfsType<sp/><sp/><sp/><sp/><sp/>*/</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="328"><highlight class="normal"><sp/><sp/><sp/>};<sp/></highlight><highlight class="comment">/*<sp/>UFS<sp/>*/</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="329"><highlight class="normal"></highlight></codeline>
<codeline lineno="330"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal"><sp/>(<ref refid="vfs_8h_18652b1ccbcf7d2a872c5781640f7d59a" kindref="member">vfsRegisterFS</ref>(ufs)<sp/>!=<sp/>0x0)<sp/>{</highlight></codeline>
<codeline lineno="331"><highlight class="normal"><sp/><sp/><sp/><sp/><ref refid="kpanic_8h_1db9a182aa071791a306163d50d653deb" kindref="member">kpanic</ref>(</highlight><highlight class="stringliteral">&quot;Unable<sp/>To<sp/>Enable<sp/>UFS&quot;</highlight><highlight class="normal">);</highlight></codeline>
<codeline lineno="332"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">return</highlight><highlight class="normal">(0<ref refid="ap-boot_8S_11a3ac2137e21f6f0d400f1996914dd19" kindref="member">x1</ref>);</highlight></codeline>
<codeline lineno="333"><highlight class="normal"><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="334"><highlight class="normal"><sp/><sp/><sp/></highlight><highlight class="comment">//dmadat<sp/>=<sp/>(struct<sp/>dmadat<sp/>*)kmalloc(sizeof(struct<sp/>dmadat));<sp/></highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="335"><highlight class="normal"><sp/><sp/></highlight><highlight class="comment">/*<sp/>Return<sp/>*/</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="336"><highlight class="normal"><sp/><sp/></highlight><highlight class="keywordflow">return</highlight><highlight class="normal">(0x0);</highlight></codeline>
<codeline lineno="337"><highlight class="normal"><sp/><sp/>}</highlight></codeline>
<codeline lineno="338"><highlight class="normal"></highlight></codeline>
<codeline lineno="339"><highlight class="normal"></highlight><highlight class="comment">/***</highlight></codeline>
<codeline lineno="340"><highlight class="comment"><sp/>END</highlight></codeline>
<codeline lineno="341"><highlight class="comment"><sp/>***/</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="342"><highlight class="normal"></highlight></codeline>
    </programlisting>
    <location file="/usr/home/reddawg/source/ubix2/src/sys/ufs/ufs.c"/>
  </compounddef>
</doxygen>