sunrpc: add xprt_switch direcotry to sunrpc's sysfs
[linux-2.6-microblaze.git] / net / sunrpc / xprtmultipath.c
index 4969a4c..2d73a35 100644 (file)
@@ -19,6 +19,8 @@
 #include <linux/sunrpc/addr.h>
 #include <linux/sunrpc/xprtmultipath.h>
 
+#include "sysfs.h"
+
 typedef struct rpc_xprt *(*xprt_switch_find_xprt_t)(struct rpc_xprt_switch *xps,
                const struct rpc_xprt *cur);
 
@@ -133,6 +135,7 @@ struct rpc_xprt_switch *xprt_switch_alloc(struct rpc_xprt *xprt,
                xps->xps_net = NULL;
                INIT_LIST_HEAD(&xps->xps_xprt_list);
                xps->xps_iter_ops = &rpc_xprt_iter_singular;
+               rpc_sysfs_xprt_switch_setup(xps, xprt, gfp_flags);
                xprt_switch_add_xprt_locked(xps, xprt);
        }
 
@@ -161,6 +164,7 @@ static void xprt_switch_free(struct kref *kref)
                        struct rpc_xprt_switch, xps_kref);
 
        xprt_switch_free_entries(xps);
+       rpc_sysfs_xprt_switch_destroy(xps);
        xprt_switch_free_id(xps);
        kfree_rcu(xps, xps_rcu);
 }