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_TCP_TLS || in rpc_sysfs_xprt_dstaddr_store()
243 xprt->xprt_class->ident == XPRT_TRANSPORT_RDMA)) { in rpc_sysfs_xprt_dstaddr_store()
244 xprt_put(xprt); in rpc_sysfs_xprt_dstaddr_store()
248 if (wait_on_bit_lock(&xprt->state, XPRT_LOCKED, TASK_KILLABLE)) { in rpc_sysfs_xprt_dstaddr_store()
252 saddr = (struct sockaddr *)&xprt->addr; in rpc_sysfs_xprt_dstaddr_store()
267 rcu_dereference_raw(xprt->address_strings[RPC_DISPLAY_ADDR]); in rpc_sysfs_xprt_dstaddr_store()
268 rcu_assign_pointer(xprt->address_strings[RPC_DISPLAY_ADDR], dst_addr); in rpc_sysfs_xprt_dstaddr_store()
270 xprt->addrlen = rpc_pton(xprt->xprt_net, buf, buf_len, saddr, in rpc_sysfs_xprt_dstaddr_store()
274 xprt_force_disconnect(xprt); in rpc_sysfs_xprt_dstaddr_store()
276 xprt_release_write(xprt, NULL); in rpc_sysfs_xprt_dstaddr_store()
278 xprt_put(xprt); in rpc_sysfs_xprt_dstaddr_store()
291 struct rpc_xprt *xprt = rpc_sysfs_xprt_kobj_get_xprt(kobj); in rpc_sysfs_xprt_state_change() local
295 if (!xprt || !xps) { in rpc_sysfs_xprt_state_change()
311 if (wait_on_bit_lock(&xprt->state, XPRT_LOCKED, TASK_KILLABLE)) { in rpc_sysfs_xprt_state_change()
315 if (xprt->main) { in rpc_sysfs_xprt_state_change()
320 xprt_set_offline_locked(xprt, xps); in rpc_sysfs_xprt_state_change()
322 xprt_set_online_locked(xprt, xps); in rpc_sysfs_xprt_state_change()
324 if (test_bit(XPRT_OFFLINE, &xprt->state)) in rpc_sysfs_xprt_state_change()
325 xprt_delete_locked(xprt, xps); in rpc_sysfs_xprt_state_change()
331 xprt_release_write(xprt, NULL); in rpc_sysfs_xprt_state_change()
333 xprt_put(xprt); in rpc_sysfs_xprt_state_change()
379 struct rpc_sysfs_xprt *xprt; in rpc_sysfs_xprt_release() local
381 xprt = container_of(kobj, struct rpc_sysfs_xprt, kobject); in rpc_sysfs_xprt_release()
382 kfree(xprt); in rpc_sysfs_xprt_release()
398 kobject)->xprt->xprt_net; in rpc_sysfs_xprt_namespace()
499 struct rpc_xprt *xprt, in rpc_sysfs_xprt_alloc() argument
509 parent, "xprt-%d-%s", xprt->id, in rpc_sysfs_xprt_alloc()
510 xprt->address_strings[RPC_DISPLAY_PROTO]) == 0) in rpc_sysfs_xprt_alloc()
547 struct rpc_xprt *xprt, in rpc_sysfs_xprt_switch_setup() argument
556 net = xprt->xprt_net; in rpc_sysfs_xprt_switch_setup()
563 rpc_xprt_switch->xprt = xprt; in rpc_sysfs_xprt_switch_setup()
571 struct rpc_xprt *xprt, in rpc_sysfs_xprt_setup() argument
581 rpc_xprt = rpc_sysfs_xprt_alloc(&switch_obj->kobject, xprt, gfp_flags); in rpc_sysfs_xprt_setup()
583 xprt->xprt_sysfs = rpc_xprt; in rpc_sysfs_xprt_setup()
584 rpc_xprt->xprt = xprt; in rpc_sysfs_xprt_setup()
617 void rpc_sysfs_xprt_destroy(struct rpc_xprt *xprt) in rpc_sysfs_xprt_destroy() argument
619 struct rpc_sysfs_xprt *rpc_xprt = xprt->xprt_sysfs; in rpc_sysfs_xprt_destroy()
625 xprt->xprt_sysfs = NULL; in rpc_sysfs_xprt_destroy()