[Gluster-devel] Translator issue: Change content of iovec

Vijay Bellur vbellur at redhat.com
Mon Apr 3 17:43:29 UTC 2017


On Mon, Apr 3, 2017 at 10:38 AM, David Spisla <david.spisla at iternity.com>
wrote:

> Dear GlusterDevels,
>
>
>
> I am coding a translator which is changing the content of the iovec if a
> user wants to read the content of the original file. Imagine you have a
> simple text file with the content „hello“.
>
> If the user wants to read that file, my translator changes the content to
> „I am the new content!!!“. But at the moment my translator is not working
> perfectly.
>
>
>
> Original Content à„hello“
>
> New content à „I am the new content!!!“
>
>
>
> If I read that file I get à „I am “
>
> It seems that there is still the old filesize allocated. I am looking for
> a way to allocate a new size so that my new String will fit into that file.
>
> I tried out several things, but without success. Maybe someone of you has
> an idea. At the moment my translator is on the top of the client stack.
>
>
>
> You find the source attached. I did all changes in à stub_readv_cbk
>
>
>


You would need to modify lookup_cbk in stub.c to indicate the appropriate
meta data attributes for the file being read. Specifically, you would need
to set ia_size in struct iatt.

HTH,
Vijay
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.gluster.org/pipermail/gluster-devel/attachments/20170403/cc56af25/attachment.html>


More information about the Gluster-devel mailing list