Exemple #1
0
void request_send(struct fuse_conn *fc, struct fuse_in *in,
		  struct fuse_out *out)
{
	struct fuse_req *req;

	out->h.error = -ERESTARTSYS;
	if(down_interruptible(&fc->outstanding))
		return;

	out->h.error = -ENOMEM;
	req = request_new();
	if(!req)
		return;

	req->in = in;
	req->out = out;
	req->issync = 1;

	spin_lock(&fuse_lock);
	out->h.error = -ENOTCONN;
	if(fc->file) {
		in->h.unique = get_unique(fc);		
		list_add_tail(&req->list, &fc->pending);
		wake_up(&fc->waitq);
		request_wait_answer(req);
		list_del(&req->list);
	}
	spin_unlock(&fuse_lock);
	request_free(req);

	up(&fc->outstanding);
}
Exemple #2
0
void request_send(struct fuse_conn *fc, struct fuse_req *req)
{
	req->isreply = 1;
	spin_lock(&fc->lock);
	if (!fc->connected)
		req->out.h.error = -ENOTCONN;
	else if (fc->conn_error)
		req->out.h.error = -ECONNREFUSED;
	else {
		queue_request(fc, req);
		/* acquire extra reference, since request is still needed
		   after request_end() */
		__fuse_get_request(req);

		request_wait_answer(fc, req);
	}
	spin_unlock(&fc->lock);
}