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

Commit 8c5c8420 authored by qctecmdr's avatar qctecmdr Committed by Gerrit - the friendly Code Review server
Browse files

Merge "fuse: give wakeup hints to the scheduler"

parents 7a50a7a3 4e2e0b5c
Loading
Loading
Loading
Loading
+9 −5
Original line number Diff line number Diff line
@@ -327,11 +327,15 @@ static u64 fuse_get_unique(struct fuse_iqueue *fiq)
	return ++fiq->reqctr;
}

static void queue_request(struct fuse_iqueue *fiq, struct fuse_req *req)
static void queue_request(struct fuse_iqueue *fiq, struct fuse_req *req,
				bool sync)
{
	req->in.h.len = sizeof(struct fuse_in_header) +
		len_args(req->in.numargs, (struct fuse_arg *) req->in.args);
	list_add_tail(&req->list, &fiq->pending);
	if (sync)
		wake_up_sync(&fiq->waitq);
	else
		wake_up(&fiq->waitq);
	kill_fasync(&fiq->fasync, SIGIO, POLL_IN);
}
@@ -368,7 +372,7 @@ static void flush_bg_queue(struct fuse_conn *fc)
		fc->active_background++;
		spin_lock(&fiq->lock);
		req->in.h.unique = fuse_get_unique(fiq);
		queue_request(fiq, req);
		queue_request(fiq, req, 0);
		spin_unlock(&fiq->lock);
	}
}
@@ -497,7 +501,7 @@ static void __fuse_request_send(struct fuse_conn *fc, struct fuse_req *req)
		req->out.h.error = -ENOTCONN;
	} else {
		req->in.h.unique = fuse_get_unique(fiq);
		queue_request(fiq, req);
		queue_request(fiq, req, 1);
		/* acquire extra reference, since request is still needed
		   after request_end() */
		__fuse_get_request(req);
@@ -637,7 +641,7 @@ static int fuse_request_send_notify_reply(struct fuse_conn *fc,
	req->in.h.unique = unique;
	spin_lock(&fiq->lock);
	if (fiq->connected) {
		queue_request(fiq, req);
		queue_request(fiq, req, 0);
		err = 0;
	}
	spin_unlock(&fiq->lock);