Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit fc1e1a0a authored by Jeff Brown's avatar Jeff Brown
Browse files

Refactor request opcode handlers.

This is mostly a structural change.  The handlers have been moved
into individual functions, which will help with upcoming changes.

Change-Id: I774739d859e177d6b5d4186d2771444166b734fa
parent 7729d245
Loading
Loading
Loading
Loading
+513 −329
Original line number Diff line number Diff line
@@ -363,7 +363,9 @@ static inline __u64 ptr_to_id(void *ptr)

struct node *lookup_by_inode(struct fuse *fuse, __u64 nid)
{
    if (nid == FUSE_ROOT_ID) {
    if (!nid) {
        return NULL;
    } else if (nid == FUSE_ROOT_ID) {
        return &fuse->root;
    } else {
        return id_to_ptr(nid);
@@ -517,21 +519,21 @@ void fuse_reply(struct fuse *fuse, __u64 unique, void *data, int len)
    }
}

void lookup_entry(struct fuse *fuse, struct node *node,
                  const char *name, __u64 unique)
static void lookup_entry(struct fuse* fuse, struct fuse_handler* handler,
        __u64 unique, struct node* parent_node, const char* name)
{
    struct fuse_entry_out out;
    struct node* node;

    memset(&out, 0, sizeof(out));

    node = node_lookup(fuse, node, name, &out.attr);
    node = node_lookup(fuse, parent_node, name, &out.attr);
    if (!node) {
        fuse_status(fuse, unique, -ENOENT);
        return;
    }

    node->refcount++;
//    fprintf(stderr,"ACQUIRE %p (%s) rc=%d\n", node, node->name, node->refcount);
    TRACE("ACQUIRE %p (%s) rc=%d\n", node, node->name, node->refcount);
    out.nodeid = node->nid;
    out.generation = node->gen;
    out.entry_valid = 10;
@@ -540,62 +542,73 @@ void lookup_entry(struct fuse *fuse, struct node *node,
    fuse_reply(fuse, unique, &out, sizeof(out));
}

void handle_fuse_request(struct fuse *fuse, struct fuse_handler* handler,
        const struct fuse_in_header *hdr, const void *data, size_t data_len)
static void handle_lookup(struct fuse* fuse, struct fuse_handler* handler,
        const struct fuse_in_header *hdr, const char* name)
{
    struct node *node;
    struct node* node = lookup_by_inode(fuse, hdr->nodeid);

    if (hdr->nodeid) {
        node = lookup_by_inode(fuse, hdr->nodeid);
    TRACE("LOOKUP %s @ %llx (%s)\n", name, hdr->nodeid, node ? node->name : "?");
    if (!node) {
        fuse_status(fuse, hdr->unique, -ENOENT);
        return;
    }
    } else {
        node = 0;

    lookup_entry(fuse, handler, hdr->unique, node, name);
}

    switch (hdr->opcode) {
    case FUSE_LOOKUP: { /* bytez[] -> entry_out */
        const char* name = data;
        TRACE("LOOKUP %llx %s\n", hdr->nodeid, name);
        lookup_entry(fuse, node, name, hdr->unique);
static void handle_forget(struct fuse* fuse, struct fuse_handler* handler,
        const struct fuse_in_header *hdr, const struct fuse_forget_in *req)
{
    struct node* node = lookup_by_inode(fuse, hdr->nodeid);
    __u64 n = req->nlookup;

    TRACE("FORGET #%lld @ %llx (%s)\n", n, hdr->nodeid, node ? node->name : "?");
    if (!node) {
        fuse_status(fuse, hdr->unique, -ENOENT);
        return;
    }

    case FUSE_FORGET: {
        const struct fuse_forget_in *req = data;
        __u64 n = req->nlookup;
        TRACE("FORGET %llx (%s) #%lld\n", hdr->nodeid, node->name, n);
            /* no reply */
        while (n--)
    while (n--) {
        node_release(node);
        return;
    }
    /* no reply */
}

    case FUSE_GETATTR: { /* getattr_in -> attr_out */
        const struct fuse_getattr_in *req = data;
static void handle_getaddr(struct fuse* fuse, struct fuse_handler* handler,
        const struct fuse_in_header *hdr, const struct fuse_getattr_in *req)
{
    struct fuse_attr_out out;
    struct node* node = lookup_by_inode(fuse, hdr->nodeid);

        TRACE("GETATTR flags=%x fh=%llx\n", req->getattr_flags, req->fh);
    TRACE("GETATTR flags=%x fh=%llx @ %llx (%s)\n", req->getattr_flags, req->fh,
            hdr->nodeid, node ? node->name : "?");
    if (!node) {
        fuse_status(fuse, hdr->unique, -ENOENT);
        return;
    }

    memset(&out, 0, sizeof(out));
    node_get_attr(node, &out.attr);
    out.attr_valid = 10;

    fuse_reply(fuse, hdr->unique, &out, sizeof(out));
        return;
}

    case FUSE_SETATTR: { /* setattr_in -> attr_out */
        const struct fuse_setattr_in *req = data;
static void handle_setattr(struct fuse* fuse, struct fuse_handler* handler,
        const struct fuse_in_header *hdr, const struct fuse_setattr_in *req)
{
    struct fuse_attr_out out;
    char *path, buffer[PATH_MAX];
    int res = 0;
    struct timespec times[2];
    struct node* node = lookup_by_inode(fuse, hdr->nodeid);

        TRACE("SETATTR fh=%llx id=%llx valid=%x\n",
              req->fh, hdr->nodeid, req->valid);
    TRACE("SETATTR fh=%llx valid=%x @ %llx (%s)\n", req->fh, req->valid,
            hdr->nodeid, node ? node->name : "?");
    if (!node) {
        fuse_status(fuse, hdr->unique, -ENOENT);
        return;
    }

    /* XXX: incomplete implementation on purpose.   chmod/chown
     * should NEVER be implemented.*/
@@ -603,8 +616,10 @@ void handle_fuse_request(struct fuse *fuse, struct fuse_handler* handler,
    path = node_get_path(node, buffer, 0);
    if (req->valid & FATTR_SIZE)
        res = truncate(path, req->size);
        if (res)
            goto getout;
    if (res < 0) {
        fuse_status(fuse, hdr->unique, -errno);
        return;
    }

    /* Handle changing atime and mtime.  If FATTR_ATIME_and FATTR_ATIME_NOW
     * are both set, then set it to the current time.  Else, set it to the
@@ -633,94 +648,121 @@ void handle_fuse_request(struct fuse *fuse, struct fuse_handler* handler,
        }
        TRACE("Calling utimensat on %s with atime %ld, mtime=%ld\n", path, times[0].tv_sec, times[1].tv_sec);
        res = utimensat(-1, path, times, 0);
        if (res < 0) {
            fuse_status(fuse, hdr->unique, -errno);
            return;
        }
    }

        getout:
    memset(&out, 0, sizeof(out));
    node_get_attr(node, &out.attr);
    out.attr_valid = 10;

        if (res)
            fuse_status(fuse, hdr->unique, -errno);
        else
    fuse_reply(fuse, hdr->unique, &out, sizeof(out));
        return;
}

//    case FUSE_READLINK:
//    case FUSE_SYMLINK:
    case FUSE_MKNOD: { /* mknod_in, bytez[] -> entry_out */
        const struct fuse_mknod_in *req = data;
        const char *name = ((const char*) data) + sizeof(*req);
static void handle_mknod(struct fuse* fuse, struct fuse_handler* handler,
        const struct fuse_in_header* hdr, const struct fuse_mknod_in* req, const char* name)
{
    char *path, buffer[PATH_MAX];
    int res;
    struct node* node = lookup_by_inode(fuse, hdr->nodeid);

    TRACE("MKNOD %s @ %llx (%s)\n", name, hdr->nodeid, node ? node->name : "?");
    if (!node) {
        fuse_status(fuse, hdr->unique, -ENOENT);
        return;
    }

        TRACE("MKNOD %s @ %llx\n", name, hdr->nodeid);
    path = node_get_path(node, buffer, name);

    __u32 mode = (req->mode & (~0777)) | 0664;
    res = mknod(path, mode, req->rdev); /* XXX perm?*/
    if (res < 0) {
        fuse_status(fuse, hdr->unique, -errno);
        } else {
            lookup_entry(fuse, node, name, hdr->unique);
        }
        return;
    }

    case FUSE_MKDIR: { /* mkdir_in, bytez[] -> entry_out */
        const struct fuse_mkdir_in *req = data;
        const char *name = ((const char*) data) + sizeof(*req);
    lookup_entry(fuse, handler, hdr->unique, node, name);
}

static void handle_mkdir(struct fuse* fuse, struct fuse_handler* handler,
        const struct fuse_in_header* hdr, const struct fuse_mkdir_in* req, const char* name)
{
    struct fuse_entry_out out;
    char *path, buffer[PATH_MAX];
    int res;
    struct node* node = lookup_by_inode(fuse, hdr->nodeid);

    TRACE("MKDIR %s 0%o @ %llx (%s)\n", name, req->mode, hdr->nodeid, node ? node->name : "?");
    if (!node) {
        fuse_status(fuse, hdr->unique, -ENOENT);
        return;
    }

        TRACE("MKDIR %s @ %llx 0%o\n", name, hdr->nodeid, req->mode);
    path = node_get_path(node, buffer, name);

    __u32 mode = (req->mode & (~0777)) | 0775;
    res = mkdir(path, mode);
    if (res < 0) {
        fuse_status(fuse, hdr->unique, -errno);
        } else {
            lookup_entry(fuse, node, name, hdr->unique);
        }
        return;
    }

    case FUSE_UNLINK: { /* bytez[] -> */
        const char* name = data;
    lookup_entry(fuse, handler, hdr->unique, node, name);
}

static void handle_unlink(struct fuse* fuse, struct fuse_handler* handler,
        const struct fuse_in_header* hdr, const char* name)
{
    char *path, buffer[PATH_MAX];
    int res;
        TRACE("UNLINK %s @ %llx\n", name, hdr->nodeid);
    struct node* node = lookup_by_inode(fuse, hdr->nodeid);

    TRACE("UNLINK %s @ %llx (%s)\n", name, hdr->nodeid, node ? node->name : "?");
    if (!node) {
        fuse_status(fuse, hdr->unique, -ENOENT);
        return;
    }

    path = node_get_path(node, buffer, name);
    res = unlink(path);
    fuse_status(fuse, hdr->unique, res ? -errno : 0);
        return;
}

    case FUSE_RMDIR: { /* bytez[] -> */
        const char* name = data;
static void handle_rmdir(struct fuse* fuse, struct fuse_handler* handler,
        const struct fuse_in_header* hdr, const char* name)
{
    char *path, buffer[PATH_MAX];
    int res;
        TRACE("RMDIR %s @ %llx\n", name, hdr->nodeid);
    struct node* node = lookup_by_inode(fuse, hdr->nodeid);

    TRACE("RMDIR %s @ %llx (%s)\n", name, hdr->nodeid, node ? node->name : "?");
    if (!node) {
        fuse_status(fuse, hdr->unique, -ENOENT);
        return;
    }

    path = node_get_path(node, buffer, name);
    res = rmdir(path);
    fuse_status(fuse, hdr->unique, res ? -errno : 0);
        return;
}

    case FUSE_RENAME: { /* rename_in, oldname, newname ->  */
        const struct fuse_rename_in *req = data;
        const char *oldname = ((const char*) data) + sizeof(*req);
        const char *newname = oldname + strlen(oldname) + 1;
static void handle_rename(struct fuse* fuse, struct fuse_handler* handler,
        const struct fuse_in_header* hdr, const struct fuse_rename_in* req,
        const char* oldname, const char* newname)
{
    char *oldpath, oldbuffer[PATH_MAX];
    char *newpath, newbuffer[PATH_MAX];
    struct node *target;
    struct node *newparent;
    int res;
    struct node* node = lookup_by_inode(fuse, hdr->nodeid);

        TRACE("RENAME %s->%s @ %llx\n", oldname, newname, hdr->nodeid);
    TRACE("RENAME %s->%s @ %llx (%s)\n", oldname, newname, hdr->nodeid, node ? node->name : "?");
    if (!node) {
        fuse_status(fuse, hdr->unique, -ENOENT);
        return;
    }

    target = lookup_child_by_name(node, oldname);
    if (!target) {
@@ -760,15 +802,15 @@ void handle_fuse_request(struct fuse *fuse, struct fuse_handler* handler,
    TRACE("RENAME result %d\n", res);

    fuse_status(fuse, hdr->unique, res ? -errno : 0);
        return;
}

//    case FUSE_LINK:        
    case FUSE_OPEN: { /* open_in -> open_out */
        const struct fuse_open_in *req = data;
static void handle_open(struct fuse* fuse, struct fuse_handler* handler,
        const struct fuse_in_header* hdr, const struct fuse_open_in* req)
{
    struct fuse_open_out out;
    char *path, buffer[PATH_MAX];
    struct handle *h;
    struct node* node = lookup_by_inode(fuse, hdr->nodeid);

    h = malloc(sizeof(*h));
    if (!h) {
@@ -776,8 +818,13 @@ void handle_fuse_request(struct fuse *fuse, struct fuse_handler* handler,
        return;
    }

    TRACE("OPEN 0%o fh=%p @ %llx (%s)\n", req->flags, h, hdr->nodeid, node ? node->name : "?");
    if (!node) {
        fuse_status(fuse, hdr->unique, -ENOENT);
        return;
    }

    path = node_get_path(node, buffer, 0);
        TRACE("OPEN %llx '%s' 0%o fh=%p\n", hdr->nodeid, path, req->flags, h);
    h->fd = open(path, req->flags);
    if (h->fd < 0) {
        ERROR("ERROR\n");
@@ -789,11 +836,11 @@ void handle_fuse_request(struct fuse *fuse, struct fuse_handler* handler,
    out.open_flags = 0;
    out.padding = 0;
    fuse_reply(fuse, hdr->unique, &out, sizeof(out));
        return;
}

    case FUSE_READ: { /* read_in -> byte[] */
        const struct fuse_read_in *req = data;
static void handle_read(struct fuse* fuse, struct fuse_handler* handler,
        const struct fuse_in_header* hdr, const struct fuse_read_in* req)
{
    struct handle *h = id_to_ptr(req->fh);
    __u64 unique = hdr->unique;
    __u32 size = req->size;
@@ -813,12 +860,12 @@ void handle_fuse_request(struct fuse *fuse, struct fuse_handler* handler,
        return;
    }
    fuse_reply(fuse, unique, handler->read_buffer, res);
        return;
}

    case FUSE_WRITE: { /* write_in, byte[write_in.size] -> write_out */
        const struct fuse_write_in *req = data;
        const void* buffer = (const __u8*)data + sizeof(*req);
static void handle_write(struct fuse* fuse, struct fuse_handler* handler,
        const struct fuse_in_header* hdr, const struct fuse_write_in* req,
        const void* buffer)
{
    struct fuse_write_out out;
    struct handle *h = id_to_ptr(req->fh);
    int res;
@@ -830,10 +877,11 @@ void handle_fuse_request(struct fuse *fuse, struct fuse_handler* handler,
    }
    out.size = res;
    fuse_reply(fuse, hdr->unique, &out, sizeof(out));
        return;
}

    case FUSE_STATFS: { /* getattr_in -> attr_out */
static void handle_statfs(struct fuse* fuse, struct fuse_handler* handler,
        const struct fuse_in_header* hdr)
{
    struct statfs stat;
    struct fuse_statfs_out out;
    int res;
@@ -855,21 +903,21 @@ void handle_fuse_request(struct fuse *fuse, struct fuse_handler* handler,
    out.st.namelen = stat.f_namelen;
    out.st.frsize = stat.f_frsize;
    fuse_reply(fuse, hdr->unique, &out, sizeof(out));
        return;
}

    case FUSE_RELEASE: { /* release_in -> */
        const struct fuse_release_in *req = data;
static void handle_release(struct fuse* fuse, struct fuse_handler* handler,
        const struct fuse_in_header* hdr, const struct fuse_release_in* req)
{
    struct handle *h = id_to_ptr(req->fh);
    TRACE("RELEASE %p(%d)\n", h, h->fd);
    close(h->fd);
    free(h);
    fuse_status(fuse, hdr->unique, 0);
        return;
}

    case FUSE_FSYNC: {
        const struct fuse_fsync_in *req = data;
static void handle_fsync(struct fuse* fuse, struct fuse_handler* handler,
        const struct fuse_in_header* hdr, const struct fuse_fsync_in* req)
{
    int is_data_sync = req->fsync_flags & 1;
    struct handle *h = id_to_ptr(req->fh);
    int res;
@@ -880,23 +928,27 @@ void handle_fuse_request(struct fuse *fuse, struct fuse_handler* handler,
        return;
    }
    fuse_status(fuse, hdr->unique, 0);
        return;
}

//    case FUSE_SETXATTR:
//    case FUSE_GETXATTR:
//    case FUSE_LISTXATTR:
//    case FUSE_REMOVEXATTR:
    case FUSE_FLUSH: {
static void handle_flush(struct fuse* fuse, struct fuse_handler* handler,
        const struct fuse_in_header* hdr)
{
    fuse_status(fuse, hdr->unique, 0);
        return;
}

    case FUSE_OPENDIR: { /* open_in -> open_out */
        const struct fuse_open_in *req = data;
static void handle_opendir(struct fuse* fuse, struct fuse_handler* handler,
        const struct fuse_in_header* hdr, const struct fuse_open_in* req)
{
    struct fuse_open_out out;
    char *path, buffer[PATH_MAX];
    struct dirhandle *h;
    struct node* node = lookup_by_inode(fuse, hdr->nodeid);

    TRACE("OPENDIR @ %llx (%s)\n", hdr->nodeid, node ? node->name : "?");
    if (!node) {
        fuse_status(fuse, hdr->unique, -ENOENT);
        return;
    }

    h = malloc(sizeof(*h));
    if (!h) {
@@ -905,7 +957,6 @@ void handle_fuse_request(struct fuse *fuse, struct fuse_handler* handler,
    }

    path = node_get_path(node, buffer, 0);
        TRACE("OPENDIR %llx '%s'\n", hdr->nodeid, path);
    h->d = opendir(path);
    if (h->d == 0) {
        ERROR("ERROR\n");
@@ -915,11 +966,11 @@ void handle_fuse_request(struct fuse *fuse, struct fuse_handler* handler,
    }
    out.fh = ptr_to_id(h);
    fuse_reply(fuse, hdr->unique, &out, sizeof(out));
        return;
}

    case FUSE_READDIR: {
        const struct fuse_read_in *req = data;
static void handle_readdir(struct fuse* fuse, struct fuse_handler* handler,
        const struct fuse_in_header* hdr, const struct fuse_read_in* req)
{
    char buffer[8192];
    struct fuse_dirent *fde = (struct fuse_dirent*) buffer;
    struct dirent *de;
@@ -943,22 +994,21 @@ void handle_fuse_request(struct fuse *fuse, struct fuse_handler* handler,
    memcpy(fde->name, de->d_name, fde->namelen + 1);
    fuse_reply(fuse, hdr->unique, fde,
               FUSE_DIRENT_ALIGN(sizeof(struct fuse_dirent) + fde->namelen));
        return;
}

    case FUSE_RELEASEDIR: { /* release_in -> */
        const struct fuse_release_in *req = data;
static void handle_releasedir(struct fuse* fuse, struct fuse_handler* handler,
        const struct fuse_in_header* hdr, const struct fuse_release_in* req)
{
    struct dirhandle *h = id_to_ptr(req->fh);
    TRACE("RELEASEDIR %p\n",h);
    closedir(h->d);
    free(h);
    fuse_status(fuse, hdr->unique, 0);
        return;
}

//    case FUSE_FSYNCDIR:
    case FUSE_INIT: { /* init_in -> init_out */
        const struct fuse_init_in *req = data;
static void handle_init(struct fuse* fuse, struct fuse_handler* handler,
        const struct fuse_in_header* hdr, const struct fuse_init_in* req)
{
    struct fuse_init_out out;

    TRACE("INIT ver=%d.%d maxread=%d flags=%x\n",
@@ -973,6 +1023,140 @@ void handle_fuse_request(struct fuse *fuse, struct fuse_handler* handler,
    out.max_write = MAX_WRITE;

    fuse_reply(fuse, hdr->unique, &out, sizeof(out));
}

static void handle_fuse_request(struct fuse *fuse, struct fuse_handler* handler,
        const struct fuse_in_header *hdr, const void *data, size_t data_len)
{
    switch (hdr->opcode) {
    case FUSE_LOOKUP: { /* bytez[] -> entry_out */
        const char* name = data;
        handle_lookup(fuse, handler, hdr, name);
        return;
    }

    case FUSE_FORGET: {
        const struct fuse_forget_in *req = data;
        handle_forget(fuse, handler, hdr, req);
        return;
    }

    case FUSE_GETATTR: { /* getattr_in -> attr_out */
        const struct fuse_getattr_in *req = data;
        handle_getaddr(fuse, handler, hdr, req);
        return;
    }

    case FUSE_SETATTR: { /* setattr_in -> attr_out */
        const struct fuse_setattr_in *req = data;
        handle_setattr(fuse, handler, hdr, req);
        return;
    }

//    case FUSE_READLINK:
//    case FUSE_SYMLINK:
    case FUSE_MKNOD: { /* mknod_in, bytez[] -> entry_out */
        const struct fuse_mknod_in *req = data;
        const char *name = ((const char*) data) + sizeof(*req);
        handle_mknod(fuse, handler, hdr, req, name);
        return;
    }

    case FUSE_MKDIR: { /* mkdir_in, bytez[] -> entry_out */
        const struct fuse_mkdir_in *req = data;
        const char *name = ((const char*) data) + sizeof(*req);
        handle_mkdir(fuse, handler, hdr, req, name);
        return;
    }

    case FUSE_UNLINK: { /* bytez[] -> */
        const char* name = data;
        handle_unlink(fuse, handler, hdr, name);
        return;
    }

    case FUSE_RMDIR: { /* bytez[] -> */
        const char* name = data;
        handle_rmdir(fuse, handler, hdr, name);
        return;
    }

    case FUSE_RENAME: { /* rename_in, oldname, newname ->  */
        const struct fuse_rename_in *req = data;
        const char *oldname = ((const char*) data) + sizeof(*req);
        const char *newname = oldname + strlen(oldname) + 1;
        handle_rename(fuse, handler, hdr, req, oldname, newname);
        return;
    }

//    case FUSE_LINK:
    case FUSE_OPEN: { /* open_in -> open_out */
        const struct fuse_open_in *req = data;
        handle_open(fuse, handler, hdr, req);
        return;
    }

    case FUSE_READ: { /* read_in -> byte[] */
        const struct fuse_read_in *req = data;
        handle_read(fuse, handler, hdr, req);
        return;
    }

    case FUSE_WRITE: { /* write_in, byte[write_in.size] -> write_out */
        const struct fuse_write_in *req = data;
        const void* buffer = (const __u8*)data + sizeof(*req);
        handle_write(fuse, handler, hdr, req, buffer);
        return;
    }

    case FUSE_STATFS: { /* getattr_in -> attr_out */
        handle_statfs(fuse, handler, hdr);
        return;
    }

    case FUSE_RELEASE: { /* release_in -> */
        const struct fuse_release_in *req = data;
        handle_release(fuse, handler, hdr, req);
        return;
    }

    case FUSE_FSYNC: {
        const struct fuse_fsync_in *req = data;
        handle_fsync(fuse, handler, hdr, req);
        return;
    }

//    case FUSE_SETXATTR:
//    case FUSE_GETXATTR:
//    case FUSE_LISTXATTR:
//    case FUSE_REMOVEXATTR:
    case FUSE_FLUSH: {
        handle_flush(fuse, handler, hdr);
        return;
    }

    case FUSE_OPENDIR: { /* open_in -> open_out */
        const struct fuse_open_in *req = data;
        handle_opendir(fuse, handler, hdr, req);
        return;
    }

    case FUSE_READDIR: {
        const struct fuse_read_in *req = data;
        handle_readdir(fuse, handler, hdr, req);
        return;
    }

    case FUSE_RELEASEDIR: { /* release_in -> */
        const struct fuse_release_in *req = data;
        handle_releasedir(fuse, handler, hdr, req);
        return;
    }

//    case FUSE_FSYNCDIR:
    case FUSE_INIT: { /* init_in -> init_out */
        const struct fuse_init_in *req = data;
        handle_init(fuse, handler, hdr, req);
        return;
    }

@@ -985,7 +1169,7 @@ void handle_fuse_request(struct fuse *fuse, struct fuse_handler* handler,
    }
}

void handle_fuse_requests(struct fuse *fuse, struct fuse_handler* handler)
static void handle_fuse_requests(struct fuse *fuse, struct fuse_handler* handler)
{
    for (;;) {
        ssize_t len = read(fuse->fd, handler->request_buffer, sizeof(handler->request_buffer));
@@ -1016,7 +1200,7 @@ void handle_fuse_requests(struct fuse *fuse, struct fuse_handler* handler)
    }
}

int ignite_fuse(struct fuse* fuse)
static int ignite_fuse(struct fuse* fuse)
{
    /* use only one handler thread for now */
    struct fuse_handler handler;