diff options
author | Fred Isaman <iisaman@netapp.com> | 2011-03-23 09:27:52 -0400 |
---|---|---|
committer | Trond Myklebust <Trond.Myklebust@netapp.com> | 2011-03-23 15:29:03 -0400 |
commit | 988b6dceb0ae6d642587c8594529b94f6be0c5ea (patch) | |
tree | 78438f297eb2f8c9058872ac8a0f33d1a99b461c /fs/nfs | |
parent | a861a1e1c398fe34701569fd8ac9225dfe0a9a7e (diff) |
NFSv4.1: remove GETATTR from ds commits
Any COMMIT compound directed to a data server needs to have the
GETATTR calls suppressed. We here, make sure the field we are testing
(data->lseg) is set and refcounted correctly.
Signed-off-by: Fred Isaman <iisaman@netapp.com>
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
Diffstat (limited to 'fs/nfs')
-rw-r--r-- | fs/nfs/nfs4proc.c | 8 | ||||
-rw-r--r-- | fs/nfs/nfs4xdr.c | 8 | ||||
-rw-r--r-- | fs/nfs/write.c | 7 |
3 files changed, 16 insertions, 7 deletions
diff --git a/fs/nfs/nfs4proc.c b/fs/nfs/nfs4proc.c index bcc29bdc9bee..5d61cccc8d4d 100644 --- a/fs/nfs/nfs4proc.c +++ b/fs/nfs/nfs4proc.c | |||
@@ -3217,8 +3217,12 @@ static int nfs4_commit_done(struct rpc_task *task, struct nfs_write_data *data) | |||
3217 | static void nfs4_proc_commit_setup(struct nfs_write_data *data, struct rpc_message *msg) | 3217 | static void nfs4_proc_commit_setup(struct nfs_write_data *data, struct rpc_message *msg) |
3218 | { | 3218 | { |
3219 | struct nfs_server *server = NFS_SERVER(data->inode); | 3219 | struct nfs_server *server = NFS_SERVER(data->inode); |
3220 | 3220 | ||
3221 | data->args.bitmask = server->cache_consistency_bitmask; | 3221 | if (data->lseg) { |
3222 | data->args.bitmask = NULL; | ||
3223 | data->res.fattr = NULL; | ||
3224 | } else | ||
3225 | data->args.bitmask = server->cache_consistency_bitmask; | ||
3222 | if (!data->write_done_cb) | 3226 | if (!data->write_done_cb) |
3223 | data->write_done_cb = nfs4_commit_done_cb; | 3227 | data->write_done_cb = nfs4_commit_done_cb; |
3224 | data->res.server = server; | 3228 | data->res.server = server; |
diff --git a/fs/nfs/nfs4xdr.c b/fs/nfs/nfs4xdr.c index 0cf560f77884..07cdf925c524 100644 --- a/fs/nfs/nfs4xdr.c +++ b/fs/nfs/nfs4xdr.c | |||
@@ -2294,7 +2294,8 @@ static void nfs4_xdr_enc_commit(struct rpc_rqst *req, struct xdr_stream *xdr, | |||
2294 | encode_sequence(xdr, &args->seq_args, &hdr); | 2294 | encode_sequence(xdr, &args->seq_args, &hdr); |
2295 | encode_putfh(xdr, args->fh, &hdr); | 2295 | encode_putfh(xdr, args->fh, &hdr); |
2296 | encode_commit(xdr, args, &hdr); | 2296 | encode_commit(xdr, args, &hdr); |
2297 | encode_getfattr(xdr, args->bitmask, &hdr); | 2297 | if (args->bitmask) |
2298 | encode_getfattr(xdr, args->bitmask, &hdr); | ||
2298 | encode_nops(&hdr); | 2299 | encode_nops(&hdr); |
2299 | } | 2300 | } |
2300 | 2301 | ||
@@ -5723,8 +5724,9 @@ static int nfs4_xdr_dec_commit(struct rpc_rqst *rqstp, struct xdr_stream *xdr, | |||
5723 | status = decode_commit(xdr, res); | 5724 | status = decode_commit(xdr, res); |
5724 | if (status) | 5725 | if (status) |
5725 | goto out; | 5726 | goto out; |
5726 | decode_getfattr(xdr, res->fattr, res->server, | 5727 | if (res->fattr) |
5727 | !RPC_IS_ASYNC(rqstp->rq_task)); | 5728 | decode_getfattr(xdr, res->fattr, res->server, |
5729 | !RPC_IS_ASYNC(rqstp->rq_task)); | ||
5728 | out: | 5730 | out: |
5729 | return status; | 5731 | return status; |
5730 | } | 5732 | } |
diff --git a/fs/nfs/write.c b/fs/nfs/write.c index 6927a18b6891..cae5d160d835 100644 --- a/fs/nfs/write.c +++ b/fs/nfs/write.c | |||
@@ -1295,6 +1295,7 @@ static void nfs_commitdata_release(void *data) | |||
1295 | { | 1295 | { |
1296 | struct nfs_write_data *wdata = data; | 1296 | struct nfs_write_data *wdata = data; |
1297 | 1297 | ||
1298 | put_lseg(wdata->lseg); | ||
1298 | put_nfs_open_context(wdata->args.context); | 1299 | put_nfs_open_context(wdata->args.context); |
1299 | nfs_commit_free(wdata); | 1300 | nfs_commit_free(wdata); |
1300 | } | 1301 | } |
@@ -1338,7 +1339,8 @@ static int nfs_initiate_commit(struct nfs_write_data *data, struct rpc_clnt *cln | |||
1338 | * Set up the argument/result storage required for the RPC call. | 1339 | * Set up the argument/result storage required for the RPC call. |
1339 | */ | 1340 | */ |
1340 | static void nfs_init_commit(struct nfs_write_data *data, | 1341 | static void nfs_init_commit(struct nfs_write_data *data, |
1341 | struct list_head *head) | 1342 | struct list_head *head, |
1343 | struct pnfs_layout_segment *lseg) | ||
1342 | { | 1344 | { |
1343 | struct nfs_page *first = nfs_list_entry(head->next); | 1345 | struct nfs_page *first = nfs_list_entry(head->next); |
1344 | struct inode *inode = first->wb_context->path.dentry->d_inode; | 1346 | struct inode *inode = first->wb_context->path.dentry->d_inode; |
@@ -1350,6 +1352,7 @@ static void nfs_init_commit(struct nfs_write_data *data, | |||
1350 | 1352 | ||
1351 | data->inode = inode; | 1353 | data->inode = inode; |
1352 | data->cred = first->wb_context->cred; | 1354 | data->cred = first->wb_context->cred; |
1355 | data->lseg = lseg; /* reference transferred */ | ||
1353 | data->mds_ops = &nfs_commit_ops; | 1356 | data->mds_ops = &nfs_commit_ops; |
1354 | 1357 | ||
1355 | data->args.fh = NFS_FH(data->inode); | 1358 | data->args.fh = NFS_FH(data->inode); |
@@ -1393,7 +1396,7 @@ nfs_commit_list(struct inode *inode, struct list_head *head, int how) | |||
1393 | goto out_bad; | 1396 | goto out_bad; |
1394 | 1397 | ||
1395 | /* Set up the argument struct */ | 1398 | /* Set up the argument struct */ |
1396 | nfs_init_commit(data, head); | 1399 | nfs_init_commit(data, head, NULL); |
1397 | return nfs_initiate_commit(data, NFS_CLIENT(inode), data->mds_ops, how); | 1400 | return nfs_initiate_commit(data, NFS_CLIENT(inode), data->mds_ops, how); |
1398 | out_bad: | 1401 | out_bad: |
1399 | nfs_retry_commit(head, NULL); | 1402 | nfs_retry_commit(head, NULL); |