diff options
Diffstat (limited to 'fs/nfs/read.c')
-rw-r--r-- | fs/nfs/read.c | 30 |
1 files changed, 28 insertions, 2 deletions
diff --git a/fs/nfs/read.c b/fs/nfs/read.c index 70ba2b4cb9a4..d71f0d55ebde 100644 --- a/fs/nfs/read.c +++ b/fs/nfs/read.c | |||
@@ -22,6 +22,7 @@ | |||
22 | 22 | ||
23 | #include <asm/system.h> | 23 | #include <asm/system.h> |
24 | 24 | ||
25 | #include "nfs4_fs.h" | ||
25 | #include "internal.h" | 26 | #include "internal.h" |
26 | #include "iostat.h" | 27 | #include "iostat.h" |
27 | #include "fscache.h" | 28 | #include "fscache.h" |
@@ -358,19 +359,25 @@ static void nfs_readpage_retry(struct rpc_task *task, struct nfs_read_data *data | |||
358 | struct nfs_readres *resp = &data->res; | 359 | struct nfs_readres *resp = &data->res; |
359 | 360 | ||
360 | if (resp->eof || resp->count == argp->count) | 361 | if (resp->eof || resp->count == argp->count) |
361 | return; | 362 | goto out; |
362 | 363 | ||
363 | /* This is a short read! */ | 364 | /* This is a short read! */ |
364 | nfs_inc_stats(data->inode, NFSIOS_SHORTREAD); | 365 | nfs_inc_stats(data->inode, NFSIOS_SHORTREAD); |
365 | /* Has the server at least made some progress? */ | 366 | /* Has the server at least made some progress? */ |
366 | if (resp->count == 0) | 367 | if (resp->count == 0) |
367 | return; | 368 | goto out; |
368 | 369 | ||
369 | /* Yes, so retry the read at the end of the data */ | 370 | /* Yes, so retry the read at the end of the data */ |
370 | argp->offset += resp->count; | 371 | argp->offset += resp->count; |
371 | argp->pgbase += resp->count; | 372 | argp->pgbase += resp->count; |
372 | argp->count -= resp->count; | 373 | argp->count -= resp->count; |
373 | rpc_restart_call(task); | 374 | rpc_restart_call(task); |
375 | return; | ||
376 | out: | ||
377 | nfs4_sequence_free_slot(NFS_SERVER(data->inode)->nfs_client, | ||
378 | &data->res.seq_res); | ||
379 | return; | ||
380 | |||
374 | } | 381 | } |
375 | 382 | ||
376 | /* | 383 | /* |
@@ -407,7 +414,23 @@ static void nfs_readpage_release_partial(void *calldata) | |||
407 | nfs_readdata_release(calldata); | 414 | nfs_readdata_release(calldata); |
408 | } | 415 | } |
409 | 416 | ||
417 | #if defined(CONFIG_NFS_V4_1) | ||
418 | void nfs_read_prepare(struct rpc_task *task, void *calldata) | ||
419 | { | ||
420 | struct nfs_read_data *data = calldata; | ||
421 | |||
422 | if (nfs4_setup_sequence(NFS_SERVER(data->inode)->nfs_client, | ||
423 | &data->args.seq_args, &data->res.seq_res, | ||
424 | 0, task)) | ||
425 | return; | ||
426 | rpc_call_start(task); | ||
427 | } | ||
428 | #endif /* CONFIG_NFS_V4_1 */ | ||
429 | |||
410 | static const struct rpc_call_ops nfs_read_partial_ops = { | 430 | static const struct rpc_call_ops nfs_read_partial_ops = { |
431 | #if defined(CONFIG_NFS_V4_1) | ||
432 | .rpc_call_prepare = nfs_read_prepare, | ||
433 | #endif /* CONFIG_NFS_V4_1 */ | ||
411 | .rpc_call_done = nfs_readpage_result_partial, | 434 | .rpc_call_done = nfs_readpage_result_partial, |
412 | .rpc_release = nfs_readpage_release_partial, | 435 | .rpc_release = nfs_readpage_release_partial, |
413 | }; | 436 | }; |
@@ -471,6 +494,9 @@ static void nfs_readpage_release_full(void *calldata) | |||
471 | } | 494 | } |
472 | 495 | ||
473 | static const struct rpc_call_ops nfs_read_full_ops = { | 496 | static const struct rpc_call_ops nfs_read_full_ops = { |
497 | #if defined(CONFIG_NFS_V4_1) | ||
498 | .rpc_call_prepare = nfs_read_prepare, | ||
499 | #endif /* CONFIG_NFS_V4_1 */ | ||
474 | .rpc_call_done = nfs_readpage_result_full, | 500 | .rpc_call_done = nfs_readpage_result_full, |
475 | .rpc_release = nfs_readpage_release_full, | 501 | .rpc_release = nfs_readpage_release_full, |
476 | }; | 502 | }; |