Commit 4cdc685c authored by Boaz Harrosh's avatar Boaz Harrosh Committed by Trond Myklebust

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: default avatarBoaz Harrosh <bharrosh@panasas.com>
Signed-off-by: default avatarTrond Myklebust <Trond.Myklebust@netapp.com>
parent 994c0e99
...@@ -287,17 +287,14 @@ static void _rpc_read_complete(struct work_struct *work) ...@@ -287,17 +287,14 @@ static void _rpc_read_complete(struct work_struct *work)
void void
objlayout_read_done(struct objlayout_io_state *state, ssize_t status, bool sync) objlayout_read_done(struct objlayout_io_state *state, ssize_t status, bool sync)
{ {
int eof = state->eof; struct nfs_read_data *rdata = state->rpcdata;
struct nfs_read_data *rdata;
state->status = status; state->status = status;
dprintk("%s: Begin status=%zd eof=%d\n", __func__, status, eof); dprintk("%s: Begin status=%zd eof=%d\n", __func__,
rdata = state->rpcdata; status, rdata->res.eof);
rdata->task.tk_status = status; rdata->task.tk_status = status;
if (status >= 0) { if (status >= 0)
rdata->res.count = status; rdata->res.count = status;
rdata->res.eof = eof;
}
objlayout_iodone(state); objlayout_iodone(state);
/* must not use state after this point */ /* must not use state after this point */
...@@ -330,11 +327,14 @@ objlayout_read_pagelist(struct nfs_read_data *rdata) ...@@ -330,11 +327,14 @@ objlayout_read_pagelist(struct nfs_read_data *rdata)
status = 0; status = 0;
rdata->res.count = 0; rdata->res.count = 0;
rdata->res.eof = 1; rdata->res.eof = 1;
/*FIXME: do we need to call pnfs_ld_read_done() */
goto out; goto out;
} }
count = eof - offset; count = eof - offset;
} }
rdata->res.eof = (offset + count) >= eof;
state = objlayout_alloc_io_state(NFS_I(rdata->inode)->layout, state = objlayout_alloc_io_state(NFS_I(rdata->inode)->layout,
rdata->args.pages, rdata->args.pgbase, rdata->args.pages, rdata->args.pgbase,
offset, count, offset, count,
...@@ -345,8 +345,6 @@ objlayout_read_pagelist(struct nfs_read_data *rdata) ...@@ -345,8 +345,6 @@ objlayout_read_pagelist(struct nfs_read_data *rdata)
goto out; goto out;
} }
state->eof = state->offset + state->count >= eof;
status = objio_read_pagelist(state); status = objio_read_pagelist(state);
out: out:
dprintk("%s: Return status %Zd\n", __func__, status); dprintk("%s: Return status %Zd\n", __func__, status);
......
...@@ -86,7 +86,6 @@ struct objlayout_io_state { ...@@ -86,7 +86,6 @@ struct objlayout_io_state {
void *rpcdata; void *rpcdata;
int status; /* res */ int status; /* res */
int eof; /* res */
int committed; /* res */ int committed; /* res */
/* Error reporting (layout_return) */ /* Error reporting (layout_return) */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment