diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2015-11-09 21:11:22 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2015-11-09 21:11:22 -0500 |
commit | e6604ecb70d4b1dbc0372c6518b51c25c4b135a1 (patch) | |
tree | 2d12c51b84c3ba8472e59ddbe37da034e2c5251f /include | |
parent | 9d74288ca79249af4b906215788b37d52263b58b (diff) | |
parent | 941c3ff3102ccce440034d59cf9e4e9cc10b720d (diff) |
Merge tag 'nfs-for-4.4-1' of git://git.linux-nfs.org/projects/trondmy/linux-nfs
Pull NFS client updates from Trond Myklebust:
"Highlights include:
New features:
- RDMA client backchannel from Chuck
- Support for NFSv4.2 file CLONE using the btrfs ioctl
Bugfixes + cleanups:
- Move socket data receive out of the bottom halves and into a
workqueue
- Refactor NFSv4 error handling so synchronous and asynchronous RPC
handles errors identically.
- Fix a panic when blocks or object layouts reads return a bad data
length
- Fix nfsroot so it can handle a 1024 byte long path.
- Fix bad usage of page offset in bl_read_pagelist
- Various NFSv4 callback cleanups+fixes
- Fix GETATTR bitmap verification
- Support hexadecimal number for sunrpc debug sysctl files"
* tag 'nfs-for-4.4-1' of git://git.linux-nfs.org/projects/trondmy/linux-nfs: (53 commits)
Sunrpc: Supports hexadecimal number for sysctl files of sunrpc debug
nfs: Fix GETATTR bitmap verification
nfs: Remove unused xdr page offsets in getacl/setacl arguments
fs/nfs: remove unnecessary new_valid_dev check
SUNRPC: fix variable type
NFS: Enable client side NFSv4.1 backchannel to use other transports
pNFS/flexfiles: Add support for FF_FLAGS_NO_IO_THRU_MDS
pNFS/flexfiles: When mirrored, retry failed reads by switching mirrors
SUNRPC: Remove the TCP-only restriction in bc_svc_process()
svcrdma: Add backward direction service for RPC/RDMA transport
xprtrdma: Handle incoming backward direction RPC calls
xprtrdma: Add support for sending backward direction RPC replies
xprtrdma: Pre-allocate Work Requests for backchannel
xprtrdma: Pre-allocate backward rpc_rqst and send/receive buffers
SUNRPC: Abstract backchannel operations
xprtrdma: Saving IRQs no longer needed for rb_lock
xprtrdma: Remove reply tasklet
xprtrdma: Use workqueue to process RPC/RDMA replies
xprtrdma: Replace send and receive arrays
xprtrdma: Refactor reply handler error handling
...
Diffstat (limited to 'include')
-rw-r--r-- | include/linux/nfs4.h | 3 | ||||
-rw-r--r-- | include/linux/nfs_fs_sb.h | 2 | ||||
-rw-r--r-- | include/linux/nfs_xdr.h | 28 | ||||
-rw-r--r-- | include/linux/sunrpc/bc_xprt.h | 5 | ||||
-rw-r--r-- | include/linux/sunrpc/svc_rdma.h | 6 | ||||
-rw-r--r-- | include/linux/sunrpc/xprt.h | 9 | ||||
-rw-r--r-- | include/linux/sunrpc/xprtsock.h | 2 | ||||
-rw-r--r-- | include/uapi/linux/nfs.h | 13 |
8 files changed, 62 insertions, 6 deletions
diff --git a/include/linux/nfs4.h b/include/linux/nfs4.h index 00121f298269..e7e78537aea2 100644 --- a/include/linux/nfs4.h +++ b/include/linux/nfs4.h | |||
@@ -130,6 +130,7 @@ enum nfs_opnum4 { | |||
130 | OP_READ_PLUS = 68, | 130 | OP_READ_PLUS = 68, |
131 | OP_SEEK = 69, | 131 | OP_SEEK = 69, |
132 | OP_WRITE_SAME = 70, | 132 | OP_WRITE_SAME = 70, |
133 | OP_CLONE = 71, | ||
133 | 134 | ||
134 | OP_ILLEGAL = 10044, | 135 | OP_ILLEGAL = 10044, |
135 | }; | 136 | }; |
@@ -421,6 +422,7 @@ enum lock_type4 { | |||
421 | #define FATTR4_WORD2_LAYOUT_TYPES (1UL << 0) | 422 | #define FATTR4_WORD2_LAYOUT_TYPES (1UL << 0) |
422 | #define FATTR4_WORD2_LAYOUT_BLKSIZE (1UL << 1) | 423 | #define FATTR4_WORD2_LAYOUT_BLKSIZE (1UL << 1) |
423 | #define FATTR4_WORD2_MDSTHRESHOLD (1UL << 4) | 424 | #define FATTR4_WORD2_MDSTHRESHOLD (1UL << 4) |
425 | #define FATTR4_WORD2_CLONE_BLKSIZE (1UL << 13) | ||
424 | #define FATTR4_WORD2_SECURITY_LABEL (1UL << 16) | 426 | #define FATTR4_WORD2_SECURITY_LABEL (1UL << 16) |
425 | 427 | ||
426 | /* MDS threshold bitmap bits */ | 428 | /* MDS threshold bitmap bits */ |
@@ -501,6 +503,7 @@ enum { | |||
501 | NFSPROC4_CLNT_ALLOCATE, | 503 | NFSPROC4_CLNT_ALLOCATE, |
502 | NFSPROC4_CLNT_DEALLOCATE, | 504 | NFSPROC4_CLNT_DEALLOCATE, |
503 | NFSPROC4_CLNT_LAYOUTSTATS, | 505 | NFSPROC4_CLNT_LAYOUTSTATS, |
506 | NFSPROC4_CLNT_CLONE, | ||
504 | }; | 507 | }; |
505 | 508 | ||
506 | /* nfs41 types */ | 509 | /* nfs41 types */ |
diff --git a/include/linux/nfs_fs_sb.h b/include/linux/nfs_fs_sb.h index 570a7df2775b..2469ab0bb3a1 100644 --- a/include/linux/nfs_fs_sb.h +++ b/include/linux/nfs_fs_sb.h | |||
@@ -147,6 +147,7 @@ struct nfs_server { | |||
147 | unsigned int acdirmax; | 147 | unsigned int acdirmax; |
148 | unsigned int namelen; | 148 | unsigned int namelen; |
149 | unsigned int options; /* extra options enabled by mount */ | 149 | unsigned int options; /* extra options enabled by mount */ |
150 | unsigned int clone_blksize; /* granularity of a CLONE operation */ | ||
150 | #define NFS_OPTION_FSCACHE 0x00000001 /* - local caching enabled */ | 151 | #define NFS_OPTION_FSCACHE 0x00000001 /* - local caching enabled */ |
151 | #define NFS_OPTION_MIGRATION 0x00000002 /* - NFSv4 migration enabled */ | 152 | #define NFS_OPTION_MIGRATION 0x00000002 /* - NFSv4 migration enabled */ |
152 | 153 | ||
@@ -243,5 +244,6 @@ struct nfs_server { | |||
243 | #define NFS_CAP_ALLOCATE (1U << 20) | 244 | #define NFS_CAP_ALLOCATE (1U << 20) |
244 | #define NFS_CAP_DEALLOCATE (1U << 21) | 245 | #define NFS_CAP_DEALLOCATE (1U << 21) |
245 | #define NFS_CAP_LAYOUTSTATS (1U << 22) | 246 | #define NFS_CAP_LAYOUTSTATS (1U << 22) |
247 | #define NFS_CAP_CLONE (1U << 23) | ||
246 | 248 | ||
247 | #endif | 249 | #endif |
diff --git a/include/linux/nfs_xdr.h b/include/linux/nfs_xdr.h index 52faf7e96c65..570d630f98ae 100644 --- a/include/linux/nfs_xdr.h +++ b/include/linux/nfs_xdr.h | |||
@@ -141,6 +141,7 @@ struct nfs_fsinfo { | |||
141 | __u32 lease_time; /* in seconds */ | 141 | __u32 lease_time; /* in seconds */ |
142 | __u32 layouttype; /* supported pnfs layout driver */ | 142 | __u32 layouttype; /* supported pnfs layout driver */ |
143 | __u32 blksize; /* preferred pnfs io block size */ | 143 | __u32 blksize; /* preferred pnfs io block size */ |
144 | __u32 clone_blksize; /* granularity of a CLONE operation */ | ||
144 | }; | 145 | }; |
145 | 146 | ||
146 | struct nfs_fsstat { | 147 | struct nfs_fsstat { |
@@ -359,6 +360,25 @@ struct nfs42_layoutstat_data { | |||
359 | struct nfs42_layoutstat_res res; | 360 | struct nfs42_layoutstat_res res; |
360 | }; | 361 | }; |
361 | 362 | ||
363 | struct nfs42_clone_args { | ||
364 | struct nfs4_sequence_args seq_args; | ||
365 | struct nfs_fh *src_fh; | ||
366 | struct nfs_fh *dst_fh; | ||
367 | nfs4_stateid src_stateid; | ||
368 | nfs4_stateid dst_stateid; | ||
369 | __u64 src_offset; | ||
370 | __u64 dst_offset; | ||
371 | __u64 count; | ||
372 | const u32 *dst_bitmask; | ||
373 | }; | ||
374 | |||
375 | struct nfs42_clone_res { | ||
376 | struct nfs4_sequence_res seq_res; | ||
377 | unsigned int rpc_status; | ||
378 | struct nfs_fattr *dst_fattr; | ||
379 | const struct nfs_server *server; | ||
380 | }; | ||
381 | |||
362 | struct stateowner_id { | 382 | struct stateowner_id { |
363 | __u64 create_time; | 383 | __u64 create_time; |
364 | __u32 uniquifier; | 384 | __u32 uniquifier; |
@@ -528,7 +548,7 @@ struct nfs4_delegreturnargs { | |||
528 | struct nfs4_delegreturnres { | 548 | struct nfs4_delegreturnres { |
529 | struct nfs4_sequence_res seq_res; | 549 | struct nfs4_sequence_res seq_res; |
530 | struct nfs_fattr * fattr; | 550 | struct nfs_fattr * fattr; |
531 | const struct nfs_server *server; | 551 | struct nfs_server *server; |
532 | }; | 552 | }; |
533 | 553 | ||
534 | /* | 554 | /* |
@@ -601,7 +621,7 @@ struct nfs_removeargs { | |||
601 | 621 | ||
602 | struct nfs_removeres { | 622 | struct nfs_removeres { |
603 | struct nfs4_sequence_res seq_res; | 623 | struct nfs4_sequence_res seq_res; |
604 | const struct nfs_server *server; | 624 | struct nfs_server *server; |
605 | struct nfs_fattr *dir_attr; | 625 | struct nfs_fattr *dir_attr; |
606 | struct nfs4_change_info cinfo; | 626 | struct nfs4_change_info cinfo; |
607 | }; | 627 | }; |
@@ -619,7 +639,7 @@ struct nfs_renameargs { | |||
619 | 639 | ||
620 | struct nfs_renameres { | 640 | struct nfs_renameres { |
621 | struct nfs4_sequence_res seq_res; | 641 | struct nfs4_sequence_res seq_res; |
622 | const struct nfs_server *server; | 642 | struct nfs_server *server; |
623 | struct nfs4_change_info old_cinfo; | 643 | struct nfs4_change_info old_cinfo; |
624 | struct nfs_fattr *old_fattr; | 644 | struct nfs_fattr *old_fattr; |
625 | struct nfs4_change_info new_cinfo; | 645 | struct nfs4_change_info new_cinfo; |
@@ -685,7 +705,6 @@ struct nfs_setaclargs { | |||
685 | struct nfs4_sequence_args seq_args; | 705 | struct nfs4_sequence_args seq_args; |
686 | struct nfs_fh * fh; | 706 | struct nfs_fh * fh; |
687 | size_t acl_len; | 707 | size_t acl_len; |
688 | unsigned int acl_pgbase; | ||
689 | struct page ** acl_pages; | 708 | struct page ** acl_pages; |
690 | }; | 709 | }; |
691 | 710 | ||
@@ -697,7 +716,6 @@ struct nfs_getaclargs { | |||
697 | struct nfs4_sequence_args seq_args; | 716 | struct nfs4_sequence_args seq_args; |
698 | struct nfs_fh * fh; | 717 | struct nfs_fh * fh; |
699 | size_t acl_len; | 718 | size_t acl_len; |
700 | unsigned int acl_pgbase; | ||
701 | struct page ** acl_pages; | 719 | struct page ** acl_pages; |
702 | }; | 720 | }; |
703 | 721 | ||
diff --git a/include/linux/sunrpc/bc_xprt.h b/include/linux/sunrpc/bc_xprt.h index 8df43c9f11dc..4397a4824c81 100644 --- a/include/linux/sunrpc/bc_xprt.h +++ b/include/linux/sunrpc/bc_xprt.h | |||
@@ -38,6 +38,11 @@ void xprt_free_bc_request(struct rpc_rqst *req); | |||
38 | int xprt_setup_backchannel(struct rpc_xprt *, unsigned int min_reqs); | 38 | int xprt_setup_backchannel(struct rpc_xprt *, unsigned int min_reqs); |
39 | void xprt_destroy_backchannel(struct rpc_xprt *, unsigned int max_reqs); | 39 | void xprt_destroy_backchannel(struct rpc_xprt *, unsigned int max_reqs); |
40 | 40 | ||
41 | /* Socket backchannel transport methods */ | ||
42 | int xprt_setup_bc(struct rpc_xprt *xprt, unsigned int min_reqs); | ||
43 | void xprt_destroy_bc(struct rpc_xprt *xprt, unsigned int max_reqs); | ||
44 | void xprt_free_bc_rqst(struct rpc_rqst *req); | ||
45 | |||
41 | /* | 46 | /* |
42 | * Determine if a shared backchannel is in use | 47 | * Determine if a shared backchannel is in use |
43 | */ | 48 | */ |
diff --git a/include/linux/sunrpc/svc_rdma.h b/include/linux/sunrpc/svc_rdma.h index 1e4438ea2380..f869807a0d0e 100644 --- a/include/linux/sunrpc/svc_rdma.h +++ b/include/linux/sunrpc/svc_rdma.h | |||
@@ -226,9 +226,13 @@ extern void svc_rdma_put_frmr(struct svcxprt_rdma *, | |||
226 | struct svc_rdma_fastreg_mr *); | 226 | struct svc_rdma_fastreg_mr *); |
227 | extern void svc_sq_reap(struct svcxprt_rdma *); | 227 | extern void svc_sq_reap(struct svcxprt_rdma *); |
228 | extern void svc_rq_reap(struct svcxprt_rdma *); | 228 | extern void svc_rq_reap(struct svcxprt_rdma *); |
229 | extern struct svc_xprt_class svc_rdma_class; | ||
230 | extern void svc_rdma_prep_reply_hdr(struct svc_rqst *); | 229 | extern void svc_rdma_prep_reply_hdr(struct svc_rqst *); |
231 | 230 | ||
231 | extern struct svc_xprt_class svc_rdma_class; | ||
232 | #ifdef CONFIG_SUNRPC_BACKCHANNEL | ||
233 | extern struct svc_xprt_class svc_rdma_bc_class; | ||
234 | #endif | ||
235 | |||
232 | /* svc_rdma.c */ | 236 | /* svc_rdma.c */ |
233 | extern int svc_rdma_init(void); | 237 | extern int svc_rdma_init(void); |
234 | extern void svc_rdma_cleanup(void); | 238 | extern void svc_rdma_cleanup(void); |
diff --git a/include/linux/sunrpc/xprt.h b/include/linux/sunrpc/xprt.h index 0fb9acbb4780..69ef5b3ab038 100644 --- a/include/linux/sunrpc/xprt.h +++ b/include/linux/sunrpc/xprt.h | |||
@@ -54,6 +54,8 @@ enum rpc_display_format_t { | |||
54 | struct rpc_task; | 54 | struct rpc_task; |
55 | struct rpc_xprt; | 55 | struct rpc_xprt; |
56 | struct seq_file; | 56 | struct seq_file; |
57 | struct svc_serv; | ||
58 | struct net; | ||
57 | 59 | ||
58 | /* | 60 | /* |
59 | * This describes a complete RPC request | 61 | * This describes a complete RPC request |
@@ -136,6 +138,12 @@ struct rpc_xprt_ops { | |||
136 | int (*enable_swap)(struct rpc_xprt *xprt); | 138 | int (*enable_swap)(struct rpc_xprt *xprt); |
137 | void (*disable_swap)(struct rpc_xprt *xprt); | 139 | void (*disable_swap)(struct rpc_xprt *xprt); |
138 | void (*inject_disconnect)(struct rpc_xprt *xprt); | 140 | void (*inject_disconnect)(struct rpc_xprt *xprt); |
141 | int (*bc_setup)(struct rpc_xprt *xprt, | ||
142 | unsigned int min_reqs); | ||
143 | int (*bc_up)(struct svc_serv *serv, struct net *net); | ||
144 | void (*bc_free_rqst)(struct rpc_rqst *rqst); | ||
145 | void (*bc_destroy)(struct rpc_xprt *xprt, | ||
146 | unsigned int max_reqs); | ||
139 | }; | 147 | }; |
140 | 148 | ||
141 | /* | 149 | /* |
@@ -153,6 +161,7 @@ enum xprt_transports { | |||
153 | XPRT_TRANSPORT_TCP = IPPROTO_TCP, | 161 | XPRT_TRANSPORT_TCP = IPPROTO_TCP, |
154 | XPRT_TRANSPORT_BC_TCP = IPPROTO_TCP | XPRT_TRANSPORT_BC, | 162 | XPRT_TRANSPORT_BC_TCP = IPPROTO_TCP | XPRT_TRANSPORT_BC, |
155 | XPRT_TRANSPORT_RDMA = 256, | 163 | XPRT_TRANSPORT_RDMA = 256, |
164 | XPRT_TRANSPORT_BC_RDMA = XPRT_TRANSPORT_RDMA | XPRT_TRANSPORT_BC, | ||
156 | XPRT_TRANSPORT_LOCAL = 257, | 165 | XPRT_TRANSPORT_LOCAL = 257, |
157 | }; | 166 | }; |
158 | 167 | ||
diff --git a/include/linux/sunrpc/xprtsock.h b/include/linux/sunrpc/xprtsock.h index 357e44c1a46b..0ece4ba06f06 100644 --- a/include/linux/sunrpc/xprtsock.h +++ b/include/linux/sunrpc/xprtsock.h | |||
@@ -44,6 +44,8 @@ struct sock_xprt { | |||
44 | */ | 44 | */ |
45 | unsigned long sock_state; | 45 | unsigned long sock_state; |
46 | struct delayed_work connect_worker; | 46 | struct delayed_work connect_worker; |
47 | struct work_struct recv_worker; | ||
48 | struct mutex recv_mutex; | ||
47 | struct sockaddr_storage srcaddr; | 49 | struct sockaddr_storage srcaddr; |
48 | unsigned short srcport; | 50 | unsigned short srcport; |
49 | 51 | ||
diff --git a/include/uapi/linux/nfs.h b/include/uapi/linux/nfs.h index 5199a36dd574..654bae3f1a38 100644 --- a/include/uapi/linux/nfs.h +++ b/include/uapi/linux/nfs.h | |||
@@ -7,6 +7,8 @@ | |||
7 | #ifndef _UAPI_LINUX_NFS_H | 7 | #ifndef _UAPI_LINUX_NFS_H |
8 | #define _UAPI_LINUX_NFS_H | 8 | #define _UAPI_LINUX_NFS_H |
9 | 9 | ||
10 | #include <linux/types.h> | ||
11 | |||
10 | #define NFS_PROGRAM 100003 | 12 | #define NFS_PROGRAM 100003 |
11 | #define NFS_PORT 2049 | 13 | #define NFS_PORT 2049 |
12 | #define NFS_MAXDATA 8192 | 14 | #define NFS_MAXDATA 8192 |
@@ -31,6 +33,17 @@ | |||
31 | 33 | ||
32 | #define NFS_PIPE_DIRNAME "nfs" | 34 | #define NFS_PIPE_DIRNAME "nfs" |
33 | 35 | ||
36 | /* NFS ioctls */ | ||
37 | /* Let's follow btrfs lead on CLONE to avoid messing userspace */ | ||
38 | #define NFS_IOC_CLONE _IOW(0x94, 9, int) | ||
39 | #define NFS_IOC_CLONE_RANGE _IOW(0x94, 13, int) | ||
40 | |||
41 | struct nfs_ioctl_clone_range_args { | ||
42 | __s64 src_fd; | ||
43 | __u64 src_off, count; | ||
44 | __u64 dst_off; | ||
45 | }; | ||
46 | |||
34 | /* | 47 | /* |
35 | * NFS stats. The good thing with these values is that NFSv3 errors are | 48 | * NFS stats. The good thing with these values is that NFSv3 errors are |
36 | * a superset of NFSv2 errors (with the exception of NFSERR_WFLUSH which | 49 | * a superset of NFSv2 errors (with the exception of NFSERR_WFLUSH which |