summaryrefslogtreecommitdiffstats
path: root/net/9p/client.c
Commit message (Collapse)AuthorAgeFilesLines
* p9: Fix leak of waitqueue in request allocation pathTom Tucker2008-11-051-0/+3
| | | | | | | | | | | | | | | If a T or R fcall cannot be allocated, the function returns an error but neglects to free the wait queue that was successfully allocated. If it comes through again a second time this wq will be overwritten with a new allocation and the old allocation will be leaked. Also, if the client is subsequently closed, the close path will attempt to clean up these allocations, so set the req fields to NULL to avoid duplicate free. Signed-off-by: Tom Tucker <tom@opengridcomputing.com> Signed-off-by: Eric Van Hensbergen <ericvh@gmail.com>
* 9p: Remove unneeded free of fcall for FlushTom Tucker2008-11-051-6/+0
| | | | | | | | T and R fcall are reused until the client is destroyed. There does not need to be a special case for Flush Signed-off-by: Tom Tucker <tom@opengridcomputing.com> Signed-off-by: Eric Van Hensbergen <ericvh@gmail.com>
* 9p: Make all client spin locks IRQ safeTom Tucker2008-11-051-4/+6
| | | | | | | | The client lock must be IRQ safe. Some of the lock acquisition paths took regular spin locks. Signed-off-by: Tom Tucker <tom@opengridcomputing.com> Signed-off-by: Eric Van Hensbergen <ericvh@gmail.com>
* 9p: fix sparse warningsEric Van Hensbergen2008-10-221-0/+1
| | | | | | | | | Several sparse warnings were introduced by patches accepted during the merge window which weren't caught. This patch fixes those warnings. Signed-off-by: Eric Van Hensbergen <ericvh@gmail.com>
* 9p: Improve debug supportEric Van Hensbergen2008-10-171-21/+55
| | | | | | | | | | | | | The new debug support lacks some of the information that the previous fcprint code provided -- this patch focuses on better presentation of debug data along with more helpful debug along error paths. Signed-off-by: Eric Van Hensbergen <ericvh@gmail.com>
* 9p: rework client code to use new protocol support functionsEric Van Hensbergen2008-10-171-477/+454
| | | | | | | | | | Now that the new protocol functions are in place, this patch switches the client code to using the new support code. Signed-off-by: Eric Van Hensbergen <ericvh@gmail.com>
* 9p: remove 9p fcall debug printsEric Van Hensbergen2008-10-171-9/+0
| | | | | | | | | | | | | | | One of the current debug options allows users to get a verbose dump of fcalls. This isn't really necessary as correctly parsed protocol frames can be printed as part of the code in the client functions. The consolidated printfcalls structure would require new entries to be added for every extension. This patch removes the debug print methods and their use. Signed-off-by: Eric Van Hensbergen <ericvh@gmail.com>
* 9p: encapsulate version functionEric Van Hensbergen2008-10-171-30/+44
| | | | | | | | | | | | | | Alsmot all 9P client wire functions have their own (set of) functions. Tversion is an exception as its encapsulated into the client_create code. This patch moves the protocol specifics of this to a function to match the rest of the code. Signed-off-by: Eric Van Hensbergen <ericvh@gmail.com>
* 9p: move dirread to fs layerEric Van Hensbergen2008-10-171-103/+0
| | | | | | | | | | | | | | | | | Currently reading a directory is implemented in the client code. This function is not actually a wire operation, but a meta operation which calls read operations and processes the results. This patch moves this functionality to the fs layer and calls component wire operations instead of constructing their packets. This provides a cleaner separation and will help when we reorganize the client functions and protocol processing methods. Signed-off-by: Eric Van Hensbergen <ericvh@gmail.com>
* 9p: move readn meta-function from client to fs layerEric Van Hensbergen2008-10-171-26/+0
| | | | | | | | | | | | | | | There are a couple of methods in the client code which aren't actually wire operations. To keep things organized cleaner, these operations are being moved to the fs layer. This patch moves the readn meta-function (which executes multiple wire reads until a buffer is full) to the fs layer. Signed-off-by: Eric Van Hensbergen <ericvh@gmail.com>
* 9p: consolidate read/write functionsEric Van Hensbergen2008-10-171-122/+28
| | | | | | | | | | | | | | | Currently there are two separate versions of read and write. One for dealing with user buffers and the other for dealing with kernel buffers. There is a tremendous amount of code duplication in the otherwise identical versions of these functions. This patch adds an additional user buffer parameter to read and write and conditionalizes handling of the buffer on whether the kernel buffer or the user buffer is populated. Signed-off-by: Eric Van Hensbergen <ericvh@gmail.com>
* 9p: make rpc code common and rework flush codeEric Van Hensbergen2008-10-171-14/+251
| | | | | | | | | | | | | This code moves the rpc function to the common client base, reorganizes the flush code to be more simple and stable, and makes the necessary adjustments to the underlying transports to adapt to the new structure. This reduces the overall amount of code duplication between the transports and should make adding new transports more straightforward. Signed-off-by: Eric Van Hensbergen <ericvh@gmail.com>
* 9p: apply common request code to trans_fdEric Van Hensbergen2008-10-171-0/+21
| | | | | | | Apply the now common p9_req_t structure to the fd transport. Signed-off-by: Eric Van Hensbergen <ericvh@gmail.com>
* 9p: move request management to client codeEric Van Hensbergen2008-10-171-0/+152
| | | | | | | | | | The virtio transport uses a simplified request management system that I want to use for all transports. This patch adapts and moves the exisiting code for managing requests to the client common code. Later patches will apply these mechanisms to the other transports. Signed-off-by: Eric Van Hensbergen <ericvh@gmail.com>
* 9p: remove unnecessary prototypesEric Van Hensbergen2008-10-171-94/+89
| | | | | | | | | | | Cleanup files by reordering functions in order to remove need for unnecessary function prototypes. There are no code changes here, just functions being moved around and prototypes being eliminated. Signed-off-by: Eric Van Hensbergen <ericvh@gmail.com>
* 9p: consolidate transport structureEric Van Hensbergen2008-10-171-14/+7
| | | | | | | | | | | | | Right now there is a transport module structure which provides per-transport type functions and data and a transport structure which contains per-instance public data as well as function pointers to instance specific functions. This patch moves public transport visible instance data to the client structure (which in some cases had duplicate data) and consolidates the functions into the transport module structure. Signed-off-by: Eric Van Hensbergen <ericvh@gmail.com>
* vfs: Use const for kernel parser tableSteven Whitehouse2008-10-131-1/+1
| | | | | | | | | | | | | | This is a much better version of a previous patch to make the parser tables constant. Rather than changing the typedef, we put the "const" in all the various places where its required, allowing the __initconst exception for nfsroot which was the cause of the previous trouble. This was posted for review some time ago and I believe its been in -mm since then. Signed-off-by: Steven Whitehouse <swhiteho@redhat.com> Cc: Alexander Viro <aviro@redhat.com> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
* 9p: implement proper trans module refcounting and unregistrationTejun Heo2008-09-241-2/+8
| | | | | | | | | | | | | | | | | | | | | 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: Correct fidpool creation failure in p9_client_createJosef 'Jeff' Sipek2008-05-141-1/+1
| | | | | | | On error, p9_idpool_create returns an ERR_PTR-encoded errno. Signed-off-by: Josef 'Jeff' Sipek <jeffpc@josefsipek.net> Acked-by: Eric Van Hensbergen <ericvh@gmail.com>
* 9p: propagate parse_option changes to client and transportsEric Van Hensbergen2008-05-141-7/+23
| | | | | | | | | Propagate changes that were made to the parse_options code to the other parse options pieces present in the other modules. Looks like the client parse options was probably corrupting the parse string and causing problems for others. Signed-off-by: Eric Van Hensbergen <ericvh@gmail.com>
* 9p: transport API reorganizationEric Van Hensbergen2008-02-061-21/+94
| | | | | | | | | | 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: block-based virtio clientEric Van Hensbergen2008-02-061-17/+17
| | | | | | | | 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>
* 9p: create transport rpc cut-thruEric Van Hensbergen2008-02-061-16/+33
| | | | | | | | | Add a new transport function which allows a cut-thru directly to the transport instead of processing request through the mux if the cut-thru exists. Signed-off-by: Eric Van Hensbergen <ericvh@gmail.com>
* 9p: fix bug in p9_clone_statMartin Stava2008-02-061-0/+5
| | | | | | | | | This patch fixes a bug in the copying of 9P stat information where string references weren't being updated properly. Signed-off-by: Martin Sava <martin.stava@gmail.com> Signed-off-by: Eric Van Hensbergen <ericvh@gmail.com>
* 9p: fix bad kconfig cross-dependencyEric Van Hensbergen2007-10-171-0/+1
| | | | | | | | This patch moves transport dynamic registration and matching to the net module to prevent a bad Kconfig dependency between the net and fs 9p modules. Signed-off-by: Eric Van Hensbergen <ericvh@gmail.com>
* 9p: attach-per-userLatchesar Ionkov2007-10-171-4/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The 9P2000 protocol requires the authentication and permission checks to be done in the file server. For that reason every user that accesses the file server tree has to authenticate and attach to the server separately. Multiple users can share the same connection to the server. Currently v9fs does a single attach and executes all I/O operations as a single user. This makes using v9fs in multiuser environment unsafe as it depends on the client doing the permission checking. This patch improves the 9P2000 support by allowing every user to attach separately. The patch defines three modes of access (new mount option 'access'): - attach-per-user (access=user) (default mode for 9P2000.u) If a user tries to access a file served by v9fs for the first time, v9fs sends an attach command to the server (Tattach) specifying the user. If the attach succeeds, the user can access the v9fs tree. As there is no uname->uid (string->integer) mapping yet, this mode works only with the 9P2000.u dialect. - allow only one user to access the tree (access=<uid>) Only the user with uid can access the v9fs tree. Other users that attempt to access it will get EPERM error. - do all operations as a single user (access=any) (default for 9P2000) V9fs does a single attach and all operations are done as a single user. If this mode is selected, the v9fs behavior is identical with the current one. Signed-off-by: Latchesar Ionkov <lucho@ionkov.net> Signed-off-by: Eric Van Hensbergen <ericvh@gmail.com>
* 9p: Make transports dynamicEric Van Hensbergen2007-10-171-1/+1
| | | | | | | | | This patch abstracts out the interfaces to underlying transports so that new transports can be added as modules. This should also allow kernel configuration of transports without ifdef-hell. Signed-off-by: Eric Van Hensbergen <ericvh@gmail.com>
* 9p: fix a race condition bug in umount which caused a segfaultEric Van Hensbergen2007-07-141-3/+3
| | | | | | | | umounting partitions after heavy activity would sometimes trigger a segmentation violation. This fix appears to remove that problem. Fix originally provided by Latchesar Ionkov. Signed-off-by: Eric Van Hensbergen <ericvh@gmail.com>
* 9p: Reorganization of 9p file system codeLatchesar Ionkov2007-07-141-0/+965
This patchset moves non-filesystem interfaces of v9fs from fs/9p to net/9p. It moves the transport, packet marshalling and connection layers to net/9p leaving only the VFS related files in fs/9p. This work is being done in preparation for in-kernel 9p servers as well as alternate 9p clients (other than VFS). Signed-off-by: Latchesar Ionkov <lucho@ionkov.net> Signed-off-by: Eric Van Hensbergen <ericvh@gmail.com>