Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Kent Overstreet and committed by
Dominique Martinet
8b11ff09 6cda1286

+17 -17
+1 -1
include/net/9p/client.h
··· 236 236 return refcount_inc_not_zero(&r->refcount); 237 237 } 238 238 239 - int p9_req_put(struct p9_req_t *r); 239 + int p9_req_put(struct p9_client *c, struct p9_req_t *r); 240 240 241 241 /* We cannot have the real tracepoints in header files, 242 242 * use a wrapper function */
+6 -6
net/9p/client.c
··· 341 341 if (!p9_req_try_get(req)) 342 342 goto again; 343 343 if (req->tc.tag != tag) { 344 - p9_req_put(req); 344 + p9_req_put(c, req); 345 345 goto again; 346 346 } 347 347 } ··· 367 367 spin_lock_irqsave(&c->lock, flags); 368 368 idr_remove(&c->reqs, tag); 369 369 spin_unlock_irqrestore(&c->lock, flags); 370 - return p9_req_put(r); 370 + return p9_req_put(c, r); 371 371 } 372 372 373 - int p9_req_put(struct p9_req_t *r) 373 + int p9_req_put(struct p9_client *c, struct p9_req_t *r) 374 374 { 375 375 if (refcount_dec_and_test(&r->refcount)) { 376 376 p9_fcall_fini(&r->tc); ··· 423 423 424 424 wake_up(&req->wq); 425 425 p9_debug(P9_DEBUG_MUX, "wakeup: %d\n", req->tc.tag); 426 - p9_req_put(req); 426 + p9_req_put(c, req); 427 427 } 428 428 EXPORT_SYMBOL(p9_client_cb); 429 429 ··· 706 706 reterr: 707 707 p9_tag_remove(c, req); 708 708 /* 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); 710 710 return ERR_PTR(err); 711 711 } 712 712 ··· 743 743 err = c->trans_mod->request(c, req); 744 744 if (err < 0) { 745 745 /* write won't happen */ 746 - p9_req_put(req); 746 + p9_req_put(c, req); 747 747 if (err != -ERESTARTSYS && err != -EFAULT) 748 748 c->status = Disconnected; 749 749 goto recalc_sigpending;
+6 -6
net/9p/trans_fd.c
··· 378 378 m->rc.sdata = NULL; 379 379 m->rc.offset = 0; 380 380 m->rc.capacity = 0; 381 - p9_req_put(m->rreq); 381 + p9_req_put(m->client, m->rreq); 382 382 m->rreq = NULL; 383 383 } 384 384 ··· 492 492 m->wpos += err; 493 493 if (m->wpos == m->wsize) { 494 494 m->wpos = m->wsize = 0; 495 - p9_req_put(m->wreq); 495 + p9_req_put(m->client, m->wreq); 496 496 m->wreq = NULL; 497 497 } 498 498 ··· 695 695 if (req->status == REQ_STATUS_UNSENT) { 696 696 list_del(&req->req_list); 697 697 req->status = REQ_STATUS_FLSHD; 698 - p9_req_put(req); 698 + p9_req_put(client, req); 699 699 ret = 0; 700 700 } 701 701 spin_unlock(&client->lock); ··· 722 722 list_del(&req->req_list); 723 723 req->status = REQ_STATUS_FLSHD; 724 724 spin_unlock(&client->lock); 725 - p9_req_put(req); 725 + p9_req_put(client, req); 726 726 727 727 return 0; 728 728 } ··· 883 883 p9_mux_poll_stop(m); 884 884 cancel_work_sync(&m->rq); 885 885 if (m->rreq) { 886 - p9_req_put(m->rreq); 886 + p9_req_put(m->client, m->rreq); 887 887 m->rreq = NULL; 888 888 } 889 889 cancel_work_sync(&m->wq); 890 890 if (m->wreq) { 891 - p9_req_put(m->wreq); 891 + p9_req_put(m->client, m->wreq); 892 892 m->wreq = NULL; 893 893 } 894 894
+1 -1
net/9p/trans_rdma.c
··· 350 350 c->busa, c->req->tc.size, 351 351 DMA_TO_DEVICE); 352 352 up(&rdma->sq_sem); 353 - p9_req_put(c->req); 353 + p9_req_put(client, c->req); 354 354 kfree(c); 355 355 } 356 356
+2 -2
net/9p/trans_virtio.c
··· 199 199 /* Reply won't come, so drop req ref */ 200 200 static int p9_virtio_cancelled(struct p9_client *client, struct p9_req_t *req) 201 201 { 202 - p9_req_put(req); 202 + p9_req_put(client, req); 203 203 return 0; 204 204 } 205 205 ··· 523 523 kvfree(out_pages); 524 524 if (!kicked) { 525 525 /* reply won't come */ 526 - p9_req_put(req); 526 + p9_req_put(client, req); 527 527 } 528 528 return err; 529 529 }
+1 -1
net/9p/trans_xen.c
··· 163 163 ring->intf->out_prod = prod; 164 164 spin_unlock_irqrestore(&ring->lock, flags); 165 165 notify_remote_via_irq(ring->irq); 166 - p9_req_put(p9_req); 166 + p9_req_put(client, p9_req); 167 167 168 168 return 0; 169 169 }