#define P9_PORT 564
#define MAX_SOCK_BUF (64*1024)
-#define ERREQFLUSH 1
#define MAXPOLLWADDR 2
/**
Wpending = 8, /* can write */
};
-enum {
- None,
- Flushing,
- Flushed,
-};
-
-/**
- * struct p9_req - fd mux encoding of an rpc transaction
- * @lock: protects req_list
- * @tag: numeric tag for rpc transaction
- * @tcall: request &p9_fcall structure
- * @rcall: response &p9_fcall structure
- * @err: error state
- * @flush: flag to indicate RPC has been flushed
- * @req_list: list link for higher level objects to chain requests
- * @m: connection this request was issued on
- * @wqueue: wait queue that client is blocked on for this rpc
- *
- */
-
-struct p9_req {
- spinlock_t lock;
- int tag;
- struct p9_fcall *tcall;
- struct p9_fcall *rcall;
- int err;
- int flush;
- struct list_head req_list;
- struct p9_conn *m;
- wait_queue_head_t wqueue;
-};
-
struct p9_poll_wait {
struct p9_conn *conn;
wait_queue_t wait;
/**
* struct p9_conn - fd mux connection state information
- * @lock: protects mux_list (?)
* @mux_list: list link for mux to manage multiple connections (?)
* @client: reference to client instance for this connection
* @err: error state
* @req_list: accounting for requests which have been sent
* @unsent_req_list: accounting for requests that haven't been sent
- * @rcall: current response &p9_fcall structure
+ * @req: current request being processed (if any)
+ * @tmp_buf: temporary buffer to read in header
+ * @rsize: amount to read for current frame
* @rpos: read position in current frame
* @rbuf: current read buffer
* @wpos: write position for current frame
*/
struct p9_conn {
- spinlock_t lock; /* protect lock structure */
struct list_head mux_list;
struct p9_client *client;
int err;
struct list_head req_list;
struct list_head unsent_req_list;
- struct p9_fcall *rcall;
+ struct p9_req_t *req;
+ char tmp_buf[7];
+ int rsize;
int rpos;
char *rbuf;
int wpos;
spin_unlock_irqrestore(&p9_poll_lock, flags);
}
-static void p9_mux_free_request(struct p9_conn *m, struct p9_req *req)
-{
- if (req->tag != P9_NOTAG &&
- p9_idpool_check(req->tag, m->client->tagpool))
- p9_idpool_put(req->tag, m->client->tagpool);
- kfree(req);
-}
-
-static void p9_conn_rpc_cb(struct p9_req *req);
-
-static void p9_mux_flush_cb(struct p9_req *freq)
-{
- int tag;
- struct p9_conn *m = freq->m;
- struct p9_req *req, *rreq, *rptr;
-
- P9_DPRINTK(P9_DEBUG_MUX, "mux %p tc %p rc %p err %d oldtag %d\n", m,
- freq->tcall, freq->rcall, freq->err,
- freq->tcall->params.tflush.oldtag);
-
- spin_lock(&m->lock);
- tag = freq->tcall->params.tflush.oldtag;
- req = NULL;
- list_for_each_entry_safe(rreq, rptr, &m->req_list, req_list) {
- if (rreq->tag == tag) {
- req = rreq;
- list_del(&req->req_list);
- break;
- }
- }
- spin_unlock(&m->lock);
-
- if (req) {
- spin_lock(&req->lock);
- req->flush = Flushed;
- spin_unlock(&req->lock);
-
- p9_conn_rpc_cb(req);
- }
-
- kfree(freq->tcall);
- kfree(freq->rcall);
- p9_mux_free_request(m, freq);
-}
-
-static void p9_conn_rpc_cb(struct p9_req *req)
-{
- P9_DPRINTK(P9_DEBUG_MUX, "req %p\n", req);
-
- if (req->tcall->id == P9_TFLUSH) { /* flush callback */
- P9_DPRINTK(P9_DEBUG_MUX, "flush req %p\n", req);
- p9_mux_flush_cb(req);
- } else { /* normal wakeup path */
- P9_DPRINTK(P9_DEBUG_MUX, "normal req %p\n", req);
- if (req->flush != None && !req->err)
- req->err = -ERESTARTSYS;
-
- wake_up(&req->wqueue);
- }
-}
-
/**
* p9_conn_cancel - cancel all pending requests with error
* @m: mux data
*
*/
-void p9_conn_cancel(struct p9_conn *m, int err)
+static void p9_conn_cancel(struct p9_conn *m, int err)
{
- struct p9_req *req, *rtmp;
+ struct p9_req_t *req, *rtmp;
+ unsigned long flags;
LIST_HEAD(cancel_list);
P9_DPRINTK(P9_DEBUG_ERROR, "mux %p err %d\n", m, err);
m->err = err;
- spin_lock(&m->lock);
+ spin_lock_irqsave(&m->client->lock, flags);
list_for_each_entry_safe(req, rtmp, &m->req_list, req_list) {
+ req->status = REQ_STATUS_ERROR;
+ if (!req->t_err)
+ req->t_err = err;
list_move(&req->req_list, &cancel_list);
}
list_for_each_entry_safe(req, rtmp, &m->unsent_req_list, req_list) {
+ req->status = REQ_STATUS_ERROR;
+ if (!req->t_err)
+ req->t_err = err;
list_move(&req->req_list, &cancel_list);
}
- spin_unlock(&m->lock);
+ spin_unlock_irqrestore(&m->client->lock, flags);
list_for_each_entry_safe(req, rtmp, &cancel_list, req_list) {
list_del(&req->req_list);
- if (!req->err)
- req->err = err;
-
- p9_conn_rpc_cb(req);
- }
-}
-
-static void process_request(struct p9_conn *m, struct p9_req *req)
-{
- int ecode;
- struct p9_str *ename;
-
- if (!req->err && req->rcall->id == P9_RERROR) {
- ecode = req->rcall->params.rerror.errno;
- ename = &req->rcall->params.rerror.error;
-
- P9_DPRINTK(P9_DEBUG_MUX, "Rerror %.*s\n", ename->len,
- ename->str);
-
- if (m->client->dotu)
- req->err = -ecode;
-
- if (!req->err) {
- req->err = p9_errstr2errno(ename->str, ename->len);
-
- /* string match failed */
- if (!req->err) {
- PRINT_FCALL_ERROR("unknown error", req->rcall);
- req->err = -ESERVERFAULT;
- }
- }
- } else if (req->tcall && req->rcall->id != req->tcall->id + 1) {
- P9_DPRINTK(P9_DEBUG_ERROR,
- "fcall mismatch: expected %d, got %d\n",
- req->tcall->id + 1, req->rcall->id);
- if (!req->err)
- req->err = -EIO;
+ P9_DPRINTK(P9_DEBUG_ERROR, "call back req %p\n", req);
+ p9_client_cb(m->client, req);
}
}
{
int n, err;
struct p9_conn *m;
- struct p9_req *req, *rptr, *rreq;
- struct p9_fcall *rcall;
- char *rbuf;
m = container_of(work, struct p9_conn, rq);
if (m->err < 0)
return;
- rcall = NULL;
- P9_DPRINTK(P9_DEBUG_MUX, "start mux %p pos %d\n", m, m->rpos);
-
- if (!m->rcall) {
- m->rcall =
- kmalloc(sizeof(struct p9_fcall) + m->client->msize,
- GFP_KERNEL);
- if (!m->rcall) {
- err = -ENOMEM;
- goto error;
- }
+ P9_DPRINTK(P9_DEBUG_TRANS, "start mux %p pos %d\n", m, m->rpos);
- m->rbuf = (char *)m->rcall + sizeof(struct p9_fcall);
+ if (!m->rbuf) {
+ m->rbuf = m->tmp_buf;
m->rpos = 0;
+ m->rsize = 7; /* start by reading header */
}
clear_bit(Rpending, &m->wsched);
+ P9_DPRINTK(P9_DEBUG_TRANS, "read mux %p pos %d size: %d = %d\n", m,
+ m->rpos, m->rsize, m->rsize-m->rpos);
err = p9_fd_read(m->client, m->rbuf + m->rpos,
- m->client->msize - m->rpos);
- P9_DPRINTK(P9_DEBUG_MUX, "mux %p got %d bytes\n", m, err);
+ m->rsize - m->rpos);
+ P9_DPRINTK(P9_DEBUG_TRANS, "mux %p got %d bytes\n", m, err);
if (err == -EAGAIN) {
clear_bit(Rworksched, &m->wsched);
return;
goto error;
m->rpos += err;
- while (m->rpos > 4) {
- n = le32_to_cpu(*(__le32 *) m->rbuf);
+
+ if ((!m->req) && (m->rpos == m->rsize)) { /* header read in */
+ u16 tag;
+ P9_DPRINTK(P9_DEBUG_TRANS, "got new header\n");
+
+ n = le32_to_cpu(*(__le32 *) m->rbuf); /* read packet size */
if (n >= m->client->msize) {
P9_DPRINTK(P9_DEBUG_ERROR,
"requested packet size too big: %d\n", n);
goto error;
}
- if (m->rpos < n)
- break;
+ tag = le16_to_cpu(*(__le16 *) (m->rbuf+5)); /* read tag */
+ P9_DPRINTK(P9_DEBUG_TRANS,
+ "mux %p pkt: size: %d bytes tag: %d\n", m, n, tag);
- err =
- p9_deserialize_fcall(m->rbuf, n, m->rcall, m->client->dotu);
- if (err < 0)
+ m->req = p9_tag_lookup(m->client, tag);
+ if (!m->req) {
+ P9_DPRINTK(P9_DEBUG_ERROR, "Unexpected packet tag %d\n",
+ tag);
+ err = -EIO;
goto error;
-
-#ifdef CONFIG_NET_9P_DEBUG
- if ((p9_debug_level&P9_DEBUG_FCALL) == P9_DEBUG_FCALL) {
- char buf[150];
-
- p9_printfcall(buf, sizeof(buf), m->rcall,
- m->client->dotu);
- printk(KERN_NOTICE ">>> %p %s\n", m, buf);
}
-#endif
- rcall = m->rcall;
- rbuf = m->rbuf;
- if (m->rpos > n) {
- m->rcall = kmalloc(sizeof(struct p9_fcall) +
+ if (m->req->rc == NULL) {
+ m->req->rc = kmalloc(sizeof(struct p9_fcall) +
m->client->msize, GFP_KERNEL);
- if (!m->rcall) {
+ if (!m->req->rc) {
+ m->req = NULL;
err = -ENOMEM;
goto error;
}
-
- m->rbuf = (char *)m->rcall + sizeof(struct p9_fcall);
- memmove(m->rbuf, rbuf + n, m->rpos - n);
- m->rpos -= n;
- } else {
- m->rcall = NULL;
- m->rbuf = NULL;
- m->rpos = 0;
}
+ m->rbuf = (char *)m->req->rc + sizeof(struct p9_fcall);
+ memcpy(m->rbuf, m->tmp_buf, m->rsize);
+ m->rsize = n;
+ }
- P9_DPRINTK(P9_DEBUG_MUX, "mux %p fcall id %d tag %d\n", m,
- rcall->id, rcall->tag);
-
- req = NULL;
- spin_lock(&m->lock);
- list_for_each_entry_safe(rreq, rptr, &m->req_list, req_list) {
- if (rreq->tag == rcall->tag) {
- req = rreq;
- if (req->flush != Flushing)
- list_del(&req->req_list);
- break;
- }
- }
- spin_unlock(&m->lock);
-
- if (req) {
- req->rcall = rcall;
- process_request(m, req);
-
- if (req->flush != Flushing)
- p9_conn_rpc_cb(req);
- } else {
- if (err >= 0 && rcall->id != P9_RFLUSH)
- P9_DPRINTK(P9_DEBUG_ERROR,
- "unexpected response mux %p id %d tag %d\n",
- m, rcall->id, rcall->tag);
- kfree(rcall);
- }
+ /* not an else because some packets (like clunk) have no payload */
+ if ((m->req) && (m->rpos == m->rsize)) { /* packet is read in */
+ P9_DPRINTK(P9_DEBUG_TRANS, "got new packet\n");
+
+ list_del(&m->req->req_list);
+ p9_client_cb(m->client, m->req);
+
+ m->rbuf = NULL;
+ m->rpos = 0;
+ m->rsize = 0;
+ m->req = NULL;
}
if (!list_empty(&m->req_list)) {
n = p9_fd_poll(m->client, NULL);
if (n & POLLIN) {
- P9_DPRINTK(P9_DEBUG_MUX, "schedule read work %p\n", m);
+ P9_DPRINTK(P9_DEBUG_TRANS, "sched read work %p\n", m);
queue_work(p9_mux_wq, &m->rq);
} else
clear_bit(Rworksched, &m->wsched);
clear_bit(Rworksched, &m->wsched);
return;
-
error:
p9_conn_cancel(m, err);
clear_bit(Rworksched, &m->wsched);
{
int n, err;
struct p9_conn *m;
- struct p9_req *req;
+ struct p9_req_t *req;
m = container_of(work, struct p9_conn, wq);
return;
}
- spin_lock(&m->lock);
-again:
- req = list_entry(m->unsent_req_list.next, struct p9_req,
+ spin_lock(&m->client->lock);
+ req = list_entry(m->unsent_req_list.next, struct p9_req_t,
req_list);
+ req->status = REQ_STATUS_SENT;
list_move_tail(&req->req_list, &m->req_list);
- if (req->err == ERREQFLUSH)
- goto again;
- m->wbuf = req->tcall->sdata;
- m->wsize = req->tcall->size;
+ m->wbuf = req->tc->sdata;
+ m->wsize = req->tc->size;
m->wpos = 0;
- spin_unlock(&m->lock);
+ spin_unlock(&m->client->lock);
}
- P9_DPRINTK(P9_DEBUG_MUX, "mux %p pos %d size %d\n", m, m->wpos,
+ P9_DPRINTK(P9_DEBUG_TRANS, "mux %p pos %d size %d\n", m, m->wpos,
m->wsize);
clear_bit(Wpending, &m->wsched);
err = p9_fd_write(m->client, m->wbuf + m->wpos, m->wsize - m->wpos);
- P9_DPRINTK(P9_DEBUG_MUX, "mux %p sent %d bytes\n", m, err);
+ P9_DPRINTK(P9_DEBUG_TRANS, "mux %p sent %d bytes\n", m, err);
if (err == -EAGAIN) {
clear_bit(Wworksched, &m->wsched);
return;
n = p9_fd_poll(m->client, NULL);
if (n & POLLOUT) {
- P9_DPRINTK(P9_DEBUG_MUX, "schedule write work %p\n", m);
+ P9_DPRINTK(P9_DEBUG_TRANS, "sched write work %p\n", m);
queue_work(p9_mux_wq, &m->wq);
} else
clear_bit(Wworksched, &m->wsched);
return;
}
- if (!wait_address) {
- P9_DPRINTK(P9_DEBUG_ERROR, "no wait_address\n");
- pwait->wait_addr = ERR_PTR(-EIO);
- return;
- }
-
pwait->conn = m;
pwait->wait_addr = wait_address;
init_waitqueue_func_entry(&pwait->wait, p9_pollwake);
static struct p9_conn *p9_conn_create(struct p9_client *client)
{
- int i, n;
+ int n;
struct p9_conn *m;
- P9_DPRINTK(P9_DEBUG_MUX, "client %p msize %d\n", client, client->msize);
+ P9_DPRINTK(P9_DEBUG_TRANS, "client %p msize %d\n", client,
+ client->msize);
m = kzalloc(sizeof(struct p9_conn), GFP_KERNEL);
if (!m)
return ERR_PTR(-ENOMEM);
- spin_lock_init(&m->lock);
INIT_LIST_HEAD(&m->mux_list);
m->client = client;
n = p9_fd_poll(client, &m->pt);
if (n & POLLIN) {
- P9_DPRINTK(P9_DEBUG_MUX, "mux %p can read\n", m);
+ P9_DPRINTK(P9_DEBUG_TRANS, "mux %p can read\n", m);
set_bit(Rpending, &m->wsched);
}
if (n & POLLOUT) {
- P9_DPRINTK(P9_DEBUG_MUX, "mux %p can write\n", m);
+ P9_DPRINTK(P9_DEBUG_TRANS, "mux %p can write\n", m);
set_bit(Wpending, &m->wsched);
}
- for (i = 0; i < ARRAY_SIZE(m->poll_wait); i++) {
- if (IS_ERR(m->poll_wait[i].wait_addr)) {
- p9_mux_poll_stop(m);
- kfree(m);
- /* return the error code */
- return (void *)m->poll_wait[i].wait_addr;
- }
- }
-
return m;
}
n = p9_fd_poll(m->client, NULL);
if (n < 0 || n & (POLLERR | POLLHUP | POLLNVAL)) {
- P9_DPRINTK(P9_DEBUG_MUX, "error mux %p err %d\n", m, n);
+ P9_DPRINTK(P9_DEBUG_TRANS, "error mux %p err %d\n", m, n);
if (n >= 0)
n = -ECONNRESET;
p9_conn_cancel(m, n);
if (n & POLLIN) {
set_bit(Rpending, &m->wsched);
- P9_DPRINTK(P9_DEBUG_MUX, "mux %p can read\n", m);
+ P9_DPRINTK(P9_DEBUG_TRANS, "mux %p can read\n", m);
if (!test_and_set_bit(Rworksched, &m->wsched)) {
- P9_DPRINTK(P9_DEBUG_MUX, "schedule read work %p\n", m);
+ P9_DPRINTK(P9_DEBUG_TRANS, "sched read work %p\n", m);
queue_work(p9_mux_wq, &m->rq);
}
}
if (n & POLLOUT) {
set_bit(Wpending, &m->wsched);
- P9_DPRINTK(P9_DEBUG_MUX, "mux %p can write\n", m);
+ P9_DPRINTK(P9_DEBUG_TRANS, "mux %p can write\n", m);
if ((m->wsize || !list_empty(&m->unsent_req_list))
&& !test_and_set_bit(Wworksched, &m->wsched)) {
- P9_DPRINTK(P9_DEBUG_MUX, "schedule write work %p\n", m);
+ P9_DPRINTK(P9_DEBUG_TRANS, "sched write work %p\n", m);
queue_work(p9_mux_wq, &m->wq);
}
}
}
/**
- * p9_send_request - send 9P request
+ * p9_fd_request - send 9P request
* The function can sleep until the request is scheduled for sending.
* The function can be interrupted. Return from the function is not
- * a guarantee that the request is sent successfully. Can return errors
- * that can be retrieved by PTR_ERR macros.
+ * a guarantee that the request is sent successfully.
*
- * @m: mux data
- * @tc: request to be sent
+ * @client: client instance
+ * @req: request to be sent
*
*/
-static struct p9_req *p9_send_request(struct p9_conn *m, struct p9_fcall *tc)
+static int p9_fd_request(struct p9_client *client, struct p9_req_t *req)
{
int n;
- struct p9_req *req;
+ struct p9_trans_fd *ts = client->trans;
+ struct p9_conn *m = ts->conn;
- P9_DPRINTK(P9_DEBUG_MUX, "mux %p task %p tcall %p id %d\n", m, current,
- tc, tc->id);
+ P9_DPRINTK(P9_DEBUG_TRANS, "mux %p task %p tcall %p id %d\n", m,
+ current, req->tc, req->tc->id);
if (m->err < 0)
- return ERR_PTR(m->err);
-
- req = kmalloc(sizeof(struct p9_req), GFP_KERNEL);
- if (!req)
- return ERR_PTR(-ENOMEM);
-
- n = P9_NOTAG;
- if (tc->id != P9_TVERSION) {
- n = p9_idpool_get(m->client->tagpool);
- if (n < 0) {
- kfree(req);
- return ERR_PTR(-ENOMEM);
- }
- }
-
- p9_set_tag(tc, n);
+ return m->err;
-#ifdef CONFIG_NET_9P_DEBUG
- if ((p9_debug_level&P9_DEBUG_FCALL) == P9_DEBUG_FCALL) {
- char buf[150];
+ req->status = REQ_STATUS_UNSENT;
- p9_printfcall(buf, sizeof(buf), tc, m->client->dotu);
- printk(KERN_NOTICE "<<< %p %s\n", m, buf);
- }
-#endif
-
- spin_lock_init(&req->lock);
- req->m = m;
- init_waitqueue_head(&req->wqueue);
- req->tag = n;
- req->tcall = tc;
- req->rcall = NULL;
- req->err = 0;
- req->flush = None;
-
- spin_lock(&m->lock);
+ spin_lock(&client->lock);
list_add_tail(&req->req_list, &m->unsent_req_list);
- spin_unlock(&m->lock);
+ spin_unlock(&client->lock);
if (test_and_clear_bit(Wpending, &m->wsched))
n = POLLOUT;
if (n & POLLOUT && !test_and_set_bit(Wworksched, &m->wsched))
queue_work(p9_mux_wq, &m->wq);
- return req;
+ return 0;
}
-static int
-p9_mux_flush_request(struct p9_conn *m, struct p9_req *req)
+static int p9_fd_cancel(struct p9_client *client, struct p9_req_t *req)
{
- struct p9_fcall *fc;
- struct p9_req *rreq, *rptr;
+ struct p9_trans_fd *ts = client->trans;
+ struct p9_conn *m = ts->conn;
- P9_DPRINTK(P9_DEBUG_MUX, "mux %p req %p tag %d\n", m, req, req->tag);
+ P9_DPRINTK(P9_DEBUG_TRANS, "mux %p req %p\n", m, req);
- /* if a response was received for a request, do nothing */
- spin_lock(&req->lock);
- if (req->rcall || req->err) {
- spin_unlock(&req->lock);
- P9_DPRINTK(P9_DEBUG_MUX,
- "mux %p req %p response already received\n", m, req);
- return 0;
- }
+ spin_lock(&client->lock);
+ list_del(&req->req_list);
+ spin_unlock(&client->lock);
- req->flush = Flushing;
- spin_unlock(&req->lock);
-
- spin_lock(&m->lock);
- /* if the request is not sent yet, just remove it from the list */
- list_for_each_entry_safe(rreq, rptr, &m->unsent_req_list, req_list) {
- if (rreq->tag == req->tag) {
- P9_DPRINTK(P9_DEBUG_MUX,
- "mux %p req %p request is not sent yet\n", m, req);
- list_del(&rreq->req_list);
- req->flush = Flushed;
- spin_unlock(&m->lock);
- p9_conn_rpc_cb(req);
- return 0;
- }
+ if (req->status == REQ_STATUS_UNSENT) {
+ req->status = REQ_STATUS_FLSHD;
+ return 0;
}
- spin_unlock(&m->lock);
- clear_thread_flag(TIF_SIGPENDING);
- fc = p9_create_tflush(req->tag);
- p9_send_request(m, fc);
return 1;
}
-/**
- * p9_fd_rpc- sends 9P request and waits until a response is available.
- * The function can be interrupted.
- * @client: client instance
- * @tc: request to be sent
- * @rc: pointer where a pointer to the response is stored
- *
- */
-
-int
-p9_fd_rpc(struct p9_client *client, struct p9_fcall *tc, struct p9_fcall **rc)
-{
- struct p9_trans_fd *p = client->trans;
- struct p9_conn *m = p->conn;
- int err, sigpending;
- unsigned long flags;
- struct p9_req *req;
-
- if (rc)
- *rc = NULL;
-
- sigpending = 0;
- if (signal_pending(current)) {
- sigpending = 1;
- clear_thread_flag(TIF_SIGPENDING);
- }
-
- req = p9_send_request(m, tc);
- if (IS_ERR(req)) {
- err = PTR_ERR(req);
- P9_DPRINTK(P9_DEBUG_MUX, "error %d\n", err);
- return err;
- }
-
- err = wait_event_interruptible(req->wqueue, req->rcall != NULL ||
- req->err < 0);
- if (req->err < 0)
- err = req->err;
-
- if (err == -ERESTARTSYS && client->status == Connected
- && m->err == 0) {
- if (p9_mux_flush_request(m, req)) {
- /* wait until we get response of the flush message */
- do {
- clear_thread_flag(TIF_SIGPENDING);
- err = wait_event_interruptible(req->wqueue,
- req->rcall || req->err);
- } while (!req->rcall && !req->err &&
- err == -ERESTARTSYS &&
- client->status == Connected && !m->err);
-
- err = -ERESTARTSYS;
- }
- sigpending = 1;
- }
-
- if (sigpending) {
- spin_lock_irqsave(¤t->sighand->siglock, flags);
- recalc_sigpending();
- spin_unlock_irqrestore(¤t->sighand->siglock, flags);
- }
-
- if (rc)
- *rc = req->rcall;
- else
- kfree(req->rcall);
-
- p9_mux_free_request(m, req);
- if (err > 0)
- err = -EIO;
-
- return err;
-}
-
/**
* parse_options - parse mount options into session structure
* @options: options string passed from mount
static void p9_conn_destroy(struct p9_conn *m)
{
- P9_DPRINTK(P9_DEBUG_MUX, "mux %p prev %p next %p\n", m,
+ P9_DPRINTK(P9_DEBUG_TRANS, "mux %p prev %p next %p\n", m,
m->mux_list.prev, m->mux_list.next);
p9_mux_poll_stop(m);
.def = 1,
.create = p9_fd_create_tcp,
.close = p9_fd_close,
- .rpc = p9_fd_rpc,
+ .request = p9_fd_request,
+ .cancel = p9_fd_cancel,
.owner = THIS_MODULE,
};
.def = 0,
.create = p9_fd_create_unix,
.close = p9_fd_close,
- .rpc = p9_fd_rpc,
+ .request = p9_fd_request,
+ .cancel = p9_fd_cancel,
.owner = THIS_MODULE,
};
.def = 0,
.create = p9_fd_create,
.close = p9_fd_close,
- .rpc = p9_fd_rpc,
+ .request = p9_fd_request,
+ .cancel = p9_fd_cancel,
.owner = THIS_MODULE,
};
{
unsigned long flags;
- P9_DPRINTK(P9_DEBUG_MUX, "start %p\n", current);
+ P9_DPRINTK(P9_DEBUG_TRANS, "start %p\n", current);
repeat:
spin_lock_irqsave(&p9_poll_lock, flags);
while (!list_empty(&p9_poll_pending_list)) {
set_current_state(TASK_INTERRUPTIBLE);
if (list_empty(&p9_poll_pending_list)) {
- P9_DPRINTK(P9_DEBUG_MUX, "sleeping...\n");
+ P9_DPRINTK(P9_DEBUG_TRANS, "sleeping...\n");
schedule();
}
__set_current_state(TASK_RUNNING);
if (!kthread_should_stop())
goto repeat;
- P9_DPRINTK(P9_DEBUG_MUX, "finish\n");
+ P9_DPRINTK(P9_DEBUG_TRANS, "finish\n");
return 0;
}