Skip to content

Commit 4cdc685

Browse files
Boaz HarroshTrond Myklebust
authored andcommitted
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>
1 parent 994c0e9 commit 4cdc685

2 files changed

Lines changed: 7 additions & 10 deletions

File tree

‎fs/nfs/objlayout/objlayout.c‎

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -287,17 +287,14 @@ static void _rpc_read_complete(struct work_struct *work)
287287
void
288288
objlayout_read_done(struct objlayout_io_state *state, ssize_t status, bool sync)
289289
{
290-
int eof = state->eof;
291-
struct nfs_read_data *rdata;
290+
struct nfs_read_data *rdata = state->rpcdata;
292291

293292
state->status = status;
294-
dprintk("%s: Begin status=%zd eof=%d\n", __func__, status, eof);
295-
rdata = state->rpcdata;
293+
dprintk("%s: Begin status=%zd eof=%d\n", __func__,
294+
status, rdata->res.eof);
296295
rdata->task.tk_status = status;
297-
if (status >= 0) {
296+
if (status >= 0)
298297
rdata->res.count = status;
299-
rdata->res.eof = eof;
300-
}
301298
objlayout_iodone(state);
302299
/* must not use state after this point */
303300

@@ -330,11 +327,14 @@ objlayout_read_pagelist(struct nfs_read_data *rdata)
330327
status = 0;
331328
rdata->res.count = 0;
332329
rdata->res.eof = 1;
330+
/*FIXME: do we need to call pnfs_ld_read_done() */
333331
goto out;
334332
}
335333
count = eof - offset;
336334
}
337335

336+
rdata->res.eof = (offset + count) >= eof;
337+
338338
state = objlayout_alloc_io_state(NFS_I(rdata->inode)->layout,
339339
rdata->args.pages, rdata->args.pgbase,
340340
offset, count,
@@ -345,8 +345,6 @@ objlayout_read_pagelist(struct nfs_read_data *rdata)
345345
goto out;
346346
}
347347

348-
state->eof = state->offset + state->count >= eof;
349-
350348
status = objio_read_pagelist(state);
351349
out:
352350
dprintk("%s: Return status %Zd\n", __func__, status);

‎fs/nfs/objlayout/objlayout.h‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,6 @@ struct objlayout_io_state {
8686

8787
void *rpcdata;
8888
int status; /* res */
89-
int eof; /* res */
9089
int committed; /* res */
9190

9291
/* Error reporting (layout_return) */

0 commit comments

Comments
 (0)