diff options
author | Boaz Harrosh <bharrosh@panasas.com> | 2011-10-31 17:45:06 -0400 |
---|---|---|
committer | Trond Myklebust <Trond.Myklebust@netapp.com> | 2011-11-02 23:56:00 -0400 |
commit | 4cdc685c7d06f659ef6c336d4242005cdd8df401 (patch) | |
tree | af4074fae08ad9d24b035b54ab065f90bae31b5f /fs/nfs/objlayout | |
parent | 994c0e992522c123298b4a91b72f5e67ba2d1123 (diff) |
pnfs-obj: Remove redundant EOF from objlayout_io_state
The EOF calculation was done on .read_pagelist(), cached
in objlayout_io_state->eof, and set in objlayout_read_done()
into nfs_read_data->res.eof.
So set it directly into nfs_read_data->res.eof and avoid
the extra member.
Signed-off-by: Boaz Harrosh <bharrosh@panasas.com>
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
Diffstat (limited to 'fs/nfs/objlayout')
-rw-r--r-- | fs/nfs/objlayout/objlayout.c | 16 | ||||
-rw-r--r-- | fs/nfs/objlayout/objlayout.h | 1 |
2 files changed, 7 insertions, 10 deletions
diff --git a/fs/nfs/objlayout/objlayout.c b/fs/nfs/objlayout/objlayout.c index 1d06f8e2adea..1300736e0fb4 100644 --- a/fs/nfs/objlayout/objlayout.c +++ b/fs/nfs/objlayout/objlayout.c | |||
@@ -287,17 +287,14 @@ static void _rpc_read_complete(struct work_struct *work) | |||
287 | void | 287 | void |
288 | objlayout_read_done(struct objlayout_io_state *state, ssize_t status, bool sync) | 288 | objlayout_read_done(struct objlayout_io_state *state, ssize_t status, bool sync) |
289 | { | 289 | { |
290 | int eof = state->eof; | 290 | struct nfs_read_data *rdata = state->rpcdata; |
291 | struct nfs_read_data *rdata; | ||
292 | 291 | ||
293 | state->status = status; | 292 | state->status = status; |
294 | dprintk("%s: Begin status=%zd eof=%d\n", __func__, status, eof); | 293 | dprintk("%s: Begin status=%zd eof=%d\n", __func__, |
295 | rdata = state->rpcdata; | 294 | status, rdata->res.eof); |
296 | rdata->task.tk_status = status; | 295 | rdata->task.tk_status = status; |
297 | if (status >= 0) { | 296 | if (status >= 0) |
298 | rdata->res.count = status; | 297 | rdata->res.count = status; |
299 | rdata->res.eof = eof; | ||
300 | } | ||
301 | objlayout_iodone(state); | 298 | objlayout_iodone(state); |
302 | /* must not use state after this point */ | 299 | /* must not use state after this point */ |
303 | 300 | ||
@@ -330,11 +327,14 @@ objlayout_read_pagelist(struct nfs_read_data *rdata) | |||
330 | status = 0; | 327 | status = 0; |
331 | rdata->res.count = 0; | 328 | rdata->res.count = 0; |
332 | rdata->res.eof = 1; | 329 | rdata->res.eof = 1; |
330 | /*FIXME: do we need to call pnfs_ld_read_done() */ | ||
333 | goto out; | 331 | goto out; |
334 | } | 332 | } |
335 | count = eof - offset; | 333 | count = eof - offset; |
336 | } | 334 | } |
337 | 335 | ||
336 | rdata->res.eof = (offset + count) >= eof; | ||
337 | |||
338 | state = objlayout_alloc_io_state(NFS_I(rdata->inode)->layout, | 338 | state = objlayout_alloc_io_state(NFS_I(rdata->inode)->layout, |
339 | rdata->args.pages, rdata->args.pgbase, | 339 | rdata->args.pages, rdata->args.pgbase, |
340 | offset, count, | 340 | offset, count, |
@@ -345,8 +345,6 @@ objlayout_read_pagelist(struct nfs_read_data *rdata) | |||
345 | goto out; | 345 | goto out; |
346 | } | 346 | } |
347 | 347 | ||
348 | state->eof = state->offset + state->count >= eof; | ||
349 | |||
350 | status = objio_read_pagelist(state); | 348 | status = objio_read_pagelist(state); |
351 | out: | 349 | out: |
352 | dprintk("%s: Return status %Zd\n", __func__, status); | 350 | dprintk("%s: Return status %Zd\n", __func__, status); |
diff --git a/fs/nfs/objlayout/objlayout.h b/fs/nfs/objlayout/objlayout.h index a8244c8e042d..ffb884c6fef0 100644 --- a/fs/nfs/objlayout/objlayout.h +++ b/fs/nfs/objlayout/objlayout.h | |||
@@ -86,7 +86,6 @@ struct objlayout_io_state { | |||
86 | 86 | ||
87 | void *rpcdata; | 87 | void *rpcdata; |
88 | int status; /* res */ | 88 | int status; /* res */ |
89 | int eof; /* res */ | ||
90 | int committed; /* res */ | 89 | int committed; /* res */ |
91 | 90 | ||
92 | /* Error reporting (layout_return) */ | 91 | /* Error reporting (layout_return) */ |