1<html><head><meta http-equiv="Content-Type" content="text/html; charset=ANSI_X3.4-1968"><title>blk_stack_limits</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-blk-queue-stack-limits.html" title="blk_queue_stack_limits"><link rel="next" href="API-bdev-stack-limits.html" title="bdev_stack_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_stack_limits</span></th></tr><tr><td width="20%" align="left"><a accesskey="p" href="API-blk-queue-stack-limits.html">Prev</a> </td><th width="60%" align="center">Chapter 14. Block Devices</th><td width="20%" align="right"> <a accesskey="n" href="API-bdev-stack-limits.html">Next</a></td></tr></table><hr></div><div class="refentry"><a name="API-blk-stack-limits"></a><div class="titlepage"></div><div class="refnamediv"><h2>Name</h2><p>blk_stack_limits — 2 adjust queue_limits for stacked devices 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">int <b class="fsfunc">blk_stack_limits </b>(</code></td><td>struct queue_limits * <var class="pdparam">t</var>, </td></tr><tr><td> </td><td>struct queue_limits * <var class="pdparam">b</var>, </td></tr><tr><td> </td><td>sector_t <var class="pdparam">start</var><code>)</code>;</td></tr></table><div class="funcprototype-spacer"> </div></div></div><div class="refsect1"><a name="idp1128531884"></a><h2>Arguments</h2><div class="variablelist"><dl class="variablelist"><dt><span class="term"><em class="parameter"><code>t</code></em></span></dt><dd><p> 4 the stacking driver limits (top device) 5 </p></dd><dt><span class="term"><em class="parameter"><code>b</code></em></span></dt><dd><p> 6 the underlying queue limits (bottom, component device) 7 </p></dd><dt><span class="term"><em class="parameter"><code>start</code></em></span></dt><dd><p> 8 first data sector within component device 9 </p></dd></dl></div></div><div class="refsect1"><a name="idp1128535588"></a><h2>Description</h2><p> 10 This function is used by stacking drivers like MD and DM to ensure 11 that all component devices have compatible block sizes and 12 alignments. The stacking driver must provide a queue_limits 13 struct (top) and then iteratively call the stacking function for 14 all component (bottom) devices. The stacking function will 15 attempt to combine the values and ensure proper alignment. 16 </p><p> 17 18 Returns 0 if the top and bottom queue_limits are compatible. The 19 top device's block sizes and alignment offsets may be adjusted to 20 ensure alignment with the bottom device. If no compatible sizes 21 and alignments exist, -1 is returned and the resulting top 22 queue_limits will have the misaligned flag set to indicate that 23 the alignment_offset is undefined. 24</p></div></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="API-blk-queue-stack-limits.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-bdev-stack-limits.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top"><span class="phrase">blk_queue_stack_limits</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">bdev_stack_limits</span></td></tr></table></div></body></html> 25