diff options
author | Trond Myklebust <Trond.Myklebust@netapp.com> | 2012-05-01 11:21:43 -0400 |
---|---|---|
committer | Trond Myklebust <Trond.Myklebust@netapp.com> | 2012-05-01 13:48:13 -0400 |
commit | 9146ab5055152bbacb5690c384df2fd610fb3c68 (patch) | |
tree | 59594c1f94c39e06b4a9644643dc1062c4d8ba03 /fs/nfs/read.c | |
parent | 4f97615d19c370d1d907ef37f8bcd9c3672851ca (diff) |
NFS: Read cleanups
Remove unused variables, and reformat some code.
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
Cc: Fred Isaman <iisaman@netapp.com>
Diffstat (limited to 'fs/nfs/read.c')
-rw-r--r-- | fs/nfs/read.c | 13 |
1 files changed, 4 insertions, 9 deletions
diff --git a/fs/nfs/read.c b/fs/nfs/read.c index 35e2dcebffe6..20a029324060 100644 --- a/fs/nfs/read.c +++ b/fs/nfs/read.c | |||
@@ -341,8 +341,6 @@ static int nfs_pagein_multi(struct nfs_pageio_descriptor *desc, | |||
341 | struct nfs_read_data *data; | 341 | struct nfs_read_data *data; |
342 | size_t rsize = desc->pg_bsize, nbytes; | 342 | size_t rsize = desc->pg_bsize, nbytes; |
343 | unsigned int offset; | 343 | unsigned int offset; |
344 | int requests = 0; | ||
345 | int ret = 0; | ||
346 | 344 | ||
347 | nfs_list_remove_request(req); | 345 | nfs_list_remove_request(req); |
348 | nfs_list_add_request(req, &hdr->pages); | 346 | nfs_list_add_request(req, &hdr->pages); |
@@ -358,12 +356,11 @@ static int nfs_pagein_multi(struct nfs_pageio_descriptor *desc, | |||
358 | data->pages.pagevec[0] = page; | 356 | data->pages.pagevec[0] = page; |
359 | nfs_read_rpcsetup(data, len, offset); | 357 | nfs_read_rpcsetup(data, len, offset); |
360 | list_add(&data->list, &hdr->rpc_list); | 358 | list_add(&data->list, &hdr->rpc_list); |
361 | requests++; | ||
362 | nbytes -= len; | 359 | nbytes -= len; |
363 | offset += len; | 360 | offset += len; |
364 | } while(nbytes != 0); | 361 | } while (nbytes != 0); |
365 | desc->pg_rpc_callops = &nfs_read_common_ops; | 362 | desc->pg_rpc_callops = &nfs_read_common_ops; |
366 | return ret; | 363 | return 0; |
367 | out_bad: | 364 | out_bad: |
368 | while (!list_empty(&hdr->rpc_list)) { | 365 | while (!list_empty(&hdr->rpc_list)) { |
369 | data = list_first_entry(&hdr->rpc_list, struct nfs_read_data, list); | 366 | data = list_first_entry(&hdr->rpc_list, struct nfs_read_data, list); |
@@ -387,8 +384,7 @@ static int nfs_pagein_one(struct nfs_pageio_descriptor *desc, | |||
387 | desc->pg_count)); | 384 | desc->pg_count)); |
388 | if (!data) { | 385 | if (!data) { |
389 | desc->pg_completion_ops->error_cleanup(head); | 386 | desc->pg_completion_ops->error_cleanup(head); |
390 | ret = -ENOMEM; | 387 | return -ENOMEM; |
391 | goto out; | ||
392 | } | 388 | } |
393 | 389 | ||
394 | pages = data->pages.pagevec; | 390 | pages = data->pages.pagevec; |
@@ -402,8 +398,7 @@ static int nfs_pagein_one(struct nfs_pageio_descriptor *desc, | |||
402 | nfs_read_rpcsetup(data, desc->pg_count, 0); | 398 | nfs_read_rpcsetup(data, desc->pg_count, 0); |
403 | list_add(&data->list, &hdr->rpc_list); | 399 | list_add(&data->list, &hdr->rpc_list); |
404 | desc->pg_rpc_callops = &nfs_read_common_ops; | 400 | desc->pg_rpc_callops = &nfs_read_common_ops; |
405 | out: | 401 | return 0; |
406 | return ret; | ||
407 | } | 402 | } |
408 | 403 | ||
409 | int nfs_generic_pagein(struct nfs_pageio_descriptor *desc, | 404 | int nfs_generic_pagein(struct nfs_pageio_descriptor *desc, |