aboutsummaryrefslogtreecommitdiff
path: root/include/linux/sunrpc
AgeCommit message (Collapse)AuthorFilesLines
2007-10-09SUNRPC: rearrange RPC sockets definitions\"Talpey, Thomas\2-22/+40
To prepare for including non-sockets-based RPC transports, move the sockets-dependent definitions into their own file. Signed-off-by: Tom Talpey <[email protected]> Signed-off-by: Trond Myklebust <[email protected]>
2007-10-09SUNRPC: rename the rpc_xprtsock_create structure\"Talpey, Thomas\1-5/+5
To prepare for including non-sockets-based RPC transports, change the overly suggestive name of the transport creation arguments struct. Signed-off-by: Tom Talpey <[email protected]> Signed-off-by: Trond Myklebust <[email protected]>
2007-10-09SUNRPC: Provide a new API for registering transport implementations\"Talpey, Thomas\1-0/+11
To allow transport capabilities to be loaded dynamically, provide an API for registering and unregistering the transports with the RPC client. Eventually xprt_create_transport() will be changed to search the list of registered transports when initializing a fresh transport. Signed-off-by: Chuck Lever <[email protected]> Signed-off-by: Tom Talpey <[email protected]> Signed-off-by: Trond Myklebust <[email protected]>
2007-10-09SUNRPC: mark bulk read/write data in xdrbuf\"Talpey, Thomas\1-1/+4
Adds a flag word to the xdrbuf struct which indicates any bulk disposition of the data. This enables RPC transport providers to marshal it efficiently/appropriately, and may enable other optimizations. Signed-off-by: Tom Talpey <[email protected]> Signed-off-by: Trond Myklebust <[email protected]>
2007-10-09SUNRPC: export per-transport rpcbind netid's\"Talpey, Thomas\1-0/+1
The rpcbind (v3+) netid is provided by each RPC client transport. This fixes an omission in IPv6 rpcbind client support, and enables future extension. Signed-off-by: Tom Talpey <[email protected]> Signed-off-by: Trond Myklebust <[email protected]>
2007-10-09SUNRPC: move per-transport rpcbind netid's\"Talpey, Thomas\1-0/+13
Move the TCP/UDP rpcbind netid's from the rpcbind client to a global header. Signed-off-by: Tom Talpey <[email protected]> Signed-off-by: Trond Myklebust <[email protected]>
2007-10-09SUNRPC: fix a signed v. unsigned comparison nit in rpc_bind_new_programChuck Lever1-1/+1
/home/cel/linux/net/sunrpc/clnt.c: In function ‘rpc_bind_new_program’: /home/cel/linux/net/sunrpc/clnt.c:445: warning: comparison between signed and unsigned RPC version numbers are u32, not int. Signed-off-by: Chuck Lever <[email protected]> Signed-off-by: Trond Myklebust <[email protected]>
2007-10-09SUNRPC: Add support for formatted universal addressesChuck Lever1-0/+1
"Universal addresses" are a string representation of an IP address and port. They are described fully in RFC 3530, section 2.2. Add support for generating them in the RPC client's socket transport module. Signed-off-by: Chuck Lever <[email protected]>
2007-10-09SUNRPC: Add hex-formatted address support to rpc_peeraddr2str()Chuck Lever1-0/+2
Add support for the NFS client's need to export volume information with IP addresses formatted in hex instead of decimal. This isn't used yet, but subsequent patches (not in this series) will change the NFS client to use this functionality. Signed-off-by: Chuck Lever <[email protected]> Signed-off-by: Trond Myklebust <[email protected]>
2007-07-19SUNRPC: move bkl locking and xdr proc invocation into a common helperJ. Bruce Fields1-0/+16
Since every invocation of xdr encode or decode functions takes the BKL now, there's a lot of redundant lock_kernel/unlock_kernel pairs that we can pull out into a common function. Signed-off-by: J. Bruce Fields <[email protected]> Signed-off-by: Trond Myklebust <[email protected]>
2007-07-17knfsd: nfsd4: secinfo handling without secinfo= optionJ. Bruce Fields1-0/+1
We could return some sort of error in the case where someone asks for secinfo on an export without the secinfo= option set--that'd be no worse than what we've been doing. But it's not really correct. So, hack up an approximate secinfo response in that case--it may not be complete, but it'll tell the client at least one acceptable security flavor. Signed-off-by: "J. Bruce Fields" <[email protected]> Signed-off-by: Neil Brown <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
2007-07-17knfsd: nfsd: set rq_client to ip-address-determined-domainJ. Bruce Fields2-0/+2
We want it to be possible for users to restrict exports both by IP address and by pseudoflavor. The pseudoflavor information has previously been passed using special auth_domains stored in the rq_client field. After the preceding patch that stored the pseudoflavor in rq_pflavor, that's now superfluous; so now we use rq_client for the ip information, as auth_null and auth_unix do. However, we keep around the special auth_domain in the rq_gssclient field for backwards compatibility purposes, so we can still do upcalls using the old "gss/pseudoflavor" auth_domain if upcalls using the unix domain to give us an appropriate export. This allows us to continue supporting old mountd. In fact, for this first patch, we always use the "gss/pseudoflavor" auth_domain (and only it) if it is available; thus rq_client is ignored in the auth_gss case, and this patch on its own makes no change in behavior; that will be left to later patches. Note on idmap: I'm almost tempted to just replace the auth_domain in the idmap upcall by a dummy value--no version of idmapd has ever used it, and it's unlikely anyone really wants to perform idmapping differently depending on the where the client is (they may want to perform *credential* mapping differently, but that's a different matter--the idmapper just handles id's used in getattr and setattr). But I'm updating the idmapd code anyway, just out of general backwards-compatibility paranoia. Signed-off-by: "J. Bruce Fields" <[email protected]> Signed-off-by: Neil Brown <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
2007-07-17knfsd: nfsd4: store pseudoflavor in requestAndy Adamson2-0/+2
Add a new field to the svc_rqst structure to record the pseudoflavor that the request was made with. For now we record the pseudoflavor but don't use it for anything. Signed-off-by: Andy Adamson <[email protected]> Signed-off-by: "J. Bruce Fields" <[email protected]> Signed-off-by: Neil Brown <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
2007-07-10SUNRPC client: add interface for binding to a local addressFrank van Maarseveen2-0/+2
In addition to binding to a local privileged port the NFS client should allow binding to a specific local address. This is used by the server for callbacks. The patch adds the necessary interface. Signed-off-by: Frank van Maarseveen <[email protected]> Signed-off-by: Trond Myklebust <[email protected]>
2007-07-10SUNRPC server: record the destination address of a requestFrank van Maarseveen1-0/+1
Save the destination address of an incoming request over TCP like is done already for UDP. It is necessary later for callbacks by the server. Signed-off-by: Frank van Maarseveen <[email protected]> Signed-off-by: Trond Myklebust <[email protected]>
2007-07-10SUNRPC: cleanup transport creation argument passingFrank van Maarseveen1-4/+11
Cleanup argument passing to functions for creating an RPC transport. Signed-off-by: Frank van Maarseveen <[email protected]> Signed-off-by: Trond Myklebust <[email protected]>
2007-07-10SUNRPC: Rename rpcb_getport to be consistent with new rpcb_getport_sync nameChuck Lever1-1/+1
Clean up, for consistency. Rename rpcb_getport as rpcb_getport_async, to match the naming scheme of rpcb_getport_sync. Signed-off-by: Chuck Lever <[email protected]> Signed-off-by: Trond Myklebust <[email protected]>
2007-07-10SUNRPC: Rename rpcb_getport_external routineChuck Lever1-5/+2
In preparation for handling NFS mount option parsing in the kernel, rename rpcb_getport_external as rpcb_get_port_sync, and make it available always (instead of only when CONFIG_ROOT_NFS is enabled). Signed-off-by: Chuck Lever <[email protected]> Signed-off-by: Trond Myklebust <[email protected]>
2007-07-10SUNRPC: Remove the tk_auth macro...Trond Myklebust1-1/+0
We should almost always be deferencing the rpc_auth struct by means of the credential's cr_auth field instead of the rpc_clnt->cl_auth anyway. Fix up that historical mistake, and remove the macro that propagated it. Signed-off-by: Trond Myklebust <[email protected]>
2007-07-10SUNRPC: Convert gss_ctx_lock to an RCU lockTrond Myklebust1-0/+1
Signed-off-by: Trond Myklebust <[email protected]>
2007-07-10SUNRPC: Convert the credential garbage collector into a shrinker callbackTrond Myklebust1-3/+3
Signed-off-by: Trond Myklebust <[email protected]>
2007-07-10SUNRPC: Give credential cache a local spinlockTrond Myklebust1-0/+3
Signed-off-by: Trond Myklebust <[email protected]>
2007-07-10SUNRPC: Convert the credcache lookup code to use RCUTrond Myklebust1-0/+3
Signed-off-by: Trond Myklebust <[email protected]>
2007-07-10SUNRPC: cleanup rpc credential cache garbage collectionTrond Myklebust1-0/+1
Signed-off-by: Trond Myklebust <[email protected]>
2007-07-10SUNRPC: Enforce atomic updates of rpc_cred->cr_flagsTrond Myklebust1-5/+5
Convert to the use of atomic bitops... Signed-off-by: Trond Myklebust <[email protected]>
2007-07-10SUNRPC: Clean up rpc credential initialisationTrond Myklebust2-5/+1
Add a helper rpc_cred_init() Signed-off-by: Trond Myklebust <[email protected]>
2007-07-10SUNRPC: Mark auth and cred operation tables as constant.Trond Myklebust2-10/+7
Also do the same for gss_api operation tables. Signed-off-by: Trond Myklebust <[email protected]>
2007-07-10SUNRPC: Rename rpcauth_destroy() to rpcauth_release()Trond Myklebust1-1/+1
Signed-off-by: Trond Myklebust <[email protected]>
2007-07-10SUNRPC: Add the helper function 'rpc_call_null()'Trond Myklebust1-0/+2
Does a NULL RPC call and returns a pointer to the resulting rpc_task. The call may be either synchronous or asynchronous. Signed-off-by: Trond Myklebust <[email protected]>
2007-07-10SUNRPC: Make rpc_ping() staticTrond Myklebust1-1/+0
Signed-off-by: Trond Myklebust <[email protected]>
2007-07-10SUNRPC: Fix a memory leak in the auth credcache codeTrond Myklebust1-1/+2
The leak only affects the RPCSEC_GSS caches, since they are the only ones that are dynamically allocated... Rename the existing rpcauth_free_credcache() to rpcauth_clear_credcache() in order to better describe its role, then add a new function rpcauth_destroy_credcache() that actually frees the cache in addition to clearing it out. Also move the call to destroy the credcache in gss_destroy() to come before the rpc upcall pipe is unlinked. Signed-off-by: Trond Myklebust <[email protected]>
2007-07-10SUNRPC: Add a field to track the number of kernel users of an rpc_pipeTrond Myklebust1-0/+1
This allows us to correctly deduce when we need to remove the pipe. Signed-off-by: Trond Myklebust <[email protected]>
2007-07-10SUNRPC: Add a downcall queue to struct rpc_inodeTrond Myklebust1-0/+1
Currently, the downcall queue is tied to the struct gss_auth, which means that different RPCSEC_GSS pseudoflavours must use different upcall pipes. Add a list to struct rpc_inode that can be used instead. Signed-off-by: Trond Myklebust <[email protected]>
2007-07-10SUNRPC: Add a backpointer from the struct rpc_cred to the rpc_authTrond Myklebust1-0/+4
Cleans up an issue whereby rpcsec_gss uses the rpc_clnt->cl_auth. If we want to be able to add several rpc_auths to a single rpc_clnt, then this abuse must go. Signed-off-by: Trond Myklebust <[email protected]>
2007-07-10SUNRPC: Move rpc_register_client and friends into net/sunrpc/clnt.cTrond Myklebust1-2/+0
Signed-off-by: Trond Myklebust <[email protected]>
2007-07-10SUNRPC: Remove rpc_clnt->cl_countTrond Myklebust1-3/+1
The kref now does most of what cl_count + cl_user used to do. The only remaining role for cl_count is to tell us if we are in a 'shutdown' phase. We can provide that information using a single bit field instead of a full atomic counter. Also rename rpc_destroy_client() to rpc_close_client(), which reflects better what its role is these days. Signed-off-by: Trond Myklebust <[email protected]>
2007-07-10SUNRPC: Kill rpc_clnt->cl_oneshotTrond Myklebust1-6/+4
Replace it with explicit calls to rpc_shutdown_client() or rpc_destroy_client() (for the case of asynchronous calls). Signed-off-by: Trond Myklebust <[email protected]>
2007-07-10SUNRPC: Kill rpc_clnt->cl_deadTrond Myklebust1-2/+1
Its use is at best racy, and there is only one user (lockd), which has additional locking that makes the whole thing redundant. Signed-off-by: Trond Myklebust <[email protected]>
2007-07-10SUNRPC: Convert rpc_clnt->cl_users to a krefTrond Myklebust1-1/+1
Signed-off-by: Trond Myklebust <[email protected]>
2007-07-10SUNRPC: Add a per-rpc_clnt spinlockTrond Myklebust1-0/+1
Use that to protect the rpc_clnt->cl_tasks list instead of using a global lock. Signed-off-by: Trond Myklebust <[email protected]>
2007-07-10SUNRPC: Move rpc_task->tk_task list into struct rpc_clntTrond Myklebust2-5/+4
Signed-off-by: Trond Myklebust <[email protected]>
2007-07-10sendfile: convert nfsd to splice_direct_to_actor()Jens Axboe1-1/+1
Signed-off-by: Jens Axboe <[email protected]>
2007-05-14SUNRPC: Fix sparse warningsTrond Myklebust2-0/+4
- net/sunrpc/xprtsock.c:1635:5: warning: symbol 'init_socket_xprt' was not declared. Should it be static? - net/sunrpc/xprtsock.c:1649:6: warning: symbol 'cleanup_socket_xprt' was not declared. Should it be static? Signed-off-by: Trond Myklebust <[email protected]>
2007-05-09RPC: add wrapper for svc_reserve to account for checksumJeff Layton1-0/+19
When the kernel calls svc_reserve to downsize the expected size of an RPC reply, it fails to account for the possibility of a checksum at the end of the packet. If a client mounts a NFSv2/3 with sec=krb5i/p, and does I/O then you'll generally see messages similar to this in the server's ring buffer: RPC request reserved 164 but used 208 While I was never able to verify it, I suspect that this problem is also the root cause of some oopses I've seen under these conditions: https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=227726 This is probably also a problem for other sec= types and for NFSv4. The large reserved size for NFSv4 compound packets seems to generally paper over the problem, however. This patch adds a wrapper for svc_reserve that accounts for the possibility of a checksum. It also fixes up the appropriate callers of svc_reserve to call the wrapper. For now, it just uses a hardcoded value that I determined via testing. That value may need to be revised upward as things change, or we may want to eventually add a new auth_op that attempts to calculate this somehow. Unfortunately, there doesn't seem to be a good way to reliably determine the expected checksum length prior to actually calculating it, particularly with schemes like spkm3. Signed-off-by: Jeff Layton <[email protected]> Acked-by: Neil Brown <[email protected]> Cc: Trond Myklebust <[email protected]> Acked-by: J. Bruce Fields <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
2007-05-09knfsd: rename sk_defer_lock to sk_lockNeilBrown1-1/+2
Now that sk_defer_lock protects two different things, make the name more generic. Also don't bother with disabling _bh as the lock is only ever taken from process context. Signed-off-by: Neil Brown <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
2007-04-30SUNRPC: remove old portmapperChuck Lever3-8/+0
net/sunrpc/pmap_clnt.c has been replaced by net/sunrpc/rpcb_clnt.c. Signed-off-by: Chuck Lever <[email protected]> Signed-off-by: Trond Myklebust <[email protected]>
2007-04-30SUNRPC: introduce rpcbind: replacement for in-kernel portmapperChuck Lever3-0/+5
Introduce a replacement for the in-kernel portmapper client that supports all 3 versions of the rpcbind protocol. This code is not used yet. Original code by Groupe Bull updated for the latest kernel, with multiple bug fixes. Note that rpcb_clnt.c does not yet support registering via versions 3 and 4 of the rpcbind protocol. That is planned for a later patch. Signed-off-by: Chuck Lever <[email protected]> Signed-off-by: Trond Myklebust <[email protected]>
2007-04-30SUNRPC: Eliminate side effects from rpc_mallocChuck Lever2-2/+2
Currently rpc_malloc sets req->rq_buffer internally. Make this a more generic interface: return a pointer to the new buffer (or NULL) and make the caller set req->rq_buffer and req->rq_bufsize. This looks much more like kmalloc and eliminates the side effects. To fix a potential deadlock, this patch also replaces GFP_NOFS with GFP_NOWAIT in rpc_malloc. This prevents async RPCs from sleeping outside the RPC's task scheduler while allocating their buffer. Signed-off-by: Chuck Lever <[email protected]> Signed-off-by: Trond Myklebust <[email protected]>
2007-04-30SUNRPC: RPC buffer size estimates are too largeChuck Lever2-2/+5
The RPC buffer size estimation logic in net/sunrpc/clnt.c always significantly overestimates the requirements for the buffer size. A little instrumentation demonstrated that in fact rpc_malloc was never allocating the buffer from the mempool, but almost always called kmalloc. To compute the size of the RPC buffer more precisely, split p_bufsiz into two fields; one for the argument size, and one for the result size. Then, compute the sum of the exact call and reply header sizes, and split the RPC buffer precisely between the two. That should keep almost all RPC buffers within the 2KiB buffer mempool limit. And, we can finally be rid of RPC_SLACK_SPACE! Signed-off-by: Chuck Lever <[email protected]> Signed-off-by: Trond Myklebust <[email protected]>
2007-03-06[PATCH] knfsd: fix recently introduced problem with shutting down a busy NFS ↵NeilBrown1-1/+1
server When the last thread of nfsd exits, it shuts down all related sockets. It currently uses svc_close_socket to do this, but that only is immediately effective if the socket is not SK_BUSY. If the socket is busy - i.e. if a request has arrived that has not yet been processes - svc_close_socket is not effective and the shutdown process spins. So create a new svc_force_close_socket which removes the SK_BUSY flag is set and then calls svc_close_socket. Also change some open-codes loops in svc_destroy to use list_for_each_entry_safe. Signed-off-by: Neil Brown <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>