[Gluster-devel] Using syncop_readdir inside Xlator

David Spisla spisla80 at gmail.com
Tue Mar 27 15:17:00 UTC 2018

Dear Gluster Devels,

I want to read all the entries in a DIR inside of a xlator. For this
purpose I use the syncop_readdir function which is also used in die
self-heal functionality for example.
Here is a piece of code from inside the worm_rename function:

               fd_t                 *fd             = NULL;
               gf_dirent_t           entries;

                fd = fd_anonymous (oldloc->inode);
                if (fd == NULL) {
                        gf_log (this->name, GF_LOG_ERROR, "fd creation
                        ret = -ENOMEM;
                        goto out;
                INIT_LIST_HEAD (&entries.list);
                ret = syncop_readdir (this, fd, 131072, 0, &entries, NULL,
                if (ret) {
                        gf_log (this->name, GF_LOG_ERROR, "failed getting
dir entries");
                        ret = -ENOMEM;
                        goto out;

The problem is, that I always get the Error: "failed getting dir entries" .
It seems to be that there is something wrong with the execution of that
function. Any ideas?

David Spisla
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.gluster.org/pipermail/gluster-devel/attachments/20180327/d29e92d8/attachment.html>

More information about the Gluster-devel mailing list