Skip to content

Commit 8b11ff0

Browse files
koverstreetmartinetd
authored andcommitted
9p: Add client parameter to p9_req_put()
This is to aid in adding mempools, in the next patch. Link: https://lkml.kernel.org/r/20220704014243.153050-2-kent.overstreet@gmail.com Signed-off-by: Kent Overstreet <kent.overstreet@gmail.com> Cc: Eric Van Hensbergen <ericvh@gmail.com> Cc: Latchesar Ionkov <lucho@ionkov.net> Signed-off-by: Dominique Martinet <asmadeus@codewreck.org>
1 parent 6cda128 commit 8b11ff0

File tree

6 files changed

+17
-17
lines changed

6 files changed

+17
-17
lines changed

include/net/9p/client.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -236,7 +236,7 @@ static inline int p9_req_try_get(struct p9_req_t *r)
236236
return refcount_inc_not_zero(&r->refcount);
237237
}
238238

239-
int p9_req_put(struct p9_req_t *r);
239+
int p9_req_put(struct p9_client *c, struct p9_req_t *r);
240240

241241
/* We cannot have the real tracepoints in header files,
242242
* use a wrapper function */

net/9p/client.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -341,7 +341,7 @@ struct p9_req_t *p9_tag_lookup(struct p9_client *c, u16 tag)
341341
if (!p9_req_try_get(req))
342342
goto again;
343343
if (req->tc.tag != tag) {
344-
p9_req_put(req);
344+
p9_req_put(c, req);
345345
goto again;
346346
}
347347
}
@@ -367,10 +367,10 @@ static int p9_tag_remove(struct p9_client *c, struct p9_req_t *r)
367367
spin_lock_irqsave(&c->lock, flags);
368368
idr_remove(&c->reqs, tag);
369369
spin_unlock_irqrestore(&c->lock, flags);
370-
return p9_req_put(r);
370+
return p9_req_put(c, r);
371371
}
372372

373-
int p9_req_put(struct p9_req_t *r)
373+
int p9_req_put(struct p9_client *c, struct p9_req_t *r)
374374
{
375375
if (refcount_dec_and_test(&r->refcount)) {
376376
p9_fcall_fini(&r->tc);
@@ -423,7 +423,7 @@ void p9_client_cb(struct p9_client *c, struct p9_req_t *req, int status)
423423

424424
wake_up(&req->wq);
425425
p9_debug(P9_DEBUG_MUX, "wakeup: %d\n", req->tc.tag);
426-
p9_req_put(req);
426+
p9_req_put(c, req);
427427
}
428428
EXPORT_SYMBOL(p9_client_cb);
429429

@@ -706,7 +706,7 @@ static struct p9_req_t *p9_client_prepare_req(struct p9_client *c,
706706
reterr:
707707
p9_tag_remove(c, req);
708708
/* We have to put also the 2nd reference as it won't be used */
709-
p9_req_put(req);
709+
p9_req_put(c, req);
710710
return ERR_PTR(err);
711711
}
712712

@@ -743,7 +743,7 @@ p9_client_rpc(struct p9_client *c, int8_t type, const char *fmt, ...)
743743
err = c->trans_mod->request(c, req);
744744
if (err < 0) {
745745
/* write won't happen */
746-
p9_req_put(req);
746+
p9_req_put(c, req);
747747
if (err != -ERESTARTSYS && err != -EFAULT)
748748
c->status = Disconnected;
749749
goto recalc_sigpending;

net/9p/trans_fd.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -378,7 +378,7 @@ static void p9_read_work(struct work_struct *work)
378378
m->rc.sdata = NULL;
379379
m->rc.offset = 0;
380380
m->rc.capacity = 0;
381-
p9_req_put(m->rreq);
381+
p9_req_put(m->client, m->rreq);
382382
m->rreq = NULL;
383383
}
384384

@@ -492,7 +492,7 @@ static void p9_write_work(struct work_struct *work)
492492
m->wpos += err;
493493
if (m->wpos == m->wsize) {
494494
m->wpos = m->wsize = 0;
495-
p9_req_put(m->wreq);
495+
p9_req_put(m->client, m->wreq);
496496
m->wreq = NULL;
497497
}
498498

@@ -695,7 +695,7 @@ static int p9_fd_cancel(struct p9_client *client, struct p9_req_t *req)
695695
if (req->status == REQ_STATUS_UNSENT) {
696696
list_del(&req->req_list);
697697
req->status = REQ_STATUS_FLSHD;
698-
p9_req_put(req);
698+
p9_req_put(client, req);
699699
ret = 0;
700700
}
701701
spin_unlock(&client->lock);
@@ -722,7 +722,7 @@ static int p9_fd_cancelled(struct p9_client *client, struct p9_req_t *req)
722722
list_del(&req->req_list);
723723
req->status = REQ_STATUS_FLSHD;
724724
spin_unlock(&client->lock);
725-
p9_req_put(req);
725+
p9_req_put(client, req);
726726

727727
return 0;
728728
}
@@ -883,12 +883,12 @@ static void p9_conn_destroy(struct p9_conn *m)
883883
p9_mux_poll_stop(m);
884884
cancel_work_sync(&m->rq);
885885
if (m->rreq) {
886-
p9_req_put(m->rreq);
886+
p9_req_put(m->client, m->rreq);
887887
m->rreq = NULL;
888888
}
889889
cancel_work_sync(&m->wq);
890890
if (m->wreq) {
891-
p9_req_put(m->wreq);
891+
p9_req_put(m->client, m->wreq);
892892
m->wreq = NULL;
893893
}
894894

net/9p/trans_rdma.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -350,7 +350,7 @@ send_done(struct ib_cq *cq, struct ib_wc *wc)
350350
c->busa, c->req->tc.size,
351351
DMA_TO_DEVICE);
352352
up(&rdma->sq_sem);
353-
p9_req_put(c->req);
353+
p9_req_put(client, c->req);
354354
kfree(c);
355355
}
356356

net/9p/trans_virtio.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -199,7 +199,7 @@ static int p9_virtio_cancel(struct p9_client *client, struct p9_req_t *req)
199199
/* Reply won't come, so drop req ref */
200200
static int p9_virtio_cancelled(struct p9_client *client, struct p9_req_t *req)
201201
{
202-
p9_req_put(req);
202+
p9_req_put(client, req);
203203
return 0;
204204
}
205205

@@ -523,7 +523,7 @@ p9_virtio_zc_request(struct p9_client *client, struct p9_req_t *req,
523523
kvfree(out_pages);
524524
if (!kicked) {
525525
/* reply won't come */
526-
p9_req_put(req);
526+
p9_req_put(client, req);
527527
}
528528
return err;
529529
}

net/9p/trans_xen.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,7 @@ static int p9_xen_request(struct p9_client *client, struct p9_req_t *p9_req)
163163
ring->intf->out_prod = prod;
164164
spin_unlock_irqrestore(&ring->lock, flags);
165165
notify_remote_via_irq(ring->irq);
166-
p9_req_put(p9_req);
166+
p9_req_put(client, p9_req);
167167

168168
return 0;
169169
}

0 commit comments

Comments
 (0)