vsock: Make transport the proto owner

Right now the core vsock module is the owner of the proto family. This
means there's nothing preventing the transport module from unloading if
there are open sockets, which results in a panic. Fix that by allowing
the transport to be the owner, which will refcount it properly.

Includes version bump to 1.0.1.0-k

Passes checkpatch this time, I swear...

Acked-by: Dmitry Torokhov <dtor@vmware.com>
Signed-off-by: Andy King <acking@vmware.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
Andy King
2014-05-01 15:20:43 -07:00
committed by David S. Miller
parent b8dff4e60c
commit 2c4a336e0a
2 changed files with 27 additions and 26 deletions

View File

@@ -155,7 +155,11 @@ struct vsock_transport {
/**** CORE ****/
int vsock_core_init(const struct vsock_transport *t);
int __vsock_core_init(const struct vsock_transport *t, struct module *owner);
static inline int vsock_core_init(const struct vsock_transport *t)
{
return __vsock_core_init(t, THIS_MODULE);
}
void vsock_core_exit(void);
/**** UTILS ****/