aboutsummaryrefslogtreecommitdiffstats
path: root/fs/nfs/objlayout
diff options
context:
space:
mode:
Diffstat (limited to 'fs/nfs/objlayout')
-rw-r--r--fs/nfs/objlayout/objlayout.c16
-rw-r--r--fs/nfs/objlayout/objlayout.h1
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)
287void 287void
288objlayout_read_done(struct objlayout_io_state *state, ssize_t status, bool sync) 288objlayout_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) */