<div dir="ltr"><p style="margin:0px 0px 1em;padding:0px;border:0px;font-size:13.333333969116211px;vertical-align:baseline;clear:both;word-wrap:break-word;color:rgb(0,0,0);font-family:Arial,&#39;Liberation Sans&#39;,&#39;DejaVu Sans&#39;,sans-serif;line-height:16.666667938232422px">
hi all</p><p style="margin:0px 0px 1em;padding:0px;border:0px;font-size:13.333333969116211px;vertical-align:baseline;clear:both;word-wrap:break-word;color:rgb(0,0,0);font-family:Arial,&#39;Liberation Sans&#39;,&#39;DejaVu Sans&#39;,sans-serif;line-height:16.666667938232422px">
the codes about filesystem in the kernel is:</p><pre class="" style="margin-top:0px;margin-bottom:10px;padding:5px;border:0px;font-size:13.333333969116211px;vertical-align:baseline;background-color:rgb(238,238,238);font-family:Consolas,Menlo,Monaco,&#39;Lucida Console&#39;,&#39;Liberation Mono&#39;,&#39;DejaVu Sans Mono&#39;,&#39;Bitstream Vera Sans Mono&#39;,&#39;Courier New&#39;,monospace,serif;overflow:auto;width:auto;max-height:600px;color:rgb(0,0,0);line-height:16.666667938232422px">
<code style="margin:0px;padding:0px;border:0px;font-size:13.333333969116211px;vertical-align:baseline;font-family:Consolas,Menlo,Monaco,&#39;Lucida Console&#39;,&#39;Liberation Mono&#39;,&#39;DejaVu Sans Mono&#39;,&#39;Bitstream Vera Sans Mono&#39;,&#39;Courier New&#39;,monospace,serif"><span class="" style="margin:0px;padding:0px;border:0px;font-size:13.333333969116211px;vertical-align:baseline;background-color:transparent;color:rgb(0,0,139)">static</span><span class="" style="margin:0px;padding:0px;border:0px;font-size:13.333333969116211px;vertical-align:baseline;background-color:transparent"> </span><span class="" style="margin:0px;padding:0px;border:0px;font-size:13.333333969116211px;vertical-align:baseline;background-color:transparent;color:rgb(0,0,139)">inline</span><span class="" style="margin:0px;padding:0px;border:0px;font-size:13.333333969116211px;vertical-align:baseline;background-color:transparent"> </span><span class="" style="margin:0px;padding:0px;border:0px;font-size:13.333333969116211px;vertical-align:baseline;background-color:transparent;color:rgb(0,0,139)">struct</span><span class="" style="margin:0px;padding:0px;border:0px;font-size:13.333333969116211px;vertical-align:baseline;background-color:transparent"> list_head </span><span class="" style="margin:0px;padding:0px;border:0px;font-size:13.333333969116211px;vertical-align:baseline;background-color:transparent">*</span><span class="" style="margin:0px;padding:0px;border:0px;font-size:13.333333969116211px;vertical-align:baseline;background-color:transparent"> d_hash</span><span class="" style="margin:0px;padding:0px;border:0px;font-size:13.333333969116211px;vertical-align:baseline;background-color:transparent">(</span><span class="" style="margin:0px;padding:0px;border:0px;font-size:13.333333969116211px;vertical-align:baseline;background-color:transparent;color:rgb(0,0,139)">struct</span><span class="" style="margin:0px;padding:0px;border:0px;font-size:13.333333969116211px;vertical-align:baseline;background-color:transparent"> dentry </span><span class="" style="margin:0px;padding:0px;border:0px;font-size:13.333333969116211px;vertical-align:baseline;background-color:transparent">*</span><span class="" style="margin:0px;padding:0px;border:0px;font-size:13.333333969116211px;vertical-align:baseline;background-color:transparent">parent</span><span class="" style="margin:0px;padding:0px;border:0px;font-size:13.333333969116211px;vertical-align:baseline;background-color:transparent">,</span><span class="" style="margin:0px;padding:0px;border:0px;font-size:13.333333969116211px;vertical-align:baseline;background-color:transparent"> </span><span class="" style="margin:0px;padding:0px;border:0px;font-size:13.333333969116211px;vertical-align:baseline;background-color:transparent;color:rgb(0,0,139)">unsigned</span><span class="" style="margin:0px;padding:0px;border:0px;font-size:13.333333969116211px;vertical-align:baseline;background-color:transparent"> </span><span class="" style="margin:0px;padding:0px;border:0px;font-size:13.333333969116211px;vertical-align:baseline;background-color:transparent;color:rgb(0,0,139)">long</span><span class="" style="margin:0px;padding:0px;border:0px;font-size:13.333333969116211px;vertical-align:baseline;background-color:transparent"> hash</span><span class="" style="margin:0px;padding:0px;border:0px;font-size:13.333333969116211px;vertical-align:baseline;background-color:transparent">)</span><span class="" style="margin:0px;padding:0px;border:0px;font-size:13.333333969116211px;vertical-align:baseline;background-color:transparent">
</span><span class="" style="margin:0px;padding:0px;border:0px;font-size:13.333333969116211px;vertical-align:baseline;background-color:transparent">{</span><span class="" style="margin:0px;padding:0px;border:0px;font-size:13.333333969116211px;vertical-align:baseline;background-color:transparent">
      hash </span><span class="" style="margin:0px;padding:0px;border:0px;font-size:13.333333969116211px;vertical-align:baseline;background-color:transparent">+=</span><span class="" style="margin:0px;padding:0px;border:0px;font-size:13.333333969116211px;vertical-align:baseline;background-color:transparent"> </span><span class="" style="margin:0px;padding:0px;border:0px;font-size:13.333333969116211px;vertical-align:baseline;background-color:transparent">(</span><span class="" style="margin:0px;padding:0px;border:0px;font-size:13.333333969116211px;vertical-align:baseline;background-color:transparent;color:rgb(0,0,139)">unsigned</span><span class="" style="margin:0px;padding:0px;border:0px;font-size:13.333333969116211px;vertical-align:baseline;background-color:transparent"> </span><span class="" style="margin:0px;padding:0px;border:0px;font-size:13.333333969116211px;vertical-align:baseline;background-color:transparent;color:rgb(0,0,139)">long</span><span class="" style="margin:0px;padding:0px;border:0px;font-size:13.333333969116211px;vertical-align:baseline;background-color:transparent">)</span><span class="" style="margin:0px;padding:0px;border:0px;font-size:13.333333969116211px;vertical-align:baseline;background-color:transparent">parent </span><span class="" style="margin:0px;padding:0px;border:0px;font-size:13.333333969116211px;vertical-align:baseline;background-color:transparent">/</span><span class="" style="margin:0px;padding:0px;border:0px;font-size:13.333333969116211px;vertical-align:baseline;background-color:transparent"> L1_CACHE_BYTES</span><span class="" style="margin:0px;padding:0px;border:0px;font-size:13.333333969116211px;vertical-align:baseline;background-color:transparent">;</span><span class="" style="margin:0px;padding:0px;border:0px;font-size:13.333333969116211px;vertical-align:baseline;background-color:transparent">
      hash </span><span class="" style="margin:0px;padding:0px;border:0px;font-size:13.333333969116211px;vertical-align:baseline;background-color:transparent">=</span><span class="" style="margin:0px;padding:0px;border:0px;font-size:13.333333969116211px;vertical-align:baseline;background-color:transparent"> hash</span><span class="" style="margin:0px;padding:0px;border:0px;font-size:13.333333969116211px;vertical-align:baseline;background-color:transparent">^(</span><span class="" style="margin:0px;padding:0px;border:0px;font-size:13.333333969116211px;vertical-align:baseline;background-color:transparent">hash</span><span class="" style="margin:0px;padding:0px;border:0px;font-size:13.333333969116211px;vertical-align:baseline;background-color:transparent">&gt;&gt;</span><span class="" style="margin:0px;padding:0px;border:0px;font-size:13.333333969116211px;vertical-align:baseline;background-color:transparent">D_HASHBITS</span><span class="" style="margin:0px;padding:0px;border:0px;font-size:13.333333969116211px;vertical-align:baseline;background-color:transparent">)^(</span><span class="" style="margin:0px;padding:0px;border:0px;font-size:13.333333969116211px;vertical-align:baseline;background-color:transparent">hash</span><span class="" style="margin:0px;padding:0px;border:0px;font-size:13.333333969116211px;vertical-align:baseline;background-color:transparent">&gt;&gt;</span><span class="" style="margin:0px;padding:0px;border:0px;font-size:13.333333969116211px;vertical-align:baseline;background-color:transparent">D_HASHBITS</span><span class="" style="margin:0px;padding:0px;border:0px;font-size:13.333333969116211px;vertical-align:baseline;background-color:transparent">*</span><span class="" style="margin:0px;padding:0px;border:0px;font-size:13.333333969116211px;vertical-align:baseline;background-color:transparent;color:rgb(128,0,0)">2</span><span class="" style="margin:0px;padding:0px;border:0px;font-size:13.333333969116211px;vertical-align:baseline;background-color:transparent">);</span><span class="" style="margin:0px;padding:0px;border:0px;font-size:13.333333969116211px;vertical-align:baseline;background-color:transparent">
      </span><span class="" style="margin:0px;padding:0px;border:0px;font-size:13.333333969116211px;vertical-align:baseline;background-color:transparent;color:rgb(0,0,139)">return</span><span class="" style="margin:0px;padding:0px;border:0px;font-size:13.333333969116211px;vertical-align:baseline;background-color:transparent"> dentry_hashtable </span><span class="" style="margin:0px;padding:0px;border:0px;font-size:13.333333969116211px;vertical-align:baseline;background-color:transparent">+</span><span class="" style="margin:0px;padding:0px;border:0px;font-size:13.333333969116211px;vertical-align:baseline;background-color:transparent"> </span><span class="" style="margin:0px;padding:0px;border:0px;font-size:13.333333969116211px;vertical-align:baseline;background-color:transparent">(</span><span class="" style="margin:0px;padding:0px;border:0px;font-size:13.333333969116211px;vertical-align:baseline;background-color:transparent">hash </span><span class="" style="margin:0px;padding:0px;border:0px;font-size:13.333333969116211px;vertical-align:baseline;background-color:transparent">&amp;</span><span class="" style="margin:0px;padding:0px;border:0px;font-size:13.333333969116211px;vertical-align:baseline;background-color:transparent"> D_HASHMASK</span><span class="" style="margin:0px;padding:0px;border:0px;font-size:13.333333969116211px;vertical-align:baseline;background-color:transparent">);</span><span class="" style="margin:0px;padding:0px;border:0px;font-size:13.333333969116211px;vertical-align:baseline;background-color:transparent">
</span><span class="" style="margin:0px;padding:0px;border:0px;font-size:13.333333969116211px;vertical-align:baseline;background-color:transparent">}</span></code></pre><p style="margin:0px 0px 1em;padding:0px;border:0px;font-size:13.333333969116211px;vertical-align:baseline;clear:both;word-wrap:break-word;color:rgb(0,0,0);font-family:Arial,&#39;Liberation Sans&#39;,&#39;DejaVu Sans&#39;,sans-serif;line-height:16.666667938232422px">
I know the function parameter of <code style="margin:0px;padding:1px 5px;border:0px;font-size:13.333333969116211px;vertical-align:baseline;background-color:rgb(238,238,238);font-family:Consolas,Menlo,Monaco,&#39;Lucida Console&#39;,&#39;Liberation Mono&#39;,&#39;DejaVu Sans Mono&#39;,&#39;Bitstream Vera Sans Mono&#39;,&#39;Courier New&#39;,monospace,serif">hash</code> belongs to the qstr string is looking up, and the local variables<code style="margin:0px;padding:1px 5px;border:0px;font-size:13.333333969116211px;vertical-align:baseline;background-color:rgb(238,238,238);font-family:Consolas,Menlo,Monaco,&#39;Lucida Console&#39;,&#39;Liberation Mono&#39;,&#39;DejaVu Sans Mono&#39;,&#39;Bitstream Vera Sans Mono&#39;,&#39;Courier New&#39;,monospace,serif">hash</code> should add the <strong style="margin:0px;padding:0px;border:0px;font-size:13.333333969116211px;vertical-align:baseline;background-color:transparent">address of the dentry of parent</strong>. <br>
</p><p style="margin:0px 0px 1em;padding:0px;border:0px;font-size:13.333333969116211px;vertical-align:baseline;clear:both;word-wrap:break-word;color:rgb(0,0,0);font-family:Arial,&#39;Liberation Sans&#39;,&#39;DejaVu Sans&#39;,sans-serif;line-height:16.666667938232422px">
Why count the hash value use &quot;L1_CACHE_BYTES&quot; , &quot;D_HASHBITS&quot; and &quot;D_HASHMASK&quot;?<br></p><p style="margin:0px 0px 1em;padding:0px;border:0px;font-size:13.333333969116211px;vertical-align:baseline;clear:both;word-wrap:break-word;color:rgb(0,0,0);font-family:Arial,&#39;Liberation Sans&#39;,&#39;DejaVu Sans&#39;,sans-serif;line-height:16.666667938232422px">
And How to understand the codes following ?</p><p style="margin:0px 0px 1em;padding:0px;border:0px;font-size:13.333333969116211px;vertical-align:baseline;clear:both;word-wrap:break-word;color:rgb(0,0,0);font-family:Arial,&#39;Liberation Sans&#39;,&#39;DejaVu Sans&#39;,sans-serif;line-height:16.666667938232422px">
</p><pre class="" style="font-size:13.333333969116211px;margin-top:0px;margin-bottom:10px;padding:5px;border:0px;vertical-align:baseline;background-color:rgb(238,238,238);font-family:Consolas,Menlo,Monaco,&#39;Lucida Console&#39;,&#39;Liberation Mono&#39;,&#39;DejaVu Sans Mono&#39;,&#39;Bitstream Vera Sans Mono&#39;,&#39;Courier New&#39;,monospace,serif;overflow:auto;width:auto;max-height:600px;line-height:16.666667938232422px">
<code style="margin:0px;padding:0px;border:0px;font-size:13.333333969116211px;vertical-align:baseline;font-family:Consolas,Menlo,Monaco,&#39;Lucida Console&#39;,&#39;Liberation Mono&#39;,&#39;DejaVu Sans Mono&#39;,&#39;Bitstream Vera Sans Mono&#39;,&#39;Courier New&#39;,monospace,serif"><span class="" style="margin:0px;padding:0px;border:0px;font-size:13.333333969116211px;vertical-align:baseline;background-color:transparent">hash </span><span class="" style="margin:0px;padding:0px;border:0px;font-size:13.333333969116211px;vertical-align:baseline;background-color:transparent">+=</span><span class="" style="margin:0px;padding:0px;border:0px;font-size:13.333333969116211px;vertical-align:baseline;background-color:transparent"> </span><span class="" style="margin:0px;padding:0px;border:0px;font-size:13.333333969116211px;vertical-align:baseline;background-color:transparent">(</span><span class="" style="margin:0px;padding:0px;border:0px;font-size:13.333333969116211px;vertical-align:baseline;background-color:transparent;color:rgb(0,0,139)">unsigned</span><span class="" style="margin:0px;padding:0px;border:0px;font-size:13.333333969116211px;vertical-align:baseline;background-color:transparent"> </span><span class="" style="margin:0px;padding:0px;border:0px;font-size:13.333333969116211px;vertical-align:baseline;background-color:transparent;color:rgb(0,0,139)">long</span><span class="" style="margin:0px;padding:0px;border:0px;font-size:13.333333969116211px;vertical-align:baseline;background-color:transparent">)</span><span class="" style="margin:0px;padding:0px;border:0px;font-size:13.333333969116211px;vertical-align:baseline;background-color:transparent">parent </span><span class="" style="margin:0px;padding:0px;border:0px;font-size:13.333333969116211px;vertical-align:baseline;background-color:transparent">/</span><span class="" style="margin:0px;padding:0px;border:0px;font-size:13.333333969116211px;vertical-align:baseline;background-color:transparent"> L1_CACHE_BYTES</span><span class="" style="margin:0px;padding:0px;border:0px;font-size:13.333333969116211px;vertical-align:baseline;background-color:transparent">;</span><span class="" style="margin:0px;padding:0px;border:0px;font-size:13.333333969116211px;vertical-align:baseline;background-color:transparent">
hash </span><span class="" style="margin:0px;padding:0px;border:0px;font-size:13.333333969116211px;vertical-align:baseline;background-color:transparent">=</span><span class="" style="margin:0px;padding:0px;border:0px;font-size:13.333333969116211px;vertical-align:baseline;background-color:transparent"> hash</span><span class="" style="margin:0px;padding:0px;border:0px;font-size:13.333333969116211px;vertical-align:baseline;background-color:transparent">^(</span><span class="" style="margin:0px;padding:0px;border:0px;font-size:13.333333969116211px;vertical-align:baseline;background-color:transparent">hash</span><span class="" style="margin:0px;padding:0px;border:0px;font-size:13.333333969116211px;vertical-align:baseline;background-color:transparent">&gt;&gt;</span><span class="" style="margin:0px;padding:0px;border:0px;font-size:13.333333969116211px;vertical-align:baseline;background-color:transparent">D_HASHBITS</span><span class="" style="margin:0px;padding:0px;border:0px;font-size:13.333333969116211px;vertical-align:baseline;background-color:transparent">)^(</span><span class="" style="margin:0px;padding:0px;border:0px;font-size:13.333333969116211px;vertical-align:baseline;background-color:transparent">hash</span><span class="" style="margin:0px;padding:0px;border:0px;font-size:13.333333969116211px;vertical-align:baseline;background-color:transparent">&gt;&gt;</span><span class="" style="margin:0px;padding:0px;border:0px;font-size:13.333333969116211px;vertical-align:baseline;background-color:transparent">D_HASHBITS</span><span class="" style="margin:0px;padding:0px;border:0px;font-size:13.333333969116211px;vertical-align:baseline;background-color:transparent">*</span><span class="" style="margin:0px;padding:0px;border:0px;font-size:13.333333969116211px;vertical-align:baseline;background-color:transparent;color:rgb(128,0,0)">2</span><span class="" style="margin:0px;padding:0px;border:0px;font-size:13.333333969116211px;vertical-align:baseline;background-color:transparent">);</span></code></pre>
<p></p></div>