Lines Matching refs:rd
60 struct rpcrdma_device *rd = rpcrdma_get_client_data(device); in rpcrdma_rn_register() local
62 if (!rd || test_bit(RPCRDMA_RD_F_REMOVING, &rd->rd_flags)) in rpcrdma_rn_register()
65 if (xa_alloc(&rd->rd_xa, &rn->rn_index, rn, xa_limit_32b, GFP_KERNEL) < 0) in rpcrdma_rn_register()
67 kref_get(&rd->rd_kref); in rpcrdma_rn_register()
75 struct rpcrdma_device *rd = container_of(kref, struct rpcrdma_device, in rpcrdma_rn_release() local
78 trace_rpcrdma_client_completion(rd->rd_device); in rpcrdma_rn_release()
79 complete(&rd->rd_done); in rpcrdma_rn_release()
90 struct rpcrdma_device *rd = rpcrdma_get_client_data(device); in rpcrdma_rn_unregister() local
92 if (!rd) in rpcrdma_rn_unregister()
96 xa_erase(&rd->rd_xa, rn->rn_index); in rpcrdma_rn_unregister()
97 kref_put(&rd->rd_kref, rpcrdma_rn_release); in rpcrdma_rn_unregister()
109 struct rpcrdma_device *rd; in rpcrdma_add_one() local
111 rd = kzalloc(sizeof(*rd), GFP_KERNEL); in rpcrdma_add_one()
112 if (!rd) in rpcrdma_add_one()
115 kref_init(&rd->rd_kref); in rpcrdma_add_one()
116 xa_init_flags(&rd->rd_xa, XA_FLAGS_ALLOC); in rpcrdma_add_one()
117 rd->rd_device = device; in rpcrdma_add_one()
118 init_completion(&rd->rd_done); in rpcrdma_add_one()
119 ib_set_client_data(device, &rpcrdma_ib_client, rd); in rpcrdma_add_one()
136 struct rpcrdma_device *rd = client_data; in rpcrdma_remove_one() local
142 set_bit(RPCRDMA_RD_F_REMOVING, &rd->rd_flags); in rpcrdma_remove_one()
143 xa_for_each(&rd->rd_xa, index, rn) in rpcrdma_remove_one()
150 if (!refcount_dec_and_test(&rd->rd_kref.refcount)) { in rpcrdma_remove_one()
152 wait_for_completion(&rd->rd_done); in rpcrdma_remove_one()
156 xa_destroy(&rd->rd_xa); in rpcrdma_remove_one()
157 kfree(rd); in rpcrdma_remove_one()