Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 308585
b: refs/heads/master
c: 5a37f85
h: refs/heads/master
i:
  308583: 3925221
v: v3
  • Loading branch information
Trond Myklebust authored and Trond Myklebust committed May 1, 2012
1 parent 9eb8e69 commit 97654b6
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 3 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: 778d28172f710184855bcfeadcdd6b46997c4de2
refs/heads/master: 5a37f85131c526ed7a3991d4dc2845498f81c1de
19 changes: 17 additions & 2 deletions trunk/fs/nfs/nfs4proc.c
Original file line number Diff line number Diff line change
Expand Up @@ -3370,7 +3370,7 @@ static int nfs4_write_done_cb(struct rpc_task *task, struct nfs_write_data *data
}
if (task->tk_status >= 0) {
renew_lease(NFS_SERVER(inode), data->timestamp);
nfs_post_op_update_inode_force_wcc(inode, data->res.fattr);
nfs_post_op_update_inode_force_wcc(inode, &data->fattr);
}
return 0;
}
Expand Down Expand Up @@ -3401,15 +3401,30 @@ void nfs4_reset_write(struct rpc_task *task, struct nfs_write_data *data)
}
EXPORT_SYMBOL_GPL(nfs4_reset_write);

static
bool nfs4_write_need_cache_consistency_data(const struct nfs_write_data *data)
{
const struct nfs_pgio_header *hdr = data->header;

/* Don't request attributes for pNFS or O_DIRECT writes */
if (data->ds_clp != NULL || hdr->dreq != NULL)
return false;
/* Otherwise, request attributes if and only if we don't hold
* a delegation
*/
return nfs_have_delegation(hdr->inode, FMODE_READ) == 0;
}

static void nfs4_proc_write_setup(struct nfs_write_data *data, struct rpc_message *msg)
{
struct nfs_server *server = NFS_SERVER(data->header->inode);

if (data->ds_clp) {
if (!nfs4_write_need_cache_consistency_data(data)) {
data->args.bitmask = NULL;
data->res.fattr = NULL;
} else
data->args.bitmask = server->cache_consistency_bitmask;

if (!data->write_done_cb)
data->write_done_cb = nfs4_write_done_cb;
data->res.server = server;
Expand Down

0 comments on commit 97654b6

Please sign in to comment.