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 /fs/nfs/nfs42xdr.c | |
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 'fs/nfs/nfs42xdr.c')
-rw-r--r-- | fs/nfs/nfs42xdr.c | 97 |
1 files changed, 96 insertions, 1 deletions
diff --git a/fs/nfs/nfs42xdr.c b/fs/nfs/nfs42xdr.c index 0eb29e14070d..0ca482a51e53 100644 --- a/fs/nfs/nfs42xdr.c +++ b/fs/nfs/nfs42xdr.c | |||
@@ -34,6 +34,12 @@ | |||
34 | 1 /* opaque devaddr4 length */ + \ | 34 | 1 /* opaque devaddr4 length */ + \ |
35 | XDR_QUADLEN(PNFS_LAYOUTSTATS_MAXSIZE)) | 35 | XDR_QUADLEN(PNFS_LAYOUTSTATS_MAXSIZE)) |
36 | #define decode_layoutstats_maxsz (op_decode_hdr_maxsz) | 36 | #define decode_layoutstats_maxsz (op_decode_hdr_maxsz) |
37 | #define encode_clone_maxsz (encode_stateid_maxsz + \ | ||
38 | encode_stateid_maxsz + \ | ||
39 | 2 /* src offset */ + \ | ||
40 | 2 /* dst offset */ + \ | ||
41 | 2 /* count */) | ||
42 | #define decode_clone_maxsz (op_decode_hdr_maxsz) | ||
37 | 43 | ||
38 | #define NFS4_enc_allocate_sz (compound_encode_hdr_maxsz + \ | 44 | #define NFS4_enc_allocate_sz (compound_encode_hdr_maxsz + \ |
39 | encode_putfh_maxsz + \ | 45 | encode_putfh_maxsz + \ |
@@ -65,7 +71,20 @@ | |||
65 | decode_sequence_maxsz + \ | 71 | decode_sequence_maxsz + \ |
66 | decode_putfh_maxsz + \ | 72 | decode_putfh_maxsz + \ |
67 | PNFS_LAYOUTSTATS_MAXDEV * decode_layoutstats_maxsz) | 73 | PNFS_LAYOUTSTATS_MAXDEV * decode_layoutstats_maxsz) |
68 | 74 | #define NFS4_enc_clone_sz (compound_encode_hdr_maxsz + \ | |
75 | encode_sequence_maxsz + \ | ||
76 | encode_putfh_maxsz + \ | ||
77 | encode_savefh_maxsz + \ | ||
78 | encode_putfh_maxsz + \ | ||
79 | encode_clone_maxsz + \ | ||
80 | encode_getattr_maxsz) | ||
81 | #define NFS4_dec_clone_sz (compound_decode_hdr_maxsz + \ | ||
82 | decode_sequence_maxsz + \ | ||
83 | decode_putfh_maxsz + \ | ||
84 | decode_savefh_maxsz + \ | ||
85 | decode_putfh_maxsz + \ | ||
86 | decode_clone_maxsz + \ | ||
87 | decode_getattr_maxsz) | ||
69 | 88 | ||
70 | static void encode_fallocate(struct xdr_stream *xdr, | 89 | static void encode_fallocate(struct xdr_stream *xdr, |
71 | struct nfs42_falloc_args *args) | 90 | struct nfs42_falloc_args *args) |
@@ -128,6 +147,21 @@ static void encode_layoutstats(struct xdr_stream *xdr, | |||
128 | encode_uint32(xdr, 0); | 147 | encode_uint32(xdr, 0); |
129 | } | 148 | } |
130 | 149 | ||
150 | static void encode_clone(struct xdr_stream *xdr, | ||
151 | struct nfs42_clone_args *args, | ||
152 | struct compound_hdr *hdr) | ||
153 | { | ||
154 | __be32 *p; | ||
155 | |||
156 | encode_op_hdr(xdr, OP_CLONE, decode_clone_maxsz, hdr); | ||
157 | encode_nfs4_stateid(xdr, &args->src_stateid); | ||
158 | encode_nfs4_stateid(xdr, &args->dst_stateid); | ||
159 | p = reserve_space(xdr, 3*8); | ||
160 | p = xdr_encode_hyper(p, args->src_offset); | ||
161 | p = xdr_encode_hyper(p, args->dst_offset); | ||
162 | xdr_encode_hyper(p, args->count); | ||
163 | } | ||
164 | |||
131 | /* | 165 | /* |
132 | * Encode ALLOCATE request | 166 | * Encode ALLOCATE request |
133 | */ | 167 | */ |
@@ -206,6 +240,27 @@ static void nfs4_xdr_enc_layoutstats(struct rpc_rqst *req, | |||
206 | encode_nops(&hdr); | 240 | encode_nops(&hdr); |
207 | } | 241 | } |
208 | 242 | ||
243 | /* | ||
244 | * Encode CLONE request | ||
245 | */ | ||
246 | static void nfs4_xdr_enc_clone(struct rpc_rqst *req, | ||
247 | struct xdr_stream *xdr, | ||
248 | struct nfs42_clone_args *args) | ||
249 | { | ||
250 | struct compound_hdr hdr = { | ||
251 | .minorversion = nfs4_xdr_minorversion(&args->seq_args), | ||
252 | }; | ||
253 | |||
254 | encode_compound_hdr(xdr, req, &hdr); | ||
255 | encode_sequence(xdr, &args->seq_args, &hdr); | ||
256 | encode_putfh(xdr, args->src_fh, &hdr); | ||
257 | encode_savefh(xdr, &hdr); | ||
258 | encode_putfh(xdr, args->dst_fh, &hdr); | ||
259 | encode_clone(xdr, args, &hdr); | ||
260 | encode_getfattr(xdr, args->dst_bitmask, &hdr); | ||
261 | encode_nops(&hdr); | ||
262 | } | ||
263 | |||
209 | static int decode_allocate(struct xdr_stream *xdr, struct nfs42_falloc_res *res) | 264 | static int decode_allocate(struct xdr_stream *xdr, struct nfs42_falloc_res *res) |
210 | { | 265 | { |
211 | return decode_op_hdr(xdr, OP_ALLOCATE); | 266 | return decode_op_hdr(xdr, OP_ALLOCATE); |
@@ -243,6 +298,11 @@ static int decode_layoutstats(struct xdr_stream *xdr) | |||
243 | return decode_op_hdr(xdr, OP_LAYOUTSTATS); | 298 | return decode_op_hdr(xdr, OP_LAYOUTSTATS); |
244 | } | 299 | } |
245 | 300 | ||
301 | static int decode_clone(struct xdr_stream *xdr) | ||
302 | { | ||
303 | return decode_op_hdr(xdr, OP_CLONE); | ||
304 | } | ||
305 | |||
246 | /* | 306 | /* |
247 | * Decode ALLOCATE request | 307 | * Decode ALLOCATE request |
248 | */ | 308 | */ |
@@ -351,4 +411,39 @@ out: | |||
351 | return status; | 411 | return status; |
352 | } | 412 | } |
353 | 413 | ||
414 | /* | ||
415 | * Decode CLONE request | ||
416 | */ | ||
417 | static int nfs4_xdr_dec_clone(struct rpc_rqst *rqstp, | ||
418 | struct xdr_stream *xdr, | ||
419 | struct nfs42_clone_res *res) | ||
420 | { | ||
421 | struct compound_hdr hdr; | ||
422 | int status; | ||
423 | |||
424 | status = decode_compound_hdr(xdr, &hdr); | ||
425 | if (status) | ||
426 | goto out; | ||
427 | status = decode_sequence(xdr, &res->seq_res, rqstp); | ||
428 | if (status) | ||
429 | goto out; | ||
430 | status = decode_putfh(xdr); | ||
431 | if (status) | ||
432 | goto out; | ||
433 | status = decode_savefh(xdr); | ||
434 | if (status) | ||
435 | goto out; | ||
436 | status = decode_putfh(xdr); | ||
437 | if (status) | ||
438 | goto out; | ||
439 | status = decode_clone(xdr); | ||
440 | if (status) | ||
441 | goto out; | ||
442 | status = decode_getfattr(xdr, res->dst_fattr, res->server); | ||
443 | |||
444 | out: | ||
445 | res->rpc_status = status; | ||
446 | return status; | ||
447 | } | ||
448 | |||
354 | #endif /* __LINUX_FS_NFS_NFS4_2XDR_H */ | 449 | #endif /* __LINUX_FS_NFS_NFS4_2XDR_H */ |