diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2012-03-23 11:53:47 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2012-03-23 11:53:47 -0400 |
commit | f63d395d47f37a4fe771e6d4b1db9d2cdae5ffc5 (patch) | |
tree | 3448a14ae965802adb963762cadeb9989ce4caa2 /fs/nfs/cache_lib.c | |
parent | 643ac9fc5429e85b8b7f534544b80bcc4f34c367 (diff) | |
parent | 5a7c9eec9fde1da0e3adf0a4ddb64ff2a324a492 (diff) |
Merge tag 'nfs-for-3.4-1' of git://git.linux-nfs.org/projects/trondmy/linux-nfs
Pull NFS client updates for Linux 3.4 from Trond Myklebust:
"New features include:
- Add NFS client support for containers.
This should enable most of the necessary functionality, including
lockd support, and support for rpc.statd, NFSv4 idmapper and
RPCSEC_GSS upcalls into the correct network namespace from which
the mount system call was issued.
- NFSv4 idmapper scalability improvements
Base the idmapper cache on the keyring interface to allow
concurrent access to idmapper entries. Start the process of
migrating users from the single-threaded daemon-based approach to
the multi-threaded request-key based approach.
- NFSv4.1 implementation id.
Allows the NFSv4.1 client and server to mutually identify each
other for logging and debugging purposes.
- Support the 'vers=4.1' mount option for mounting NFSv4.1 instead of
having to use the more counterintuitive 'vers=4,minorversion=1'.
- SUNRPC tracepoints.
Start the process of adding tracepoints in order to improve
debugging of the RPC layer.
- pNFS object layout support for autologin.
Important bugfixes include:
- Fix a bug in rpc_wake_up/rpc_wake_up_status that caused them to
fail to wake up all tasks when applied to priority waitqueues.
- Ensure that we handle read delegations correctly, when we try to
truncate a file.
- A number of fixes for NFSv4 state manager loops (mostly to do with
delegation recovery)."
* tag 'nfs-for-3.4-1' of git://git.linux-nfs.org/projects/trondmy/linux-nfs: (224 commits)
NFS: fix sb->s_id in nfs debug prints
xprtrdma: Remove assumption that each segment is <= PAGE_SIZE
xprtrdma: The transport should not bug-check when a dup reply is received
pnfs-obj: autologin: Add support for protocol autologin
NFS: Remove nfs4_setup_sequence from generic rename code
NFS: Remove nfs4_setup_sequence from generic unlink code
NFS: Remove nfs4_setup_sequence from generic read code
NFS: Remove nfs4_setup_sequence from generic write code
NFS: Fix more NFS debug related build warnings
SUNRPC/LOCKD: Fix build warnings when CONFIG_SUNRPC_DEBUG is undefined
nfs: non void functions must return a value
SUNRPC: Kill compiler warning when RPC_DEBUG is unset
SUNRPC/NFS: Add Kbuild dependencies for NFS_DEBUG/RPC_DEBUG
NFS: Use cond_resched_lock() to reduce latencies in the commit scans
NFSv4: It is not safe to dereference lsp->ls_state in release_lockowner
NFS: ncommit count is being double decremented
SUNRPC: We must not use list_for_each_entry_safe() in rpc_wake_up()
Try using machine credentials for RENEW calls
NFSv4.1: Fix a few issues in filelayout_commit_pagelist
NFSv4.1: Clean ups and bugfixes for the pNFS read/writeback/commit code
...
Diffstat (limited to 'fs/nfs/cache_lib.c')
-rw-r--r-- | fs/nfs/cache_lib.c | 61 |
1 files changed, 43 insertions, 18 deletions
diff --git a/fs/nfs/cache_lib.c b/fs/nfs/cache_lib.c index c98b439332fc..dded26368111 100644 --- a/fs/nfs/cache_lib.c +++ b/fs/nfs/cache_lib.c | |||
@@ -13,6 +13,7 @@ | |||
13 | #include <linux/slab.h> | 13 | #include <linux/slab.h> |
14 | #include <linux/sunrpc/cache.h> | 14 | #include <linux/sunrpc/cache.h> |
15 | #include <linux/sunrpc/rpc_pipe_fs.h> | 15 | #include <linux/sunrpc/rpc_pipe_fs.h> |
16 | #include <net/net_namespace.h> | ||
16 | 17 | ||
17 | #include "cache_lib.h" | 18 | #include "cache_lib.h" |
18 | 19 | ||
@@ -111,30 +112,54 @@ int nfs_cache_wait_for_upcall(struct nfs_cache_defer_req *dreq) | |||
111 | return 0; | 112 | return 0; |
112 | } | 113 | } |
113 | 114 | ||
114 | int nfs_cache_register(struct cache_detail *cd) | 115 | int nfs_cache_register_sb(struct super_block *sb, struct cache_detail *cd) |
115 | { | 116 | { |
116 | struct vfsmount *mnt; | ||
117 | struct path path; | ||
118 | int ret; | 117 | int ret; |
118 | struct dentry *dir; | ||
119 | 119 | ||
120 | mnt = rpc_get_mount(); | 120 | dir = rpc_d_lookup_sb(sb, "cache"); |
121 | if (IS_ERR(mnt)) | 121 | BUG_ON(dir == NULL); |
122 | return PTR_ERR(mnt); | 122 | ret = sunrpc_cache_register_pipefs(dir, cd->name, 0600, cd); |
123 | ret = vfs_path_lookup(mnt->mnt_root, mnt, "/cache", 0, &path); | 123 | dput(dir); |
124 | if (ret) | ||
125 | goto err; | ||
126 | ret = sunrpc_cache_register_pipefs(path.dentry, cd->name, 0600, cd); | ||
127 | path_put(&path); | ||
128 | if (!ret) | ||
129 | return ret; | ||
130 | err: | ||
131 | rpc_put_mount(); | ||
132 | return ret; | 124 | return ret; |
133 | } | 125 | } |
134 | 126 | ||
135 | void nfs_cache_unregister(struct cache_detail *cd) | 127 | int nfs_cache_register_net(struct net *net, struct cache_detail *cd) |
136 | { | 128 | { |
137 | sunrpc_cache_unregister_pipefs(cd); | 129 | struct super_block *pipefs_sb; |
138 | rpc_put_mount(); | 130 | int ret = 0; |
131 | |||
132 | pipefs_sb = rpc_get_sb_net(net); | ||
133 | if (pipefs_sb) { | ||
134 | ret = nfs_cache_register_sb(pipefs_sb, cd); | ||
135 | rpc_put_sb_net(net); | ||
136 | } | ||
137 | return ret; | ||
138 | } | ||
139 | |||
140 | void nfs_cache_unregister_sb(struct super_block *sb, struct cache_detail *cd) | ||
141 | { | ||
142 | if (cd->u.pipefs.dir) | ||
143 | sunrpc_cache_unregister_pipefs(cd); | ||
144 | } | ||
145 | |||
146 | void nfs_cache_unregister_net(struct net *net, struct cache_detail *cd) | ||
147 | { | ||
148 | struct super_block *pipefs_sb; | ||
149 | |||
150 | pipefs_sb = rpc_get_sb_net(net); | ||
151 | if (pipefs_sb) { | ||
152 | nfs_cache_unregister_sb(pipefs_sb, cd); | ||
153 | rpc_put_sb_net(net); | ||
154 | } | ||
155 | } | ||
156 | |||
157 | void nfs_cache_init(struct cache_detail *cd) | ||
158 | { | ||
159 | sunrpc_init_cache_detail(cd); | ||
139 | } | 160 | } |
140 | 161 | ||
162 | void nfs_cache_destroy(struct cache_detail *cd) | ||
163 | { | ||
164 | sunrpc_destroy_cache_detail(cd); | ||
165 | } | ||