.. | .. |
---|
58 | 58 | static const struct nfs_commit_completion_ops nfs_commit_completion_ops; |
---|
59 | 59 | static const struct nfs_rw_ops nfs_rw_write_ops; |
---|
60 | 60 | static void nfs_inode_remove_request(struct nfs_page *req); |
---|
61 | | -static void nfs_clear_request_commit(struct nfs_page *req); |
---|
| 61 | +static void nfs_clear_request_commit(struct nfs_commit_info *cinfo, |
---|
| 62 | + struct nfs_page *req); |
---|
62 | 63 | static void nfs_init_cinfo_from_inode(struct nfs_commit_info *cinfo, |
---|
63 | 64 | struct inode *inode); |
---|
64 | 65 | static struct nfs_page * |
---|
.. | .. |
---|
500 | 501 | * the (former) group. All subrequests are removed from any write or commit |
---|
501 | 502 | * lists, unlinked from the group and destroyed. |
---|
502 | 503 | */ |
---|
503 | | -void |
---|
504 | | -nfs_join_page_group(struct nfs_page *head, struct inode *inode) |
---|
| 504 | +void nfs_join_page_group(struct nfs_page *head, struct nfs_commit_info *cinfo, |
---|
| 505 | + struct inode *inode) |
---|
505 | 506 | { |
---|
506 | 507 | struct nfs_page *subreq; |
---|
507 | 508 | struct nfs_page *destroy_list = NULL; |
---|
.. | .. |
---|
531 | 532 | * Commit list removal accounting is done after locks are dropped */ |
---|
532 | 533 | subreq = head; |
---|
533 | 534 | do { |
---|
534 | | - nfs_clear_request_commit(subreq); |
---|
| 535 | + nfs_clear_request_commit(cinfo, subreq); |
---|
535 | 536 | subreq = subreq->wb_this_page; |
---|
536 | 537 | } while (subreq != head); |
---|
537 | 538 | |
---|
.. | .. |
---|
565 | 566 | { |
---|
566 | 567 | struct inode *inode = page_file_mapping(page)->host; |
---|
567 | 568 | struct nfs_page *head; |
---|
| 569 | + struct nfs_commit_info cinfo; |
---|
568 | 570 | int ret; |
---|
569 | 571 | |
---|
| 572 | + nfs_init_cinfo_from_inode(&cinfo, inode); |
---|
570 | 573 | /* |
---|
571 | 574 | * A reference is taken only on the head request which acts as a |
---|
572 | 575 | * reference to the whole page group - the group will not be destroyed |
---|
.. | .. |
---|
583 | 586 | return ERR_PTR(ret); |
---|
584 | 587 | } |
---|
585 | 588 | |
---|
586 | | - nfs_join_page_group(head, inode); |
---|
| 589 | + nfs_join_page_group(head, &cinfo, inode); |
---|
587 | 590 | |
---|
588 | 591 | return head; |
---|
589 | 592 | } |
---|
.. | .. |
---|
944 | 947 | } |
---|
945 | 948 | |
---|
946 | 949 | /* Called holding the request lock on @req */ |
---|
947 | | -static void |
---|
948 | | -nfs_clear_request_commit(struct nfs_page *req) |
---|
| 950 | +static void nfs_clear_request_commit(struct nfs_commit_info *cinfo, |
---|
| 951 | + struct nfs_page *req) |
---|
949 | 952 | { |
---|
950 | 953 | if (test_bit(PG_CLEAN, &req->wb_flags)) { |
---|
951 | 954 | struct nfs_open_context *ctx = nfs_req_openctx(req); |
---|
952 | 955 | struct inode *inode = d_inode(ctx->dentry); |
---|
953 | | - struct nfs_commit_info cinfo; |
---|
954 | 956 | |
---|
955 | | - nfs_init_cinfo_from_inode(&cinfo, inode); |
---|
956 | 957 | mutex_lock(&NFS_I(inode)->commit_mutex); |
---|
957 | | - if (!pnfs_clear_request_commit(req, &cinfo)) { |
---|
958 | | - nfs_request_remove_commit_list(req, &cinfo); |
---|
| 958 | + if (!pnfs_clear_request_commit(req, cinfo)) { |
---|
| 959 | + nfs_request_remove_commit_list(req, cinfo); |
---|
959 | 960 | } |
---|
960 | 961 | mutex_unlock(&NFS_I(inode)->commit_mutex); |
---|
961 | 962 | nfs_clear_page_commit(req->wb_page); |
---|