diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2013-09-09 12:19:15 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2013-09-09 12:19:15 -0400 |
commit | bf97293eb878df3792d9de7213bd7b82135aea77 (patch) | |
tree | 16cb367bd78095b9eb8a54c800fcddfcccb618c7 /fs/nfs/internal.h | |
parent | 16d70e15295953b19ecf59e943723a181782b856 (diff) | |
parent | b1b3e136948a2bf4915326acb0d825d7d180753f (diff) |
Merge tag 'nfs-for-3.12-1' of git://git.linux-nfs.org/projects/trondmy/linux-nfs
Pull NFS client updates from Trond Myklebust:
"Highlights include:
- Fix NFSv4 recovery so that it doesn't recover lost locks in cases
such as lease loss due to a network partition, where doing so may
result in data corruption. Add a kernel parameter to control
choice of legacy behaviour or not.
- Performance improvements when 2 processes are writing to the same
file.
- Flush data to disk when an RPCSEC_GSS session timeout is imminent.
- Implement NFSv4.1 SP4_MACH_CRED state protection to prevent other
NFS clients from being able to manipulate our lease and file
locking state.
- Allow sharing of RPCSEC_GSS caches between different rpc clients.
- Fix the broken NFSv4 security auto-negotiation between client and
server.
- Fix rmdir() to wait for outstanding sillyrename unlinks to complete
- Add a tracepoint framework for debugging NFSv4 state recovery
issues.
- Add tracing to the generic NFS layer.
- Add tracing for the SUNRPC socket connection state.
- Clean up the rpc_pipefs mount/umount event management.
- Merge more patches from Chuck in preparation for NFSv4 migration
support"
* tag 'nfs-for-3.12-1' of git://git.linux-nfs.org/projects/trondmy/linux-nfs: (107 commits)
NFSv4: use mach cred for SECINFO_NO_NAME w/ integrity
NFS: nfs_compare_super shouldn't check the auth flavour unless 'sec=' was set
NFSv4: Allow security autonegotiation for submounts
NFSv4: Disallow security negotiation for lookups when 'sec=' is specified
NFSv4: Fix security auto-negotiation
NFS: Clean up nfs_parse_security_flavors()
NFS: Clean up the auth flavour array mess
NFSv4.1 Use MDS auth flavor for data server connection
NFS: Don't check lock owner compatability unless file is locked (part 2)
NFS: Don't check lock owner compatibility in writes unless file is locked
nfs4: Map NFS4ERR_WRONG_CRED to EPERM
nfs4.1: Add SP4_MACH_CRED write and commit support
nfs4.1: Add SP4_MACH_CRED stateid support
nfs4.1: Add SP4_MACH_CRED secinfo support
nfs4.1: Add SP4_MACH_CRED cleanup support
nfs4.1: Add state protection handler
nfs4.1: Minimal SP4_MACH_CRED implementation
SUNRPC: Replace pointer values with task->tk_pid and rpc_clnt->cl_clid
SUNRPC: Add an identifier for struct rpc_clnt
SUNRPC: Ensure rpc_task->tk_pid is available for tracepoints
...
Diffstat (limited to 'fs/nfs/internal.h')
-rw-r--r-- | fs/nfs/internal.h | 31 |
1 files changed, 27 insertions, 4 deletions
diff --git a/fs/nfs/internal.h b/fs/nfs/internal.h index 3c8373f90ab3..d388302c005f 100644 --- a/fs/nfs/internal.h +++ b/fs/nfs/internal.h | |||
@@ -5,6 +5,7 @@ | |||
5 | #include "nfs4_fs.h" | 5 | #include "nfs4_fs.h" |
6 | #include <linux/mount.h> | 6 | #include <linux/mount.h> |
7 | #include <linux/security.h> | 7 | #include <linux/security.h> |
8 | #include <linux/crc32.h> | ||
8 | 9 | ||
9 | #define NFS_MS_MASK (MS_RDONLY|MS_NOSUID|MS_NODEV|MS_NOEXEC|MS_SYNCHRONOUS) | 10 | #define NFS_MS_MASK (MS_RDONLY|MS_NOSUID|MS_NODEV|MS_NOEXEC|MS_SYNCHRONOUS) |
10 | 11 | ||
@@ -185,6 +186,8 @@ extern struct nfs_client *nfs4_set_ds_client(struct nfs_client* mds_clp, | |||
185 | int ds_addrlen, int ds_proto, | 186 | int ds_addrlen, int ds_proto, |
186 | unsigned int ds_timeo, | 187 | unsigned int ds_timeo, |
187 | unsigned int ds_retrans); | 188 | unsigned int ds_retrans); |
189 | extern struct rpc_clnt *nfs4_find_or_create_ds_client(struct nfs_client *, | ||
190 | struct inode *); | ||
188 | #ifdef CONFIG_PROC_FS | 191 | #ifdef CONFIG_PROC_FS |
189 | extern int __init nfs_fs_proc_init(void); | 192 | extern int __init nfs_fs_proc_init(void); |
190 | extern void nfs_fs_proc_exit(void); | 193 | extern void nfs_fs_proc_exit(void); |
@@ -267,7 +270,7 @@ extern struct rpc_procinfo nfs4_procedures[]; | |||
267 | void nfs_close_context(struct nfs_open_context *ctx, int is_sync); | 270 | void nfs_close_context(struct nfs_open_context *ctx, int is_sync); |
268 | extern struct nfs_client *nfs_init_client(struct nfs_client *clp, | 271 | extern struct nfs_client *nfs_init_client(struct nfs_client *clp, |
269 | const struct rpc_timeout *timeparms, | 272 | const struct rpc_timeout *timeparms, |
270 | const char *ip_addr, rpc_authflavor_t authflavour); | 273 | const char *ip_addr); |
271 | 274 | ||
272 | /* dir.c */ | 275 | /* dir.c */ |
273 | extern int nfs_access_cache_shrinker(struct shrinker *shrink, | 276 | extern int nfs_access_cache_shrinker(struct shrinker *shrink, |
@@ -355,7 +358,7 @@ extern struct dentry *nfs_get_root(struct super_block *, struct nfs_fh *, | |||
355 | extern struct dentry *nfs4_get_root(struct super_block *, struct nfs_fh *, | 358 | extern struct dentry *nfs4_get_root(struct super_block *, struct nfs_fh *, |
356 | const char *); | 359 | const char *); |
357 | 360 | ||
358 | extern int nfs4_get_rootfh(struct nfs_server *server, struct nfs_fh *mntfh); | 361 | extern int nfs4_get_rootfh(struct nfs_server *server, struct nfs_fh *mntfh, bool); |
359 | #endif | 362 | #endif |
360 | 363 | ||
361 | struct nfs_pgio_completion_ops; | 364 | struct nfs_pgio_completion_ops; |
@@ -430,6 +433,8 @@ void nfs_request_remove_commit_list(struct nfs_page *req, | |||
430 | void nfs_init_cinfo(struct nfs_commit_info *cinfo, | 433 | void nfs_init_cinfo(struct nfs_commit_info *cinfo, |
431 | struct inode *inode, | 434 | struct inode *inode, |
432 | struct nfs_direct_req *dreq); | 435 | struct nfs_direct_req *dreq); |
436 | int nfs_key_timeout_notify(struct file *filp, struct inode *inode); | ||
437 | bool nfs_ctx_key_to_expire(struct nfs_open_context *ctx); | ||
433 | 438 | ||
434 | #ifdef CONFIG_MIGRATION | 439 | #ifdef CONFIG_MIGRATION |
435 | extern int nfs_migrate_page(struct address_space *, | 440 | extern int nfs_migrate_page(struct address_space *, |
@@ -451,8 +456,7 @@ extern ssize_t nfs_dreq_bytes_left(struct nfs_direct_req *dreq); | |||
451 | extern void __nfs4_read_done_cb(struct nfs_read_data *); | 456 | extern void __nfs4_read_done_cb(struct nfs_read_data *); |
452 | extern struct nfs_client *nfs4_init_client(struct nfs_client *clp, | 457 | extern struct nfs_client *nfs4_init_client(struct nfs_client *clp, |
453 | const struct rpc_timeout *timeparms, | 458 | const struct rpc_timeout *timeparms, |
454 | const char *ip_addr, | 459 | const char *ip_addr); |
455 | rpc_authflavor_t authflavour); | ||
456 | extern int nfs40_walk_client_list(struct nfs_client *clp, | 460 | extern int nfs40_walk_client_list(struct nfs_client *clp, |
457 | struct nfs_client **result, | 461 | struct nfs_client **result, |
458 | struct rpc_cred *cred); | 462 | struct rpc_cred *cred); |
@@ -575,3 +579,22 @@ u64 nfs_timespec_to_change_attr(const struct timespec *ts) | |||
575 | { | 579 | { |
576 | return ((u64)ts->tv_sec << 30) + ts->tv_nsec; | 580 | return ((u64)ts->tv_sec << 30) + ts->tv_nsec; |
577 | } | 581 | } |
582 | |||
583 | #ifdef CONFIG_CRC32 | ||
584 | /** | ||
585 | * nfs_fhandle_hash - calculate the crc32 hash for the filehandle | ||
586 | * @fh - pointer to filehandle | ||
587 | * | ||
588 | * returns a crc32 hash for the filehandle that is compatible with | ||
589 | * the one displayed by "wireshark". | ||
590 | */ | ||
591 | static inline u32 nfs_fhandle_hash(const struct nfs_fh *fh) | ||
592 | { | ||
593 | return ~crc32_le(0xFFFFFFFF, &fh->data[0], fh->size); | ||
594 | } | ||
595 | #else | ||
596 | static inline u32 nfs_fhandle_hash(const struct nfs_fh *fh) | ||
597 | { | ||
598 | return 0; | ||
599 | } | ||
600 | #endif | ||