<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Sat, Jul 23, 2016 at 8:02 PM, Emmanuel Dreyfus <span dir="ltr">&lt;<a href="mailto:manu@netbsd.org" target="_blank">manu@netbsd.org</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="">Pranith Kumar Karampuri &lt;<a href="mailto:pkarampu@redhat.com">pkarampu@redhat.com</a>&gt; wrote:<br>
<br>
&gt; So should we do readdir() with external locks for everything instead?<br>
<br>
</span>readdir() with a per-directory lock is safe. However, it may come with a<br>
performance hit in some scenarios, since two threads cannot read the<br>
same directory at once. But I am not sure it can happen in GlusterFS.<br>
<br>
I am a bit disturbed by readdir_r() being planned for deprecation. The<br>
Open Group does not say that, or I missed it:<br>
<a href="http://pubs.opengroup.org/onlinepubs/9699919799/functions/readdir.html" rel="noreferrer" target="_blank">http://pubs.opengroup.org/onlinepubs/9699919799/functions/readdir.html</a></blockquote><div><br></div><div>I will wait for more people to comment on this. Let us see what they think as well.<br></div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><br>
<span class="HOEnZb"><font color="#888888"><br>
--<br>
Emmanuel Dreyfus<br>
<a href="http://hcpnet.free.fr/pubz" rel="noreferrer" target="_blank">http://hcpnet.free.fr/pubz</a><br>
<a href="mailto:manu@netbsd.org">manu@netbsd.org</a><br>
</font></span></blockquote></div><br><br clear="all"><br>-- <br><div class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr">Pranith<br></div></div>
</div></div>