1<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>blk_attempt_plug_merge</title><meta name="generator" content="DocBook XSL Stylesheets V1.78.1"><link rel="home" href="index.html" title="The Linux Kernel API"><link rel="up" href="blkdev.html" title="Chapter 14. Block Devices"><link rel="prev" href="API-get-request.html" title="get_request"><link rel="next" href="API-blk-cloned-rq-check-limits.html" title="blk_cloned_rq_check_limits"></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">blk_attempt_plug_merge</span></th></tr><tr><td width="20%" align="left"><a accesskey="p" href="API-get-request.html">Prev</a> </td><th width="60%" align="center">Chapter 14. Block Devices</th><td width="20%" align="right"> <a accesskey="n" href="API-blk-cloned-rq-check-limits.html">Next</a></td></tr></table><hr></div><div class="refentry"><a name="API-blk-attempt-plug-merge"></a><div class="titlepage"></div><div class="refnamediv"><h2>Name</h2><p>blk_attempt_plug_merge — 
2     try to merge with <code class="constant">current</code>'s plugged list
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">bool <b class="fsfunc">blk_attempt_plug_merge </b>(</code></td><td>struct request_queue * <var class="pdparam">q</var>, </td></tr><tr><td> </td><td>struct bio * <var class="pdparam">bio</var>, </td></tr><tr><td> </td><td>unsigned int * <var class="pdparam">request_count</var>, </td></tr><tr><td> </td><td>struct request ** <var class="pdparam">same_queue_rq</var><code>)</code>;</td></tr></table><div class="funcprototype-spacer"> </div></div></div><div class="refsect1"><a name="id-1.16.52.5"></a><h2>Arguments</h2><div class="variablelist"><dl class="variablelist"><dt><span class="term"><em class="parameter"><code>q</code></em></span></dt><dd><p>
4     request_queue new bio is being queued at
5    </p></dd><dt><span class="term"><em class="parameter"><code>bio</code></em></span></dt><dd><p>
6     new bio being queued
7    </p></dd><dt><span class="term"><em class="parameter"><code>request_count</code></em></span></dt><dd><p>
8     out parameter for number of traversed plugged requests
9    </p></dd><dt><span class="term"><em class="parameter"><code>same_queue_rq</code></em></span></dt><dd><p>
10     pointer to <span class="structname">struct request</span> that gets filled in when
11     another request associated with <em class="parameter"><code>q</code></em> is found on the plug list
12     (optional, may be <code class="constant">NULL</code>)
13    </p></dd></dl></div></div><div class="refsect1"><a name="id-1.16.52.6"></a><h2>Description</h2><p>
14   Determine whether <em class="parameter"><code>bio</code></em> being queued on <em class="parameter"><code>q</code></em> can be merged with a request
15   on <code class="constant">current</code>'s plugged list.  Returns <code class="constant">true</code> if merge was successful,
16   otherwise <code class="constant">false</code>.
17   </p><p>
18
19   Plugging coalesces IOs from the same issuer for the same purpose without
20   going through <em class="parameter"><code>q</code></em>-&gt;queue_lock.  As such it's more of an issuing mechanism
21   than scheduling, and the request, while may have elvpriv data, is not
22   added on the elevator at this point.  In addition, we don't have
23   reliable access to the elevator outside queue lock.  Only check basic
24   merging parameters without querying the elevator.
25   </p><p>
26
27   Caller must ensure !blk_queue_nomerges(q) beforehand.
28</p></div></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="API-get-request.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="blkdev.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="API-blk-cloned-rq-check-limits.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top"><span class="phrase">get_request</span> </td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top"> <span class="phrase">blk_cloned_rq_check_limits</span></td></tr></table></div></body></html>
29