<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>http://kernsec.org/wiki/index.php?action=history&amp;feed=atom&amp;title=Kernel_Protections%2Frefcount_t</id>
	<title>Kernel Protections/refcount t - Revision history</title>
	<link rel="self" type="application/atom+xml" href="http://kernsec.org/wiki/index.php?action=history&amp;feed=atom&amp;title=Kernel_Protections%2Frefcount_t"/>
	<link rel="alternate" type="text/html" href="http://kernsec.org/wiki/index.php?title=Kernel_Protections/refcount_t&amp;action=history"/>
	<updated>2026-05-07T12:06:30Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.36.1</generator>
	<entry>
		<id>http://kernsec.org/wiki/index.php?title=Kernel_Protections/refcount_t&amp;diff=3894&amp;oldid=prev</id>
		<title>KeesCook: /* Reference Counting API */</title>
		<link rel="alternate" type="text/html" href="http://kernsec.org/wiki/index.php?title=Kernel_Protections/refcount_t&amp;diff=3894&amp;oldid=prev"/>
		<updated>2017-08-04T05:20:11Z</updated>

		<summary type="html">&lt;p&gt;&lt;span dir=&quot;auto&quot;&gt;&lt;span class=&quot;autocomment&quot;&gt;Reference Counting API&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 05:20, 4 August 2017&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l5&quot;&gt;Line 5:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 5:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;= Reference Counting API =&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;= Reference Counting API =&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br/&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br/&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;HARDENED_ATOMIC introduces &lt;/del&gt;a new data type: &amp;lt;code&amp;gt;refcount_t&amp;lt;/code&amp;gt;.  This type is to be used for all kernel reference counters.   &lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Instead of the traditional &amp;lt;code&amp;gt;atomic_t&amp;lt;/code&amp;gt;, reference counting uses &lt;/ins&gt;a new data type: &amp;lt;code&amp;gt;refcount_t&amp;lt;/code&amp;gt;.  This type is to be used for all kernel reference counters.   &lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br/&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br/&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;The following is the kernel reference counting API.&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;The following is the kernel reference counting API.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>KeesCook</name></author>
	</entry>
	<entry>
		<id>http://kernsec.org/wiki/index.php?title=Kernel_Protections/refcount_t&amp;diff=3893&amp;oldid=prev</id>
		<title>KeesCook: /* Summary */</title>
		<link rel="alternate" type="text/html" href="http://kernsec.org/wiki/index.php?title=Kernel_Protections/refcount_t&amp;diff=3893&amp;oldid=prev"/>
		<updated>2017-08-04T05:19:12Z</updated>

		<summary type="html">&lt;p&gt;&lt;span dir=&quot;auto&quot;&gt;&lt;span class=&quot;autocomment&quot;&gt;Summary&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 05:19, 4 August 2017&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l1&quot;&gt;Line 1:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 1:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;= Summary =  &lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;= Summary =  &lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br/&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br/&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;HARDENED_ATOMIC &lt;/del&gt;is a kernel self-protection mechanism that greatly helps with the prevention of [[Bug Classes/Use after free|use-after-free]] bugs.  It is based off of work done by the [https://pax.grsecurity.net PaX Team], originally called [https://forums.grsecurity.net/viewtopic.php?f=7&amp;amp;t=4173 PAX_REFCOUNT].&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;The refcount_t API &lt;/ins&gt;is a kernel self-protection mechanism that greatly helps with the prevention of [[Bug Classes/Use after free|use-after-free]] bugs.  It is based off of work done by the [https://pax.grsecurity.net PaX Team], originally called [https://forums.grsecurity.net/viewtopic.php?f=7&amp;amp;t=4173 PAX_REFCOUNT].&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br/&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br/&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;= Reference Counting API =&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;= Reference Counting API =&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>KeesCook</name></author>
	</entry>
	<entry>
		<id>http://kernsec.org/wiki/index.php?title=Kernel_Protections/refcount_t&amp;diff=3891&amp;oldid=prev</id>
		<title>KeesCook: KeesCook moved page Kernel Protections/HARDENED ATOMIC to Kernel Protections/refcount t</title>
		<link rel="alternate" type="text/html" href="http://kernsec.org/wiki/index.php?title=Kernel_Protections/refcount_t&amp;diff=3891&amp;oldid=prev"/>
		<updated>2017-08-04T05:18:41Z</updated>

		<summary type="html">&lt;p&gt;KeesCook moved page &lt;a href=&quot;/wiki/index.php/Kernel_Protections/HARDENED_ATOMIC&quot; class=&quot;mw-redirect&quot; title=&quot;Kernel Protections/HARDENED ATOMIC&quot;&gt;Kernel Protections/HARDENED ATOMIC&lt;/a&gt; to &lt;a href=&quot;/wiki/index.php/Kernel_Protections/refcount_t&quot; title=&quot;Kernel Protections/refcount t&quot;&gt;Kernel Protections/refcount t&lt;/a&gt;&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;1&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;1&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 05:18, 4 August 2017&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-notice&quot; lang=&quot;en&quot;&gt;&lt;div class=&quot;mw-diff-empty&quot;&gt;(No difference)&lt;/div&gt;
&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;</summary>
		<author><name>KeesCook</name></author>
	</entry>
	<entry>
		<id>http://kernsec.org/wiki/index.php?title=Kernel_Protections/refcount_t&amp;diff=3850&amp;oldid=prev</id>
		<title>DavidWindsor: Minor language change in Reference Counting API</title>
		<link rel="alternate" type="text/html" href="http://kernsec.org/wiki/index.php?title=Kernel_Protections/refcount_t&amp;diff=3850&amp;oldid=prev"/>
		<updated>2017-02-06T14:54:25Z</updated>

		<summary type="html">&lt;p&gt;Minor language change in Reference Counting API&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 14:54, 6 February 2017&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l7&quot;&gt;Line 7:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 7:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;HARDENED_ATOMIC introduces a new data type: &amp;lt;code&amp;gt;refcount_t&amp;lt;/code&amp;gt;.  This type is to be used for all kernel reference counters.   &lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;HARDENED_ATOMIC introduces a new data type: &amp;lt;code&amp;gt;refcount_t&amp;lt;/code&amp;gt;.  This type is to be used for all kernel reference counters.   &lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br/&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br/&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;The following is the kernel reference counting API&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;.  Please note that all operations are atomic, unless otherwise specified&lt;/del&gt;.  &lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;The following is the kernel reference counting API.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br/&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br/&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;;'''&amp;lt;code&amp;gt;REFCOUNT_INIT(unsigned int)&amp;lt;/code&amp;gt;'''&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;;'''&amp;lt;code&amp;gt;REFCOUNT_INIT(unsigned int)&amp;lt;/code&amp;gt;'''&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l47&quot;&gt;Line 47:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 47:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;;'''&amp;lt;code&amp;gt;bool refcount_dec_and_lock(refcount_t *r, spinlock_t *s)&amp;lt;/code&amp;gt;'''&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;;'''&amp;lt;code&amp;gt;bool refcount_dec_and_lock(refcount_t *r, spinlock_t *s)&amp;lt;/code&amp;gt;'''&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;: Decrement &amp;lt;code&amp;gt;r&amp;lt;/code&amp;gt; and lock spinlock if &amp;lt;code&amp;gt;r&amp;lt;/code&amp;gt; becomes 0.  Will &amp;lt;code&amp;gt;WARN&amp;lt;/code&amp;gt; on underflow and fail to decrement if &amp;lt;code&amp;gt;r&amp;lt;/code&amp;gt; is saturated at &amp;lt;code&amp;gt;UINT_MAX&amp;lt;/code&amp;gt;.  Returns &amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt; if &amp;lt;code&amp;gt;r&amp;lt;/code&amp;gt; is 0 and spinlock is held, &amp;lt;code&amp;gt;false&amp;lt;/code&amp;gt; otherwise.&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;: Decrement &amp;lt;code&amp;gt;r&amp;lt;/code&amp;gt; and lock spinlock if &amp;lt;code&amp;gt;r&amp;lt;/code&amp;gt; becomes 0.  Will &amp;lt;code&amp;gt;WARN&amp;lt;/code&amp;gt; on underflow and fail to decrement if &amp;lt;code&amp;gt;r&amp;lt;/code&amp;gt; is saturated at &amp;lt;code&amp;gt;UINT_MAX&amp;lt;/code&amp;gt;.  Returns &amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt; if &amp;lt;code&amp;gt;r&amp;lt;/code&amp;gt; is 0 and spinlock is held, &amp;lt;code&amp;gt;false&amp;lt;/code&amp;gt; otherwise.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td colspan=&quot;2&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br/&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br/&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;= Examples =&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;= Examples =&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>DavidWindsor</name></author>
	</entry>
	<entry>
		<id>http://kernsec.org/wiki/index.php?title=Kernel_Protections/refcount_t&amp;diff=3849&amp;oldid=prev</id>
		<title>DavidWindsor: Minor language change in Summary</title>
		<link rel="alternate" type="text/html" href="http://kernsec.org/wiki/index.php?title=Kernel_Protections/refcount_t&amp;diff=3849&amp;oldid=prev"/>
		<updated>2017-02-06T14:53:47Z</updated>

		<summary type="html">&lt;p&gt;Minor language change in Summary&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 14:53, 6 February 2017&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l1&quot;&gt;Line 1:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 1:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;= Summary =  &lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;= Summary =  &lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br/&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br/&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;HARDENED_ATOMIC is a kernel self-protection mechanism that greatly helps with the &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;mitigation &lt;/del&gt;of [[Bug Classes/Use after free|use-after-free]] bugs.  It is based off of work done by the [https://pax.grsecurity.net PaX Team], originally called [https://forums.grsecurity.net/viewtopic.php?f=7&amp;amp;t=4173 PAX_REFCOUNT].&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;HARDENED_ATOMIC is a kernel self-protection mechanism that greatly helps with the &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;prevention &lt;/ins&gt;of [[Bug Classes/Use after free|use-after-free]] bugs.  It is based off of work done by the [https://pax.grsecurity.net PaX Team], originally called [https://forums.grsecurity.net/viewtopic.php?f=7&amp;amp;t=4173 PAX_REFCOUNT].&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br/&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br/&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;= Reference Counting API =&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;= Reference Counting API =&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>DavidWindsor</name></author>
	</entry>
	<entry>
		<id>http://kernsec.org/wiki/index.php?title=Kernel_Protections/refcount_t&amp;diff=3848&amp;oldid=prev</id>
		<title>DavidWindsor: Add Examples section</title>
		<link rel="alternate" type="text/html" href="http://kernsec.org/wiki/index.php?title=Kernel_Protections/refcount_t&amp;diff=3848&amp;oldid=prev"/>
		<updated>2017-02-06T14:45:47Z</updated>

		<summary type="html">&lt;p&gt;Add Examples section&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 14:45, 6 February 2017&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l47&quot;&gt;Line 47:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 47:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;;'''&amp;lt;code&amp;gt;bool refcount_dec_and_lock(refcount_t *r, spinlock_t *s)&amp;lt;/code&amp;gt;'''&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;;'''&amp;lt;code&amp;gt;bool refcount_dec_and_lock(refcount_t *r, spinlock_t *s)&amp;lt;/code&amp;gt;'''&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;: Decrement &amp;lt;code&amp;gt;r&amp;lt;/code&amp;gt; and lock spinlock if &amp;lt;code&amp;gt;r&amp;lt;/code&amp;gt; becomes 0.  Will &amp;lt;code&amp;gt;WARN&amp;lt;/code&amp;gt; on underflow and fail to decrement if &amp;lt;code&amp;gt;r&amp;lt;/code&amp;gt; is saturated at &amp;lt;code&amp;gt;UINT_MAX&amp;lt;/code&amp;gt;.  Returns &amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt; if &amp;lt;code&amp;gt;r&amp;lt;/code&amp;gt; is 0 and spinlock is held, &amp;lt;code&amp;gt;false&amp;lt;/code&amp;gt; otherwise.&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;: Decrement &amp;lt;code&amp;gt;r&amp;lt;/code&amp;gt; and lock spinlock if &amp;lt;code&amp;gt;r&amp;lt;/code&amp;gt; becomes 0.  Will &amp;lt;code&amp;gt;WARN&amp;lt;/code&amp;gt; on underflow and fail to decrement if &amp;lt;code&amp;gt;r&amp;lt;/code&amp;gt; is saturated at &amp;lt;code&amp;gt;UINT_MAX&amp;lt;/code&amp;gt;.  Returns &amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt; if &amp;lt;code&amp;gt;r&amp;lt;/code&amp;gt; is 0 and spinlock is held, &amp;lt;code&amp;gt;false&amp;lt;/code&amp;gt; otherwise.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;= Examples =&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;The following use case is an instance of correct usage of the &amp;lt;code&gt;refcount_t&amp;lt;/code&gt; API.  The object being counted is &amp;lt;code&gt;struct super_block&amp;lt;/code&gt;, which represents a virtual filesystem superblock, an object containing a particular filesystem's metadata such as block size, the root inode, etc.  &lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;==== Member Definition ====&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;This is the definition of the reference counter field in the &amp;lt;code&gt;struct super_block&amp;lt;/code&gt; object.  If the object being counted is a structure, the reference counter is typically defined as a field of the counted structure, as we see in &amp;lt;code&gt;struct super_block&amp;lt;/code&gt; below.&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;  &lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;From &amp;lt;code&gt;[http://lxr.free-electrons.com/source/include/linux/fs.h include/linux/fs.h]&amp;lt;/code&gt;:&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&amp;lt;code&gt;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;    struct super_block {&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;        ...&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;        refcount_t s_active;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;        ...&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;    };&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&amp;lt;/code&gt;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;==== Object Initialization ====&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;When a counted object is created, its reference counter must be initialized to something sane, typically 1 (since, by virtue of being called in an &quot;allocation&quot; method, a user of the object already exists).  &lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;From &amp;lt;code&gt;[http://lxr.free-electrons.com/source/fs/super.c fs/super.c]&amp;lt;/code&gt;:&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&amp;lt;code&gt;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;    static struct super_block *alloc_super(struct file_system_type *type, int flags, struct user_namespace *user_ns)&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;    {&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;        struct super_block *s = kzalloc(sizeof(struct super_block), GFP_USER);   &lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;        ...&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;        refcount_set(&amp;amp;s-&gt;s_active, 1);&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;        ...&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;    }&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&amp;lt;/code&gt;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;==== Getting a New Reference ====&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;This code is executed when a user wishes to obtain a new reference to a &amp;lt;code&gt;struct super_block&amp;lt;/code&gt; object.  The following code corresponds to the traditional reference counting &quot;get&quot; method.&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;From &amp;lt;code&gt;[http://lxr.free-electrons.com/source/fs/super.c fs/super.c]&amp;lt;/code&gt;:&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&amp;lt;code&gt;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;    static int grab_super(struct super_block *s) __releases(sb_lock)&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;    {&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;        s-&gt;s_count++;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;        spin_unlock(&amp;amp;sb_lock);&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;        down_write(&amp;amp;s-&gt;s_umount);&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;        if ((s-&gt;s_flags &amp;amp; MS_BORN) &amp;amp;&amp;amp; refcount_inc_not_zero(&amp;amp;s-&gt;s_active)) {&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;            put_super(s);&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;            return 1;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;        }&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;        up_write(&amp;amp;s-&gt;s_umount);&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;        put_super(s);&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;        return 0;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;    }&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&amp;lt;/code&gt;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;==== Releasing an Existing Reference ====&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;This code is executed when a user currently holding a reference to a &amp;lt;code&gt;struct super_block&amp;lt;/code&gt; object no longer needs the object and wants to release it.  The following code corresponds to the traditional reference counting &quot;put&quot; method.  &lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;From &amp;lt;code&gt;[http://lxr.free-electrons.com/source/fs/super.c fs/super.c]&amp;lt;/code&gt;:&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&amp;lt;code&gt;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;    void deactivate_locked_super(struct super_block *s) {&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;        ...&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;        if (refcount_dec_and_test(&amp;amp;s-&gt;s_active)) {&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;            ...&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;            put_super(s);&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;        }&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;    }&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;    void deactivate_super(struct super_block *s)&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;    {&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;        if (!refcount_dec_not_one(&amp;amp;s-&gt;s_active)) {&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;            down_write(&amp;amp;s-&gt;s_umount);nnNnnn&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;            deactivate_locked_super(s);&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;        }&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;    }&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&amp;lt;/code&gt;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>DavidWindsor</name></author>
	</entry>
	<entry>
		<id>http://kernsec.org/wiki/index.php?title=Kernel_Protections/refcount_t&amp;diff=3847&amp;oldid=prev</id>
		<title>DavidWindsor: Change &lt;tt&gt; tags to &lt;code&gt;</title>
		<link rel="alternate" type="text/html" href="http://kernsec.org/wiki/index.php?title=Kernel_Protections/refcount_t&amp;diff=3847&amp;oldid=prev"/>
		<updated>2017-02-06T12:19:19Z</updated>

		<summary type="html">&lt;p&gt;Change &amp;lt;tt&amp;gt; tags to &amp;lt;code&amp;gt;&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 12:19, 6 February 2017&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l5&quot;&gt;Line 5:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 5:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;= Reference Counting API =&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;= Reference Counting API =&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br/&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br/&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;HARDENED_ATOMIC introduces a new data type: &amp;lt;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;tt&lt;/del&gt;&amp;gt;refcount_t&amp;lt;/&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;tt&lt;/del&gt;&amp;gt;.  This type is to be used for all kernel reference counters.   &lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;HARDENED_ATOMIC introduces a new data type: &amp;lt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;code&lt;/ins&gt;&amp;gt;refcount_t&amp;lt;/&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;code&lt;/ins&gt;&amp;gt;.  This type is to be used for all kernel reference counters.   &lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br/&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br/&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;The following is the kernel reference counting API.  Please note that all operations are atomic, unless otherwise specified.  &lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;The following is the kernel reference counting API.  Please note that all operations are atomic, unless otherwise specified.  &lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br/&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br/&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;;'''&amp;lt;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;tt&lt;/del&gt;&amp;gt;REFCOUNT_INIT(unsigned int)&amp;lt;/&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;tt&lt;/del&gt;&amp;gt;'''&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;;'''&amp;lt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;code&lt;/ins&gt;&amp;gt;REFCOUNT_INIT(unsigned int)&amp;lt;/&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;code&lt;/ins&gt;&amp;gt;'''&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;: Initialize a &amp;lt;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;tt&lt;/del&gt;&amp;gt;refcount_t&amp;lt;/&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;tt&lt;/del&gt;&amp;gt; object.&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;: Initialize a &amp;lt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;code&lt;/ins&gt;&amp;gt;refcount_t&amp;lt;/&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;code&lt;/ins&gt;&amp;gt; object.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br/&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br/&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;;'''&amp;lt;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;tt&lt;/del&gt;&amp;gt;void refcount_set(refcount_t *, unsigned int)&amp;lt;/&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;tt&lt;/del&gt;&amp;gt;'''&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;;'''&amp;lt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;code&lt;/ins&gt;&amp;gt;void refcount_set(refcount_t *, unsigned int)&amp;lt;/&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;code&lt;/ins&gt;&amp;gt;'''&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;: Set a &amp;lt;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;tt&lt;/del&gt;&amp;gt;refcount_t&amp;lt;/&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;tt&lt;/del&gt;&amp;gt; object's internal value.&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;: Set a &amp;lt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;code&lt;/ins&gt;&amp;gt;refcount_t&amp;lt;/&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;code&lt;/ins&gt;&amp;gt; object's internal value.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br/&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br/&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;;'''&amp;lt;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;tt&lt;/del&gt;&amp;gt;unsigned int refcount_read(refcount_t *)&amp;lt;/&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;tt&lt;/del&gt;&amp;gt;'''&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;;'''&amp;lt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;code&lt;/ins&gt;&amp;gt;unsigned int refcount_read(refcount_t *)&amp;lt;/&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;code&lt;/ins&gt;&amp;gt;'''&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;: Returns the &amp;lt;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;tt&lt;/del&gt;&amp;gt;refcount_t&amp;lt;/&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;tt&lt;/del&gt;&amp;gt; object's internal value.&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;: Returns the &amp;lt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;code&lt;/ins&gt;&amp;gt;refcount_t&amp;lt;/&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;code&lt;/ins&gt;&amp;gt; object's internal value.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br/&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br/&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;;'''&amp;lt;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;tt&lt;/del&gt;&amp;gt;bool refcount_add_not_zero(unsigned int v, refcount_t *r)&amp;lt;/&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;tt&lt;/del&gt;&amp;gt;'''&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;;'''&amp;lt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;code&lt;/ins&gt;&amp;gt;bool refcount_add_not_zero(unsigned int v, refcount_t *r)&amp;lt;/&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;code&lt;/ins&gt;&amp;gt;'''&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;: Add &amp;lt;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;tt&lt;/del&gt;&amp;gt;v&amp;lt;/&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;tt&lt;/del&gt;&amp;gt; to &amp;lt;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;tt&lt;/del&gt;&amp;gt;r&amp;lt;/&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;tt&lt;/del&gt;&amp;gt;.  If &amp;lt;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;tt&lt;/del&gt;&amp;gt;r + v&amp;lt;/&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;tt&lt;/del&gt;&amp;gt; causes an overflow, the result of the addition operation is not saved to &amp;lt;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;tt&lt;/del&gt;&amp;gt;r&amp;lt;/&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;tt&lt;/del&gt;&amp;gt;.  Returns &amp;lt;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;tt&lt;/del&gt;&amp;gt;true&amp;lt;/&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;tt&lt;/del&gt;&amp;gt; if the resulting value of &amp;lt;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;tt&lt;/del&gt;&amp;gt;r&amp;lt;/&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;tt&lt;/del&gt;&amp;gt; is non-zero, &amp;lt;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;tt&lt;/del&gt;&amp;gt;false&amp;lt;/&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;tt&lt;/del&gt;&amp;gt; otherwise.&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;: Add &amp;lt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;code&lt;/ins&gt;&amp;gt;v&amp;lt;/&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;code&lt;/ins&gt;&amp;gt; to &amp;lt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;code&lt;/ins&gt;&amp;gt;r&amp;lt;/&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;code&lt;/ins&gt;&amp;gt;.  If &amp;lt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;code&lt;/ins&gt;&amp;gt;r + v&amp;lt;/&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;code&lt;/ins&gt;&amp;gt; causes an overflow, the result of the addition operation is not saved to &amp;lt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;code&lt;/ins&gt;&amp;gt;r&amp;lt;/&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;code&lt;/ins&gt;&amp;gt;.  Returns &amp;lt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;code&lt;/ins&gt;&amp;gt;true&amp;lt;/&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;code&lt;/ins&gt;&amp;gt; if the resulting value of &amp;lt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;code&lt;/ins&gt;&amp;gt;r&amp;lt;/&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;code&lt;/ins&gt;&amp;gt; is non-zero, &amp;lt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;code&lt;/ins&gt;&amp;gt;false&amp;lt;/&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;code&lt;/ins&gt;&amp;gt; otherwise.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br/&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br/&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;;'''&amp;lt;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;tt&lt;/del&gt;&amp;gt;void refcount_add(unsigned int v, refcount_t *r)&amp;lt;/&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;tt&lt;/del&gt;&amp;gt;'''&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;;'''&amp;lt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;code&lt;/ins&gt;&amp;gt;void refcount_add(unsigned int v, refcount_t *r)&amp;lt;/&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;code&lt;/ins&gt;&amp;gt;'''&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;: Adds &amp;lt;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;tt&lt;/del&gt;&amp;gt;v&amp;lt;/&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;tt&lt;/del&gt;&amp;gt; to &amp;lt;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;tt&lt;/del&gt;&amp;gt;r&amp;lt;/&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;tt&lt;/del&gt;&amp;gt; and stores the value in &amp;lt;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;tt&lt;/del&gt;&amp;gt;r&amp;lt;/&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;tt&lt;/del&gt;&amp;gt;.&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;: Adds &amp;lt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;code&lt;/ins&gt;&amp;gt;v&amp;lt;/&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;code&lt;/ins&gt;&amp;gt; to &amp;lt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;code&lt;/ins&gt;&amp;gt;r&amp;lt;/&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;code&lt;/ins&gt;&amp;gt; and stores the value in &amp;lt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;code&lt;/ins&gt;&amp;gt;r&amp;lt;/&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;code&lt;/ins&gt;&amp;gt;.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br/&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br/&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;;'''&amp;lt;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;tt&lt;/del&gt;&amp;gt;bool refcount_inc_not_zero(refcount_t *r)&amp;lt;/&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;tt&lt;/del&gt;&amp;gt;'''&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;;'''&amp;lt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;code&lt;/ins&gt;&amp;gt;bool refcount_inc_not_zero(refcount_t *r)&amp;lt;/&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;code&lt;/ins&gt;&amp;gt;'''&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;: Increments &amp;lt;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;tt&lt;/del&gt;&amp;gt;r&amp;lt;/&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;tt&lt;/del&gt;&amp;gt; and tests whether &amp;lt;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;tt&lt;/del&gt;&amp;gt;r + 1&amp;lt;/&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;tt&lt;/del&gt;&amp;gt; causes an overflow.  If an overflow does occur, the result of the increment operation is not saved to &amp;lt;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;tt&lt;/del&gt;&amp;gt;r&amp;lt;/&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;tt&lt;/del&gt;&amp;gt;.  Will saturate at &amp;lt;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;tt&lt;/del&gt;&amp;gt;UINT_MAX&amp;lt;/&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;tt&lt;/del&gt;&amp;gt; and &amp;lt;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;tt&lt;/del&gt;&amp;gt;WARN&amp;lt;/&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;tt&lt;/del&gt;&amp;gt;. Returns &amp;lt;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;tt&lt;/del&gt;&amp;gt;true&amp;lt;/&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;tt&lt;/del&gt;&amp;gt; if the resulting value of &amp;lt;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;tt&lt;/del&gt;&amp;gt;r&amp;lt;/&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;tt&lt;/del&gt;&amp;gt; is non-zero, &amp;lt;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;tt&lt;/del&gt;&amp;gt;false&amp;lt;/&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;tt&lt;/del&gt;&amp;gt; otherwise.   &lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;: Increments &amp;lt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;code&lt;/ins&gt;&amp;gt;r&amp;lt;/&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;code&lt;/ins&gt;&amp;gt; and tests whether &amp;lt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;code&lt;/ins&gt;&amp;gt;r + 1&amp;lt;/&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;code&lt;/ins&gt;&amp;gt; causes an overflow.  If an overflow does occur, the result of the increment operation is not saved to &amp;lt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;code&lt;/ins&gt;&amp;gt;r&amp;lt;/&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;code&lt;/ins&gt;&amp;gt;.  Will saturate at &amp;lt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;code&lt;/ins&gt;&amp;gt;UINT_MAX&amp;lt;/&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;code&lt;/ins&gt;&amp;gt; and &amp;lt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;code&lt;/ins&gt;&amp;gt;WARN&amp;lt;/&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;code&lt;/ins&gt;&amp;gt;. Returns &amp;lt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;code&lt;/ins&gt;&amp;gt;true&amp;lt;/&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;code&lt;/ins&gt;&amp;gt; if the resulting value of &amp;lt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;code&lt;/ins&gt;&amp;gt;r&amp;lt;/&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;code&lt;/ins&gt;&amp;gt; is non-zero, &amp;lt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;code&lt;/ins&gt;&amp;gt;false&amp;lt;/&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;code&lt;/ins&gt;&amp;gt; otherwise.   &lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br/&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br/&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;;'''&amp;lt;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;tt&lt;/del&gt;&amp;gt;void refcount_inc(refcount_t *r)&amp;lt;/&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;tt&lt;/del&gt;&amp;gt;'''&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;;'''&amp;lt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;code&lt;/ins&gt;&amp;gt;void refcount_inc(refcount_t *r)&amp;lt;/&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;code&lt;/ins&gt;&amp;gt;'''&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;: Increment &amp;lt;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;tt&lt;/del&gt;&amp;gt;r&amp;lt;/&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;tt&lt;/del&gt;&amp;gt;.  Will saturate at &amp;lt;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;tt&lt;/del&gt;&amp;gt;UINT_MAX&amp;lt;/&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;tt&lt;/del&gt;&amp;gt; and &amp;lt;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;tt&lt;/del&gt;&amp;gt;WARN&amp;lt;/&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;tt&lt;/del&gt;&amp;gt;.&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;: Increment &amp;lt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;code&lt;/ins&gt;&amp;gt;r&amp;lt;/&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;code&lt;/ins&gt;&amp;gt;.  Will saturate at &amp;lt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;code&lt;/ins&gt;&amp;gt;UINT_MAX&amp;lt;/&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;code&lt;/ins&gt;&amp;gt; and &amp;lt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;code&lt;/ins&gt;&amp;gt;WARN&amp;lt;/&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;code&lt;/ins&gt;&amp;gt;.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br/&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br/&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;;'''&amp;lt;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;tt&lt;/del&gt;&amp;gt;bool refcount_sub_and_test(unsigned int v, refcount_t *r)&amp;lt;/&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;tt&lt;/del&gt;&amp;gt;'''&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;;'''&amp;lt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;code&lt;/ins&gt;&amp;gt;bool refcount_sub_and_test(unsigned int v, refcount_t *r)&amp;lt;/&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;code&lt;/ins&gt;&amp;gt;'''&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;: Subtract &amp;lt;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;tt&lt;/del&gt;&amp;gt;v&amp;lt;/&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;tt&lt;/del&gt;&amp;gt; from &amp;lt;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;tt&lt;/del&gt;&amp;gt;r&amp;lt;/&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;tt&lt;/del&gt;&amp;gt; and tests whether &amp;lt;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;tt&lt;/del&gt;&amp;gt;r - v&amp;lt;/&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;tt&lt;/del&gt;&amp;gt; causes an underflow.  If an underflow does occur, the result of the decrement operation is not saved to &amp;lt;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;tt&lt;/del&gt;&amp;gt;r&amp;lt;/&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;tt&lt;/del&gt;&amp;gt;.  Will fail to decrement when saturated at &amp;lt;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;tt&lt;/del&gt;&amp;gt;UINT_MAX&amp;lt;/&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;tt&lt;/del&gt;&amp;gt;.  Returns &amp;lt;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;tt&lt;/del&gt;&amp;gt;true&amp;lt;/&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;tt&lt;/del&gt;&amp;gt; if the resulting value of &amp;lt;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;tt&lt;/del&gt;&amp;gt;r&amp;lt;/&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;tt&lt;/del&gt;&amp;gt; is non-zero, &amp;lt;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;tt&lt;/del&gt;&amp;gt;false&amp;lt;/&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;tt&lt;/del&gt;&amp;gt; otherwise.&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;: Subtract &amp;lt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;code&lt;/ins&gt;&amp;gt;v&amp;lt;/&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;code&lt;/ins&gt;&amp;gt; from &amp;lt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;code&lt;/ins&gt;&amp;gt;r&amp;lt;/&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;code&lt;/ins&gt;&amp;gt; and tests whether &amp;lt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;code&lt;/ins&gt;&amp;gt;r - v&amp;lt;/&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;code&lt;/ins&gt;&amp;gt; causes an underflow.  If an underflow does occur, the result of the decrement operation is not saved to &amp;lt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;code&lt;/ins&gt;&amp;gt;r&amp;lt;/&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;code&lt;/ins&gt;&amp;gt;.  Will fail to decrement when saturated at &amp;lt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;code&lt;/ins&gt;&amp;gt;UINT_MAX&amp;lt;/&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;code&lt;/ins&gt;&amp;gt;.  Returns &amp;lt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;code&lt;/ins&gt;&amp;gt;true&amp;lt;/&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;code&lt;/ins&gt;&amp;gt; if the resulting value of &amp;lt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;code&lt;/ins&gt;&amp;gt;r&amp;lt;/&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;code&lt;/ins&gt;&amp;gt; is non-zero, &amp;lt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;code&lt;/ins&gt;&amp;gt;false&amp;lt;/&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;code&lt;/ins&gt;&amp;gt; otherwise.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br/&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br/&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;;'''&amp;lt;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;tt&lt;/del&gt;&amp;gt;void refcount_dec(refcount_t *r)&amp;lt;/&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;tt&lt;/del&gt;&amp;gt;'''&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;;'''&amp;lt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;code&lt;/ins&gt;&amp;gt;void refcount_dec(refcount_t *r)&amp;lt;/&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;code&lt;/ins&gt;&amp;gt;'''&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;: Decrement &amp;lt;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;tt&lt;/del&gt;&amp;gt;r&amp;lt;/&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;tt&lt;/del&gt;&amp;gt;.  If &amp;lt;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;tt&lt;/del&gt;&amp;gt;r - 1&amp;lt;/&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;tt&lt;/del&gt;&amp;gt; causes an underflow, the result of the decrement operation is not saved to &amp;lt;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;tt&lt;/del&gt;&amp;gt;r&amp;lt;/&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;tt&lt;/del&gt;&amp;gt;.  Will fail to decrement when saturated at &amp;lt;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;tt&lt;/del&gt;&amp;gt;UINT_MAX&amp;lt;/&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;tt&lt;/del&gt;&amp;gt;.&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;: Decrement &amp;lt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;code&lt;/ins&gt;&amp;gt;r&amp;lt;/&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;code&lt;/ins&gt;&amp;gt;.  If &amp;lt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;code&lt;/ins&gt;&amp;gt;r - 1&amp;lt;/&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;code&lt;/ins&gt;&amp;gt; causes an underflow, the result of the decrement operation is not saved to &amp;lt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;code&lt;/ins&gt;&amp;gt;r&amp;lt;/&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;code&lt;/ins&gt;&amp;gt;.  Will fail to decrement when saturated at &amp;lt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;code&lt;/ins&gt;&amp;gt;UINT_MAX&amp;lt;/&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;code&lt;/ins&gt;&amp;gt;.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br/&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br/&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;;'''&amp;lt;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;tt&lt;/del&gt;&amp;gt;bool refcount_dec_if_one(refcount_t *r)&amp;lt;/&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;tt&lt;/del&gt;&amp;gt;'''&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;;'''&amp;lt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;code&lt;/ins&gt;&amp;gt;bool refcount_dec_if_one(refcount_t *r)&amp;lt;/&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;code&lt;/ins&gt;&amp;gt;'''&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;: Attempts to transition &amp;lt;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;tt&lt;/del&gt;&amp;gt;r&amp;lt;/&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;tt&lt;/del&gt;&amp;gt; from 1 to 0.  If &amp;lt;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;tt&lt;/del&gt;&amp;gt;r&amp;lt;/&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;tt&lt;/del&gt;&amp;gt; is 1, decrement it to 0.  Returns &amp;lt;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;tt&lt;/del&gt;&amp;gt;true&amp;lt;/&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;tt&lt;/del&gt;&amp;gt; if &amp;lt;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;tt&lt;/del&gt;&amp;gt;r&amp;lt;/&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;tt&lt;/del&gt;&amp;gt; was decremented, &amp;lt;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;tt&lt;/del&gt;&amp;gt;false&amp;lt;/&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;tt&lt;/del&gt;&amp;gt; otherwise.   &lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;: Attempts to transition &amp;lt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;code&lt;/ins&gt;&amp;gt;r&amp;lt;/&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;code&lt;/ins&gt;&amp;gt; from 1 to 0.  If &amp;lt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;code&lt;/ins&gt;&amp;gt;r&amp;lt;/&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;code&lt;/ins&gt;&amp;gt; is 1, decrement it to 0.  Returns &amp;lt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;code&lt;/ins&gt;&amp;gt;true&amp;lt;/&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;code&lt;/ins&gt;&amp;gt; if &amp;lt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;code&lt;/ins&gt;&amp;gt;r&amp;lt;/&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;code&lt;/ins&gt;&amp;gt; was decremented, &amp;lt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;code&lt;/ins&gt;&amp;gt;false&amp;lt;/&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;code&lt;/ins&gt;&amp;gt; otherwise.   &lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br/&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br/&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;;'''&amp;lt;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;tt&lt;/del&gt;&amp;gt;bool refcount_dec_not_one(refcount_t *r)&amp;lt;/&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;tt&lt;/del&gt;&amp;gt;'''&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;;'''&amp;lt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;code&lt;/ins&gt;&amp;gt;bool refcount_dec_not_one(refcount_t *r)&amp;lt;/&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;code&lt;/ins&gt;&amp;gt;'''&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;: Decrement &amp;lt;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;tt&lt;/del&gt;&amp;gt;r&amp;lt;/&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;tt&lt;/del&gt;&amp;gt; unless the value of &amp;lt;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;tt&lt;/del&gt;&amp;gt;r&amp;lt;/&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;tt&lt;/del&gt;&amp;gt; is 1.  Returns &amp;lt;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;tt&lt;/del&gt;&amp;gt;true&amp;lt;/&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;tt&lt;/del&gt;&amp;gt; if &amp;lt;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;tt&lt;/del&gt;&amp;gt;r&amp;lt;/&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;tt&lt;/del&gt;&amp;gt; was decremented, &amp;lt;/&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;tt&lt;/del&gt;&amp;gt;false&amp;lt;/&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;tt&lt;/del&gt;&amp;gt; otherwise.&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;: Decrement &amp;lt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;code&lt;/ins&gt;&amp;gt;r&amp;lt;/&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;code&lt;/ins&gt;&amp;gt; unless the value of &amp;lt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;code&lt;/ins&gt;&amp;gt;r&amp;lt;/&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;code&lt;/ins&gt;&amp;gt; is 1.  Returns &amp;lt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;code&lt;/ins&gt;&amp;gt;true&amp;lt;/&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;code&lt;/ins&gt;&amp;gt; if &amp;lt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;code&lt;/ins&gt;&amp;gt;r&amp;lt;/&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;code&lt;/ins&gt;&amp;gt; was decremented, &amp;lt;/&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;code&lt;/ins&gt;&amp;gt;false&amp;lt;/&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;code&lt;/ins&gt;&amp;gt; otherwise.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br/&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br/&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;;'''&amp;lt;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;tt&lt;/del&gt;&amp;gt;bool refcount_dec_and_mutex_lock(refcount_t *r, struct mutex *lock)&amp;lt;/&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;tt&lt;/del&gt;&amp;gt;'''&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;;'''&amp;lt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;code&lt;/ins&gt;&amp;gt;bool refcount_dec_and_mutex_lock(refcount_t *r, struct mutex *lock)&amp;lt;/&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;code&lt;/ins&gt;&amp;gt;'''&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;: Decrement &amp;lt;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;tt&lt;/del&gt;&amp;gt;r&amp;lt;/&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;tt&lt;/del&gt;&amp;gt; and lock mutex if &amp;lt;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;tt&lt;/del&gt;&amp;gt;r&amp;lt;/&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;tt&lt;/del&gt;&amp;gt; becomes 0.  Will &amp;lt;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;tt&lt;/del&gt;&amp;gt;WARN&amp;lt;/&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;tt&lt;/del&gt;&amp;gt; on underflow and fail to decrement if &amp;lt;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;tt&lt;/del&gt;&amp;gt;r&amp;lt;/&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;tt&lt;/del&gt;&amp;gt; is saturated at &amp;lt;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;tt&lt;/del&gt;&amp;gt;UINT_MAX&amp;lt;/&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;tt&lt;/del&gt;&amp;gt;.  Returns &amp;lt;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;tt&lt;/del&gt;&amp;gt;true&amp;lt;/&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;tt&lt;/del&gt;&amp;gt; if &amp;lt;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;tt&lt;/del&gt;&amp;gt;r&amp;lt;/&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;tt&lt;/del&gt;&amp;gt; is 0 and mutex is held, &amp;lt;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;tt&lt;/del&gt;&amp;gt;false&amp;lt;/&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;tt&lt;/del&gt;&amp;gt; otherwise.&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;: Decrement &amp;lt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;code&lt;/ins&gt;&amp;gt;r&amp;lt;/&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;code&lt;/ins&gt;&amp;gt; and lock mutex if &amp;lt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;code&lt;/ins&gt;&amp;gt;r&amp;lt;/&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;code&lt;/ins&gt;&amp;gt; becomes 0.  Will &amp;lt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;code&lt;/ins&gt;&amp;gt;WARN&amp;lt;/&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;code&lt;/ins&gt;&amp;gt; on underflow and fail to decrement if &amp;lt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;code&lt;/ins&gt;&amp;gt;r&amp;lt;/&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;code&lt;/ins&gt;&amp;gt; is saturated at &amp;lt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;code&lt;/ins&gt;&amp;gt;UINT_MAX&amp;lt;/&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;code&lt;/ins&gt;&amp;gt;.  Returns &amp;lt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;code&lt;/ins&gt;&amp;gt;true&amp;lt;/&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;code&lt;/ins&gt;&amp;gt; if &amp;lt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;code&lt;/ins&gt;&amp;gt;r&amp;lt;/&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;code&lt;/ins&gt;&amp;gt; is 0 and mutex is held, &amp;lt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;code&lt;/ins&gt;&amp;gt;false&amp;lt;/&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;code&lt;/ins&gt;&amp;gt; otherwise.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br/&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br/&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;;'''&amp;lt;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;tt&lt;/del&gt;&amp;gt;bool refcount_dec_and_lock(refcount_t *r, spinlock_t *s)&amp;lt;/&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;tt&lt;/del&gt;&amp;gt;'''&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;;'''&amp;lt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;code&lt;/ins&gt;&amp;gt;bool refcount_dec_and_lock(refcount_t *r, spinlock_t *s)&amp;lt;/&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;code&lt;/ins&gt;&amp;gt;'''&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;: Decrement &amp;lt;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;tt&lt;/del&gt;&amp;gt;r&amp;lt;/&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;tt&lt;/del&gt;&amp;gt; and lock spinlock if &amp;lt;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;tt&lt;/del&gt;&amp;gt;r&amp;lt;/&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;tt&lt;/del&gt;&amp;gt; becomes 0.  Will &amp;lt;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;tt&lt;/del&gt;&amp;gt;WARN&amp;lt;/&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;tt&lt;/del&gt;&amp;gt; on underflow and fail to decrement if &amp;lt;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;tt&lt;/del&gt;&amp;gt;r&amp;lt;/&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;tt&lt;/del&gt;&amp;gt; is saturated at &amp;lt;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;tt&lt;/del&gt;&amp;gt;UINT_MAX&amp;lt;/&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;tt&lt;/del&gt;&amp;gt;.  Returns &amp;lt;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;tt&lt;/del&gt;&amp;gt;true&amp;lt;/&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;tt&lt;/del&gt;&amp;gt; if &amp;lt;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;tt&lt;/del&gt;&amp;gt;r&amp;lt;/&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;tt&lt;/del&gt;&amp;gt; is 0 and spinlock is held, &amp;lt;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;tt&lt;/del&gt;&amp;gt;false&amp;lt;/&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;tt&lt;/del&gt;&amp;gt; otherwise.&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;: Decrement &amp;lt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;code&lt;/ins&gt;&amp;gt;r&amp;lt;/&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;code&lt;/ins&gt;&amp;gt; and lock spinlock if &amp;lt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;code&lt;/ins&gt;&amp;gt;r&amp;lt;/&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;code&lt;/ins&gt;&amp;gt; becomes 0.  Will &amp;lt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;code&lt;/ins&gt;&amp;gt;WARN&amp;lt;/&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;code&lt;/ins&gt;&amp;gt; on underflow and fail to decrement if &amp;lt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;code&lt;/ins&gt;&amp;gt;r&amp;lt;/&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;code&lt;/ins&gt;&amp;gt; is saturated at &amp;lt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;code&lt;/ins&gt;&amp;gt;UINT_MAX&amp;lt;/&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;code&lt;/ins&gt;&amp;gt;.  Returns &amp;lt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;code&lt;/ins&gt;&amp;gt;true&amp;lt;/&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;code&lt;/ins&gt;&amp;gt; if &amp;lt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;code&lt;/ins&gt;&amp;gt;r&amp;lt;/&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;code&lt;/ins&gt;&amp;gt; is 0 and spinlock is held, &amp;lt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;code&lt;/ins&gt;&amp;gt;false&amp;lt;/&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;code&lt;/ins&gt;&amp;gt; otherwise.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>DavidWindsor</name></author>
	</entry>
	<entry>
		<id>http://kernsec.org/wiki/index.php?title=Kernel_Protections/refcount_t&amp;diff=3846&amp;oldid=prev</id>
		<title>DavidWindsor: Minor language change in Reference Counting API</title>
		<link rel="alternate" type="text/html" href="http://kernsec.org/wiki/index.php?title=Kernel_Protections/refcount_t&amp;diff=3846&amp;oldid=prev"/>
		<updated>2017-02-04T11:20:47Z</updated>

		<summary type="html">&lt;p&gt;Minor language change in Reference Counting API&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 11:20, 4 February 2017&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l7&quot;&gt;Line 7:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 7:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;HARDENED_ATOMIC introduces a new data type: &amp;lt;tt&amp;gt;refcount_t&amp;lt;/tt&amp;gt;.  This type is to be used for all kernel reference counters.   &lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;HARDENED_ATOMIC introduces a new data type: &amp;lt;tt&amp;gt;refcount_t&amp;lt;/tt&amp;gt;.  This type is to be used for all kernel reference counters.   &lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br/&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br/&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;The following &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;operations are &lt;/del&gt;the kernel reference counting API.  Please note that all operations are atomic, unless otherwise specified.  &lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;The following &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;is &lt;/ins&gt;the kernel reference counting API.  Please note that all operations are atomic, unless otherwise specified.  &lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br/&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br/&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;;'''&amp;lt;tt&amp;gt;REFCOUNT_INIT(unsigned int)&amp;lt;/tt&amp;gt;'''&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;;'''&amp;lt;tt&amp;gt;REFCOUNT_INIT(unsigned int)&amp;lt;/tt&amp;gt;'''&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>DavidWindsor</name></author>
	</entry>
	<entry>
		<id>http://kernsec.org/wiki/index.php?title=Kernel_Protections/refcount_t&amp;diff=3845&amp;oldid=prev</id>
		<title>DavidWindsor: Minor language change in Summary</title>
		<link rel="alternate" type="text/html" href="http://kernsec.org/wiki/index.php?title=Kernel_Protections/refcount_t&amp;diff=3845&amp;oldid=prev"/>
		<updated>2017-02-04T11:19:13Z</updated>

		<summary type="html">&lt;p&gt;Minor language change in Summary&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 11:19, 4 February 2017&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l1&quot;&gt;Line 1:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 1:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;= Summary =  &lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;= Summary =  &lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br/&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br/&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;HARDENED_ATOMIC is a kernel self-protection &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;feature &lt;/del&gt;that greatly helps with the mitigation of [[Bug Classes/Use after free|use-after-free]] bugs.  It is based off of work done by the [https://pax.grsecurity.net PaX Team], originally called [https://forums.grsecurity.net/viewtopic.php?f=7&amp;amp;t=4173 PAX_REFCOUNT].&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;HARDENED_ATOMIC is a kernel self-protection &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;mechanism &lt;/ins&gt;that greatly helps with the mitigation of [[Bug Classes/Use after free|use-after-free]] bugs.  It is based off of work done by the [https://pax.grsecurity.net PaX Team], originally called [https://forums.grsecurity.net/viewtopic.php?f=7&amp;amp;t=4173 PAX_REFCOUNT].&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br/&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br/&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;= Reference Counting API =&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;= Reference Counting API =&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>DavidWindsor</name></author>
	</entry>
	<entry>
		<id>http://kernsec.org/wiki/index.php?title=Kernel_Protections/refcount_t&amp;diff=3843&amp;oldid=prev</id>
		<title>DavidWindsor: Add refcount_t API</title>
		<link rel="alternate" type="text/html" href="http://kernsec.org/wiki/index.php?title=Kernel_Protections/refcount_t&amp;diff=3843&amp;oldid=prev"/>
		<updated>2017-02-04T06:42:17Z</updated>

		<summary type="html">&lt;p&gt;Add refcount_t API&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;= Summary = &lt;br /&gt;
&lt;br /&gt;
HARDENED_ATOMIC is a kernel self-protection feature that greatly helps with the mitigation of [[Bug Classes/Use after free|use-after-free]] bugs.  It is based off of work done by the [https://pax.grsecurity.net PaX Team], originally called [https://forums.grsecurity.net/viewtopic.php?f=7&amp;amp;t=4173 PAX_REFCOUNT].&lt;br /&gt;
&lt;br /&gt;
= Reference Counting API =&lt;br /&gt;
&lt;br /&gt;
HARDENED_ATOMIC introduces a new data type: &amp;lt;tt&amp;gt;refcount_t&amp;lt;/tt&amp;gt;.  This type is to be used for all kernel reference counters.  &lt;br /&gt;
&lt;br /&gt;
The following operations are the kernel reference counting API.  Please note that all operations are atomic, unless otherwise specified. &lt;br /&gt;
&lt;br /&gt;
;'''&amp;lt;tt&amp;gt;REFCOUNT_INIT(unsigned int)&amp;lt;/tt&amp;gt;'''&lt;br /&gt;
: Initialize a &amp;lt;tt&amp;gt;refcount_t&amp;lt;/tt&amp;gt; object.&lt;br /&gt;
&lt;br /&gt;
;'''&amp;lt;tt&amp;gt;void refcount_set(refcount_t *, unsigned int)&amp;lt;/tt&amp;gt;'''&lt;br /&gt;
: Set a &amp;lt;tt&amp;gt;refcount_t&amp;lt;/tt&amp;gt; object's internal value.&lt;br /&gt;
&lt;br /&gt;
;'''&amp;lt;tt&amp;gt;unsigned int refcount_read(refcount_t *)&amp;lt;/tt&amp;gt;'''&lt;br /&gt;
: Returns the &amp;lt;tt&amp;gt;refcount_t&amp;lt;/tt&amp;gt; object's internal value.&lt;br /&gt;
&lt;br /&gt;
;'''&amp;lt;tt&amp;gt;bool refcount_add_not_zero(unsigned int v, refcount_t *r)&amp;lt;/tt&amp;gt;'''&lt;br /&gt;
: Add &amp;lt;tt&amp;gt;v&amp;lt;/tt&amp;gt; to &amp;lt;tt&amp;gt;r&amp;lt;/tt&amp;gt;.  If &amp;lt;tt&amp;gt;r + v&amp;lt;/tt&amp;gt; causes an overflow, the result of the addition operation is not saved to &amp;lt;tt&amp;gt;r&amp;lt;/tt&amp;gt;.  Returns &amp;lt;tt&amp;gt;true&amp;lt;/tt&amp;gt; if the resulting value of &amp;lt;tt&amp;gt;r&amp;lt;/tt&amp;gt; is non-zero, &amp;lt;tt&amp;gt;false&amp;lt;/tt&amp;gt; otherwise.&lt;br /&gt;
&lt;br /&gt;
;'''&amp;lt;tt&amp;gt;void refcount_add(unsigned int v, refcount_t *r)&amp;lt;/tt&amp;gt;'''&lt;br /&gt;
: Adds &amp;lt;tt&amp;gt;v&amp;lt;/tt&amp;gt; to &amp;lt;tt&amp;gt;r&amp;lt;/tt&amp;gt; and stores the value in &amp;lt;tt&amp;gt;r&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
;'''&amp;lt;tt&amp;gt;bool refcount_inc_not_zero(refcount_t *r)&amp;lt;/tt&amp;gt;'''&lt;br /&gt;
: Increments &amp;lt;tt&amp;gt;r&amp;lt;/tt&amp;gt; and tests whether &amp;lt;tt&amp;gt;r + 1&amp;lt;/tt&amp;gt; causes an overflow.  If an overflow does occur, the result of the increment operation is not saved to &amp;lt;tt&amp;gt;r&amp;lt;/tt&amp;gt;.  Will saturate at &amp;lt;tt&amp;gt;UINT_MAX&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;WARN&amp;lt;/tt&amp;gt;. Returns &amp;lt;tt&amp;gt;true&amp;lt;/tt&amp;gt; if the resulting value of &amp;lt;tt&amp;gt;r&amp;lt;/tt&amp;gt; is non-zero, &amp;lt;tt&amp;gt;false&amp;lt;/tt&amp;gt; otherwise.  &lt;br /&gt;
&lt;br /&gt;
;'''&amp;lt;tt&amp;gt;void refcount_inc(refcount_t *r)&amp;lt;/tt&amp;gt;'''&lt;br /&gt;
: Increment &amp;lt;tt&amp;gt;r&amp;lt;/tt&amp;gt;.  Will saturate at &amp;lt;tt&amp;gt;UINT_MAX&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;WARN&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
;'''&amp;lt;tt&amp;gt;bool refcount_sub_and_test(unsigned int v, refcount_t *r)&amp;lt;/tt&amp;gt;'''&lt;br /&gt;
: Subtract &amp;lt;tt&amp;gt;v&amp;lt;/tt&amp;gt; from &amp;lt;tt&amp;gt;r&amp;lt;/tt&amp;gt; and tests whether &amp;lt;tt&amp;gt;r - v&amp;lt;/tt&amp;gt; causes an underflow.  If an underflow does occur, the result of the decrement operation is not saved to &amp;lt;tt&amp;gt;r&amp;lt;/tt&amp;gt;.  Will fail to decrement when saturated at &amp;lt;tt&amp;gt;UINT_MAX&amp;lt;/tt&amp;gt;.  Returns &amp;lt;tt&amp;gt;true&amp;lt;/tt&amp;gt; if the resulting value of &amp;lt;tt&amp;gt;r&amp;lt;/tt&amp;gt; is non-zero, &amp;lt;tt&amp;gt;false&amp;lt;/tt&amp;gt; otherwise.&lt;br /&gt;
&lt;br /&gt;
;'''&amp;lt;tt&amp;gt;void refcount_dec(refcount_t *r)&amp;lt;/tt&amp;gt;'''&lt;br /&gt;
: Decrement &amp;lt;tt&amp;gt;r&amp;lt;/tt&amp;gt;.  If &amp;lt;tt&amp;gt;r - 1&amp;lt;/tt&amp;gt; causes an underflow, the result of the decrement operation is not saved to &amp;lt;tt&amp;gt;r&amp;lt;/tt&amp;gt;.  Will fail to decrement when saturated at &amp;lt;tt&amp;gt;UINT_MAX&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
;'''&amp;lt;tt&amp;gt;bool refcount_dec_if_one(refcount_t *r)&amp;lt;/tt&amp;gt;'''&lt;br /&gt;
: Attempts to transition &amp;lt;tt&amp;gt;r&amp;lt;/tt&amp;gt; from 1 to 0.  If &amp;lt;tt&amp;gt;r&amp;lt;/tt&amp;gt; is 1, decrement it to 0.  Returns &amp;lt;tt&amp;gt;true&amp;lt;/tt&amp;gt; if &amp;lt;tt&amp;gt;r&amp;lt;/tt&amp;gt; was decremented, &amp;lt;tt&amp;gt;false&amp;lt;/tt&amp;gt; otherwise.  &lt;br /&gt;
&lt;br /&gt;
;'''&amp;lt;tt&amp;gt;bool refcount_dec_not_one(refcount_t *r)&amp;lt;/tt&amp;gt;'''&lt;br /&gt;
: Decrement &amp;lt;tt&amp;gt;r&amp;lt;/tt&amp;gt; unless the value of &amp;lt;tt&amp;gt;r&amp;lt;/tt&amp;gt; is 1.  Returns &amp;lt;tt&amp;gt;true&amp;lt;/tt&amp;gt; if &amp;lt;tt&amp;gt;r&amp;lt;/tt&amp;gt; was decremented, &amp;lt;/tt&amp;gt;false&amp;lt;/tt&amp;gt; otherwise.&lt;br /&gt;
&lt;br /&gt;
;'''&amp;lt;tt&amp;gt;bool refcount_dec_and_mutex_lock(refcount_t *r, struct mutex *lock)&amp;lt;/tt&amp;gt;'''&lt;br /&gt;
: Decrement &amp;lt;tt&amp;gt;r&amp;lt;/tt&amp;gt; and lock mutex if &amp;lt;tt&amp;gt;r&amp;lt;/tt&amp;gt; becomes 0.  Will &amp;lt;tt&amp;gt;WARN&amp;lt;/tt&amp;gt; on underflow and fail to decrement if &amp;lt;tt&amp;gt;r&amp;lt;/tt&amp;gt; is saturated at &amp;lt;tt&amp;gt;UINT_MAX&amp;lt;/tt&amp;gt;.  Returns &amp;lt;tt&amp;gt;true&amp;lt;/tt&amp;gt; if &amp;lt;tt&amp;gt;r&amp;lt;/tt&amp;gt; is 0 and mutex is held, &amp;lt;tt&amp;gt;false&amp;lt;/tt&amp;gt; otherwise.&lt;br /&gt;
&lt;br /&gt;
;'''&amp;lt;tt&amp;gt;bool refcount_dec_and_lock(refcount_t *r, spinlock_t *s)&amp;lt;/tt&amp;gt;'''&lt;br /&gt;
: Decrement &amp;lt;tt&amp;gt;r&amp;lt;/tt&amp;gt; and lock spinlock if &amp;lt;tt&amp;gt;r&amp;lt;/tt&amp;gt; becomes 0.  Will &amp;lt;tt&amp;gt;WARN&amp;lt;/tt&amp;gt; on underflow and fail to decrement if &amp;lt;tt&amp;gt;r&amp;lt;/tt&amp;gt; is saturated at &amp;lt;tt&amp;gt;UINT_MAX&amp;lt;/tt&amp;gt;.  Returns &amp;lt;tt&amp;gt;true&amp;lt;/tt&amp;gt; if &amp;lt;tt&amp;gt;r&amp;lt;/tt&amp;gt; is 0 and spinlock is held, &amp;lt;tt&amp;gt;false&amp;lt;/tt&amp;gt; otherwise.&lt;/div&gt;</summary>
		<author><name>DavidWindsor</name></author>
	</entry>
</feed>