diff options
Diffstat (limited to 'fs/nfs/write.c')
-rw-r--r-- | fs/nfs/write.c | 20 |
1 files changed, 11 insertions, 9 deletions
diff --git a/fs/nfs/write.c b/fs/nfs/write.c index 294604784f70..bc5bb9323412 100644 --- a/fs/nfs/write.c +++ b/fs/nfs/write.c | |||
@@ -964,7 +964,8 @@ static void | |||
964 | nfs_clear_request_commit(struct nfs_page *req) | 964 | nfs_clear_request_commit(struct nfs_page *req) |
965 | { | 965 | { |
966 | if (test_bit(PG_CLEAN, &req->wb_flags)) { | 966 | if (test_bit(PG_CLEAN, &req->wb_flags)) { |
967 | struct inode *inode = d_inode(req->wb_context->dentry); | 967 | struct nfs_open_context *ctx = nfs_req_openctx(req); |
968 | struct inode *inode = d_inode(ctx->dentry); | ||
968 | struct nfs_commit_info cinfo; | 969 | struct nfs_commit_info cinfo; |
969 | 970 | ||
970 | nfs_init_cinfo_from_inode(&cinfo, inode); | 971 | nfs_init_cinfo_from_inode(&cinfo, inode); |
@@ -1219,7 +1220,7 @@ int nfs_flush_incompatible(struct file *file, struct page *page) | |||
1219 | return 0; | 1220 | return 0; |
1220 | l_ctx = req->wb_lock_context; | 1221 | l_ctx = req->wb_lock_context; |
1221 | do_flush = req->wb_page != page || | 1222 | do_flush = req->wb_page != page || |
1222 | !nfs_match_open_context(req->wb_context, ctx); | 1223 | !nfs_match_open_context(nfs_req_openctx(req), ctx); |
1223 | if (l_ctx && flctx && | 1224 | if (l_ctx && flctx && |
1224 | !(list_empty_careful(&flctx->flc_posix) && | 1225 | !(list_empty_careful(&flctx->flc_posix) && |
1225 | list_empty_careful(&flctx->flc_flock))) { | 1226 | list_empty_careful(&flctx->flc_flock))) { |
@@ -1422,7 +1423,7 @@ static void nfs_redirty_request(struct nfs_page *req) | |||
1422 | /* Bump the transmission count */ | 1423 | /* Bump the transmission count */ |
1423 | req->wb_nio++; | 1424 | req->wb_nio++; |
1424 | nfs_mark_request_dirty(req); | 1425 | nfs_mark_request_dirty(req); |
1425 | set_bit(NFS_CONTEXT_RESEND_WRITES, &req->wb_context->flags); | 1426 | set_bit(NFS_CONTEXT_RESEND_WRITES, &nfs_req_openctx(req)->flags); |
1426 | nfs_end_page_writeback(req); | 1427 | nfs_end_page_writeback(req); |
1427 | nfs_release_request(req); | 1428 | nfs_release_request(req); |
1428 | } | 1429 | } |
@@ -1742,7 +1743,8 @@ void nfs_init_commit(struct nfs_commit_data *data, | |||
1742 | struct nfs_commit_info *cinfo) | 1743 | struct nfs_commit_info *cinfo) |
1743 | { | 1744 | { |
1744 | struct nfs_page *first = nfs_list_entry(head->next); | 1745 | struct nfs_page *first = nfs_list_entry(head->next); |
1745 | struct inode *inode = d_inode(first->wb_context->dentry); | 1746 | struct nfs_open_context *ctx = nfs_req_openctx(first); |
1747 | struct inode *inode = d_inode(ctx->dentry); | ||
1746 | 1748 | ||
1747 | /* Set up the RPC argument and reply structs | 1749 | /* Set up the RPC argument and reply structs |
1748 | * NB: take care not to mess about with data->commit et al. */ | 1750 | * NB: take care not to mess about with data->commit et al. */ |
@@ -1750,7 +1752,7 @@ void nfs_init_commit(struct nfs_commit_data *data, | |||
1750 | list_splice_init(head, &data->pages); | 1752 | list_splice_init(head, &data->pages); |
1751 | 1753 | ||
1752 | data->inode = inode; | 1754 | data->inode = inode; |
1753 | data->cred = first->wb_context->cred; | 1755 | data->cred = ctx->cred; |
1754 | data->lseg = lseg; /* reference transferred */ | 1756 | data->lseg = lseg; /* reference transferred */ |
1755 | /* only set lwb for pnfs commit */ | 1757 | /* only set lwb for pnfs commit */ |
1756 | if (lseg) | 1758 | if (lseg) |
@@ -1763,7 +1765,7 @@ void nfs_init_commit(struct nfs_commit_data *data, | |||
1763 | /* Note: we always request a commit of the entire inode */ | 1765 | /* Note: we always request a commit of the entire inode */ |
1764 | data->args.offset = 0; | 1766 | data->args.offset = 0; |
1765 | data->args.count = 0; | 1767 | data->args.count = 0; |
1766 | data->context = get_nfs_open_context(first->wb_context); | 1768 | data->context = get_nfs_open_context(ctx); |
1767 | data->res.fattr = &data->fattr; | 1769 | data->res.fattr = &data->fattr; |
1768 | data->res.verf = &data->verf; | 1770 | data->res.verf = &data->verf; |
1769 | nfs_fattr_init(&data->fattr); | 1771 | nfs_fattr_init(&data->fattr); |
@@ -1846,8 +1848,8 @@ static void nfs_commit_release_pages(struct nfs_commit_data *data) | |||
1846 | nfs_clear_page_commit(req->wb_page); | 1848 | nfs_clear_page_commit(req->wb_page); |
1847 | 1849 | ||
1848 | dprintk("NFS: commit (%s/%llu %d@%lld)", | 1850 | dprintk("NFS: commit (%s/%llu %d@%lld)", |
1849 | req->wb_context->dentry->d_sb->s_id, | 1851 | nfs_req_openctx(req)->dentry->d_sb->s_id, |
1850 | (unsigned long long)NFS_FILEID(d_inode(req->wb_context->dentry)), | 1852 | (unsigned long long)NFS_FILEID(d_inode(nfs_req_openctx(req)->dentry)), |
1851 | req->wb_bytes, | 1853 | req->wb_bytes, |
1852 | (long long)req_offset(req)); | 1854 | (long long)req_offset(req)); |
1853 | if (status < 0) { | 1855 | if (status < 0) { |
@@ -1871,7 +1873,7 @@ static void nfs_commit_release_pages(struct nfs_commit_data *data) | |||
1871 | /* We have a mismatch. Write the page again */ | 1873 | /* We have a mismatch. Write the page again */ |
1872 | dprintk_cont(" mismatch\n"); | 1874 | dprintk_cont(" mismatch\n"); |
1873 | nfs_mark_request_dirty(req); | 1875 | nfs_mark_request_dirty(req); |
1874 | set_bit(NFS_CONTEXT_RESEND_WRITES, &req->wb_context->flags); | 1876 | set_bit(NFS_CONTEXT_RESEND_WRITES, &nfs_req_openctx(req)->flags); |
1875 | next: | 1877 | next: |
1876 | nfs_unlock_and_release_request(req); | 1878 | nfs_unlock_and_release_request(req); |
1877 | /* Latency breaker */ | 1879 | /* Latency breaker */ |