blob: 2fbaba27d5c69a3b3bde324b05d56b9cff0f6ceb [file] [log] [blame]
Olga Kornievskaia74678742021-06-08 15:59:10 -04001// SPDX-License-Identifier: GPL-2.0
2/*
3 * Copyright (c) 2020 Anna Schumaker <Anna.Schumaker@Netapp.com>
4 */
Olga Kornievskaiac441f122021-06-08 15:59:11 -04005#include <linux/sunrpc/clnt.h>
Olga Kornievskaia74678742021-06-08 15:59:10 -04006#include <linux/kobject.h>
Olga Kornievskaia587bc722021-06-08 15:59:19 -04007#include <linux/sunrpc/addr.h>
8
Olga Kornievskaiac5a382e2021-06-08 15:59:12 -04009#include "sysfs.h"
Olga Kornievskaia74678742021-06-08 15:59:10 -040010
Olga Kornievskaia587bc722021-06-08 15:59:19 -040011struct xprt_addr {
12 const char *addr;
13 struct rcu_head rcu;
14};
15
16static void free_xprt_addr(struct rcu_head *head)
17{
18 struct xprt_addr *addr = container_of(head, struct xprt_addr, rcu);
19
20 kfree(addr->addr);
21 kfree(addr);
22}
23
Olga Kornievskaia74678742021-06-08 15:59:10 -040024static struct kset *rpc_sunrpc_kset;
Olga Kornievskaiabaea9942021-06-08 15:59:16 -040025static struct kobject *rpc_sunrpc_client_kobj, *rpc_sunrpc_xprt_switch_kobj;
Olga Kornievskaiac441f122021-06-08 15:59:11 -040026
27static void rpc_sysfs_object_release(struct kobject *kobj)
28{
29 kfree(kobj);
30}
31
32static const struct kobj_ns_type_operations *
33rpc_sysfs_object_child_ns_type(struct kobject *kobj)
34{
35 return &net_ns_type_operations;
36}
37
38static struct kobj_type rpc_sysfs_object_type = {
39 .release = rpc_sysfs_object_release,
40 .sysfs_ops = &kobj_sysfs_ops,
41 .child_ns_type = rpc_sysfs_object_child_ns_type,
42};
43
44static struct kobject *rpc_sysfs_object_alloc(const char *name,
45 struct kset *kset,
46 struct kobject *parent)
47{
48 struct kobject *kobj;
49
50 kobj = kzalloc(sizeof(*kobj), GFP_KERNEL);
51 if (kobj) {
52 kobj->kset = kset;
53 if (kobject_init_and_add(kobj, &rpc_sysfs_object_type,
54 parent, "%s", name) == 0)
55 return kobj;
56 kobject_put(kobj);
57 }
58 return NULL;
59}
Olga Kornievskaia74678742021-06-08 15:59:10 -040060
Olga Kornievskaia587bc722021-06-08 15:59:19 -040061static inline struct rpc_xprt *
62rpc_sysfs_xprt_kobj_get_xprt(struct kobject *kobj)
63{
64 struct rpc_sysfs_xprt *x = container_of(kobj,
65 struct rpc_sysfs_xprt, kobject);
66
67 return xprt_get(x->xprt);
68}
69
Olga Kornievskaia0e559032021-06-08 15:59:21 -040070static inline struct rpc_xprt_switch *
71rpc_sysfs_xprt_switch_kobj_get_xprt(struct kobject *kobj)
72{
73 struct rpc_sysfs_xprt_switch *x = container_of(kobj,
74 struct rpc_sysfs_xprt_switch, kobject);
75
76 return xprt_switch_get(x->xprt_switch);
77}
78
Olga Kornievskaia587bc722021-06-08 15:59:19 -040079static ssize_t rpc_sysfs_xprt_dstaddr_show(struct kobject *kobj,
80 struct kobj_attribute *attr,
81 char *buf)
82{
83 struct rpc_xprt *xprt = rpc_sysfs_xprt_kobj_get_xprt(kobj);
84 ssize_t ret;
85
86 if (!xprt)
87 return 0;
88 ret = sprintf(buf, "%s\n", xprt->address_strings[RPC_DISPLAY_ADDR]);
89 xprt_put(xprt);
90 return ret + 1;
91}
92
Olga Kornievskaia4a096512021-06-08 15:59:20 -040093static ssize_t rpc_sysfs_xprt_info_show(struct kobject *kobj,
94 struct kobj_attribute *attr,
95 char *buf)
96{
97 struct rpc_xprt *xprt = rpc_sysfs_xprt_kobj_get_xprt(kobj);
98 ssize_t ret;
99
100 if (!xprt)
101 return 0;
102
103 ret = sprintf(buf, "last_used=%lu\ncur_cong=%lu\ncong_win=%lu\n"
104 "max_num_slots=%u\nmin_num_slots=%u\nnum_reqs=%u\n"
105 "binding_q_len=%u\nsending_q_len=%u\npending_q_len=%u\n"
106 "backlog_q_len=%u\n", xprt->last_used, xprt->cong,
107 xprt->cwnd, xprt->max_reqs, xprt->min_reqs,
108 xprt->num_reqs, xprt->binding.qlen, xprt->sending.qlen,
109 xprt->pending.qlen, xprt->backlog.qlen);
110 xprt_put(xprt);
111 return ret + 1;
112}
113
Olga Kornievskaia681d5692021-06-08 15:59:22 -0400114static ssize_t rpc_sysfs_xprt_state_show(struct kobject *kobj,
115 struct kobj_attribute *attr,
116 char *buf)
117{
118 struct rpc_xprt *xprt = rpc_sysfs_xprt_kobj_get_xprt(kobj);
119 ssize_t ret;
120 int locked, connected, connecting, close_wait, bound, binding,
121 closing, congested, cwnd_wait, write_space;
122
123 if (!xprt)
124 return 0;
125
126 if (!xprt->state) {
127 ret = sprintf(buf, "state=CLOSED\n");
128 } else {
129 locked = test_bit(XPRT_LOCKED, &xprt->state);
130 connected = test_bit(XPRT_CONNECTED, &xprt->state);
131 connecting = test_bit(XPRT_CONNECTING, &xprt->state);
132 close_wait = test_bit(XPRT_CLOSE_WAIT, &xprt->state);
133 bound = test_bit(XPRT_BOUND, &xprt->state);
134 binding = test_bit(XPRT_BINDING, &xprt->state);
135 closing = test_bit(XPRT_CLOSING, &xprt->state);
136 congested = test_bit(XPRT_CONGESTED, &xprt->state);
137 cwnd_wait = test_bit(XPRT_CWND_WAIT, &xprt->state);
138 write_space = test_bit(XPRT_WRITE_SPACE, &xprt->state);
139
140 ret = sprintf(buf, "state=%s %s %s %s %s %s %s %s %s %s\n",
141 locked ? "LOCKED" : "",
142 connected ? "CONNECTED" : "",
143 connecting ? "CONNECTING" : "",
144 close_wait ? "CLOSE_WAIT" : "",
145 bound ? "BOUND" : "",
146 binding ? "BOUNDING" : "",
147 closing ? "CLOSING" : "",
148 congested ? "CONGESTED" : "",
149 cwnd_wait ? "CWND_WAIT" : "",
150 write_space ? "WRITE_SPACE" : "");
151 }
152
153 xprt_put(xprt);
154 return ret + 1;
155}
156
Olga Kornievskaia0e559032021-06-08 15:59:21 -0400157static ssize_t rpc_sysfs_xprt_switch_info_show(struct kobject *kobj,
158 struct kobj_attribute *attr,
159 char *buf)
160{
161 struct rpc_xprt_switch *xprt_switch =
162 rpc_sysfs_xprt_switch_kobj_get_xprt(kobj);
163 ssize_t ret;
164
165 if (!xprt_switch)
166 return 0;
167 ret = sprintf(buf, "num_xprts=%u\nnum_active=%u\nqueue_len=%ld\n",
168 xprt_switch->xps_nxprts, xprt_switch->xps_nactive,
169 atomic_long_read(&xprt_switch->xps_queuelen));
170 xprt_switch_put(xprt_switch);
171 return ret + 1;
172}
173
Olga Kornievskaia587bc722021-06-08 15:59:19 -0400174static ssize_t rpc_sysfs_xprt_dstaddr_store(struct kobject *kobj,
175 struct kobj_attribute *attr,
176 const char *buf, size_t count)
177{
178 struct rpc_xprt *xprt = rpc_sysfs_xprt_kobj_get_xprt(kobj);
179 struct sockaddr *saddr;
180 char *dst_addr;
181 int port;
182 struct xprt_addr *saved_addr;
183 size_t buf_len;
184
185 if (!xprt)
186 return 0;
187 if (!(xprt->xprt_class->ident == XPRT_TRANSPORT_TCP ||
188 xprt->xprt_class->ident == XPRT_TRANSPORT_RDMA)) {
189 xprt_put(xprt);
190 return -EOPNOTSUPP;
191 }
192
193 if (wait_on_bit_lock(&xprt->state, XPRT_LOCKED, TASK_KILLABLE)) {
194 count = -EINTR;
195 goto out_put;
196 }
197 saddr = (struct sockaddr *)&xprt->addr;
198 port = rpc_get_port(saddr);
199
200 /* buf_len is the len until the first occurence of either
201 * '\n' or '\0'
202 */
203 buf_len = strcspn(buf, "\n");
204
205 dst_addr = kstrndup(buf, buf_len, GFP_KERNEL);
206 if (!dst_addr)
207 goto out_err;
208 saved_addr = kzalloc(sizeof(*saved_addr), GFP_KERNEL);
209 if (!saved_addr)
210 goto out_err_free;
211 saved_addr->addr =
212 rcu_dereference_raw(xprt->address_strings[RPC_DISPLAY_ADDR]);
213 rcu_assign_pointer(xprt->address_strings[RPC_DISPLAY_ADDR], dst_addr);
214 call_rcu(&saved_addr->rcu, free_xprt_addr);
215 xprt->addrlen = rpc_pton(xprt->xprt_net, buf, buf_len, saddr,
216 sizeof(*saddr));
217 rpc_set_port(saddr, port);
218
219 xprt_force_disconnect(xprt);
220out:
221 xprt_release_write(xprt, NULL);
222out_put:
223 xprt_put(xprt);
224 return count;
225out_err_free:
226 kfree(dst_addr);
227out_err:
228 count = -ENOMEM;
229 goto out;
230}
231
Olga Kornievskaia74678742021-06-08 15:59:10 -0400232int rpc_sysfs_init(void)
233{
234 rpc_sunrpc_kset = kset_create_and_add("sunrpc", NULL, kernel_kobj);
235 if (!rpc_sunrpc_kset)
236 return -ENOMEM;
Olga Kornievskaiabaea9942021-06-08 15:59:16 -0400237 rpc_sunrpc_client_kobj =
238 rpc_sysfs_object_alloc("rpc-clients", rpc_sunrpc_kset, NULL);
239 if (!rpc_sunrpc_client_kobj)
240 goto err_client;
241 rpc_sunrpc_xprt_switch_kobj =
242 rpc_sysfs_object_alloc("xprt-switches", rpc_sunrpc_kset, NULL);
243 if (!rpc_sunrpc_xprt_switch_kobj)
244 goto err_switch;
Olga Kornievskaia74678742021-06-08 15:59:10 -0400245 return 0;
Olga Kornievskaiabaea9942021-06-08 15:59:16 -0400246err_switch:
247 kobject_put(rpc_sunrpc_client_kobj);
248 rpc_sunrpc_client_kobj = NULL;
249err_client:
250 kset_unregister(rpc_sunrpc_kset);
251 rpc_sunrpc_kset = NULL;
252 return -ENOMEM;
Olga Kornievskaia74678742021-06-08 15:59:10 -0400253}
254
Olga Kornievskaiac5a382e2021-06-08 15:59:12 -0400255static void rpc_sysfs_client_release(struct kobject *kobj)
256{
257 struct rpc_sysfs_client *c;
258
259 c = container_of(kobj, struct rpc_sysfs_client, kobject);
260 kfree(c);
261}
262
Olga Kornievskaiabaea9942021-06-08 15:59:16 -0400263static void rpc_sysfs_xprt_switch_release(struct kobject *kobj)
264{
265 struct rpc_sysfs_xprt_switch *xprt_switch;
266
267 xprt_switch = container_of(kobj, struct rpc_sysfs_xprt_switch, kobject);
268 kfree(xprt_switch);
269}
270
Olga Kornievskaiad408ebe2021-06-08 15:59:18 -0400271static void rpc_sysfs_xprt_release(struct kobject *kobj)
272{
273 struct rpc_sysfs_xprt *xprt;
274
275 xprt = container_of(kobj, struct rpc_sysfs_xprt, kobject);
276 kfree(xprt);
277}
278
Olga Kornievskaiac5a382e2021-06-08 15:59:12 -0400279static const void *rpc_sysfs_client_namespace(struct kobject *kobj)
280{
281 return container_of(kobj, struct rpc_sysfs_client, kobject)->net;
282}
283
Olga Kornievskaiabaea9942021-06-08 15:59:16 -0400284static const void *rpc_sysfs_xprt_switch_namespace(struct kobject *kobj)
285{
286 return container_of(kobj, struct rpc_sysfs_xprt_switch, kobject)->net;
287}
288
Olga Kornievskaiad408ebe2021-06-08 15:59:18 -0400289static const void *rpc_sysfs_xprt_namespace(struct kobject *kobj)
290{
291 return container_of(kobj, struct rpc_sysfs_xprt,
292 kobject)->xprt->xprt_net;
293}
294
Olga Kornievskaia587bc722021-06-08 15:59:19 -0400295static struct kobj_attribute rpc_sysfs_xprt_dstaddr = __ATTR(dstaddr,
296 0644, rpc_sysfs_xprt_dstaddr_show, rpc_sysfs_xprt_dstaddr_store);
297
Olga Kornievskaia4a096512021-06-08 15:59:20 -0400298static struct kobj_attribute rpc_sysfs_xprt_info = __ATTR(xprt_info,
299 0444, rpc_sysfs_xprt_info_show, NULL);
300
Olga Kornievskaia681d5692021-06-08 15:59:22 -0400301static struct kobj_attribute rpc_sysfs_xprt_change_state = __ATTR(xprt_state,
302 0644, rpc_sysfs_xprt_state_show, NULL);
303
Olga Kornievskaia587bc722021-06-08 15:59:19 -0400304static struct attribute *rpc_sysfs_xprt_attrs[] = {
305 &rpc_sysfs_xprt_dstaddr.attr,
Olga Kornievskaia4a096512021-06-08 15:59:20 -0400306 &rpc_sysfs_xprt_info.attr,
Olga Kornievskaia681d5692021-06-08 15:59:22 -0400307 &rpc_sysfs_xprt_change_state.attr,
Olga Kornievskaia587bc722021-06-08 15:59:19 -0400308 NULL,
309};
310
Olga Kornievskaia0e559032021-06-08 15:59:21 -0400311static struct kobj_attribute rpc_sysfs_xprt_switch_info =
312 __ATTR(xprt_switch_info, 0444, rpc_sysfs_xprt_switch_info_show, NULL);
313
314static struct attribute *rpc_sysfs_xprt_switch_attrs[] = {
315 &rpc_sysfs_xprt_switch_info.attr,
316 NULL,
317};
318
Olga Kornievskaiac5a382e2021-06-08 15:59:12 -0400319static struct kobj_type rpc_sysfs_client_type = {
320 .release = rpc_sysfs_client_release,
321 .sysfs_ops = &kobj_sysfs_ops,
322 .namespace = rpc_sysfs_client_namespace,
323};
324
Olga Kornievskaiabaea9942021-06-08 15:59:16 -0400325static struct kobj_type rpc_sysfs_xprt_switch_type = {
326 .release = rpc_sysfs_xprt_switch_release,
Olga Kornievskaia0e559032021-06-08 15:59:21 -0400327 .default_attrs = rpc_sysfs_xprt_switch_attrs,
Olga Kornievskaiabaea9942021-06-08 15:59:16 -0400328 .sysfs_ops = &kobj_sysfs_ops,
329 .namespace = rpc_sysfs_xprt_switch_namespace,
330};
331
Olga Kornievskaiad408ebe2021-06-08 15:59:18 -0400332static struct kobj_type rpc_sysfs_xprt_type = {
333 .release = rpc_sysfs_xprt_release,
Olga Kornievskaia587bc722021-06-08 15:59:19 -0400334 .default_attrs = rpc_sysfs_xprt_attrs,
Olga Kornievskaiad408ebe2021-06-08 15:59:18 -0400335 .sysfs_ops = &kobj_sysfs_ops,
336 .namespace = rpc_sysfs_xprt_namespace,
337};
338
Olga Kornievskaia74678742021-06-08 15:59:10 -0400339void rpc_sysfs_exit(void)
340{
Olga Kornievskaiac441f122021-06-08 15:59:11 -0400341 kobject_put(rpc_sunrpc_client_kobj);
Olga Kornievskaiabaea9942021-06-08 15:59:16 -0400342 kobject_put(rpc_sunrpc_xprt_switch_kobj);
Olga Kornievskaia74678742021-06-08 15:59:10 -0400343 kset_unregister(rpc_sunrpc_kset);
344}
Olga Kornievskaiac5a382e2021-06-08 15:59:12 -0400345
346static struct rpc_sysfs_client *rpc_sysfs_client_alloc(struct kobject *parent,
347 struct net *net,
348 int clid)
349{
350 struct rpc_sysfs_client *p;
351
352 p = kzalloc(sizeof(*p), GFP_KERNEL);
353 if (p) {
354 p->net = net;
355 p->kobject.kset = rpc_sunrpc_kset;
356 if (kobject_init_and_add(&p->kobject, &rpc_sysfs_client_type,
357 parent, "clnt-%d", clid) == 0)
358 return p;
359 kobject_put(&p->kobject);
360 }
361 return NULL;
362}
363
Olga Kornievskaiabaea9942021-06-08 15:59:16 -0400364static struct rpc_sysfs_xprt_switch *
365rpc_sysfs_xprt_switch_alloc(struct kobject *parent,
366 struct rpc_xprt_switch *xprt_switch,
367 struct net *net,
368 gfp_t gfp_flags)
369{
370 struct rpc_sysfs_xprt_switch *p;
371
372 p = kzalloc(sizeof(*p), gfp_flags);
373 if (p) {
374 p->net = net;
375 p->kobject.kset = rpc_sunrpc_kset;
376 if (kobject_init_and_add(&p->kobject,
377 &rpc_sysfs_xprt_switch_type,
378 parent, "switch-%d",
379 xprt_switch->xps_id) == 0)
380 return p;
381 kobject_put(&p->kobject);
382 }
383 return NULL;
384}
385
Olga Kornievskaiad408ebe2021-06-08 15:59:18 -0400386static struct rpc_sysfs_xprt *rpc_sysfs_xprt_alloc(struct kobject *parent,
387 struct rpc_xprt *xprt,
388 gfp_t gfp_flags)
389{
390 struct rpc_sysfs_xprt *p;
391
392 p = kzalloc(sizeof(*p), gfp_flags);
393 if (!p)
394 goto out;
395 p->kobject.kset = rpc_sunrpc_kset;
396 if (kobject_init_and_add(&p->kobject, &rpc_sysfs_xprt_type,
397 parent, "xprt-%d-%s", xprt->id,
398 xprt->address_strings[RPC_DISPLAY_PROTO]) == 0)
399 return p;
400 kobject_put(&p->kobject);
401out:
402 return NULL;
403}
404
Olga Kornievskaia2a338a52021-06-08 15:59:17 -0400405void rpc_sysfs_client_setup(struct rpc_clnt *clnt,
406 struct rpc_xprt_switch *xprt_switch,
407 struct net *net)
Olga Kornievskaiac5a382e2021-06-08 15:59:12 -0400408{
409 struct rpc_sysfs_client *rpc_client;
410
Olga Kornievskaia2a338a52021-06-08 15:59:17 -0400411 rpc_client = rpc_sysfs_client_alloc(rpc_sunrpc_client_kobj,
412 net, clnt->cl_clid);
Olga Kornievskaiac5a382e2021-06-08 15:59:12 -0400413 if (rpc_client) {
Olga Kornievskaia2a338a52021-06-08 15:59:17 -0400414 char name[] = "switch";
415 struct rpc_sysfs_xprt_switch *xswitch =
416 (struct rpc_sysfs_xprt_switch *)xprt_switch->xps_sysfs;
417 int ret;
418
Olga Kornievskaiac5a382e2021-06-08 15:59:12 -0400419 clnt->cl_sysfs = rpc_client;
Olga Kornievskaia2a338a52021-06-08 15:59:17 -0400420 rpc_client->clnt = clnt;
421 rpc_client->xprt_switch = xprt_switch;
Olga Kornievskaiac5a382e2021-06-08 15:59:12 -0400422 kobject_uevent(&rpc_client->kobject, KOBJ_ADD);
Olga Kornievskaia2a338a52021-06-08 15:59:17 -0400423 ret = sysfs_create_link_nowarn(&rpc_client->kobject,
424 &xswitch->kobject, name);
425 if (ret)
426 pr_warn("can't create link to %s in sysfs (%d)\n",
427 name, ret);
Olga Kornievskaiac5a382e2021-06-08 15:59:12 -0400428 }
429}
430
Olga Kornievskaiabaea9942021-06-08 15:59:16 -0400431void rpc_sysfs_xprt_switch_setup(struct rpc_xprt_switch *xprt_switch,
432 struct rpc_xprt *xprt,
433 gfp_t gfp_flags)
434{
435 struct rpc_sysfs_xprt_switch *rpc_xprt_switch;
436 struct net *net;
437
438 if (xprt_switch->xps_net)
439 net = xprt_switch->xps_net;
440 else
441 net = xprt->xprt_net;
442 rpc_xprt_switch =
443 rpc_sysfs_xprt_switch_alloc(rpc_sunrpc_xprt_switch_kobj,
444 xprt_switch, net, gfp_flags);
445 if (rpc_xprt_switch) {
446 xprt_switch->xps_sysfs = rpc_xprt_switch;
447 rpc_xprt_switch->xprt_switch = xprt_switch;
448 rpc_xprt_switch->xprt = xprt;
449 kobject_uevent(&rpc_xprt_switch->kobject, KOBJ_ADD);
450 }
451}
452
Olga Kornievskaiad408ebe2021-06-08 15:59:18 -0400453void rpc_sysfs_xprt_setup(struct rpc_xprt_switch *xprt_switch,
454 struct rpc_xprt *xprt,
455 gfp_t gfp_flags)
456{
457 struct rpc_sysfs_xprt *rpc_xprt;
458 struct rpc_sysfs_xprt_switch *switch_obj =
459 (struct rpc_sysfs_xprt_switch *)xprt_switch->xps_sysfs;
460
461 rpc_xprt = rpc_sysfs_xprt_alloc(&switch_obj->kobject, xprt, gfp_flags);
462 if (rpc_xprt) {
463 xprt->xprt_sysfs = rpc_xprt;
464 rpc_xprt->xprt = xprt;
465 kobject_uevent(&rpc_xprt->kobject, KOBJ_ADD);
466 }
467}
468
Olga Kornievskaiac5a382e2021-06-08 15:59:12 -0400469void rpc_sysfs_client_destroy(struct rpc_clnt *clnt)
470{
471 struct rpc_sysfs_client *rpc_client = clnt->cl_sysfs;
472
473 if (rpc_client) {
Olga Kornievskaia2a338a52021-06-08 15:59:17 -0400474 char name[] = "switch";
475
476 sysfs_remove_link(&rpc_client->kobject, name);
Olga Kornievskaiac5a382e2021-06-08 15:59:12 -0400477 kobject_uevent(&rpc_client->kobject, KOBJ_REMOVE);
478 kobject_del(&rpc_client->kobject);
479 kobject_put(&rpc_client->kobject);
480 clnt->cl_sysfs = NULL;
481 }
482}
Olga Kornievskaiabaea9942021-06-08 15:59:16 -0400483
484void rpc_sysfs_xprt_switch_destroy(struct rpc_xprt_switch *xprt_switch)
485{
486 struct rpc_sysfs_xprt_switch *rpc_xprt_switch = xprt_switch->xps_sysfs;
487
488 if (rpc_xprt_switch) {
489 kobject_uevent(&rpc_xprt_switch->kobject, KOBJ_REMOVE);
490 kobject_del(&rpc_xprt_switch->kobject);
491 kobject_put(&rpc_xprt_switch->kobject);
492 xprt_switch->xps_sysfs = NULL;
493 }
494}
Olga Kornievskaiad408ebe2021-06-08 15:59:18 -0400495
496void rpc_sysfs_xprt_destroy(struct rpc_xprt *xprt)
497{
498 struct rpc_sysfs_xprt *rpc_xprt = xprt->xprt_sysfs;
499
500 if (rpc_xprt) {
501 kobject_uevent(&rpc_xprt->kobject, KOBJ_REMOVE);
502 kobject_del(&rpc_xprt->kobject);
503 kobject_put(&rpc_xprt->kobject);
504 xprt->xprt_sysfs = NULL;
505 }
506}