summaryrefslogtreecommitdiffstats
path: root/fs/nfs/write.c
diff options
context:
space:
mode:
authorFred Isaman <iisaman@netapp.com>2012-04-20 14:47:53 -0400
committerTrond Myklebust <Trond.Myklebust@netapp.com>2012-04-27 14:10:38 -0400
commitea2cf2282b4278461266013e9c002ee1c66700ff (patch)
tree244de055925710de27206ee0d5d09caa6353bd62 /fs/nfs/write.c
parent84c53ab5c093058c756dcef1879d38be6de90a3c (diff)
NFS: create struct nfs_commit_info
It is COMMIT that is handled the most differently between the paged and direct paths. Create a structure that encapsulates everything either path needs to know about the commit state. We could use void to hide some of the layout driver stuff, but Trond suggests pulling it out to ensure type checking, given the huge changes being made, and the fact that it doesn't interfere with other drivers. Signed-off-by: Fred Isaman <iisaman@netapp.com> Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
Diffstat (limited to 'fs/nfs/write.c')
-rw-r--r--fs/nfs/write.c158
1 files changed, 93 insertions, 65 deletions
diff --git a/fs/nfs/write.c b/fs/nfs/write.c
index 2500f1cf1996..18bf70055272 100644
--- a/fs/nfs/write.c
+++ b/fs/nfs/write.c
@@ -452,65 +452,79 @@ nfs_mark_request_dirty(struct nfs_page *req)
452/** 452/**
453 * nfs_request_add_commit_list - add request to a commit list 453 * nfs_request_add_commit_list - add request to a commit list
454 * @req: pointer to a struct nfs_page 454 * @req: pointer to a struct nfs_page
455 * @head: commit list head 455 * @dst: commit list head
456 * @cinfo: holds list lock and accounting info
456 * 457 *
457 * This sets the PG_CLEAN bit, updates the inode global count of 458 * This sets the PG_CLEAN bit, updates the cinfo count of
458 * number of outstanding requests requiring a commit as well as 459 * number of outstanding requests requiring a commit as well as
459 * the MM page stats. 460 * the MM page stats.
460 * 461 *
461 * The caller must _not_ hold the inode->i_lock, but must be 462 * The caller must _not_ hold the cinfo->lock, but must be
462 * holding the nfs_page lock. 463 * holding the nfs_page lock.
463 */ 464 */
464void 465void
465nfs_request_add_commit_list(struct nfs_page *req, struct list_head *head) 466nfs_request_add_commit_list(struct nfs_page *req, struct list_head *dst,
467 struct nfs_commit_info *cinfo)
466{ 468{
467 struct inode *inode = req->wb_context->dentry->d_inode;
468
469 set_bit(PG_CLEAN, &(req)->wb_flags); 469 set_bit(PG_CLEAN, &(req)->wb_flags);
470 spin_lock(&inode->i_lock); 470 spin_lock(cinfo->lock);
471 nfs_list_add_request(req, head); 471 nfs_list_add_request(req, dst);
472 NFS_I(inode)->ncommit++; 472 cinfo->mds->ncommit++;
473 spin_unlock(&inode->i_lock); 473 spin_unlock(cinfo->lock);
474 inc_zone_page_state(req->wb_page, NR_UNSTABLE_NFS); 474 inc_zone_page_state(req->wb_page, NR_UNSTABLE_NFS);
475 inc_bdi_stat(req->wb_page->mapping->backing_dev_info, BDI_RECLAIMABLE); 475 inc_bdi_stat(req->wb_page->mapping->backing_dev_info, BDI_RECLAIMABLE);
476 __mark_inode_dirty(inode, I_DIRTY_DATASYNC); 476 __mark_inode_dirty(req->wb_context->dentry->d_inode, I_DIRTY_DATASYNC);
477} 477}
478EXPORT_SYMBOL_GPL(nfs_request_add_commit_list); 478EXPORT_SYMBOL_GPL(nfs_request_add_commit_list);
479 479
480/** 480/**
481 * nfs_request_remove_commit_list - Remove request from a commit list 481 * nfs_request_remove_commit_list - Remove request from a commit list
482 * @req: pointer to a nfs_page 482 * @req: pointer to a nfs_page
483 * @cinfo: holds list lock and accounting info
483 * 484 *
484 * This clears the PG_CLEAN bit, and updates the inode global count of 485 * This clears the PG_CLEAN bit, and updates the cinfo's count of
485 * number of outstanding requests requiring a commit 486 * number of outstanding requests requiring a commit
486 * It does not update the MM page stats. 487 * It does not update the MM page stats.
487 * 488 *
488 * The caller _must_ hold the inode->i_lock and the nfs_page lock. 489 * The caller _must_ hold the cinfo->lock and the nfs_page lock.
489 */ 490 */
490void 491void
491nfs_request_remove_commit_list(struct nfs_page *req) 492nfs_request_remove_commit_list(struct nfs_page *req,
493 struct nfs_commit_info *cinfo)
492{ 494{
493 struct inode *inode = req->wb_context->dentry->d_inode;
494
495 if (!test_and_clear_bit(PG_CLEAN, &(req)->wb_flags)) 495 if (!test_and_clear_bit(PG_CLEAN, &(req)->wb_flags))
496 return; 496 return;
497 nfs_list_remove_request(req); 497 nfs_list_remove_request(req);
498 NFS_I(inode)->ncommit--; 498 cinfo->mds->ncommit--;
499} 499}
500EXPORT_SYMBOL_GPL(nfs_request_remove_commit_list); 500EXPORT_SYMBOL_GPL(nfs_request_remove_commit_list);
501 501
502static void nfs_init_cinfo_from_inode(struct nfs_commit_info *cinfo,
503 struct inode *inode)
504{
505 cinfo->lock = &inode->i_lock;
506 cinfo->mds = &NFS_I(inode)->commit_info;
507 cinfo->ds = pnfs_get_ds_info(inode);
508}
509
510void nfs_init_cinfo(struct nfs_commit_info *cinfo,
511 struct inode *inode,
512 struct nfs_direct_req *dreq)
513{
514 nfs_init_cinfo_from_inode(cinfo, inode);
515}
516EXPORT_SYMBOL_GPL(nfs_init_cinfo);
502 517
503/* 518/*
504 * Add a request to the inode's commit list. 519 * Add a request to the inode's commit list.
505 */ 520 */
506static void 521static void
507nfs_mark_request_commit(struct nfs_page *req, struct pnfs_layout_segment *lseg) 522nfs_mark_request_commit(struct nfs_page *req, struct pnfs_layout_segment *lseg,
523 struct nfs_commit_info *cinfo)
508{ 524{
509 struct inode *inode = req->wb_context->dentry->d_inode; 525 if (pnfs_mark_request_commit(req, lseg, cinfo))
510
511 if (pnfs_mark_request_commit(req, lseg))
512 return; 526 return;
513 nfs_request_add_commit_list(req, &NFS_I(inode)->commit_list); 527 nfs_request_add_commit_list(req, &cinfo->mds->list, cinfo);
514} 528}
515 529
516static void 530static void
@@ -525,11 +539,13 @@ nfs_clear_request_commit(struct nfs_page *req)
525{ 539{
526 if (test_bit(PG_CLEAN, &req->wb_flags)) { 540 if (test_bit(PG_CLEAN, &req->wb_flags)) {
527 struct inode *inode = req->wb_context->dentry->d_inode; 541 struct inode *inode = req->wb_context->dentry->d_inode;
542 struct nfs_commit_info cinfo;
528 543
529 if (!pnfs_clear_request_commit(req)) { 544 nfs_init_cinfo_from_inode(&cinfo, inode);
530 spin_lock(&inode->i_lock); 545 if (!pnfs_clear_request_commit(req, &cinfo)) {
531 nfs_request_remove_commit_list(req); 546 spin_lock(cinfo.lock);
532 spin_unlock(&inode->i_lock); 547 nfs_request_remove_commit_list(req, &cinfo);
548 spin_unlock(cinfo.lock);
533 } 549 }
534 nfs_clear_page_commit(req->wb_page); 550 nfs_clear_page_commit(req->wb_page);
535 } 551 }
@@ -545,7 +561,8 @@ int nfs_write_need_commit(struct nfs_write_data *data)
545 561
546#else 562#else
547static void 563static void
548nfs_mark_request_commit(struct nfs_page *req, struct pnfs_layout_segment *lseg) 564nfs_mark_request_commit(struct nfs_page *req, struct pnfs_layout_segment *lseg,
565 struct nfs_commit_info *cinfo)
549{ 566{
550} 567}
551 568
@@ -564,10 +581,12 @@ int nfs_write_need_commit(struct nfs_write_data *data)
564 581
565static void nfs_write_completion(struct nfs_pgio_header *hdr) 582static void nfs_write_completion(struct nfs_pgio_header *hdr)
566{ 583{
584 struct nfs_commit_info cinfo;
567 unsigned long bytes = 0; 585 unsigned long bytes = 0;
568 586
569 if (test_bit(NFS_IOHDR_REDO, &hdr->flags)) 587 if (test_bit(NFS_IOHDR_REDO, &hdr->flags))
570 goto out; 588 goto out;
589 nfs_init_cinfo_from_inode(&cinfo, hdr->inode);
571 while (!list_empty(&hdr->pages)) { 590 while (!list_empty(&hdr->pages)) {
572 struct nfs_page *req = nfs_list_entry(hdr->pages.next); 591 struct nfs_page *req = nfs_list_entry(hdr->pages.next);
573 struct page *page = req->wb_page; 592 struct page *page = req->wb_page;
@@ -585,7 +604,7 @@ static void nfs_write_completion(struct nfs_pgio_header *hdr)
585 goto next; 604 goto next;
586 } 605 }
587 if (test_bit(NFS_IOHDR_NEED_COMMIT, &hdr->flags)) { 606 if (test_bit(NFS_IOHDR_NEED_COMMIT, &hdr->flags)) {
588 nfs_mark_request_commit(req, hdr->lseg); 607 nfs_mark_request_commit(req, hdr->lseg, &cinfo);
589 goto next; 608 goto next;
590 } 609 }
591remove_req: 610remove_req:
@@ -599,16 +618,16 @@ out:
599} 618}
600 619
601#if defined(CONFIG_NFS_V3) || defined(CONFIG_NFS_V4) 620#if defined(CONFIG_NFS_V3) || defined(CONFIG_NFS_V4)
602static int 621static unsigned long
603nfs_need_commit(struct nfs_inode *nfsi) 622nfs_reqs_to_commit(struct nfs_commit_info *cinfo)
604{ 623{
605 return nfsi->ncommit > 0; 624 return cinfo->mds->ncommit;
606} 625}
607 626
608/* i_lock held by caller */ 627/* cinfo->lock held by caller */
609static int 628static int
610nfs_scan_commit_list(struct list_head *src, struct list_head *dst, int max, 629nfs_scan_commit_list(struct list_head *src, struct list_head *dst,
611 spinlock_t *lock) 630 struct nfs_commit_info *cinfo, int max)
612{ 631{
613 struct nfs_page *req, *tmp; 632 struct nfs_page *req, *tmp;
614 int ret = 0; 633 int ret = 0;
@@ -616,9 +635,9 @@ nfs_scan_commit_list(struct list_head *src, struct list_head *dst, int max,
616 list_for_each_entry_safe(req, tmp, src, wb_list) { 635 list_for_each_entry_safe(req, tmp, src, wb_list) {
617 if (!nfs_lock_request(req)) 636 if (!nfs_lock_request(req))
618 continue; 637 continue;
619 if (cond_resched_lock(lock)) 638 if (cond_resched_lock(cinfo->lock))
620 list_safe_reset_next(req, tmp, wb_list); 639 list_safe_reset_next(req, tmp, wb_list);
621 nfs_request_remove_commit_list(req); 640 nfs_request_remove_commit_list(req, cinfo);
622 nfs_list_add_request(req, dst); 641 nfs_list_add_request(req, dst);
623 ret++; 642 ret++;
624 if (ret == max) 643 if (ret == max)
@@ -630,37 +649,38 @@ nfs_scan_commit_list(struct list_head *src, struct list_head *dst, int max,
630/* 649/*
631 * nfs_scan_commit - Scan an inode for commit requests 650 * nfs_scan_commit - Scan an inode for commit requests
632 * @inode: NFS inode to scan 651 * @inode: NFS inode to scan
633 * @dst: destination list 652 * @dst: mds destination list
653 * @cinfo: mds and ds lists of reqs ready to commit
634 * 654 *
635 * Moves requests from the inode's 'commit' request list. 655 * Moves requests from the inode's 'commit' request list.
636 * The requests are *not* checked to ensure that they form a contiguous set. 656 * The requests are *not* checked to ensure that they form a contiguous set.
637 */ 657 */
638static int 658static int
639nfs_scan_commit(struct inode *inode, struct list_head *dst) 659nfs_scan_commit(struct inode *inode, struct list_head *dst,
660 struct nfs_commit_info *cinfo)
640{ 661{
641 struct nfs_inode *nfsi = NFS_I(inode);
642 int ret = 0; 662 int ret = 0;
643 663
644 spin_lock(&inode->i_lock); 664 spin_lock(cinfo->lock);
645 if (nfsi->ncommit > 0) { 665 if (cinfo->mds->ncommit > 0) {
646 const int max = INT_MAX; 666 const int max = INT_MAX;
647 667
648 ret = nfs_scan_commit_list(&nfsi->commit_list, dst, max, 668 ret = nfs_scan_commit_list(&cinfo->mds->list, dst,
649 &inode->i_lock); 669 cinfo, max);
650 ret += pnfs_scan_commit_lists(inode, max - ret, 670 ret += pnfs_scan_commit_lists(inode, cinfo, max - ret);
651 &inode->i_lock);
652 } 671 }
653 spin_unlock(&inode->i_lock); 672 spin_unlock(cinfo->lock);
654 return ret; 673 return ret;
655} 674}
656 675
657#else 676#else
658static inline int nfs_need_commit(struct nfs_inode *nfsi) 677static unsigned long nfs_reqs_to_commit(struct nfs_commit_info *cinfo)
659{ 678{
660 return 0; 679 return 0;
661} 680}
662 681
663static inline int nfs_scan_commit(struct inode *inode, struct list_head *dst) 682static inline int nfs_scan_commit(struct inode *inode, struct list_head *dst,
683 struct nfs_commit_info *cinfo)
664{ 684{
665 return 0; 685 return 0;
666} 686}
@@ -929,7 +949,7 @@ EXPORT_SYMBOL_GPL(nfs_initiate_write);
929 */ 949 */
930static void nfs_write_rpcsetup(struct nfs_write_data *data, 950static void nfs_write_rpcsetup(struct nfs_write_data *data,
931 unsigned int count, unsigned int offset, 951 unsigned int count, unsigned int offset,
932 int how) 952 int how, struct nfs_commit_info *cinfo)
933{ 953{
934 struct nfs_page *req = data->header->req; 954 struct nfs_page *req = data->header->req;
935 955
@@ -950,7 +970,7 @@ static void nfs_write_rpcsetup(struct nfs_write_data *data,
950 case 0: 970 case 0:
951 break; 971 break;
952 case FLUSH_COND_STABLE: 972 case FLUSH_COND_STABLE:
953 if (nfs_need_commit(NFS_I(data->header->inode))) 973 if (nfs_reqs_to_commit(cinfo))
954 break; 974 break;
955 default: 975 default:
956 data->args.stable = NFS_FILE_SYNC; 976 data->args.stable = NFS_FILE_SYNC;
@@ -1034,12 +1054,14 @@ static int nfs_flush_multi(struct nfs_pageio_descriptor *desc,
1034 unsigned int offset; 1054 unsigned int offset;
1035 int requests = 0; 1055 int requests = 0;
1036 int ret = 0; 1056 int ret = 0;
1057 struct nfs_commit_info cinfo;
1037 1058
1059 nfs_init_cinfo(&cinfo, desc->pg_inode, desc->pg_dreq);
1038 nfs_list_remove_request(req); 1060 nfs_list_remove_request(req);
1039 nfs_list_add_request(req, &hdr->pages); 1061 nfs_list_add_request(req, &hdr->pages);
1040 1062
1041 if ((desc->pg_ioflags & FLUSH_COND_STABLE) && 1063 if ((desc->pg_ioflags & FLUSH_COND_STABLE) &&
1042 (desc->pg_moreio || NFS_I(desc->pg_inode)->ncommit || 1064 (desc->pg_moreio || nfs_reqs_to_commit(&cinfo) ||
1043 desc->pg_count > wsize)) 1065 desc->pg_count > wsize))
1044 desc->pg_ioflags &= ~FLUSH_COND_STABLE; 1066 desc->pg_ioflags &= ~FLUSH_COND_STABLE;
1045 1067
@@ -1053,7 +1075,7 @@ static int nfs_flush_multi(struct nfs_pageio_descriptor *desc,
1053 if (!data) 1075 if (!data)
1054 goto out_bad; 1076 goto out_bad;
1055 data->pages.pagevec[0] = page; 1077 data->pages.pagevec[0] = page;
1056 nfs_write_rpcsetup(data, len, offset, desc->pg_ioflags); 1078 nfs_write_rpcsetup(data, len, offset, desc->pg_ioflags, &cinfo);
1057 list_add(&data->list, &hdr->rpc_list); 1079 list_add(&data->list, &hdr->rpc_list);
1058 requests++; 1080 requests++;
1059 nbytes -= len; 1081 nbytes -= len;
@@ -1088,6 +1110,7 @@ static int nfs_flush_one(struct nfs_pageio_descriptor *desc,
1088 struct nfs_write_data *data; 1110 struct nfs_write_data *data;
1089 struct list_head *head = &desc->pg_list; 1111 struct list_head *head = &desc->pg_list;
1090 int ret = 0; 1112 int ret = 0;
1113 struct nfs_commit_info cinfo;
1091 1114
1092 data = nfs_writedata_alloc(hdr, nfs_page_array_len(desc->pg_base, 1115 data = nfs_writedata_alloc(hdr, nfs_page_array_len(desc->pg_base,
1093 desc->pg_count)); 1116 desc->pg_count));
@@ -1097,6 +1120,7 @@ static int nfs_flush_one(struct nfs_pageio_descriptor *desc,
1097 goto out; 1120 goto out;
1098 } 1121 }
1099 1122
1123 nfs_init_cinfo(&cinfo, desc->pg_inode, desc->pg_dreq);
1100 pages = data->pages.pagevec; 1124 pages = data->pages.pagevec;
1101 while (!list_empty(head)) { 1125 while (!list_empty(head)) {
1102 req = nfs_list_entry(head->next); 1126 req = nfs_list_entry(head->next);
@@ -1106,11 +1130,11 @@ static int nfs_flush_one(struct nfs_pageio_descriptor *desc,
1106 } 1130 }
1107 1131
1108 if ((desc->pg_ioflags & FLUSH_COND_STABLE) && 1132 if ((desc->pg_ioflags & FLUSH_COND_STABLE) &&
1109 (desc->pg_moreio || NFS_I(desc->pg_inode)->ncommit)) 1133 (desc->pg_moreio || nfs_reqs_to_commit(&cinfo)))
1110 desc->pg_ioflags &= ~FLUSH_COND_STABLE; 1134 desc->pg_ioflags &= ~FLUSH_COND_STABLE;
1111 1135
1112 /* Set up the argument struct */ 1136 /* Set up the argument struct */
1113 nfs_write_rpcsetup(data, desc->pg_count, 0, desc->pg_ioflags); 1137 nfs_write_rpcsetup(data, desc->pg_count, 0, desc->pg_ioflags, &cinfo);
1114 list_add(&data->list, &hdr->rpc_list); 1138 list_add(&data->list, &hdr->rpc_list);
1115 desc->pg_rpc_callops = &nfs_write_common_ops; 1139 desc->pg_rpc_callops = &nfs_write_common_ops;
1116out: 1140out:
@@ -1417,14 +1441,15 @@ void nfs_init_commit(struct nfs_commit_data *data,
1417EXPORT_SYMBOL_GPL(nfs_init_commit); 1441EXPORT_SYMBOL_GPL(nfs_init_commit);
1418 1442
1419void nfs_retry_commit(struct list_head *page_list, 1443void nfs_retry_commit(struct list_head *page_list,
1420 struct pnfs_layout_segment *lseg) 1444 struct pnfs_layout_segment *lseg,
1445 struct nfs_commit_info *cinfo)
1421{ 1446{
1422 struct nfs_page *req; 1447 struct nfs_page *req;
1423 1448
1424 while (!list_empty(page_list)) { 1449 while (!list_empty(page_list)) {
1425 req = nfs_list_entry(page_list->next); 1450 req = nfs_list_entry(page_list->next);
1426 nfs_list_remove_request(req); 1451 nfs_list_remove_request(req);
1427 nfs_mark_request_commit(req, lseg); 1452 nfs_mark_request_commit(req, lseg, cinfo);
1428 dec_zone_page_state(req->wb_page, NR_UNSTABLE_NFS); 1453 dec_zone_page_state(req->wb_page, NR_UNSTABLE_NFS);
1429 dec_bdi_stat(req->wb_page->mapping->backing_dev_info, 1454 dec_bdi_stat(req->wb_page->mapping->backing_dev_info,
1430 BDI_RECLAIMABLE); 1455 BDI_RECLAIMABLE);
@@ -1437,7 +1462,8 @@ EXPORT_SYMBOL_GPL(nfs_retry_commit);
1437 * Commit dirty pages 1462 * Commit dirty pages
1438 */ 1463 */
1439static int 1464static int
1440nfs_commit_list(struct inode *inode, struct list_head *head, int how) 1465nfs_commit_list(struct inode *inode, struct list_head *head, int how,
1466 struct nfs_commit_info *cinfo)
1441{ 1467{
1442 struct nfs_commit_data *data; 1468 struct nfs_commit_data *data;
1443 1469
@@ -1450,7 +1476,7 @@ nfs_commit_list(struct inode *inode, struct list_head *head, int how)
1450 nfs_init_commit(data, head, NULL); 1476 nfs_init_commit(data, head, NULL);
1451 return nfs_initiate_commit(NFS_CLIENT(inode), data, data->mds_ops, how); 1477 return nfs_initiate_commit(NFS_CLIENT(inode), data, data->mds_ops, how);
1452 out_bad: 1478 out_bad:
1453 nfs_retry_commit(head, NULL); 1479 nfs_retry_commit(head, NULL, cinfo);
1454 nfs_commit_clear_lock(NFS_I(inode)); 1480 nfs_commit_clear_lock(NFS_I(inode));
1455 return -ENOMEM; 1481 return -ENOMEM;
1456} 1482}
@@ -1524,30 +1550,32 @@ static const struct rpc_call_ops nfs_commit_ops = {
1524}; 1550};
1525 1551
1526static int nfs_generic_commit_list(struct inode *inode, struct list_head *head, 1552static int nfs_generic_commit_list(struct inode *inode, struct list_head *head,
1527 int how) 1553 int how, struct nfs_commit_info *cinfo)
1528{ 1554{
1529 int status; 1555 int status;
1530 1556
1531 status = pnfs_commit_list(inode, head, how); 1557 status = pnfs_commit_list(inode, head, how, cinfo);
1532 if (status == PNFS_NOT_ATTEMPTED) 1558 if (status == PNFS_NOT_ATTEMPTED)
1533 status = nfs_commit_list(inode, head, how); 1559 status = nfs_commit_list(inode, head, how, cinfo);
1534 return status; 1560 return status;
1535} 1561}
1536 1562
1537int nfs_commit_inode(struct inode *inode, int how) 1563int nfs_commit_inode(struct inode *inode, int how)
1538{ 1564{
1539 LIST_HEAD(head); 1565 LIST_HEAD(head);
1566 struct nfs_commit_info cinfo;
1540 int may_wait = how & FLUSH_SYNC; 1567 int may_wait = how & FLUSH_SYNC;
1541 int res; 1568 int res;
1542 1569
1543 res = nfs_commit_set_lock(NFS_I(inode), may_wait); 1570 res = nfs_commit_set_lock(NFS_I(inode), may_wait);
1544 if (res <= 0) 1571 if (res <= 0)
1545 goto out_mark_dirty; 1572 goto out_mark_dirty;
1546 res = nfs_scan_commit(inode, &head); 1573 nfs_init_cinfo_from_inode(&cinfo, inode);
1574 res = nfs_scan_commit(inode, &head, &cinfo);
1547 if (res) { 1575 if (res) {
1548 int error; 1576 int error;
1549 1577
1550 error = nfs_generic_commit_list(inode, &head, how); 1578 error = nfs_generic_commit_list(inode, &head, how, &cinfo);
1551 if (error < 0) 1579 if (error < 0)
1552 return error; 1580 return error;
1553 if (!may_wait) 1581 if (!may_wait)
@@ -1578,14 +1606,14 @@ static int nfs_commit_unstable_pages(struct inode *inode, struct writeback_contr
1578 int ret = 0; 1606 int ret = 0;
1579 1607
1580 /* no commits means nothing needs to be done */ 1608 /* no commits means nothing needs to be done */
1581 if (!nfsi->ncommit) 1609 if (!nfsi->commit_info.ncommit)
1582 return ret; 1610 return ret;
1583 1611
1584 if (wbc->sync_mode == WB_SYNC_NONE) { 1612 if (wbc->sync_mode == WB_SYNC_NONE) {
1585 /* Don't commit yet if this is a non-blocking flush and there 1613 /* Don't commit yet if this is a non-blocking flush and there
1586 * are a lot of outstanding writes for this mapping. 1614 * are a lot of outstanding writes for this mapping.
1587 */ 1615 */
1588 if (nfsi->ncommit <= (nfsi->npages >> 1)) 1616 if (nfsi->commit_info.ncommit <= (nfsi->npages >> 1))
1589 goto out_mark_dirty; 1617 goto out_mark_dirty;
1590 1618
1591 /* don't wait for the COMMIT response */ 1619 /* don't wait for the COMMIT response */