hc
2024-12-19 9370bb92b2d16684ee45cf24e879c93c509162da
kernel/fs/nfs/write.c
....@@ -58,7 +58,8 @@
5858 static const struct nfs_commit_completion_ops nfs_commit_completion_ops;
5959 static const struct nfs_rw_ops nfs_rw_write_ops;
6060 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);
6263 static void nfs_init_cinfo_from_inode(struct nfs_commit_info *cinfo,
6364 struct inode *inode);
6465 static struct nfs_page *
....@@ -500,8 +501,8 @@
500501 * the (former) group. All subrequests are removed from any write or commit
501502 * lists, unlinked from the group and destroyed.
502503 */
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)
505506 {
506507 struct nfs_page *subreq;
507508 struct nfs_page *destroy_list = NULL;
....@@ -531,7 +532,7 @@
531532 * Commit list removal accounting is done after locks are dropped */
532533 subreq = head;
533534 do {
534
- nfs_clear_request_commit(subreq);
535
+ nfs_clear_request_commit(cinfo, subreq);
535536 subreq = subreq->wb_this_page;
536537 } while (subreq != head);
537538
....@@ -565,8 +566,10 @@
565566 {
566567 struct inode *inode = page_file_mapping(page)->host;
567568 struct nfs_page *head;
569
+ struct nfs_commit_info cinfo;
568570 int ret;
569571
572
+ nfs_init_cinfo_from_inode(&cinfo, inode);
570573 /*
571574 * A reference is taken only on the head request which acts as a
572575 * reference to the whole page group - the group will not be destroyed
....@@ -583,7 +586,7 @@
583586 return ERR_PTR(ret);
584587 }
585588
586
- nfs_join_page_group(head, inode);
589
+ nfs_join_page_group(head, &cinfo, inode);
587590
588591 return head;
589592 }
....@@ -944,18 +947,16 @@
944947 }
945948
946949 /* 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)
949952 {
950953 if (test_bit(PG_CLEAN, &req->wb_flags)) {
951954 struct nfs_open_context *ctx = nfs_req_openctx(req);
952955 struct inode *inode = d_inode(ctx->dentry);
953
- struct nfs_commit_info cinfo;
954956
955
- nfs_init_cinfo_from_inode(&cinfo, inode);
956957 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);
959960 }
960961 mutex_unlock(&NFS_I(inode)->commit_mutex);
961962 nfs_clear_page_commit(req->wb_page);