Lines Matching refs:r
105 struct c2_vq_req *r; in vq_req_alloc() local
107 r = kmalloc(sizeof(struct c2_vq_req), GFP_KERNEL); in vq_req_alloc()
108 if (r) { in vq_req_alloc()
109 init_waitqueue_head(&r->wait_object); in vq_req_alloc()
110 r->reply_msg = 0; in vq_req_alloc()
111 r->event = 0; in vq_req_alloc()
112 r->cm_id = NULL; in vq_req_alloc()
113 r->qp = NULL; in vq_req_alloc()
114 atomic_set(&r->refcnt, 1); in vq_req_alloc()
115 atomic_set(&r->reply_ready, 0); in vq_req_alloc()
117 return r; in vq_req_alloc()
124 void vq_req_free(struct c2_dev *c2dev, struct c2_vq_req *r) in vq_req_free() argument
126 r->reply_msg = 0; in vq_req_free()
127 if (atomic_dec_and_test(&r->refcnt)) { in vq_req_free()
128 kfree(r); in vq_req_free()
135 void vq_req_get(struct c2_dev *c2dev, struct c2_vq_req *r) in vq_req_get() argument
137 atomic_inc(&r->refcnt); in vq_req_get()
151 void vq_req_put(struct c2_dev *c2dev, struct c2_vq_req *r) in vq_req_put() argument
153 if (atomic_dec_and_test(&r->refcnt)) { in vq_req_put()
154 if (r->reply_msg != 0) in vq_req_put()
156 (void *) (unsigned long) r->reply_msg); in vq_req_put()
157 kfree(r); in vq_req_put()