File tree Expand file tree Collapse file tree 5 files changed +33
-6
lines changed Expand file tree Collapse file tree 5 files changed +33
-6
lines changed Original file line number Diff line number Diff line change 11
11
#ifndef NET_9P_TRANSPORT_H
12
12
#define NET_9P_TRANSPORT_H
13
13
14
+ #include <linux/module.h>
15
+
14
16
#define P9_DEF_MIN_RESVPORT (665U)
15
17
#define P9_DEF_MAX_RESVPORT (1023U)
16
18
@@ -55,4 +57,8 @@ void v9fs_unregister_trans(struct p9_trans_module *m);
55
57
struct p9_trans_module * v9fs_get_trans_by_name (char * s );
56
58
struct p9_trans_module * v9fs_get_default_trans (void );
57
59
void v9fs_put_trans (struct p9_trans_module * m );
60
+
61
+ #define MODULE_ALIAS_9P (transport ) \
62
+ MODULE_ALIAS("9p-" transport)
63
+
58
64
#endif /* NET_9P_TRANSPORT_H */
Original file line number Diff line number Diff line change 12
12
#define pr_fmt (fmt ) KBUILD_MODNAME ": " fmt
13
13
14
14
#include <linux/module.h>
15
+ #include <linux/kmod.h>
15
16
#include <linux/errno.h>
16
17
#include <linux/sched.h>
17
18
#include <linux/moduleparam.h>
@@ -87,12 +88,7 @@ void v9fs_unregister_trans(struct p9_trans_module *m)
87
88
}
88
89
EXPORT_SYMBOL (v9fs_unregister_trans );
89
90
90
- /**
91
- * v9fs_get_trans_by_name - get transport with the matching name
92
- * @s: string identifying transport
93
- *
94
- */
95
- struct p9_trans_module * v9fs_get_trans_by_name (char * s )
91
+ static struct p9_trans_module * _p9_get_trans_by_name (char * s )
96
92
{
97
93
struct p9_trans_module * t , * found = NULL ;
98
94
@@ -106,6 +102,28 @@ struct p9_trans_module *v9fs_get_trans_by_name(char *s)
106
102
}
107
103
108
104
spin_unlock (& v9fs_trans_lock );
105
+
106
+ return found ;
107
+ }
108
+
109
+ /**
110
+ * v9fs_get_trans_by_name - get transport with the matching name
111
+ * @s: string identifying transport
112
+ *
113
+ */
114
+ struct p9_trans_module * v9fs_get_trans_by_name (char * s )
115
+ {
116
+ struct p9_trans_module * found = NULL ;
117
+
118
+ found = _p9_get_trans_by_name (s );
119
+
120
+ #ifdef CONFIG_MODULES
121
+ if (!found ) {
122
+ request_module ("9p-%s" , s );
123
+ found = _p9_get_trans_by_name (s );
124
+ }
125
+ #endif
126
+
109
127
return found ;
110
128
}
111
129
EXPORT_SYMBOL (v9fs_get_trans_by_name );
Original file line number Diff line number Diff line change @@ -767,6 +767,7 @@ static void __exit p9_trans_rdma_exit(void)
767
767
768
768
module_init (p9_trans_rdma_init );
769
769
module_exit (p9_trans_rdma_exit );
770
+ MODULE_ALIAS_9P ("rdma" );
770
771
771
772
MODULE_AUTHOR (
"Tom Tucker <[email protected] >" );
772
773
MODULE_DESCRIPTION ("RDMA Transport for 9P" );
Original file line number Diff line number Diff line change @@ -794,6 +794,7 @@ static void __exit p9_virtio_cleanup(void)
794
794
795
795
module_init (p9_virtio_init );
796
796
module_exit (p9_virtio_cleanup );
797
+ MODULE_ALIAS_9P ("virtio" );
797
798
798
799
MODULE_DEVICE_TABLE (virtio , id_table );
799
800
MODULE_AUTHOR (
"Eric Van Hensbergen <[email protected] >" );
Original file line number Diff line number Diff line change @@ -552,6 +552,7 @@ static int p9_trans_xen_init(void)
552
552
return rc ;
553
553
}
554
554
module_init (p9_trans_xen_init );
555
+ MODULE_ALIAS_9P ("xen" );
555
556
556
557
static void p9_trans_xen_exit (void )
557
558
{
You can’t perform that action at this time.
0 commit comments