]> git.baikalelectronics.ru Git - kernel.git/commit
9p: implement proper trans module refcounting and unregistration
authorTejun Heo <tj@kernel.org>
Wed, 24 Sep 2008 21:22:23 +0000 (16:22 -0500)
committerEric Van Hensbergen <ericvh@ericvh-desktop.austin.ibm.com>
Wed, 24 Sep 2008 21:22:23 +0000 (16:22 -0500)
commit1381c8bc244651a1d9b0a8a67befa8d8ffdca37d
treeef8948240b0aff2a366136a8303afc70e6c84da8
parent0815e04c04a472e1434df395a3b53d861f8d5e3f
9p: implement proper trans module refcounting and unregistration

9p trans modules aren't refcounted nor were they unregistered
properly.  Fix it.

* Add 9p_trans_module->owner and reference the module on each trans
  instance creation and put it on destruction.

* Protect v9fs_trans_list with a spinlock.  This isn't strictly
  necessary as the list is manipulated only during module loading /
  unloading but it's a good idea to make the API safe.

* Unregister trans modules when the corresponding module is being
  unloaded.

* While at it, kill unnecessary EXPORT_SYMBOL on p9_trans_fd_init().

Signed-off-by: Tejun Heo <tj@kernel.org>
Signed-off-by: Eric Van Hensbergen <ericvh@gmail.com>
include/net/9p/9p.h
include/net/9p/transport.h
net/9p/client.c
net/9p/mod.c
net/9p/trans_fd.c
net/9p/trans_virtio.c