Commit 90c1f6b2 authored by Trond Myklebust's avatar Trond Myklebust

NFSv4: More cleanups of the NFSv4 state.

Signed-off-by: default avatarTrond Myklebust <trond.myklebust@fys.uio.no>
parent 6caf69fe
...@@ -130,8 +130,7 @@ nfs_direct_read_seg(struct inode *inode, struct nfs_open_context *ctx, ...@@ -130,8 +130,7 @@ nfs_direct_read_seg(struct inode *inode, struct nfs_open_context *ctx,
.cred = ctx->cred, .cred = ctx->cred,
.args = { .args = {
.fh = NFS_FH(inode), .fh = NFS_FH(inode),
.lockowner = ctx->lockowner, .context = ctx,
.state = ctx->state,
}, },
.res = { .res = {
.fattr = &rdata.fattr, .fattr = &rdata.fattr,
...@@ -262,8 +261,7 @@ nfs_direct_write_seg(struct inode *inode, struct nfs_open_context *ctx, ...@@ -262,8 +261,7 @@ nfs_direct_write_seg(struct inode *inode, struct nfs_open_context *ctx,
.cred = ctx->cred, .cred = ctx->cred,
.args = { .args = {
.fh = NFS_FH(inode), .fh = NFS_FH(inode),
.lockowner = ctx->lockowner, .context = ctx,
.state = ctx->state,
}, },
.res = { .res = {
.fattr = &wdata.fattr, .fattr = &wdata.fattr,
......
...@@ -912,15 +912,15 @@ static int encode_putrootfh(struct xdr_stream *xdr) ...@@ -912,15 +912,15 @@ static int encode_putrootfh(struct xdr_stream *xdr)
return 0; return 0;
} }
static void encode_stateid(struct xdr_stream *xdr, struct nfs4_state *state, fl_owner_t lockowner) static void encode_stateid(struct xdr_stream *xdr, const struct nfs_open_context *ctx)
{ {
extern nfs4_stateid zero_stateid; extern nfs4_stateid zero_stateid;
nfs4_stateid stateid; nfs4_stateid stateid;
uint32_t *p; uint32_t *p;
RESERVE_SPACE(16); RESERVE_SPACE(16);
if (state != NULL) { if (ctx->state != NULL) {
nfs4_copy_stateid(&stateid, state, lockowner); nfs4_copy_stateid(&stateid, ctx->state, ctx->lockowner);
WRITEMEM(stateid.data, sizeof(stateid.data)); WRITEMEM(stateid.data, sizeof(stateid.data));
} else } else
WRITEMEM(zero_stateid.data, sizeof(zero_stateid.data)); WRITEMEM(zero_stateid.data, sizeof(zero_stateid.data));
...@@ -933,7 +933,7 @@ static int encode_read(struct xdr_stream *xdr, const struct nfs_readargs *args) ...@@ -933,7 +933,7 @@ static int encode_read(struct xdr_stream *xdr, const struct nfs_readargs *args)
RESERVE_SPACE(4); RESERVE_SPACE(4);
WRITE32(OP_READ); WRITE32(OP_READ);
encode_stateid(xdr, args->state, args->lockowner); encode_stateid(xdr, args->context);
RESERVE_SPACE(12); RESERVE_SPACE(12);
WRITE64(args->offset); WRITE64(args->offset);
...@@ -1092,7 +1092,7 @@ static int encode_write(struct xdr_stream *xdr, const struct nfs_writeargs *args ...@@ -1092,7 +1092,7 @@ static int encode_write(struct xdr_stream *xdr, const struct nfs_writeargs *args
RESERVE_SPACE(4); RESERVE_SPACE(4);
WRITE32(OP_WRITE); WRITE32(OP_WRITE);
encode_stateid(xdr, args->state, args->lockowner); encode_stateid(xdr, args->context);
RESERVE_SPACE(16); RESERVE_SPACE(16);
WRITE64(args->offset); WRITE64(args->offset);
......
...@@ -109,8 +109,7 @@ static int nfs_readpage_sync(struct nfs_open_context *ctx, struct inode *inode, ...@@ -109,8 +109,7 @@ static int nfs_readpage_sync(struct nfs_open_context *ctx, struct inode *inode,
rdata->inode = inode; rdata->inode = inode;
INIT_LIST_HEAD(&rdata->pages); INIT_LIST_HEAD(&rdata->pages);
rdata->args.fh = NFS_FH(inode); rdata->args.fh = NFS_FH(inode);
rdata->args.lockowner = ctx->lockowner; rdata->args.context = ctx;
rdata->args.state = ctx->state;
rdata->args.pages = &page; rdata->args.pages = &page;
rdata->args.pgbase = 0UL; rdata->args.pgbase = 0UL;
rdata->args.count = rsize; rdata->args.count = rsize;
...@@ -227,8 +226,7 @@ static void nfs_read_rpcsetup(struct nfs_page *req, struct nfs_read_data *data, ...@@ -227,8 +226,7 @@ static void nfs_read_rpcsetup(struct nfs_page *req, struct nfs_read_data *data,
data->args.pgbase = req->wb_pgbase + offset; data->args.pgbase = req->wb_pgbase + offset;
data->args.pages = data->pagevec; data->args.pages = data->pagevec;
data->args.count = count; data->args.count = count;
data->args.lockowner = req->wb_context->lockowner; data->args.context = req->wb_context;
data->args.state = req->wb_context->state;
data->res.fattr = &data->fattr; data->res.fattr = &data->fattr;
data->res.count = count; data->res.count = count;
......
...@@ -191,8 +191,7 @@ static int nfs_writepage_sync(struct nfs_open_context *ctx, struct inode *inode, ...@@ -191,8 +191,7 @@ static int nfs_writepage_sync(struct nfs_open_context *ctx, struct inode *inode,
wdata->cred = ctx->cred; wdata->cred = ctx->cred;
wdata->inode = inode; wdata->inode = inode;
wdata->args.fh = NFS_FH(inode); wdata->args.fh = NFS_FH(inode);
wdata->args.lockowner = ctx->lockowner; wdata->args.context = ctx;
wdata->args.state = ctx->state;
wdata->args.pages = &page; wdata->args.pages = &page;
wdata->args.stable = NFS_FILE_SYNC; wdata->args.stable = NFS_FILE_SYNC;
wdata->args.pgbase = offset; wdata->args.pgbase = offset;
...@@ -874,8 +873,7 @@ static void nfs_write_rpcsetup(struct nfs_page *req, ...@@ -874,8 +873,7 @@ static void nfs_write_rpcsetup(struct nfs_page *req,
data->args.pgbase = req->wb_pgbase + offset; data->args.pgbase = req->wb_pgbase + offset;
data->args.pages = data->pagevec; data->args.pages = data->pagevec;
data->args.count = count; data->args.count = count;
data->args.lockowner = req->wb_context->lockowner; data->args.context = req->wb_context;
data->args.state = req->wb_context->state;
data->res.fattr = &data->fattr; data->res.fattr = &data->fattr;
data->res.count = count; data->res.count = count;
......
...@@ -235,8 +235,7 @@ struct nfs_lockres { ...@@ -235,8 +235,7 @@ struct nfs_lockres {
struct nfs_readargs { struct nfs_readargs {
struct nfs_fh * fh; struct nfs_fh * fh;
fl_owner_t lockowner; struct nfs_open_context *context;
struct nfs4_state * state;
__u64 offset; __u64 offset;
__u32 count; __u32 count;
unsigned int pgbase; unsigned int pgbase;
...@@ -259,8 +258,7 @@ struct nfs_readres { ...@@ -259,8 +258,7 @@ struct nfs_readres {
struct nfs_writeargs { struct nfs_writeargs {
struct nfs_fh * fh; struct nfs_fh * fh;
fl_owner_t lockowner; struct nfs_open_context *context;
struct nfs4_state * state;
__u64 offset; __u64 offset;
__u32 count; __u32 count;
enum nfs3_stable_how stable; enum nfs3_stable_how stable;
......
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