<div dir="ltr">Yes, I know the architecture of translators, of course I dont want to create a new translator.<div>If I understand that my idea is correct I will create one page in uder_review tab, But I am not sure, I should test. </div><div>First I need to know which function firstly execute when a create operation is running? </div></div><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Mar 30, 2017 at 4:10 PM, Niels de Vos <span dir="ltr"><<a href="mailto:ndevos@redhat.com" target="_blank">ndevos@redhat.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="">On Thu, Mar 30, 2017 at 03:52:39PM +0430, Tahereh Fattahi wrote:<br>
> Thanks for your answer.<br>
> For example I want to save the number of files in directory as one extended<br>
> attribute.<br>
> After every create operation, this number should be added and set as<br>
> attribute, So after create I need a setxattr.<br>
> But I dont know where this create is completed, I tested in dht translator<br>
> and it was false because the creation is not complete in this translator.<br>
<br>
</span>Each xlator receives the create procedure (and its callback). The<br>
"Glustr way" of doing this, could be to write your own xlator. Because<br>
this is a functionality we would like to see too, it would be a great<br>
opportunity to contribute such an xlator (or other approach?).<br>
<br>
My take on the functionality, is that the number of entries in a<br>
directory can be represented as (struct stat)->st_size of a directory<br>
inode. The Gluster internal representation could be stored as an xattr.<br>
<br>
You seem to be interested in implementing such a feature. If you write<br>
an email to this list with your proposal, we can work with you to get<br>
this included in one of the next versions.<br>
<br>
Once the approach has been settled upon, you can write a little design<br>
document for the glusterfs-specs repository [0].<br>
<br>
HTH,<br>
Niels<br>
<br>
<br>
0. <a href="https://github.com/gluster/glusterfs-specs" rel="noreferrer" target="_blank">https://github.com/gluster/<wbr>glusterfs-specs</a> (use Gerrit to post docs)<br>
<div class="HOEnZb"><div class="h5"><br>
<br>
><br>
> On Thu, Mar 30, 2017 at 3:44 PM, Niels de Vos <<a href="mailto:ndevos@redhat.com">ndevos@redhat.com</a>> wrote:<br>
><br>
> > On Thu, Mar 30, 2017 at 07:03:28AM +0430, Tahereh Fattahi wrote:<br>
> > > Hi<br>
> > > I want after create any file, do one setxattr automatically , where and<br>
> > how<br>
> > > I should add this operation, and in which translator?<br>
> ><br>
> > We would like to add support for compound (or composite) FOPs through<br>
> > libgfapi. This is currently not available yet, and I do not think anyone<br>
> > started working on it.<br>
> ><br>
> > Could you explain a little more about your use case for this? Concrete<br>
> > examples will help in understanding and pointing you to potential<br>
> > alternative solutions.<br>
> ><br>
> > Thanks,<br>
> > Niels<br>
> ><br>
</div></div></blockquote></div><br></div>