aboutsummaryrefslogtreecommitdiffstats
path: root/net/9p/trans_virtio.c
Commit message (Collapse)AuthorAge
* 9p: implement proper trans module refcounting and unregistrationTejun Heo2008-09-24
| | | | | | | | | | | | | | | | | | | | | 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>
* 9p: fix flags length in netSteven Rostedt2008-05-14
| | | | | | | | | | | | Some files in the net/9p directory uses "int" for flags. This can cause hard to find bugs on some architectures. This patch converts the flags to use "long" instead. This bug was discovered by doing an allyesconfig make on the -rt kernel where checks are done to ensure all flags are of size sizeof(long). Signed-off-by: Steven Rostedt <srostedt@redhat.com> Acked-by: Eric Van Hensbergen <ericvh@gmail.com>
* 9p: use struct mutex instead of struct semaphoreJosef 'Jeff' Sipek2008-05-14
| | | | | | | Replace semaphores protecting use flags with a mutex. Signed-off-by: Josef 'Jeff' Sipek <jeffpc@josefsipek.net> Acked-by: Eric Van Hensbergen <ericvh@gmail.com>
* 9p: Documentation updatesEric Van Hensbergen2008-05-14
| | | | | | | | The kernel-doc comments of much of the 9p system have been in disarray since reorganization. This patch fixes those problems, adds additional documentation and a template book which collects the 9p information. Signed-off-by: Eric Van Hensbergen <ericvh@gmail.com>
* net/9p/trans_virtio.c: kmalloc() enough memoryAdrian Bunk2008-02-19
| | | | | | | | The Coverity checker spotted that less memory than required was allocated. Signed-off-by: Adrian Bunk <bunk@kernel.org> Signed-off-by: David S. Miller <davem@davemloft.net>
* net/9p/trans_virtio.c: Use BUG_ONJulia Lawall2008-02-17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | if (...) BUG(); should be replaced with BUG_ON(...) when the test has no side-effects to allow a definition of BUG_ON that drops the code completely. The semantic patch that makes this change is as follows: (http://www.emn.fr/x-info/coccinelle/) // <smpl> @ disable unlikely @ expression E,f; @@ ( if (<... f(...) ...>) { BUG(); } | - if (unlikely(E)) { BUG(); } + BUG_ON(E); ) @@ expression E,f; @@ ( if (<... f(...) ...>) { BUG(); } | - if (E) { BUG(); } + BUG_ON(E); ) // </smpl> Signed-off-by: Julia Lawall <julia@diku.dk> Signed-off-by: David S. Miller <davem@davemloft.net>
* 9p: transport API reorganizationEric Van Hensbergen2008-02-06
| | | | | | | | | | This merges the mux.c (including the connection interface) with trans_fd in preparation for transport API changes. Ultimately, trans_fd will need to be rewritten to clean it up and simplify the implementation, but this reorganization is viewed as the first step. Signed-off-by: Eric Van Hensbergen <ericvh@gmail.com>
* 9p: add remove function to trans_virtioEric Van Hensbergen2008-02-06
| | | | | | | | | | | Request from rusty: Just cleaning up patches for 2.6.25 merge, and noticed that net/9p/trans_virtio.c doesn't have a remove function. This will crash when removing the module (console doesn't have one because it can't really be removed). Signed-off-by: Eric Van Hensbergen <ericvh@gmail.com>
* 9p: Fix soft lockup in virtio transportEric Van Hensbergen2008-02-06
| | | | | | | | This fixes a poorly placed spinlock which could result in a soft lockup condition. Signed-off-by: Eric Van Hensbergen <ericvh@gmail.com>
* 9p: block-based virtio clientEric Van Hensbergen2008-02-06
| | | | | | | | This replaces the console-based virto client with a block-based client using a single request queue. Signed-off-by: Eric Van Hensbergen <ericvh@gmail.com>
* virtio: explicit enable_cb/disable_cb rather than callback return.Rusty Russell2008-02-04
| | | | | | | | | | It seems that virtio_net wants to disable callbacks (interrupts) before calling netif_rx_schedule(), so we can't use the return value to do so. Rename "restart" to "cb_enable" and introduce "cb_disable" hook: callback now returns void, rather than a boolean. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
* virtio: simplify config mechanism.Rusty Russell2008-02-04
| | | | | | | | | | | | | Previously we used a type/len pair within the config space, but this seems overkill. We now simply define a structure which represents the layout in the config space: the config space can now only be extended at the end. The main driver-visible changes: 1) We indicate what fields are present with an explicit feature bit. 2) Virtqueues are explicitly numbered, and not in the config space. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
* 9p: add virtio transportEric Van Hensbergen2007-10-23
This adds a transport to 9p for communicating between guests and a host using a virtio based transport. Signed-off-by: Eric Van Hensbergen <ericvh@gmail.com>