<div dir="ltr">Thank you very much,<div>I check all of the alternative and see that xlator/mount/fuse/src/fuse-bridge fuse_create is the first</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Mar 30, 2017 at 5:18 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 04:59:02PM +0430, Tahereh Fattahi wrote:<br>
> Yes, I know the architecture of translators, of course I dont want to<br>
> create a new translator.<br>
<br>
</span>A new xlator, or an extension to an existing one (I can't think of any<br>
appropriate one though) would be the best solution.<br>
<span class=""><br>
> If I understand that my idea is correct I will create one page in<br>
> uder_review tab, But I am not sure, I should test.<br>
> First I need to know which function firstly execute when a create operation<br>
> is running?<br>
<br>
</span>There are create functions in the different 'master xlator' (which is<br>
the xlator that starts the top of the xlator-graph). For gfapi access<br>
this is the pub_glfs_creat() or pub_glfs_open() function. There are also<br>
functions in xlators/mount/fuse/src/fuse-<wbr>bridge.c and under<br>
xlators/nfs/server/. If you place the function addition in its own<br>
xlator, it will be used by all access methods, and there would not be a<br>
need to make modifications everywhere.<br>
<span class="HOEnZb"><font color="#888888"><br>
Niels<br>
</font></span><div class="HOEnZb"><div class="h5"><br>
<br>
><br>
> On Thu, Mar 30, 2017 at 4:10 PM, Niels de Vos <<a href="mailto:ndevos@redhat.com">ndevos@redhat.com</a>> wrote:<br>
><br>
> > 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<br>
> > 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<br>
> > translator<br>
> > > and it was false because the creation is not complete in this translator.<br>
> ><br>
> > 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>
> ><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<br>
> > 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<br>
> > 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>
> ><br>
</div></div></blockquote></div><br></div>