diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2015-02-11 20:14:54 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2015-02-11 20:14:54 -0500 |
commit | 6f83e5bd3e96228ee0caff0b103addb5f4e95459 (patch) | |
tree | bf27fcc754ea8c5287088df2803edbfb3c70f716 /fs/nfs/internal.h | |
parent | 73b4f63aebd6d57db4ca1d31fa6f8516651207b0 (diff) | |
parent | c627d31ba0696cbd829437af2be2f2dee3546b1e (diff) |
Merge tag 'nfs-for-3.20-1' of git://git.linux-nfs.org/projects/trondmy/linux-nfs
Pull NFS client updates from Trond Myklebust:
"Highlights incluse:
Features:
- Removing the forced serialisation of open()/close() calls in
NFSv4.x (x>0) makes for a significant performance improvement in
metadata intensive workloads.
- Full support for the pNFS "flexible files" layout type
- Further RPC/RDMA client improvements from Chuck
Bugfixes:
- Stable fix: NFSv4.1 backchannel calls blocking operations with !TASK_RUNNING
- Stable fix: pnfs_generic_pg_init_read/write can be called with lseg == NULL
- Stable fix: Fix an Oopsable condition when nsm_mon_unmon is called
as part of the namespace cleanup,
- Stable fix: Ensure we reference the inode for return-on-close in
delegreturn
- Use SO_REUSEPORT to ensure that NFSv3 TCP connections can rebind to
the same source address/port combination during a disconnect/
reconnect event. This is a requirement imposed by most NFSv3
server duplicate reply cache implementations.
Optimisations:
- Ask for no NFSv4.1 delegations on OPEN if using O_DIRECT
Other:
- Add Anna Schumaker as co-maintainer for the NFS client"
* tag 'nfs-for-3.20-1' of git://git.linux-nfs.org/projects/trondmy/linux-nfs: (119 commits)
SUNRPC: Cleanup to remove xs_tcp_close()
pnfs: delete an unintended goto
pnfs/flexfiles: Do not dprintk after the free
SUNRPC: Fix stupid typo in xs_sock_set_reuseport
SUNRPC: Define xs_tcp_fin_timeout only if CONFIG_SUNRPC_DEBUG
SUNRPC: Handle connection reset more efficiently.
SUNRPC: Remove the redundant XPRT_CONNECTION_CLOSE flag
SUNRPC: Make xs_tcp_close() do a socket shutdown rather than a sock_release
SUNRPC: Ensure xs_tcp_shutdown() requests a full close of the connection
SUNRPC: Cleanup to remove remaining uses of XPRT_CONNECTION_ABORT
SUNRPC: Remove TCP socket linger code
SUNRPC: Remove TCP client connection reset hack
SUNRPC: TCP/UDP always close the old socket before reconnecting
SUNRPC: Add helpers to prevent socket create from racing
SUNRPC: Ensure xs_reset_transport() resets the close connection flags
SUNRPC: Do not clear the source port in xs_reset_transport
SUNRPC: Handle EADDRINUSE on connect
SUNRPC: Set SO_REUSEPORT socket option for TCP connections
NFSv4.1: Fix pnfs_put_lseg races
NFSv4.1: pnfs_send_layoutreturn should use GFP_NOFS
...
Diffstat (limited to 'fs/nfs/internal.h')
-rw-r--r-- | fs/nfs/internal.h | 53 |
1 files changed, 47 insertions, 6 deletions
diff --git a/fs/nfs/internal.h b/fs/nfs/internal.h index b6f34bfa6fe8..21469e6e3834 100644 --- a/fs/nfs/internal.h +++ b/fs/nfs/internal.h | |||
@@ -6,6 +6,7 @@ | |||
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 | #include <linux/crc32.h> |
9 | #include <linux/nfs_page.h> | ||
9 | 10 | ||
10 | #define NFS_MS_MASK (MS_RDONLY|MS_NOSUID|MS_NODEV|MS_NOEXEC|MS_SYNCHRONOUS) | 11 | #define NFS_MS_MASK (MS_RDONLY|MS_NOSUID|MS_NODEV|MS_NOEXEC|MS_SYNCHRONOUS) |
11 | 12 | ||
@@ -187,9 +188,15 @@ extern struct nfs_client *nfs4_set_ds_client(struct nfs_client* mds_clp, | |||
187 | const struct sockaddr *ds_addr, | 188 | const struct sockaddr *ds_addr, |
188 | int ds_addrlen, int ds_proto, | 189 | int ds_addrlen, int ds_proto, |
189 | unsigned int ds_timeo, | 190 | unsigned int ds_timeo, |
190 | unsigned int ds_retrans); | 191 | unsigned int ds_retrans, |
192 | u32 minor_version, | ||
193 | rpc_authflavor_t au_flavor); | ||
191 | extern struct rpc_clnt *nfs4_find_or_create_ds_client(struct nfs_client *, | 194 | extern struct rpc_clnt *nfs4_find_or_create_ds_client(struct nfs_client *, |
192 | struct inode *); | 195 | struct inode *); |
196 | extern struct nfs_client *nfs3_set_ds_client(struct nfs_client *mds_clp, | ||
197 | const struct sockaddr *ds_addr, int ds_addrlen, | ||
198 | int ds_proto, unsigned int ds_timeo, | ||
199 | unsigned int ds_retrans, rpc_authflavor_t au_flavor); | ||
193 | #ifdef CONFIG_PROC_FS | 200 | #ifdef CONFIG_PROC_FS |
194 | extern int __init nfs_fs_proc_init(void); | 201 | extern int __init nfs_fs_proc_init(void); |
195 | extern void nfs_fs_proc_exit(void); | 202 | extern void nfs_fs_proc_exit(void); |
@@ -242,9 +249,12 @@ struct nfs_pgio_header *nfs_pgio_header_alloc(const struct nfs_rw_ops *); | |||
242 | void nfs_pgio_header_free(struct nfs_pgio_header *); | 249 | void nfs_pgio_header_free(struct nfs_pgio_header *); |
243 | void nfs_pgio_data_destroy(struct nfs_pgio_header *); | 250 | void nfs_pgio_data_destroy(struct nfs_pgio_header *); |
244 | int nfs_generic_pgio(struct nfs_pageio_descriptor *, struct nfs_pgio_header *); | 251 | int nfs_generic_pgio(struct nfs_pageio_descriptor *, struct nfs_pgio_header *); |
245 | int nfs_initiate_pgio(struct rpc_clnt *, struct nfs_pgio_header *, | 252 | int nfs_initiate_pgio(struct rpc_clnt *clnt, struct nfs_pgio_header *hdr, |
246 | const struct rpc_call_ops *, int, int); | 253 | struct rpc_cred *cred, const struct nfs_rpc_ops *rpc_ops, |
254 | const struct rpc_call_ops *call_ops, int how, int flags); | ||
247 | void nfs_free_request(struct nfs_page *req); | 255 | void nfs_free_request(struct nfs_page *req); |
256 | struct nfs_pgio_mirror * | ||
257 | nfs_pgio_current_mirror(struct nfs_pageio_descriptor *desc); | ||
248 | 258 | ||
249 | static inline void nfs_iocounter_init(struct nfs_io_counter *c) | 259 | static inline void nfs_iocounter_init(struct nfs_io_counter *c) |
250 | { | 260 | { |
@@ -252,6 +262,12 @@ static inline void nfs_iocounter_init(struct nfs_io_counter *c) | |||
252 | atomic_set(&c->io_count, 0); | 262 | atomic_set(&c->io_count, 0); |
253 | } | 263 | } |
254 | 264 | ||
265 | static inline bool nfs_pgio_has_mirroring(struct nfs_pageio_descriptor *desc) | ||
266 | { | ||
267 | WARN_ON_ONCE(desc->pg_mirror_count < 1); | ||
268 | return desc->pg_mirror_count > 1; | ||
269 | } | ||
270 | |||
255 | /* nfs2xdr.c */ | 271 | /* nfs2xdr.c */ |
256 | extern struct rpc_procinfo nfs_procedures[]; | 272 | extern struct rpc_procinfo nfs_procedures[]; |
257 | extern int nfs2_decode_dirent(struct xdr_stream *, | 273 | extern int nfs2_decode_dirent(struct xdr_stream *, |
@@ -375,7 +391,7 @@ extern struct rpc_stat nfs_rpcstat; | |||
375 | 391 | ||
376 | extern int __init register_nfs_fs(void); | 392 | extern int __init register_nfs_fs(void); |
377 | extern void __exit unregister_nfs_fs(void); | 393 | extern void __exit unregister_nfs_fs(void); |
378 | extern void nfs_sb_active(struct super_block *sb); | 394 | extern bool nfs_sb_active(struct super_block *sb); |
379 | extern void nfs_sb_deactive(struct super_block *sb); | 395 | extern void nfs_sb_deactive(struct super_block *sb); |
380 | 396 | ||
381 | /* namespace.c */ | 397 | /* namespace.c */ |
@@ -427,6 +443,7 @@ extern void nfs_write_prepare(struct rpc_task *task, void *calldata); | |||
427 | extern void nfs_commit_prepare(struct rpc_task *task, void *calldata); | 443 | extern void nfs_commit_prepare(struct rpc_task *task, void *calldata); |
428 | extern int nfs_initiate_commit(struct rpc_clnt *clnt, | 444 | extern int nfs_initiate_commit(struct rpc_clnt *clnt, |
429 | struct nfs_commit_data *data, | 445 | struct nfs_commit_data *data, |
446 | const struct nfs_rpc_ops *nfs_ops, | ||
430 | const struct rpc_call_ops *call_ops, | 447 | const struct rpc_call_ops *call_ops, |
431 | int how, int flags); | 448 | int how, int flags); |
432 | extern void nfs_init_commit(struct nfs_commit_data *data, | 449 | extern void nfs_init_commit(struct nfs_commit_data *data, |
@@ -440,13 +457,15 @@ int nfs_scan_commit(struct inode *inode, struct list_head *dst, | |||
440 | struct nfs_commit_info *cinfo); | 457 | struct nfs_commit_info *cinfo); |
441 | void nfs_mark_request_commit(struct nfs_page *req, | 458 | void nfs_mark_request_commit(struct nfs_page *req, |
442 | struct pnfs_layout_segment *lseg, | 459 | struct pnfs_layout_segment *lseg, |
443 | struct nfs_commit_info *cinfo); | 460 | struct nfs_commit_info *cinfo, |
461 | u32 ds_commit_idx); | ||
444 | int nfs_write_need_commit(struct nfs_pgio_header *); | 462 | int nfs_write_need_commit(struct nfs_pgio_header *); |
445 | int nfs_generic_commit_list(struct inode *inode, struct list_head *head, | 463 | int nfs_generic_commit_list(struct inode *inode, struct list_head *head, |
446 | int how, struct nfs_commit_info *cinfo); | 464 | int how, struct nfs_commit_info *cinfo); |
447 | void nfs_retry_commit(struct list_head *page_list, | 465 | void nfs_retry_commit(struct list_head *page_list, |
448 | struct pnfs_layout_segment *lseg, | 466 | struct pnfs_layout_segment *lseg, |
449 | struct nfs_commit_info *cinfo); | 467 | struct nfs_commit_info *cinfo, |
468 | u32 ds_commit_idx); | ||
450 | void nfs_commitdata_release(struct nfs_commit_data *data); | 469 | void nfs_commitdata_release(struct nfs_commit_data *data); |
451 | void nfs_request_add_commit_list(struct nfs_page *req, struct list_head *dst, | 470 | void nfs_request_add_commit_list(struct nfs_page *req, struct list_head *dst, |
452 | struct nfs_commit_info *cinfo); | 471 | struct nfs_commit_info *cinfo); |
@@ -457,6 +476,7 @@ void nfs_init_cinfo(struct nfs_commit_info *cinfo, | |||
457 | struct nfs_direct_req *dreq); | 476 | struct nfs_direct_req *dreq); |
458 | int nfs_key_timeout_notify(struct file *filp, struct inode *inode); | 477 | int nfs_key_timeout_notify(struct file *filp, struct inode *inode); |
459 | bool nfs_ctx_key_to_expire(struct nfs_open_context *ctx); | 478 | bool nfs_ctx_key_to_expire(struct nfs_open_context *ctx); |
479 | void nfs_pageio_stop_mirroring(struct nfs_pageio_descriptor *pgio); | ||
460 | 480 | ||
461 | #ifdef CONFIG_MIGRATION | 481 | #ifdef CONFIG_MIGRATION |
462 | extern int nfs_migrate_page(struct address_space *, | 482 | extern int nfs_migrate_page(struct address_space *, |
@@ -480,6 +500,7 @@ static inline void nfs_inode_dio_wait(struct inode *inode) | |||
480 | inode_dio_wait(inode); | 500 | inode_dio_wait(inode); |
481 | } | 501 | } |
482 | extern ssize_t nfs_dreq_bytes_left(struct nfs_direct_req *dreq); | 502 | extern ssize_t nfs_dreq_bytes_left(struct nfs_direct_req *dreq); |
503 | extern void nfs_direct_set_resched_writes(struct nfs_direct_req *dreq); | ||
483 | 504 | ||
484 | /* nfs4proc.c */ | 505 | /* nfs4proc.c */ |
485 | extern void __nfs4_read_done_cb(struct nfs_pgio_header *); | 506 | extern void __nfs4_read_done_cb(struct nfs_pgio_header *); |
@@ -493,6 +514,26 @@ extern int nfs41_walk_client_list(struct nfs_client *clp, | |||
493 | struct nfs_client **result, | 514 | struct nfs_client **result, |
494 | struct rpc_cred *cred); | 515 | struct rpc_cred *cred); |
495 | 516 | ||
517 | static inline struct inode *nfs_igrab_and_active(struct inode *inode) | ||
518 | { | ||
519 | inode = igrab(inode); | ||
520 | if (inode != NULL && !nfs_sb_active(inode->i_sb)) { | ||
521 | iput(inode); | ||
522 | inode = NULL; | ||
523 | } | ||
524 | return inode; | ||
525 | } | ||
526 | |||
527 | static inline void nfs_iput_and_deactive(struct inode *inode) | ||
528 | { | ||
529 | if (inode != NULL) { | ||
530 | struct super_block *sb = inode->i_sb; | ||
531 | |||
532 | iput(inode); | ||
533 | nfs_sb_deactive(sb); | ||
534 | } | ||
535 | } | ||
536 | |||
496 | /* | 537 | /* |
497 | * Determine the device name as a string | 538 | * Determine the device name as a string |
498 | */ | 539 | */ |