Lines Matching refs:xprt

68 	return xprt_get(x->xprt);  in rpc_sysfs_xprt_kobj_get_xprt()
93 struct rpc_xprt *xprt = rpc_sysfs_xprt_kobj_get_xprt(kobj); in rpc_sysfs_xprt_dstaddr_show() local
96 if (!xprt) { in rpc_sysfs_xprt_dstaddr_show()
100 ret = sprintf(buf, "%s\n", xprt->address_strings[RPC_DISPLAY_ADDR]); in rpc_sysfs_xprt_dstaddr_show()
101 xprt_put(xprt); in rpc_sysfs_xprt_dstaddr_show()
110 struct rpc_xprt *xprt = rpc_sysfs_xprt_kobj_get_xprt(kobj); in rpc_sysfs_xprt_srcaddr_show() local
114 if (!xprt || !xprt_connected(xprt)) { in rpc_sysfs_xprt_srcaddr_show()
116 } else if (xprt->ops->get_srcaddr) { in rpc_sysfs_xprt_srcaddr_show()
117 ret = xprt->ops->get_srcaddr(xprt, buf, buflen); in rpc_sysfs_xprt_srcaddr_show()
128 xprt_put(xprt); in rpc_sysfs_xprt_srcaddr_show()
135 struct rpc_xprt *xprt = rpc_sysfs_xprt_kobj_get_xprt(kobj); in rpc_sysfs_xprt_info_show() local
140 if (!xprt || !xprt_connected(xprt)) { in rpc_sysfs_xprt_info_show()
145 if (xprt->ops->get_srcport) in rpc_sysfs_xprt_info_show()
146 srcport = xprt->ops->get_srcport(xprt); in rpc_sysfs_xprt_info_show()
154 xprt->last_used, xprt->cong, xprt->cwnd, xprt->max_reqs, in rpc_sysfs_xprt_info_show()
155 xprt->min_reqs, xprt->num_reqs, xprt->binding.qlen, in rpc_sysfs_xprt_info_show()
156 xprt->sending.qlen, xprt->pending.qlen, in rpc_sysfs_xprt_info_show()
157 xprt->backlog.qlen, xprt->main, srcport, in rpc_sysfs_xprt_info_show()
158 atomic_long_read(&xprt->queuelen), in rpc_sysfs_xprt_info_show()
159 xprt->address_strings[RPC_DISPLAY_PORT]); in rpc_sysfs_xprt_info_show()
161 xprt_put(xprt); in rpc_sysfs_xprt_info_show()
169 struct rpc_xprt *xprt = rpc_sysfs_xprt_kobj_get_xprt(kobj); in rpc_sysfs_xprt_state_show() local
174 if (!(xprt && xprt->state)) { in rpc_sysfs_xprt_state_show()
177 locked = test_bit(XPRT_LOCKED, &xprt->state); in rpc_sysfs_xprt_state_show()
178 connected = test_bit(XPRT_CONNECTED, &xprt->state); in rpc_sysfs_xprt_state_show()
179 connecting = test_bit(XPRT_CONNECTING, &xprt->state); in rpc_sysfs_xprt_state_show()
180 close_wait = test_bit(XPRT_CLOSE_WAIT, &xprt->state); in rpc_sysfs_xprt_state_show()
181 bound = test_bit(XPRT_BOUND, &xprt->state); in rpc_sysfs_xprt_state_show()
182 binding = test_bit(XPRT_BINDING, &xprt->state); in rpc_sysfs_xprt_state_show()
183 closing = test_bit(XPRT_CLOSING, &xprt->state); in rpc_sysfs_xprt_state_show()
184 congested = test_bit(XPRT_CONGESTED, &xprt->state); in rpc_sysfs_xprt_state_show()
185 cwnd_wait = test_bit(XPRT_CWND_WAIT, &xprt->state); in rpc_sysfs_xprt_state_show()
186 write_space = test_bit(XPRT_WRITE_SPACE, &xprt->state); in rpc_sysfs_xprt_state_show()
187 offline = test_bit(XPRT_OFFLINE, &xprt->state); in rpc_sysfs_xprt_state_show()
188 remove = test_bit(XPRT_REMOVE, &xprt->state); in rpc_sysfs_xprt_state_show()
205 xprt_put(xprt); in rpc_sysfs_xprt_state_show()
232 struct rpc_xprt *xprt = rpc_sysfs_xprt_kobj_get_xprt(kobj); in rpc_sysfs_xprt_dstaddr_store() local
239 if (!xprt) in rpc_sysfs_xprt_dstaddr_store()
241 if (!(xprt->xprt_class->ident == XPRT_TRANSPORT_TCP || in rpc_sysfs_xprt_dstaddr_store()
242 xprt->xprt_class->ident == XPRT_TRANSPORT_RDMA)) { in rpc_sysfs_xprt_dstaddr_store()
243 xprt_put(xprt); in rpc_sysfs_xprt_dstaddr_store()
247 if (wait_on_bit_lock(&xprt->state, XPRT_LOCKED, TASK_KILLABLE)) { in rpc_sysfs_xprt_dstaddr_store()
251 saddr = (struct sockaddr *)&xprt->addr; in rpc_sysfs_xprt_dstaddr_store()
266 rcu_dereference_raw(xprt->address_strings[RPC_DISPLAY_ADDR]); in rpc_sysfs_xprt_dstaddr_store()
267 rcu_assign_pointer(xprt->address_strings[RPC_DISPLAY_ADDR], dst_addr); in rpc_sysfs_xprt_dstaddr_store()
269 xprt->addrlen = rpc_pton(xprt->xprt_net, buf, buf_len, saddr, in rpc_sysfs_xprt_dstaddr_store()
273 xprt_force_disconnect(xprt); in rpc_sysfs_xprt_dstaddr_store()
275 xprt_release_write(xprt, NULL); in rpc_sysfs_xprt_dstaddr_store()
277 xprt_put(xprt); in rpc_sysfs_xprt_dstaddr_store()
290 struct rpc_xprt *xprt = rpc_sysfs_xprt_kobj_get_xprt(kobj); in rpc_sysfs_xprt_state_change() local
294 if (!xprt || !xps) { in rpc_sysfs_xprt_state_change()
310 if (wait_on_bit_lock(&xprt->state, XPRT_LOCKED, TASK_KILLABLE)) { in rpc_sysfs_xprt_state_change()
314 if (xprt->main) { in rpc_sysfs_xprt_state_change()
319 xprt_set_offline_locked(xprt, xps); in rpc_sysfs_xprt_state_change()
321 xprt_set_online_locked(xprt, xps); in rpc_sysfs_xprt_state_change()
323 if (test_bit(XPRT_OFFLINE, &xprt->state)) in rpc_sysfs_xprt_state_change()
324 xprt_delete_locked(xprt, xps); in rpc_sysfs_xprt_state_change()
330 xprt_release_write(xprt, NULL); in rpc_sysfs_xprt_state_change()
332 xprt_put(xprt); in rpc_sysfs_xprt_state_change()
378 struct rpc_sysfs_xprt *xprt; in rpc_sysfs_xprt_release() local
380 xprt = container_of(kobj, struct rpc_sysfs_xprt, kobject); in rpc_sysfs_xprt_release()
381 kfree(xprt); in rpc_sysfs_xprt_release()
397 kobject)->xprt->xprt_net; in rpc_sysfs_xprt_namespace()
498 struct rpc_xprt *xprt, in rpc_sysfs_xprt_alloc() argument
508 parent, "xprt-%d-%s", xprt->id, in rpc_sysfs_xprt_alloc()
509 xprt->address_strings[RPC_DISPLAY_PROTO]) == 0) in rpc_sysfs_xprt_alloc()
546 struct rpc_xprt *xprt, in rpc_sysfs_xprt_switch_setup() argument
555 net = xprt->xprt_net; in rpc_sysfs_xprt_switch_setup()
562 rpc_xprt_switch->xprt = xprt; in rpc_sysfs_xprt_switch_setup()
570 struct rpc_xprt *xprt, in rpc_sysfs_xprt_setup() argument
580 rpc_xprt = rpc_sysfs_xprt_alloc(&switch_obj->kobject, xprt, gfp_flags); in rpc_sysfs_xprt_setup()
582 xprt->xprt_sysfs = rpc_xprt; in rpc_sysfs_xprt_setup()
583 rpc_xprt->xprt = xprt; in rpc_sysfs_xprt_setup()
616 void rpc_sysfs_xprt_destroy(struct rpc_xprt *xprt) in rpc_sysfs_xprt_destroy() argument
618 struct rpc_sysfs_xprt *rpc_xprt = xprt->xprt_sysfs; in rpc_sysfs_xprt_destroy()
624 xprt->xprt_sysfs = NULL; in rpc_sysfs_xprt_destroy()