Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 10127
b: refs/heads/master
c: 4f9838c
h: refs/heads/master
i:
  10125: b1f67a0
  10123: 503483e
  10119: da5107a
  10111: 20bc232
v: v3
  • Loading branch information
Trond Myklebust authored and Trond Myklebust committed Oct 28, 2005
1 parent c58e82f commit 3778929
Show file tree
Hide file tree
Showing 4 changed files with 37 additions and 8 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 16e429596dec4d28e16812b3a9be27f18412c567
refs/heads/master: 4f9838c7ecd14f31f701f64fa65ded132fc0db8a
13 changes: 12 additions & 1 deletion trunk/fs/nfs/nfs4proc.c
Original file line number Diff line number Diff line change
Expand Up @@ -2169,8 +2169,10 @@ nfs4_write_done(struct rpc_task *task)
rpc_restart_call(task);
return;
}
if (task->tk_status >= 0)
if (task->tk_status >= 0) {
renew_lease(NFS_SERVER(inode), data->timestamp);
nfs_post_op_update_inode(inode, data->res.fattr);
}
/* Call back common NFS writeback processing */
nfs_writeback_done(task);
}
Expand All @@ -2186,6 +2188,7 @@ nfs4_proc_write_setup(struct nfs_write_data *data, int how)
.rpc_cred = data->cred,
};
struct inode *inode = data->inode;
struct nfs_server *server = NFS_SERVER(inode);
int stable;
int flags;

Expand All @@ -2197,6 +2200,8 @@ nfs4_proc_write_setup(struct nfs_write_data *data, int how)
} else
stable = NFS_UNSTABLE;
data->args.stable = stable;
data->args.bitmask = server->attr_bitmask;
data->res.server = server;

data->timestamp = jiffies;

Expand All @@ -2218,6 +2223,8 @@ nfs4_commit_done(struct rpc_task *task)
rpc_restart_call(task);
return;
}
if (task->tk_status >= 0)
nfs_post_op_update_inode(inode, data->res.fattr);
/* Call back common NFS writeback processing */
nfs_commit_done(task);
}
Expand All @@ -2233,8 +2240,12 @@ nfs4_proc_commit_setup(struct nfs_write_data *data, int how)
.rpc_cred = data->cred,
};
struct inode *inode = data->inode;
struct nfs_server *server = NFS_SERVER(inode);
int flags;

data->args.bitmask = server->attr_bitmask;
data->res.server = server;

/* Set the initial flags for the task. */
flags = (how & FLUSH_SYNC) ? 0 : RPC_TASK_ASYNC;

Expand Down
28 changes: 22 additions & 6 deletions trunk/fs/nfs/nfs4xdr.c
Original file line number Diff line number Diff line change
Expand Up @@ -159,16 +159,20 @@ static int nfs_stat_to_errno(int);
op_decode_hdr_maxsz + 2)
#define NFS4_enc_write_sz (compound_encode_hdr_maxsz + \
encode_putfh_maxsz + \
op_encode_hdr_maxsz + 8)
op_encode_hdr_maxsz + 8 + \
encode_getattr_maxsz)
#define NFS4_dec_write_sz (compound_decode_hdr_maxsz + \
decode_putfh_maxsz + \
op_decode_hdr_maxsz + 4)
op_decode_hdr_maxsz + 4 + \
decode_getattr_maxsz)
#define NFS4_enc_commit_sz (compound_encode_hdr_maxsz + \
encode_putfh_maxsz + \
op_encode_hdr_maxsz + 3)
op_encode_hdr_maxsz + 3 + \
encode_getattr_maxsz)
#define NFS4_dec_commit_sz (compound_decode_hdr_maxsz + \
decode_putfh_maxsz + \
op_decode_hdr_maxsz + 2)
op_decode_hdr_maxsz + 2 + \
decode_getattr_maxsz)
#define NFS4_enc_open_sz (compound_encode_hdr_maxsz + \
encode_putfh_maxsz + \
op_encode_hdr_maxsz + \
Expand Down Expand Up @@ -1799,7 +1803,7 @@ static int nfs4_xdr_enc_write(struct rpc_rqst *req, uint32_t *p, struct nfs_writ
{
struct xdr_stream xdr;
struct compound_hdr hdr = {
.nops = 2,
.nops = 3,
};
int status;

Expand All @@ -1809,6 +1813,9 @@ static int nfs4_xdr_enc_write(struct rpc_rqst *req, uint32_t *p, struct nfs_writ
if (status)
goto out;
status = encode_write(&xdr, args);
if (status)
goto out;
status = encode_getfattr(&xdr, args->bitmask);
out:
return status;
}
Expand All @@ -1820,7 +1827,7 @@ static int nfs4_xdr_enc_commit(struct rpc_rqst *req, uint32_t *p, struct nfs_wri
{
struct xdr_stream xdr;
struct compound_hdr hdr = {
.nops = 2,
.nops = 3,
};
int status;

Expand All @@ -1830,6 +1837,9 @@ static int nfs4_xdr_enc_commit(struct rpc_rqst *req, uint32_t *p, struct nfs_wri
if (status)
goto out;
status = encode_commit(&xdr, args);
if (status)
goto out;
status = encode_getfattr(&xdr, args->bitmask);
out:
return status;
}
Expand Down Expand Up @@ -4001,6 +4011,9 @@ static int nfs4_xdr_dec_write(struct rpc_rqst *rqstp, uint32_t *p, struct nfs_wr
if (status)
goto out;
status = decode_write(&xdr, res);
if (status)
goto out;
decode_getfattr(&xdr, res->fattr, res->server);
if (!status)
status = res->count;
out:
Expand All @@ -4024,6 +4037,9 @@ static int nfs4_xdr_dec_commit(struct rpc_rqst *rqstp, uint32_t *p, struct nfs_w
if (status)
goto out;
status = decode_commit(&xdr, res);
if (status)
goto out;
decode_getfattr(&xdr, res->fattr, res->server);
out:
return status;
}
Expand Down
2 changes: 2 additions & 0 deletions trunk/include/linux/nfs_xdr.h
Original file line number Diff line number Diff line change
Expand Up @@ -256,6 +256,7 @@ struct nfs_writeargs {
enum nfs3_stable_how stable;
unsigned int pgbase;
struct page ** pages;
const u32 * bitmask;
};

struct nfs_writeverf {
Expand All @@ -267,6 +268,7 @@ struct nfs_writeres {
struct nfs_fattr * fattr;
struct nfs_writeverf * verf;
__u32 count;
const struct nfs_server *server;
};

/*
Expand Down

0 comments on commit 3778929

Please sign in to comment.