Store struct fuse_session* in struct fuse_req
authorNikolaus Rath <Nikolaus@rath.org>
Tue, 4 Oct 2016 03:09:35 +0000 (20:09 -0700)
committerNikolaus Rath <Nikolaus@rath.org>
Tue, 4 Oct 2016 06:01:46 +0000 (23:01 -0700)
lib/fuse_i.h
lib/fuse_lowlevel.c

index c4d07091b6f9f9c38d084736d968c6c1b77fa70d..16a96d98699c83a21215bbb1fcc6f6fca60b969d 100644 (file)
@@ -31,9 +31,9 @@ struct fuse_chan {
        int fd;
 };
 
-
 struct fuse_req {
        struct fuse_ll *f;
+       struct fuse_session *se;
        uint64_t unique;
        int ctr;
        pthread_mutex_t lock;
index 375ac694115bd4d85ec29213b28eef2c39924447..82cbe06b4932eb43b4eb89d83013a9e590881f43 100644 (file)
@@ -144,7 +144,7 @@ void fuse_free_req(fuse_req_t req)
                destroy_req(req);
 }
 
-static struct fuse_req *fuse_ll_alloc_req(struct fuse_ll *f)
+static struct fuse_req *fuse_ll_alloc_req(struct fuse_session *se)
 {
        struct fuse_req *req;
 
@@ -152,7 +152,8 @@ static struct fuse_req *fuse_ll_alloc_req(struct fuse_ll *f)
        if (req == NULL) {
                fprintf(stderr, "fuse: failed to allocate request\n");
        } else {
-               req->f = f;
+               req->f = se->f;
+               req->se = se;
                req->ctr = 1;
                list_init_req(req);
                fuse_mutex_init(&req->lock);
@@ -1075,7 +1076,7 @@ static void do_batch_forget(fuse_req_t req, fuse_ino_t nodeid,
                        struct fuse_forget_one *forget = &param[i];
                        struct fuse_req *dummy_req;
 
-                       dummy_req = fuse_ll_alloc_req(req->f);
+                       dummy_req = fuse_ll_alloc_req(req->se);
                        if (dummy_req == NULL)
                                break;
 
@@ -2488,7 +2489,7 @@ void fuse_session_process_buf_int(struct fuse_session *se,
                        (unsigned long long) in->nodeid, buf->size, in->pid);
        }
 
-       req = fuse_ll_alloc_req(f);
+       req = fuse_ll_alloc_req(se);
        if (req == NULL) {
                struct fuse_out_header out = {
                        .unique = in->unique,