1<html><head><meta http-equiv="Content-Type" content="text/html; charset=ANSI_X3.4-1968"><title>bdev_direct_access</title><meta name="generator" content="DocBook XSL Stylesheets V1.78.1"><link rel="home" href="index.html" title="Linux Filesystems API"><link rel="up" href="other_functions.html" title="Other Functions"><link rel="prev" href="API-bdev-write-page.html" title="bdev_write_page"><link rel="next" href="API-bdgrab.html" title="bdgrab"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center"><span class="phrase">bdev_direct_access</span></th></tr><tr><td width="20%" align="left"><a accesskey="p" href="API-bdev-write-page.html">Prev</a>&#160;</td><th width="60%" align="center">Other Functions</th><td width="20%" align="right">&#160;<a accesskey="n" href="API-bdgrab.html">Next</a></td></tr></table><hr></div><div class="refentry"><a name="API-bdev-direct-access"></a><div class="titlepage"></div><div class="refnamediv"><h2>Name</h2><p>bdev_direct_access &#8212; 
2     Get the address for directly-accessibly memory
3 </p></div><div class="refsynopsisdiv"><h2>Synopsis</h2><div class="funcsynopsis"><table border="0" class="funcprototype-table" summary="Function synopsis" style="cellspacing: 0; cellpadding: 0;"><tr><td><code class="funcdef">long <b class="fsfunc">bdev_direct_access </b>(</code></td><td>struct block_device * <var class="pdparam">bdev</var>, </td></tr><tr><td>&#160;</td><td>sector_t <var class="pdparam">sector</var>, </td></tr><tr><td>&#160;</td><td>void ** <var class="pdparam">addr</var>, </td></tr><tr><td>&#160;</td><td>unsigned long * <var class="pdparam">pfn</var>, </td></tr><tr><td>&#160;</td><td>long <var class="pdparam">size</var><code>)</code>;</td></tr></table><div class="funcprototype-spacer">&#160;</div></div></div><div class="refsect1"><a name="idp1102878644"></a><h2>Arguments</h2><div class="variablelist"><dl class="variablelist"><dt><span class="term"><em class="parameter"><code>bdev</code></em></span></dt><dd><p>
4     The device containing the memory
5    </p></dd><dt><span class="term"><em class="parameter"><code>sector</code></em></span></dt><dd><p>
6     The offset within the device
7    </p></dd><dt><span class="term"><em class="parameter"><code>addr</code></em></span></dt><dd><p>
8     Where to put the address of the memory
9    </p></dd><dt><span class="term"><em class="parameter"><code>pfn</code></em></span></dt><dd><p>
10     The Page Frame Number for the memory
11    </p></dd><dt><span class="term"><em class="parameter"><code>size</code></em></span></dt><dd><p>
12     The number of bytes requested
13    </p></dd></dl></div></div><div class="refsect1"><a name="idp1102884396"></a><h2>Description</h2><p>
14   If a block device is made up of directly addressable memory, this function
15   will tell the caller the PFN and the address of the memory.  The address
16   may be directly dereferenced within the kernel without the need to call
17   <code class="function">ioremap</code>, <code class="function">kmap</code> or similar.  The PFN is suitable for inserting into
18   page tables.
19</p></div><div class="refsect1"><a name="idp1102885996"></a><h2>Return</h2><p>
20   negative errno if an error occurs, otherwise the number of bytes
21   accessible at this address.
22</p></div></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="API-bdev-write-page.html">Prev</a>&#160;</td><td width="20%" align="center"><a accesskey="u" href="other_functions.html">Up</a></td><td width="40%" align="right">&#160;<a accesskey="n" href="API-bdgrab.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top"><span class="phrase">bdev_write_page</span>&#160;</td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top">&#160;<span class="phrase">bdgrab</span></td></tr></table></div></body></html>
23