<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Tue, May 2, 2017 at 5:30 PM, Tahereh Fattahi <span dir="ltr">&lt;<a href="mailto:t28.fattahi@gmail.com" target="_blank">t28.fattahi@gmail.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Hi<div><br><div>I want to use a file as a counter when I create a file in dht xlator.</div><div>I mean, after creating a new file,  I want open a file in the same directory with a special name, read that, update the counter and write back. </div><div>I think for this purpose I  should open in dht_create_cbk, read in dht_open_cbk and write in dht_readv_cbk.</div><div>I think I should use dht_open , dht_readv and dht_writev. Maybe I could create inputs for these function expect frame! is it correct to use the frame fro dht_create function?</div><div><br></div><div>Is this scenario correct or there is better way?</div></div></div>
<br></blockquote><div>This is correct. But very in-efficient (for so many different fops for one fop from user). See if you can keep another extended attribute itself which you can update. That way, you can just handle the counter management using &#39;xattrop&#39; or `setxattr()&#39; fops<br></div><div> <br></div><div>Regards,<br></div><div>Amar<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">______________________________<wbr>_________________<br>
Gluster-devel mailing list<br>
<a href="mailto:Gluster-devel@gluster.org">Gluster-devel@gluster.org</a><br>
<a href="http://lists.gluster.org/mailman/listinfo/gluster-devel" rel="noreferrer" target="_blank">http://lists.gluster.org/<wbr>mailman/listinfo/gluster-devel</a><br></blockquote></div><br><br clear="all"><br>-- <br><div class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><div><div dir="ltr"><div>Amar Tumballi (amarts)<br></div></div></div></div></div>
</div></div>