aboutsummaryrefslogtreecommitdiffstats
path: root/fs/xfs
diff options
context:
space:
mode:
authorChristoph Hellwig <hch@infradead.org>2010-06-23 04:11:15 -0400
committerAlex Elder <aelder@sgi.com>2010-07-26 14:16:39 -0400
commitb4e9181e772b0c8b9038c5822ead368b96c2b533 (patch)
tree2c6cd32cb72a5c7450fefca3701ebc774e830f1c /fs/xfs
parentcd8b0bb3c49d0691e9e7b4cf19e21ca63b92c053 (diff)
xfs: remove unused delta tracking code in xfs_bmapi
This code was introduced four years ago in commit 3e57ecf640428c01ba1ed8c8fc538447ada1715b without any review and has been unused since. Remove it just as the rest of the code introduced in that commit to reduce that stack usage and complexity in this central piece of code. Signed-off-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Dave Chinner <dchinner@redhat.com>
Diffstat (limited to 'fs/xfs')
-rw-r--r--fs/xfs/linux-2.6/xfs_aops.c4
-rw-r--r--fs/xfs/linux-2.6/xfs_file.c4
-rw-r--r--fs/xfs/quota/xfs_dquot.c4
-rw-r--r--fs/xfs/quota/xfs_qm.c2
-rw-r--r--fs/xfs/xfs_attr.c10
-rw-r--r--fs/xfs/xfs_attr_leaf.c2
-rw-r--r--fs/xfs/xfs_bmap.c217
-rw-r--r--fs/xfs/xfs_bmap.h20
-rw-r--r--fs/xfs/xfs_da_btree.c9
-rw-r--r--fs/xfs/xfs_dir2.c7
-rw-r--r--fs/xfs/xfs_dir2_leaf.c2
-rw-r--r--fs/xfs/xfs_inode.c4
-rw-r--r--fs/xfs/xfs_iomap.c12
-rw-r--r--fs/xfs/xfs_rtalloc.c2
-rw-r--r--fs/xfs/xfs_vnodeops.c20
15 files changed, 59 insertions, 260 deletions
diff --git a/fs/xfs/linux-2.6/xfs_aops.c b/fs/xfs/linux-2.6/xfs_aops.c
index e42c0ba6688a..b25d11a3d84e 100644
--- a/fs/xfs/linux-2.6/xfs_aops.c
+++ b/fs/xfs/linux-2.6/xfs_aops.c
@@ -974,7 +974,7 @@ xfs_aops_discard_page(
974 */ 974 */
975 error = xfs_bmapi(NULL, ip, offset_fsb, 1, 975 error = xfs_bmapi(NULL, ip, offset_fsb, 1,
976 XFS_BMAPI_ENTIRE, NULL, 0, &imap, 976 XFS_BMAPI_ENTIRE, NULL, 0, &imap,
977 &nimaps, NULL, NULL); 977 &nimaps, NULL);
978 978
979 if (error) { 979 if (error) {
980 /* something screwed, just bail */ 980 /* something screwed, just bail */
@@ -1002,7 +1002,7 @@ xfs_aops_discard_page(
1002 */ 1002 */
1003 xfs_bmap_init(&flist, &firstblock); 1003 xfs_bmap_init(&flist, &firstblock);
1004 error = xfs_bunmapi(NULL, ip, offset_fsb, 1, 0, 1, &firstblock, 1004 error = xfs_bunmapi(NULL, ip, offset_fsb, 1, 0, 1, &firstblock,
1005 &flist, NULL, &done); 1005 &flist, &done);
1006 1006
1007 ASSERT(!flist.xbf_count && !flist.xbf_first); 1007 ASSERT(!flist.xbf_count && !flist.xbf_first);
1008 if (error) { 1008 if (error) {
diff --git a/fs/xfs/linux-2.6/xfs_file.c b/fs/xfs/linux-2.6/xfs_file.c
index 9a9b446a58a7..22edad7a0bec 100644
--- a/fs/xfs/linux-2.6/xfs_file.c
+++ b/fs/xfs/linux-2.6/xfs_file.c
@@ -414,7 +414,7 @@ xfs_zero_last_block(
414 last_fsb = XFS_B_TO_FSBT(mp, isize); 414 last_fsb = XFS_B_TO_FSBT(mp, isize);
415 nimaps = 1; 415 nimaps = 1;
416 error = xfs_bmapi(NULL, ip, last_fsb, 1, 0, NULL, 0, &imap, 416 error = xfs_bmapi(NULL, ip, last_fsb, 1, 0, NULL, 0, &imap,
417 &nimaps, NULL, NULL); 417 &nimaps, NULL);
418 if (error) { 418 if (error) {
419 return error; 419 return error;
420 } 420 }
@@ -509,7 +509,7 @@ xfs_zero_eof(
509 nimaps = 1; 509 nimaps = 1;
510 zero_count_fsb = end_zero_fsb - start_zero_fsb + 1; 510 zero_count_fsb = end_zero_fsb - start_zero_fsb + 1;
511 error = xfs_bmapi(NULL, ip, start_zero_fsb, zero_count_fsb, 511 error = xfs_bmapi(NULL, ip, start_zero_fsb, zero_count_fsb,
512 0, NULL, 0, &imap, &nimaps, NULL, NULL); 512 0, NULL, 0, &imap, &nimaps, NULL);
513 if (error) { 513 if (error) {
514 ASSERT(xfs_isilocked(ip, XFS_ILOCK_EXCL|XFS_IOLOCK_EXCL)); 514 ASSERT(xfs_isilocked(ip, XFS_ILOCK_EXCL|XFS_IOLOCK_EXCL));
515 return error; 515 return error;
diff --git a/fs/xfs/quota/xfs_dquot.c b/fs/xfs/quota/xfs_dquot.c
index 56f366e327f3..e1a2f6800e01 100644
--- a/fs/xfs/quota/xfs_dquot.c
+++ b/fs/xfs/quota/xfs_dquot.c
@@ -385,7 +385,7 @@ xfs_qm_dqalloc(
385 XFS_BMAPI_METADATA | XFS_BMAPI_WRITE, 385 XFS_BMAPI_METADATA | XFS_BMAPI_WRITE,
386 &firstblock, 386 &firstblock,
387 XFS_QM_DQALLOC_SPACE_RES(mp), 387 XFS_QM_DQALLOC_SPACE_RES(mp),
388 &map, &nmaps, &flist, NULL))) { 388 &map, &nmaps, &flist))) {
389 goto error0; 389 goto error0;
390 } 390 }
391 ASSERT(map.br_blockcount == XFS_DQUOT_CLUSTER_SIZE_FSB); 391 ASSERT(map.br_blockcount == XFS_DQUOT_CLUSTER_SIZE_FSB);
@@ -501,7 +501,7 @@ xfs_qm_dqtobp(
501 error = xfs_bmapi(NULL, quotip, dqp->q_fileoffset, 501 error = xfs_bmapi(NULL, quotip, dqp->q_fileoffset,
502 XFS_DQUOT_CLUSTER_SIZE_FSB, 502 XFS_DQUOT_CLUSTER_SIZE_FSB,
503 XFS_BMAPI_METADATA, 503 XFS_BMAPI_METADATA,
504 NULL, 0, &map, &nmaps, NULL, NULL); 504 NULL, 0, &map, &nmaps, NULL);
505 505
506 xfs_iunlock(quotip, XFS_ILOCK_SHARED); 506 xfs_iunlock(quotip, XFS_ILOCK_SHARED);
507 if (error) 507 if (error)
diff --git a/fs/xfs/quota/xfs_qm.c b/fs/xfs/quota/xfs_qm.c
index b32c3fb9e779..7a33d65e2d28 100644
--- a/fs/xfs/quota/xfs_qm.c
+++ b/fs/xfs/quota/xfs_qm.c
@@ -1490,7 +1490,7 @@ xfs_qm_dqiterate(
1490 maxlblkcnt - lblkno, 1490 maxlblkcnt - lblkno,
1491 XFS_BMAPI_METADATA, 1491 XFS_BMAPI_METADATA,
1492 NULL, 1492 NULL,
1493 0, map, &nmaps, NULL, NULL); 1493 0, map, &nmaps, NULL);
1494 xfs_iunlock(qip, XFS_ILOCK_SHARED); 1494 xfs_iunlock(qip, XFS_ILOCK_SHARED);
1495 if (error) 1495 if (error)
1496 break; 1496 break;
diff --git a/fs/xfs/xfs_attr.c b/fs/xfs/xfs_attr.c
index f3ca7186155a..c2568242a901 100644
--- a/fs/xfs/xfs_attr.c
+++ b/fs/xfs/xfs_attr.c
@@ -1977,7 +1977,7 @@ xfs_attr_rmtval_get(xfs_da_args_t *args)
1977 error = xfs_bmapi(args->trans, args->dp, (xfs_fileoff_t)lblkno, 1977 error = xfs_bmapi(args->trans, args->dp, (xfs_fileoff_t)lblkno,
1978 args->rmtblkcnt, 1978 args->rmtblkcnt,
1979 XFS_BMAPI_ATTRFORK | XFS_BMAPI_METADATA, 1979 XFS_BMAPI_ATTRFORK | XFS_BMAPI_METADATA,
1980 NULL, 0, map, &nmap, NULL, NULL); 1980 NULL, 0, map, &nmap, NULL);
1981 if (error) 1981 if (error)
1982 return(error); 1982 return(error);
1983 ASSERT(nmap >= 1); 1983 ASSERT(nmap >= 1);
@@ -2056,7 +2056,7 @@ xfs_attr_rmtval_set(xfs_da_args_t *args)
2056 XFS_BMAPI_ATTRFORK | XFS_BMAPI_METADATA | 2056 XFS_BMAPI_ATTRFORK | XFS_BMAPI_METADATA |
2057 XFS_BMAPI_WRITE, 2057 XFS_BMAPI_WRITE,
2058 args->firstblock, args->total, &map, &nmap, 2058 args->firstblock, args->total, &map, &nmap,
2059 args->flist, NULL); 2059 args->flist);
2060 if (!error) { 2060 if (!error) {
2061 error = xfs_bmap_finish(&args->trans, args->flist, 2061 error = xfs_bmap_finish(&args->trans, args->flist,
2062 &committed); 2062 &committed);
@@ -2107,7 +2107,7 @@ xfs_attr_rmtval_set(xfs_da_args_t *args)
2107 args->rmtblkcnt, 2107 args->rmtblkcnt,
2108 XFS_BMAPI_ATTRFORK | XFS_BMAPI_METADATA, 2108 XFS_BMAPI_ATTRFORK | XFS_BMAPI_METADATA,
2109 args->firstblock, 0, &map, &nmap, 2109 args->firstblock, 0, &map, &nmap,
2110 NULL, NULL); 2110 NULL);
2111 if (error) { 2111 if (error) {
2112 return(error); 2112 return(error);
2113 } 2113 }
@@ -2172,7 +2172,7 @@ xfs_attr_rmtval_remove(xfs_da_args_t *args)
2172 args->rmtblkcnt, 2172 args->rmtblkcnt,
2173 XFS_BMAPI_ATTRFORK | XFS_BMAPI_METADATA, 2173 XFS_BMAPI_ATTRFORK | XFS_BMAPI_METADATA,
2174 args->firstblock, 0, &map, &nmap, 2174 args->firstblock, 0, &map, &nmap,
2175 args->flist, NULL); 2175 args->flist);
2176 if (error) { 2176 if (error) {
2177 return(error); 2177 return(error);
2178 } 2178 }
@@ -2210,7 +2210,7 @@ xfs_attr_rmtval_remove(xfs_da_args_t *args)
2210 error = xfs_bunmapi(args->trans, args->dp, lblkno, blkcnt, 2210 error = xfs_bunmapi(args->trans, args->dp, lblkno, blkcnt,
2211 XFS_BMAPI_ATTRFORK | XFS_BMAPI_METADATA, 2211 XFS_BMAPI_ATTRFORK | XFS_BMAPI_METADATA,
2212 1, args->firstblock, args->flist, 2212 1, args->firstblock, args->flist,
2213 NULL, &done); 2213 &done);
2214 if (!error) { 2214 if (!error) {
2215 error = xfs_bmap_finish(&args->trans, args->flist, 2215 error = xfs_bmap_finish(&args->trans, args->flist,
2216 &committed); 2216 &committed);
diff --git a/fs/xfs/xfs_attr_leaf.c b/fs/xfs/xfs_attr_leaf.c
index e4d48b2cee19..a6cff8edcdb6 100644
--- a/fs/xfs/xfs_attr_leaf.c
+++ b/fs/xfs/xfs_attr_leaf.c
@@ -2928,7 +2928,7 @@ xfs_attr_leaf_freextent(xfs_trans_t **trans, xfs_inode_t *dp,
2928 nmap = 1; 2928 nmap = 1;
2929 error = xfs_bmapi(*trans, dp, (xfs_fileoff_t)tblkno, tblkcnt, 2929 error = xfs_bmapi(*trans, dp, (xfs_fileoff_t)tblkno, tblkcnt,
2930 XFS_BMAPI_ATTRFORK | XFS_BMAPI_METADATA, 2930 XFS_BMAPI_ATTRFORK | XFS_BMAPI_METADATA,
2931 NULL, 0, &map, &nmap, NULL, NULL); 2931 NULL, 0, &map, &nmap, NULL);
2932 if (error) { 2932 if (error) {
2933 return(error); 2933 return(error);
2934 } 2934 }
diff --git a/fs/xfs/xfs_bmap.c b/fs/xfs/xfs_bmap.c
index 598a30ba3141..d74fbec80622 100644
--- a/fs/xfs/xfs_bmap.c
+++ b/fs/xfs/xfs_bmap.c
@@ -101,7 +101,6 @@ xfs_bmap_add_extent(
101 xfs_fsblock_t *first, /* pointer to firstblock variable */ 101 xfs_fsblock_t *first, /* pointer to firstblock variable */
102 xfs_bmap_free_t *flist, /* list of extents to be freed */ 102 xfs_bmap_free_t *flist, /* list of extents to be freed */
103 int *logflagsp, /* inode logging flags */ 103 int *logflagsp, /* inode logging flags */
104 xfs_extdelta_t *delta, /* Change made to incore extents */
105 int whichfork, /* data or attr fork */ 104 int whichfork, /* data or attr fork */
106 int rsvd); /* OK to allocate reserved blocks */ 105 int rsvd); /* OK to allocate reserved blocks */
107 106
@@ -119,7 +118,6 @@ xfs_bmap_add_extent_delay_real(
119 xfs_fsblock_t *first, /* pointer to firstblock variable */ 118 xfs_fsblock_t *first, /* pointer to firstblock variable */
120 xfs_bmap_free_t *flist, /* list of extents to be freed */ 119 xfs_bmap_free_t *flist, /* list of extents to be freed */
121 int *logflagsp, /* inode logging flags */ 120 int *logflagsp, /* inode logging flags */
122 xfs_extdelta_t *delta, /* Change made to incore extents */
123 int rsvd); /* OK to allocate reserved blocks */ 121 int rsvd); /* OK to allocate reserved blocks */
124 122
125/* 123/*
@@ -132,7 +130,6 @@ xfs_bmap_add_extent_hole_delay(
132 xfs_extnum_t idx, /* extent number to update/insert */ 130 xfs_extnum_t idx, /* extent number to update/insert */
133 xfs_bmbt_irec_t *new, /* new data to add to file extents */ 131 xfs_bmbt_irec_t *new, /* new data to add to file extents */
134 int *logflagsp,/* inode logging flags */ 132 int *logflagsp,/* inode logging flags */
135 xfs_extdelta_t *delta, /* Change made to incore extents */
136 int rsvd); /* OK to allocate reserved blocks */ 133 int rsvd); /* OK to allocate reserved blocks */
137 134
138/* 135/*
@@ -146,7 +143,6 @@ xfs_bmap_add_extent_hole_real(
146 xfs_btree_cur_t *cur, /* if null, not a btree */ 143 xfs_btree_cur_t *cur, /* if null, not a btree */
147 xfs_bmbt_irec_t *new, /* new data to add to file extents */ 144 xfs_bmbt_irec_t *new, /* new data to add to file extents */
148 int *logflagsp, /* inode logging flags */ 145 int *logflagsp, /* inode logging flags */
149 xfs_extdelta_t *delta, /* Change made to incore extents */
150 int whichfork); /* data or attr fork */ 146 int whichfork); /* data or attr fork */
151 147
152/* 148/*
@@ -159,8 +155,7 @@ xfs_bmap_add_extent_unwritten_real(
159 xfs_extnum_t idx, /* extent number to update/insert */ 155 xfs_extnum_t idx, /* extent number to update/insert */
160 xfs_btree_cur_t **curp, /* if *curp is null, not a btree */ 156 xfs_btree_cur_t **curp, /* if *curp is null, not a btree */
161 xfs_bmbt_irec_t *new, /* new data to add to file extents */ 157 xfs_bmbt_irec_t *new, /* new data to add to file extents */
162 int *logflagsp, /* inode logging flags */ 158 int *logflagsp); /* inode logging flags */
163 xfs_extdelta_t *delta); /* Change made to incore extents */
164 159
165/* 160/*
166 * xfs_bmap_alloc is called by xfs_bmapi to allocate an extent for a file. 161 * xfs_bmap_alloc is called by xfs_bmapi to allocate an extent for a file.
@@ -197,7 +192,6 @@ xfs_bmap_del_extent(
197 xfs_btree_cur_t *cur, /* if null, not a btree */ 192 xfs_btree_cur_t *cur, /* if null, not a btree */
198 xfs_bmbt_irec_t *new, /* new data to add to file extents */ 193 xfs_bmbt_irec_t *new, /* new data to add to file extents */
199 int *logflagsp,/* inode logging flags */ 194 int *logflagsp,/* inode logging flags */
200 xfs_extdelta_t *delta, /* Change made to incore extents */
201 int whichfork, /* data or attr fork */ 195 int whichfork, /* data or attr fork */
202 int rsvd); /* OK to allocate reserved blocks */ 196 int rsvd); /* OK to allocate reserved blocks */
203 197
@@ -486,7 +480,6 @@ xfs_bmap_add_extent(
486 xfs_fsblock_t *first, /* pointer to firstblock variable */ 480 xfs_fsblock_t *first, /* pointer to firstblock variable */
487 xfs_bmap_free_t *flist, /* list of extents to be freed */ 481 xfs_bmap_free_t *flist, /* list of extents to be freed */
488 int *logflagsp, /* inode logging flags */ 482 int *logflagsp, /* inode logging flags */
489 xfs_extdelta_t *delta, /* Change made to incore extents */
490 int whichfork, /* data or attr fork */ 483 int whichfork, /* data or attr fork */
491 int rsvd) /* OK to use reserved data blocks */ 484 int rsvd) /* OK to use reserved data blocks */
492{ 485{
@@ -521,15 +514,6 @@ xfs_bmap_add_extent(
521 logflags = XFS_ILOG_CORE | xfs_ilog_fext(whichfork); 514 logflags = XFS_ILOG_CORE | xfs_ilog_fext(whichfork);
522 } else 515 } else
523 logflags = 0; 516 logflags = 0;
524 /* DELTA: single new extent */
525 if (delta) {
526 if (delta->xed_startoff > new->br_startoff)
527 delta->xed_startoff = new->br_startoff;
528 if (delta->xed_blockcount <
529 new->br_startoff + new->br_blockcount)
530 delta->xed_blockcount = new->br_startoff +
531 new->br_blockcount;
532 }
533 } 517 }
534 /* 518 /*
535 * Any kind of new delayed allocation goes here. 519 * Any kind of new delayed allocation goes here.
@@ -539,7 +523,7 @@ xfs_bmap_add_extent(
539 ASSERT((cur->bc_private.b.flags & 523 ASSERT((cur->bc_private.b.flags &
540 XFS_BTCUR_BPRV_WASDEL) == 0); 524 XFS_BTCUR_BPRV_WASDEL) == 0);
541 if ((error = xfs_bmap_add_extent_hole_delay(ip, idx, new, 525 if ((error = xfs_bmap_add_extent_hole_delay(ip, idx, new,
542 &logflags, delta, rsvd))) 526 &logflags, rsvd)))
543 goto done; 527 goto done;
544 } 528 }
545 /* 529 /*
@@ -550,7 +534,7 @@ xfs_bmap_add_extent(
550 ASSERT((cur->bc_private.b.flags & 534 ASSERT((cur->bc_private.b.flags &
551 XFS_BTCUR_BPRV_WASDEL) == 0); 535 XFS_BTCUR_BPRV_WASDEL) == 0);
552 if ((error = xfs_bmap_add_extent_hole_real(ip, idx, cur, new, 536 if ((error = xfs_bmap_add_extent_hole_real(ip, idx, cur, new,
553 &logflags, delta, whichfork))) 537 &logflags, whichfork)))
554 goto done; 538 goto done;
555 } else { 539 } else {
556 xfs_bmbt_irec_t prev; /* old extent at offset idx */ 540 xfs_bmbt_irec_t prev; /* old extent at offset idx */
@@ -575,17 +559,17 @@ xfs_bmap_add_extent(
575 XFS_BTCUR_BPRV_WASDEL); 559 XFS_BTCUR_BPRV_WASDEL);
576 if ((error = xfs_bmap_add_extent_delay_real(ip, 560 if ((error = xfs_bmap_add_extent_delay_real(ip,
577 idx, &cur, new, &da_new, first, flist, 561 idx, &cur, new, &da_new, first, flist,
578 &logflags, delta, rsvd))) 562 &logflags, rsvd)))
579 goto done; 563 goto done;
580 } else if (new->br_state == XFS_EXT_NORM) { 564 } else if (new->br_state == XFS_EXT_NORM) {
581 ASSERT(new->br_state == XFS_EXT_NORM); 565 ASSERT(new->br_state == XFS_EXT_NORM);
582 if ((error = xfs_bmap_add_extent_unwritten_real( 566 if ((error = xfs_bmap_add_extent_unwritten_real(
583 ip, idx, &cur, new, &logflags, delta))) 567 ip, idx, &cur, new, &logflags)))
584 goto done; 568 goto done;
585 } else { 569 } else {
586 ASSERT(new->br_state == XFS_EXT_UNWRITTEN); 570 ASSERT(new->br_state == XFS_EXT_UNWRITTEN);
587 if ((error = xfs_bmap_add_extent_unwritten_real( 571 if ((error = xfs_bmap_add_extent_unwritten_real(
588 ip, idx, &cur, new, &logflags, delta))) 572 ip, idx, &cur, new, &logflags)))
589 goto done; 573 goto done;
590 } 574 }
591 ASSERT(*curp == cur || *curp == NULL); 575 ASSERT(*curp == cur || *curp == NULL);
@@ -598,7 +582,7 @@ xfs_bmap_add_extent(
598 ASSERT((cur->bc_private.b.flags & 582 ASSERT((cur->bc_private.b.flags &
599 XFS_BTCUR_BPRV_WASDEL) == 0); 583 XFS_BTCUR_BPRV_WASDEL) == 0);
600 if ((error = xfs_bmap_add_extent_hole_real(ip, idx, cur, 584 if ((error = xfs_bmap_add_extent_hole_real(ip, idx, cur,
601 new, &logflags, delta, whichfork))) 585 new, &logflags, whichfork)))
602 goto done; 586 goto done;
603 } 587 }
604 } 588 }
@@ -663,7 +647,6 @@ xfs_bmap_add_extent_delay_real(
663 xfs_fsblock_t *first, /* pointer to firstblock variable */ 647 xfs_fsblock_t *first, /* pointer to firstblock variable */
664 xfs_bmap_free_t *flist, /* list of extents to be freed */ 648 xfs_bmap_free_t *flist, /* list of extents to be freed */
665 int *logflagsp, /* inode logging flags */ 649 int *logflagsp, /* inode logging flags */
666 xfs_extdelta_t *delta, /* Change made to incore extents */
667 int rsvd) /* OK to use reserved data block allocation */ 650 int rsvd) /* OK to use reserved data block allocation */
668{ 651{
669 xfs_btree_cur_t *cur; /* btree cursor */ 652 xfs_btree_cur_t *cur; /* btree cursor */
@@ -794,11 +777,6 @@ xfs_bmap_add_extent_delay_real(
794 goto done; 777 goto done;
795 } 778 }
796 *dnew = 0; 779 *dnew = 0;
797 /* DELTA: Three in-core extents are replaced by one. */
798 temp = LEFT.br_startoff;
799 temp2 = LEFT.br_blockcount +
800 PREV.br_blockcount +
801 RIGHT.br_blockcount;
802 break; 780 break;
803 781
804 case BMAP_LEFT_FILLING | BMAP_RIGHT_FILLING | BMAP_LEFT_CONTIG: 782 case BMAP_LEFT_FILLING | BMAP_RIGHT_FILLING | BMAP_LEFT_CONTIG:
@@ -829,10 +807,6 @@ xfs_bmap_add_extent_delay_real(
829 goto done; 807 goto done;
830 } 808 }
831 *dnew = 0; 809 *dnew = 0;
832 /* DELTA: Two in-core extents are replaced by one. */
833 temp = LEFT.br_startoff;
834 temp2 = LEFT.br_blockcount +
835 PREV.br_blockcount;
836 break; 810 break;
837 811
838 case BMAP_LEFT_FILLING | BMAP_RIGHT_FILLING | BMAP_RIGHT_CONTIG: 812 case BMAP_LEFT_FILLING | BMAP_RIGHT_FILLING | BMAP_RIGHT_CONTIG:
@@ -864,10 +838,6 @@ xfs_bmap_add_extent_delay_real(
864 goto done; 838 goto done;
865 } 839 }
866 *dnew = 0; 840 *dnew = 0;
867 /* DELTA: Two in-core extents are replaced by one. */
868 temp = PREV.br_startoff;
869 temp2 = PREV.br_blockcount +
870 RIGHT.br_blockcount;
871 break; 841 break;
872 842
873 case BMAP_LEFT_FILLING | BMAP_RIGHT_FILLING: 843 case BMAP_LEFT_FILLING | BMAP_RIGHT_FILLING:
@@ -897,9 +867,6 @@ xfs_bmap_add_extent_delay_real(
897 XFS_WANT_CORRUPTED_GOTO(i == 1, done); 867 XFS_WANT_CORRUPTED_GOTO(i == 1, done);
898 } 868 }
899 *dnew = 0; 869 *dnew = 0;
900 /* DELTA: The in-core extent described by new changed type. */
901 temp = new->br_startoff;
902 temp2 = new->br_blockcount;
903 break; 870 break;
904 871
905 case BMAP_LEFT_FILLING | BMAP_LEFT_CONTIG: 872 case BMAP_LEFT_FILLING | BMAP_LEFT_CONTIG:
@@ -939,10 +906,6 @@ xfs_bmap_add_extent_delay_real(
939 xfs_bmbt_set_startblock(ep, nullstartblock((int)temp)); 906 xfs_bmbt_set_startblock(ep, nullstartblock((int)temp));
940 trace_xfs_bmap_post_update(ip, idx, state, _THIS_IP_); 907 trace_xfs_bmap_post_update(ip, idx, state, _THIS_IP_);
941 *dnew = temp; 908 *dnew = temp;
942 /* DELTA: The boundary between two in-core extents moved. */
943 temp = LEFT.br_startoff;
944 temp2 = LEFT.br_blockcount +
945 PREV.br_blockcount;
946 break; 909 break;
947 910
948 case BMAP_LEFT_FILLING: 911 case BMAP_LEFT_FILLING:
@@ -987,9 +950,6 @@ xfs_bmap_add_extent_delay_real(
987 xfs_bmbt_set_startblock(ep, nullstartblock((int)temp)); 950 xfs_bmbt_set_startblock(ep, nullstartblock((int)temp));
988 trace_xfs_bmap_post_update(ip, idx + 1, state, _THIS_IP_); 951 trace_xfs_bmap_post_update(ip, idx + 1, state, _THIS_IP_);
989 *dnew = temp; 952 *dnew = temp;
990 /* DELTA: One in-core extent is split in two. */
991 temp = PREV.br_startoff;
992 temp2 = PREV.br_blockcount;
993 break; 953 break;
994 954
995 case BMAP_RIGHT_FILLING | BMAP_RIGHT_CONTIG: 955 case BMAP_RIGHT_FILLING | BMAP_RIGHT_CONTIG:
@@ -1028,10 +988,6 @@ xfs_bmap_add_extent_delay_real(
1028 xfs_bmbt_set_startblock(ep, nullstartblock((int)temp)); 988 xfs_bmbt_set_startblock(ep, nullstartblock((int)temp));
1029 trace_xfs_bmap_post_update(ip, idx, state, _THIS_IP_); 989 trace_xfs_bmap_post_update(ip, idx, state, _THIS_IP_);
1030 *dnew = temp; 990 *dnew = temp;
1031 /* DELTA: The boundary between two in-core extents moved. */
1032 temp = PREV.br_startoff;
1033 temp2 = PREV.br_blockcount +
1034 RIGHT.br_blockcount;
1035 break; 991 break;
1036 992
1037 case BMAP_RIGHT_FILLING: 993 case BMAP_RIGHT_FILLING:
@@ -1075,9 +1031,6 @@ xfs_bmap_add_extent_delay_real(
1075 xfs_bmbt_set_startblock(ep, nullstartblock((int)temp)); 1031 xfs_bmbt_set_startblock(ep, nullstartblock((int)temp));
1076 trace_xfs_bmap_post_update(ip, idx, state, _THIS_IP_); 1032 trace_xfs_bmap_post_update(ip, idx, state, _THIS_IP_);
1077 *dnew = temp; 1033 *dnew = temp;
1078 /* DELTA: One in-core extent is split in two. */
1079 temp = PREV.br_startoff;
1080 temp2 = PREV.br_blockcount;
1081 break; 1034 break;
1082 1035
1083 case 0: 1036 case 0:
@@ -1158,9 +1111,6 @@ xfs_bmap_add_extent_delay_real(
1158 nullstartblock((int)temp2)); 1111 nullstartblock((int)temp2));
1159 trace_xfs_bmap_post_update(ip, idx + 2, state, _THIS_IP_); 1112 trace_xfs_bmap_post_update(ip, idx + 2, state, _THIS_IP_);
1160 *dnew = temp + temp2; 1113 *dnew = temp + temp2;
1161 /* DELTA: One in-core extent is split in three. */
1162 temp = PREV.br_startoff;
1163 temp2 = PREV.br_blockcount;
1164 break; 1114 break;
1165 1115
1166 case BMAP_LEFT_FILLING | BMAP_LEFT_CONTIG | BMAP_RIGHT_CONTIG: 1116 case BMAP_LEFT_FILLING | BMAP_LEFT_CONTIG | BMAP_RIGHT_CONTIG:
@@ -1176,13 +1126,6 @@ xfs_bmap_add_extent_delay_real(
1176 ASSERT(0); 1126 ASSERT(0);
1177 } 1127 }
1178 *curp = cur; 1128 *curp = cur;
1179 if (delta) {
1180 temp2 += temp;
1181 if (delta->xed_startoff > temp)
1182 delta->xed_startoff = temp;
1183 if (delta->xed_blockcount < temp2)
1184 delta->xed_blockcount = temp2;
1185 }
1186done: 1129done:
1187 *logflagsp = rval; 1130 *logflagsp = rval;
1188 return error; 1131 return error;
@@ -1201,8 +1144,7 @@ xfs_bmap_add_extent_unwritten_real(
1201 xfs_extnum_t idx, /* extent number to update/insert */ 1144 xfs_extnum_t idx, /* extent number to update/insert */
1202 xfs_btree_cur_t **curp, /* if *curp is null, not a btree */ 1145 xfs_btree_cur_t **curp, /* if *curp is null, not a btree */
1203 xfs_bmbt_irec_t *new, /* new data to add to file extents */ 1146 xfs_bmbt_irec_t *new, /* new data to add to file extents */
1204 int *logflagsp, /* inode logging flags */ 1147 int *logflagsp) /* inode logging flags */
1205 xfs_extdelta_t *delta) /* Change made to incore extents */
1206{ 1148{
1207 xfs_btree_cur_t *cur; /* btree cursor */ 1149 xfs_btree_cur_t *cur; /* btree cursor */
1208 xfs_bmbt_rec_host_t *ep; /* extent entry for idx */ 1150 xfs_bmbt_rec_host_t *ep; /* extent entry for idx */
@@ -1216,8 +1158,6 @@ xfs_bmap_add_extent_unwritten_real(
1216 /* left is 0, right is 1, prev is 2 */ 1158 /* left is 0, right is 1, prev is 2 */
1217 int rval=0; /* return value (logging flags) */ 1159 int rval=0; /* return value (logging flags) */
1218 int state = 0;/* state bits, accessed thru macros */ 1160 int state = 0;/* state bits, accessed thru macros */
1219 xfs_filblks_t temp=0;
1220 xfs_filblks_t temp2=0;
1221 1161
1222#define LEFT r[0] 1162#define LEFT r[0]
1223#define RIGHT r[1] 1163#define RIGHT r[1]
@@ -1338,11 +1278,6 @@ xfs_bmap_add_extent_unwritten_real(
1338 RIGHT.br_blockcount, LEFT.br_state))) 1278 RIGHT.br_blockcount, LEFT.br_state)))
1339 goto done; 1279 goto done;
1340 } 1280 }
1341 /* DELTA: Three in-core extents are replaced by one. */
1342 temp = LEFT.br_startoff;
1343 temp2 = LEFT.br_blockcount +
1344 PREV.br_blockcount +
1345 RIGHT.br_blockcount;
1346 break; 1281 break;
1347 1282
1348 case BMAP_LEFT_FILLING | BMAP_RIGHT_FILLING | BMAP_LEFT_CONTIG: 1283 case BMAP_LEFT_FILLING | BMAP_RIGHT_FILLING | BMAP_LEFT_CONTIG:
@@ -1379,10 +1314,6 @@ xfs_bmap_add_extent_unwritten_real(
1379 LEFT.br_state))) 1314 LEFT.br_state)))
1380 goto done; 1315 goto done;
1381 } 1316 }
1382 /* DELTA: Two in-core extents are replaced by one. */
1383 temp = LEFT.br_startoff;
1384 temp2 = LEFT.br_blockcount +
1385 PREV.br_blockcount;
1386 break; 1317 break;
1387 1318
1388 case BMAP_LEFT_FILLING | BMAP_RIGHT_FILLING | BMAP_RIGHT_CONTIG: 1319 case BMAP_LEFT_FILLING | BMAP_RIGHT_FILLING | BMAP_RIGHT_CONTIG:
@@ -1419,10 +1350,6 @@ xfs_bmap_add_extent_unwritten_real(
1419 newext))) 1350 newext)))
1420 goto done; 1351 goto done;
1421 } 1352 }
1422 /* DELTA: Two in-core extents are replaced by one. */
1423 temp = PREV.br_startoff;
1424 temp2 = PREV.br_blockcount +
1425 RIGHT.br_blockcount;
1426 break; 1353 break;
1427 1354
1428 case BMAP_LEFT_FILLING | BMAP_RIGHT_FILLING: 1355 case BMAP_LEFT_FILLING | BMAP_RIGHT_FILLING:
@@ -1450,9 +1377,6 @@ xfs_bmap_add_extent_unwritten_real(
1450 newext))) 1377 newext)))
1451 goto done; 1378 goto done;
1452 } 1379 }
1453 /* DELTA: The in-core extent described by new changed type. */
1454 temp = new->br_startoff;
1455 temp2 = new->br_blockcount;
1456 break; 1380 break;
1457 1381
1458 case BMAP_LEFT_FILLING | BMAP_LEFT_CONTIG: 1382 case BMAP_LEFT_FILLING | BMAP_LEFT_CONTIG:
@@ -1498,10 +1422,6 @@ xfs_bmap_add_extent_unwritten_real(
1498 LEFT.br_state)) 1422 LEFT.br_state))
1499 goto done; 1423 goto done;
1500 } 1424 }
1501 /* DELTA: The boundary between two in-core extents moved. */
1502 temp = LEFT.br_startoff;
1503 temp2 = LEFT.br_blockcount +
1504 PREV.br_blockcount;
1505 break; 1425 break;
1506 1426
1507 case BMAP_LEFT_FILLING: 1427 case BMAP_LEFT_FILLING:
@@ -1541,9 +1461,6 @@ xfs_bmap_add_extent_unwritten_real(
1541 goto done; 1461 goto done;
1542 XFS_WANT_CORRUPTED_GOTO(i == 1, done); 1462 XFS_WANT_CORRUPTED_GOTO(i == 1, done);
1543 } 1463 }
1544 /* DELTA: One in-core extent is split in two. */
1545 temp = PREV.br_startoff;
1546 temp2 = PREV.br_blockcount;
1547 break; 1464 break;
1548 1465
1549 case BMAP_RIGHT_FILLING | BMAP_RIGHT_CONTIG: 1466 case BMAP_RIGHT_FILLING | BMAP_RIGHT_CONTIG:
@@ -1584,10 +1501,6 @@ xfs_bmap_add_extent_unwritten_real(
1584 newext))) 1501 newext)))
1585 goto done; 1502 goto done;
1586 } 1503 }
1587 /* DELTA: The boundary between two in-core extents moved. */
1588 temp = PREV.br_startoff;
1589 temp2 = PREV.br_blockcount +
1590 RIGHT.br_blockcount;
1591 break; 1504 break;
1592 1505
1593 case BMAP_RIGHT_FILLING: 1506 case BMAP_RIGHT_FILLING:
@@ -1627,9 +1540,6 @@ xfs_bmap_add_extent_unwritten_real(
1627 goto done; 1540 goto done;
1628 XFS_WANT_CORRUPTED_GOTO(i == 1, done); 1541 XFS_WANT_CORRUPTED_GOTO(i == 1, done);
1629 } 1542 }
1630 /* DELTA: One in-core extent is split in two. */
1631 temp = PREV.br_startoff;
1632 temp2 = PREV.br_blockcount;
1633 break; 1543 break;
1634 1544
1635 case 0: 1545 case 0:
@@ -1689,9 +1599,6 @@ xfs_bmap_add_extent_unwritten_real(
1689 goto done; 1599 goto done;
1690 XFS_WANT_CORRUPTED_GOTO(i == 1, done); 1600 XFS_WANT_CORRUPTED_GOTO(i == 1, done);
1691 } 1601 }
1692 /* DELTA: One in-core extent is split in three. */
1693 temp = PREV.br_startoff;
1694 temp2 = PREV.br_blockcount;
1695 break; 1602 break;
1696 1603
1697 case BMAP_LEFT_FILLING | BMAP_LEFT_CONTIG | BMAP_RIGHT_CONTIG: 1604 case BMAP_LEFT_FILLING | BMAP_LEFT_CONTIG | BMAP_RIGHT_CONTIG:
@@ -1707,13 +1614,6 @@ xfs_bmap_add_extent_unwritten_real(
1707 ASSERT(0); 1614 ASSERT(0);
1708 } 1615 }
1709 *curp = cur; 1616 *curp = cur;
1710 if (delta) {
1711 temp2 += temp;
1712 if (delta->xed_startoff > temp)
1713 delta->xed_startoff = temp;
1714 if (delta->xed_blockcount < temp2)
1715 delta->xed_blockcount = temp2;
1716 }
1717done: 1617done:
1718 *logflagsp = rval; 1618 *logflagsp = rval;
1719 return error; 1619 return error;
@@ -1733,7 +1633,6 @@ xfs_bmap_add_extent_hole_delay(
1733 xfs_extnum_t idx, /* extent number to update/insert */ 1633 xfs_extnum_t idx, /* extent number to update/insert */
1734 xfs_bmbt_irec_t *new, /* new data to add to file extents */ 1634 xfs_bmbt_irec_t *new, /* new data to add to file extents */
1735 int *logflagsp, /* inode logging flags */ 1635 int *logflagsp, /* inode logging flags */
1736 xfs_extdelta_t *delta, /* Change made to incore extents */
1737 int rsvd) /* OK to allocate reserved blocks */ 1636 int rsvd) /* OK to allocate reserved blocks */
1738{ 1637{
1739 xfs_bmbt_rec_host_t *ep; /* extent record for idx */ 1638 xfs_bmbt_rec_host_t *ep; /* extent record for idx */
@@ -1744,7 +1643,6 @@ xfs_bmap_add_extent_hole_delay(
1744 xfs_bmbt_irec_t right; /* right neighbor extent entry */ 1643 xfs_bmbt_irec_t right; /* right neighbor extent entry */
1745 int state; /* state bits, accessed thru macros */ 1644 int state; /* state bits, accessed thru macros */
1746 xfs_filblks_t temp=0; /* temp for indirect calculations */ 1645 xfs_filblks_t temp=0; /* temp for indirect calculations */
1747 xfs_filblks_t temp2=0;
1748 1646
1749 ifp = XFS_IFORK_PTR(ip, XFS_DATA_FORK); 1647 ifp = XFS_IFORK_PTR(ip, XFS_DATA_FORK);
1750 ep = xfs_iext_get_ext(ifp, idx); 1648 ep = xfs_iext_get_ext(ifp, idx);
@@ -1816,9 +1714,6 @@ xfs_bmap_add_extent_hole_delay(
1816 1714
1817 xfs_iext_remove(ip, idx, 1, state); 1715 xfs_iext_remove(ip, idx, 1, state);
1818 ip->i_df.if_lastex = idx - 1; 1716 ip->i_df.if_lastex = idx - 1;
1819 /* DELTA: Two in-core extents were replaced by one. */
1820 temp2 = temp;
1821 temp = left.br_startoff;
1822 break; 1717 break;
1823 1718
1824 case BMAP_LEFT_CONTIG: 1719 case BMAP_LEFT_CONTIG:
@@ -1838,9 +1733,6 @@ xfs_bmap_add_extent_hole_delay(
1838 trace_xfs_bmap_post_update(ip, idx - 1, state, _THIS_IP_); 1733 trace_xfs_bmap_post_update(ip, idx - 1, state, _THIS_IP_);
1839 1734
1840 ip->i_df.if_lastex = idx - 1; 1735 ip->i_df.if_lastex = idx - 1;
1841 /* DELTA: One in-core extent grew into a hole. */
1842 temp2 = temp;
1843 temp = left.br_startoff;
1844 break; 1736 break;
1845 1737
1846 case BMAP_RIGHT_CONTIG: 1738 case BMAP_RIGHT_CONTIG:
@@ -1859,9 +1751,6 @@ xfs_bmap_add_extent_hole_delay(
1859 trace_xfs_bmap_post_update(ip, idx, state, _THIS_IP_); 1751 trace_xfs_bmap_post_update(ip, idx, state, _THIS_IP_);
1860 1752
1861 ip->i_df.if_lastex = idx; 1753 ip->i_df.if_lastex = idx;
1862 /* DELTA: One in-core extent grew into a hole. */
1863 temp2 = temp;
1864 temp = new->br_startoff;
1865 break; 1754 break;
1866 1755
1867 case 0: 1756 case 0:
@@ -1873,9 +1762,6 @@ xfs_bmap_add_extent_hole_delay(
1873 oldlen = newlen = 0; 1762 oldlen = newlen = 0;
1874 xfs_iext_insert(ip, idx, 1, new, state); 1763 xfs_iext_insert(ip, idx, 1, new, state);
1875 ip->i_df.if_lastex = idx; 1764 ip->i_df.if_lastex = idx;
1876 /* DELTA: A new in-core extent was added in a hole. */
1877 temp2 = new->br_blockcount;
1878 temp = new->br_startoff;
1879 break; 1765 break;
1880 } 1766 }
1881 if (oldlen != newlen) { 1767 if (oldlen != newlen) {
@@ -1886,13 +1772,6 @@ xfs_bmap_add_extent_hole_delay(
1886 * Nothing to do for disk quota accounting here. 1772 * Nothing to do for disk quota accounting here.
1887 */ 1773 */
1888 } 1774 }
1889 if (delta) {
1890 temp2 += temp;
1891 if (delta->xed_startoff > temp)
1892 delta->xed_startoff = temp;
1893 if (delta->xed_blockcount < temp2)
1894 delta->xed_blockcount = temp2;
1895 }
1896 *logflagsp = 0; 1775 *logflagsp = 0;
1897 return 0; 1776 return 0;
1898} 1777}
@@ -1908,7 +1787,6 @@ xfs_bmap_add_extent_hole_real(
1908 xfs_btree_cur_t *cur, /* if null, not a btree */ 1787 xfs_btree_cur_t *cur, /* if null, not a btree */
1909 xfs_bmbt_irec_t *new, /* new data to add to file extents */ 1788 xfs_bmbt_irec_t *new, /* new data to add to file extents */
1910 int *logflagsp, /* inode logging flags */ 1789 int *logflagsp, /* inode logging flags */
1911 xfs_extdelta_t *delta, /* Change made to incore extents */
1912 int whichfork) /* data or attr fork */ 1790 int whichfork) /* data or attr fork */
1913{ 1791{
1914 xfs_bmbt_rec_host_t *ep; /* pointer to extent entry ins. point */ 1792 xfs_bmbt_rec_host_t *ep; /* pointer to extent entry ins. point */
@@ -1919,8 +1797,6 @@ xfs_bmap_add_extent_hole_real(
1919 xfs_bmbt_irec_t right; /* right neighbor extent entry */ 1797 xfs_bmbt_irec_t right; /* right neighbor extent entry */
1920 int rval=0; /* return value (logging flags) */ 1798 int rval=0; /* return value (logging flags) */
1921 int state; /* state bits, accessed thru macros */ 1799 int state; /* state bits, accessed thru macros */
1922 xfs_filblks_t temp=0;
1923 xfs_filblks_t temp2=0;
1924 1800
1925 ifp = XFS_IFORK_PTR(ip, whichfork); 1801 ifp = XFS_IFORK_PTR(ip, whichfork);
1926 ASSERT(idx <= ifp->if_bytes / (uint)sizeof(xfs_bmbt_rec_t)); 1802 ASSERT(idx <= ifp->if_bytes / (uint)sizeof(xfs_bmbt_rec_t));
@@ -2017,11 +1893,6 @@ xfs_bmap_add_extent_hole_real(
2017 left.br_state))) 1893 left.br_state)))
2018 goto done; 1894 goto done;
2019 } 1895 }
2020 /* DELTA: Two in-core extents were replaced by one. */
2021 temp = left.br_startoff;
2022 temp2 = left.br_blockcount +
2023 new->br_blockcount +
2024 right.br_blockcount;
2025 break; 1896 break;
2026 1897
2027 case BMAP_LEFT_CONTIG: 1898 case BMAP_LEFT_CONTIG:
@@ -2053,10 +1924,6 @@ xfs_bmap_add_extent_hole_real(
2053 left.br_state))) 1924 left.br_state)))
2054 goto done; 1925 goto done;
2055 } 1926 }
2056 /* DELTA: One in-core extent grew. */
2057 temp = left.br_startoff;
2058 temp2 = left.br_blockcount +
2059 new->br_blockcount;
2060 break; 1927 break;
2061 1928
2062 case BMAP_RIGHT_CONTIG: 1929 case BMAP_RIGHT_CONTIG:
@@ -2089,10 +1956,6 @@ xfs_bmap_add_extent_hole_real(
2089 right.br_state))) 1956 right.br_state)))
2090 goto done; 1957 goto done;
2091 } 1958 }
2092 /* DELTA: One in-core extent grew. */
2093 temp = new->br_startoff;
2094 temp2 = new->br_blockcount +
2095 right.br_blockcount;
2096 break; 1959 break;
2097 1960
2098 case 0: 1961 case 0:
@@ -2120,18 +1983,8 @@ xfs_bmap_add_extent_hole_real(
2120 goto done; 1983 goto done;
2121 XFS_WANT_CORRUPTED_GOTO(i == 1, done); 1984 XFS_WANT_CORRUPTED_GOTO(i == 1, done);
2122 } 1985 }
2123 /* DELTA: A new extent was added in a hole. */
2124 temp = new->br_startoff;
2125 temp2 = new->br_blockcount;
2126 break; 1986 break;
2127 } 1987 }
2128 if (delta) {
2129 temp2 += temp;
2130 if (delta->xed_startoff > temp)
2131 delta->xed_startoff = temp;
2132 if (delta->xed_blockcount < temp2)
2133 delta->xed_blockcount = temp2;
2134 }
2135done: 1988done:
2136 *logflagsp = rval; 1989 *logflagsp = rval;
2137 return error; 1990 return error;
@@ -2956,7 +2809,6 @@ xfs_bmap_del_extent(
2956 xfs_btree_cur_t *cur, /* if null, not a btree */ 2809 xfs_btree_cur_t *cur, /* if null, not a btree */
2957 xfs_bmbt_irec_t *del, /* data to remove from extents */ 2810 xfs_bmbt_irec_t *del, /* data to remove from extents */
2958 int *logflagsp, /* inode logging flags */ 2811 int *logflagsp, /* inode logging flags */
2959 xfs_extdelta_t *delta, /* Change made to incore extents */
2960 int whichfork, /* data or attr fork */ 2812 int whichfork, /* data or attr fork */
2961 int rsvd) /* OK to allocate reserved blocks */ 2813 int rsvd) /* OK to allocate reserved blocks */
2962{ 2814{
@@ -3262,14 +3114,6 @@ xfs_bmap_del_extent(
3262 if (da_old > da_new) 3114 if (da_old > da_new)
3263 xfs_mod_incore_sb(mp, XFS_SBS_FDBLOCKS, (int64_t)(da_old - da_new), 3115 xfs_mod_incore_sb(mp, XFS_SBS_FDBLOCKS, (int64_t)(da_old - da_new),
3264 rsvd); 3116 rsvd);
3265 if (delta) {
3266 /* DELTA: report the original extent. */
3267 if (delta->xed_startoff > got.br_startoff)
3268 delta->xed_startoff = got.br_startoff;
3269 if (delta->xed_blockcount < got.br_startoff+got.br_blockcount)
3270 delta->xed_blockcount = got.br_startoff +
3271 got.br_blockcount;
3272 }
3273done: 3117done:
3274 *logflagsp = flags; 3118 *logflagsp = flags;
3275 return error; 3119 return error;
@@ -4481,8 +4325,7 @@ xfs_bmapi(
4481 xfs_extlen_t total, /* total blocks needed */ 4325 xfs_extlen_t total, /* total blocks needed */
4482 xfs_bmbt_irec_t *mval, /* output: map values */ 4326 xfs_bmbt_irec_t *mval, /* output: map values */
4483 int *nmap, /* i/o: mval size/count */ 4327 int *nmap, /* i/o: mval size/count */
4484 xfs_bmap_free_t *flist, /* i/o: list extents to free */ 4328 xfs_bmap_free_t *flist) /* i/o: list extents to free */
4485 xfs_extdelta_t *delta) /* o: change made to incore extents */
4486{ 4329{
4487 xfs_fsblock_t abno; /* allocated block number */ 4330 xfs_fsblock_t abno; /* allocated block number */
4488 xfs_extlen_t alen; /* allocated extent length */ 4331 xfs_extlen_t alen; /* allocated extent length */
@@ -4594,10 +4437,7 @@ xfs_bmapi(
4594 end = bno + len; 4437 end = bno + len;
4595 obno = bno; 4438 obno = bno;
4596 bma.ip = NULL; 4439 bma.ip = NULL;
4597 if (delta) { 4440
4598 delta->xed_startoff = NULLFILEOFF;
4599 delta->xed_blockcount = 0;
4600 }
4601 while (bno < end && n < *nmap) { 4441 while (bno < end && n < *nmap) {
4602 /* 4442 /*
4603 * Reading past eof, act as though there's a hole 4443 * Reading past eof, act as though there's a hole
@@ -4823,7 +4663,7 @@ xfs_bmapi(
4823 got.br_state = XFS_EXT_UNWRITTEN; 4663 got.br_state = XFS_EXT_UNWRITTEN;
4824 } 4664 }
4825 error = xfs_bmap_add_extent(ip, lastx, &cur, &got, 4665 error = xfs_bmap_add_extent(ip, lastx, &cur, &got,
4826 firstblock, flist, &tmp_logflags, delta, 4666 firstblock, flist, &tmp_logflags,
4827 whichfork, (flags & XFS_BMAPI_RSVBLOCKS)); 4667 whichfork, (flags & XFS_BMAPI_RSVBLOCKS));
4828 logflags |= tmp_logflags; 4668 logflags |= tmp_logflags;
4829 if (error) 4669 if (error)
@@ -4919,7 +4759,7 @@ xfs_bmapi(
4919 } 4759 }
4920 mval->br_state = XFS_EXT_NORM; 4760 mval->br_state = XFS_EXT_NORM;
4921 error = xfs_bmap_add_extent(ip, lastx, &cur, mval, 4761 error = xfs_bmap_add_extent(ip, lastx, &cur, mval,
4922 firstblock, flist, &tmp_logflags, delta, 4762 firstblock, flist, &tmp_logflags,
4923 whichfork, (flags & XFS_BMAPI_RSVBLOCKS)); 4763 whichfork, (flags & XFS_BMAPI_RSVBLOCKS));
4924 logflags |= tmp_logflags; 4764 logflags |= tmp_logflags;
4925 if (error) 4765 if (error)
@@ -5009,14 +4849,6 @@ xfs_bmapi(
5009 ASSERT(XFS_IFORK_FORMAT(ip, whichfork) != XFS_DINODE_FMT_BTREE || 4849 ASSERT(XFS_IFORK_FORMAT(ip, whichfork) != XFS_DINODE_FMT_BTREE ||
5010 XFS_IFORK_NEXTENTS(ip, whichfork) > ifp->if_ext_max); 4850 XFS_IFORK_NEXTENTS(ip, whichfork) > ifp->if_ext_max);
5011 error = 0; 4851 error = 0;
5012 if (delta && delta->xed_startoff != NULLFILEOFF) {
5013 /* A change was actually made.
5014 * Note that delta->xed_blockount is an offset at this
5015 * point and needs to be converted to a block count.
5016 */
5017 ASSERT(delta->xed_blockcount > delta->xed_startoff);
5018 delta->xed_blockcount -= delta->xed_startoff;
5019 }
5020error0: 4852error0:
5021 /* 4853 /*
5022 * Log everything. Do this after conversion, there's no point in 4854 * Log everything. Do this after conversion, there's no point in
@@ -5128,8 +4960,6 @@ xfs_bunmapi(
5128 xfs_fsblock_t *firstblock, /* first allocated block 4960 xfs_fsblock_t *firstblock, /* first allocated block
5129 controls a.g. for allocs */ 4961 controls a.g. for allocs */
5130 xfs_bmap_free_t *flist, /* i/o: list extents to free */ 4962 xfs_bmap_free_t *flist, /* i/o: list extents to free */
5131 xfs_extdelta_t *delta, /* o: change made to incore
5132 extents */
5133 int *done) /* set if not done yet */ 4963 int *done) /* set if not done yet */
5134{ 4964{
5135 xfs_btree_cur_t *cur; /* bmap btree cursor */ 4965 xfs_btree_cur_t *cur; /* bmap btree cursor */
@@ -5188,10 +5018,7 @@ xfs_bunmapi(
5188 bno = start + len - 1; 5018 bno = start + len - 1;
5189 ep = xfs_bmap_search_extents(ip, bno, whichfork, &eof, &lastx, &got, 5019 ep = xfs_bmap_search_extents(ip, bno, whichfork, &eof, &lastx, &got,
5190 &prev); 5020 &prev);
5191 if (delta) { 5021
5192 delta->xed_startoff = NULLFILEOFF;
5193 delta->xed_blockcount = 0;
5194 }
5195 /* 5022 /*
5196 * Check to see if the given block number is past the end of the 5023 * Check to see if the given block number is past the end of the
5197 * file, back up to the last block if so... 5024 * file, back up to the last block if so...
@@ -5289,7 +5116,7 @@ xfs_bunmapi(
5289 } 5116 }
5290 del.br_state = XFS_EXT_UNWRITTEN; 5117 del.br_state = XFS_EXT_UNWRITTEN;
5291 error = xfs_bmap_add_extent(ip, lastx, &cur, &del, 5118 error = xfs_bmap_add_extent(ip, lastx, &cur, &del,
5292 firstblock, flist, &logflags, delta, 5119 firstblock, flist, &logflags,
5293 XFS_DATA_FORK, 0); 5120 XFS_DATA_FORK, 0);
5294 if (error) 5121 if (error)
5295 goto error0; 5122 goto error0;
@@ -5344,7 +5171,7 @@ xfs_bunmapi(
5344 prev.br_state = XFS_EXT_UNWRITTEN; 5171 prev.br_state = XFS_EXT_UNWRITTEN;
5345 error = xfs_bmap_add_extent(ip, lastx - 1, &cur, 5172 error = xfs_bmap_add_extent(ip, lastx - 1, &cur,
5346 &prev, firstblock, flist, &logflags, 5173 &prev, firstblock, flist, &logflags,
5347 delta, XFS_DATA_FORK, 0); 5174 XFS_DATA_FORK, 0);
5348 if (error) 5175 if (error)
5349 goto error0; 5176 goto error0;
5350 goto nodelete; 5177 goto nodelete;
@@ -5353,7 +5180,7 @@ xfs_bunmapi(
5353 del.br_state = XFS_EXT_UNWRITTEN; 5180 del.br_state = XFS_EXT_UNWRITTEN;
5354 error = xfs_bmap_add_extent(ip, lastx, &cur, 5181 error = xfs_bmap_add_extent(ip, lastx, &cur,
5355 &del, firstblock, flist, &logflags, 5182 &del, firstblock, flist, &logflags,
5356 delta, XFS_DATA_FORK, 0); 5183 XFS_DATA_FORK, 0);
5357 if (error) 5184 if (error)
5358 goto error0; 5185 goto error0;
5359 goto nodelete; 5186 goto nodelete;
@@ -5406,7 +5233,7 @@ xfs_bunmapi(
5406 goto error0; 5233 goto error0;
5407 } 5234 }
5408 error = xfs_bmap_del_extent(ip, tp, lastx, flist, cur, &del, 5235 error = xfs_bmap_del_extent(ip, tp, lastx, flist, cur, &del,
5409 &tmp_logflags, delta, whichfork, rsvd); 5236 &tmp_logflags, whichfork, rsvd);
5410 logflags |= tmp_logflags; 5237 logflags |= tmp_logflags;
5411 if (error) 5238 if (error)
5412 goto error0; 5239 goto error0;
@@ -5463,14 +5290,6 @@ nodelete:
5463 ASSERT(ifp->if_ext_max == 5290 ASSERT(ifp->if_ext_max ==
5464 XFS_IFORK_SIZE(ip, whichfork) / (uint)sizeof(xfs_bmbt_rec_t)); 5291 XFS_IFORK_SIZE(ip, whichfork) / (uint)sizeof(xfs_bmbt_rec_t));
5465 error = 0; 5292 error = 0;
5466 if (delta && delta->xed_startoff != NULLFILEOFF) {
5467 /* A change was actually made.
5468 * Note that delta->xed_blockount is an offset at this
5469 * point and needs to be converted to a block count.
5470 */
5471 ASSERT(delta->xed_blockcount > delta->xed_startoff);
5472 delta->xed_blockcount -= delta->xed_startoff;
5473 }
5474error0: 5293error0:
5475 /* 5294 /*
5476 * Log everything. Do this after conversion, there's no point in 5295 * Log everything. Do this after conversion, there's no point in
@@ -5683,7 +5502,7 @@ xfs_getbmap(
5683 error = xfs_bmapi(NULL, ip, XFS_BB_TO_FSBT(mp, bmv->bmv_offset), 5502 error = xfs_bmapi(NULL, ip, XFS_BB_TO_FSBT(mp, bmv->bmv_offset),
5684 XFS_BB_TO_FSB(mp, bmv->bmv_length), 5503 XFS_BB_TO_FSB(mp, bmv->bmv_length),
5685 bmapi_flags, NULL, 0, map, &nmap, 5504 bmapi_flags, NULL, 0, map, &nmap,
5686 NULL, NULL); 5505 NULL);
5687 if (error) 5506 if (error)
5688 goto out_free_map; 5507 goto out_free_map;
5689 ASSERT(nmap <= subnex); 5508 ASSERT(nmap <= subnex);
diff --git a/fs/xfs/xfs_bmap.h b/fs/xfs/xfs_bmap.h
index d9c8a39b2855..b13569a6179b 100644
--- a/fs/xfs/xfs_bmap.h
+++ b/fs/xfs/xfs_bmap.h
@@ -28,20 +28,6 @@ struct xfs_trans;
28extern kmem_zone_t *xfs_bmap_free_item_zone; 28extern kmem_zone_t *xfs_bmap_free_item_zone;
29 29
30/* 30/*
31 * DELTA: describe a change to the in-core extent list.
32 *
33 * Internally the use of xed_blockount is somewhat funky.
34 * xed_blockcount contains an offset much of the time because this
35 * makes merging changes easier. (xfs_fileoff_t and xfs_filblks_t are
36 * the same underlying type).
37 */
38typedef struct xfs_extdelta
39{
40 xfs_fileoff_t xed_startoff; /* offset of range */
41 xfs_filblks_t xed_blockcount; /* blocks in range */
42} xfs_extdelta_t;
43
44/*
45 * List of extents to be free "later". 31 * List of extents to be free "later".
46 * The list is kept sorted on xbf_startblock. 32 * The list is kept sorted on xbf_startblock.
47 */ 33 */
@@ -305,9 +291,7 @@ xfs_bmapi(
305 xfs_extlen_t total, /* total blocks needed */ 291 xfs_extlen_t total, /* total blocks needed */
306 struct xfs_bmbt_irec *mval, /* output: map values */ 292 struct xfs_bmbt_irec *mval, /* output: map values */
307 int *nmap, /* i/o: mval size/count */ 293 int *nmap, /* i/o: mval size/count */
308 xfs_bmap_free_t *flist, /* i/o: list extents to free */ 294 xfs_bmap_free_t *flist); /* i/o: list extents to free */
309 xfs_extdelta_t *delta); /* o: change made to incore
310 extents */
311 295
312/* 296/*
313 * Map file blocks to filesystem blocks, simple version. 297 * Map file blocks to filesystem blocks, simple version.
@@ -341,8 +325,6 @@ xfs_bunmapi(
341 xfs_fsblock_t *firstblock, /* first allocated block 325 xfs_fsblock_t *firstblock, /* first allocated block
342 controls a.g. for allocs */ 326 controls a.g. for allocs */
343 xfs_bmap_free_t *flist, /* i/o: list extents to free */ 327 xfs_bmap_free_t *flist, /* i/o: list extents to free */
344 xfs_extdelta_t *delta, /* o: change made to incore
345 extents */
346 int *done); /* set if not done yet */ 328 int *done); /* set if not done yet */
347 329
348/* 330/*
diff --git a/fs/xfs/xfs_da_btree.c b/fs/xfs/xfs_da_btree.c
index 731f1f41eca1..2adfb761ab13 100644
--- a/fs/xfs/xfs_da_btree.c
+++ b/fs/xfs/xfs_da_btree.c
@@ -1596,7 +1596,7 @@ xfs_da_grow_inode(xfs_da_args_t *args, xfs_dablk_t *new_blkno)
1596 xfs_bmapi_aflag(w)|XFS_BMAPI_WRITE|XFS_BMAPI_METADATA| 1596 xfs_bmapi_aflag(w)|XFS_BMAPI_WRITE|XFS_BMAPI_METADATA|
1597 XFS_BMAPI_CONTIG, 1597 XFS_BMAPI_CONTIG,
1598 args->firstblock, args->total, &map, &nmap, 1598 args->firstblock, args->total, &map, &nmap,
1599 args->flist, NULL))) { 1599 args->flist))) {
1600 return error; 1600 return error;
1601 } 1601 }
1602 ASSERT(nmap <= 1); 1602 ASSERT(nmap <= 1);
@@ -1617,8 +1617,7 @@ xfs_da_grow_inode(xfs_da_args_t *args, xfs_dablk_t *new_blkno)
1617 xfs_bmapi_aflag(w)|XFS_BMAPI_WRITE| 1617 xfs_bmapi_aflag(w)|XFS_BMAPI_WRITE|
1618 XFS_BMAPI_METADATA, 1618 XFS_BMAPI_METADATA,
1619 args->firstblock, args->total, 1619 args->firstblock, args->total,
1620 &mapp[mapi], &nmap, args->flist, 1620 &mapp[mapi], &nmap, args->flist))) {
1621 NULL))) {
1622 kmem_free(mapp); 1621 kmem_free(mapp);
1623 return error; 1622 return error;
1624 } 1623 }
@@ -1879,7 +1878,7 @@ xfs_da_shrink_inode(xfs_da_args_t *args, xfs_dablk_t dead_blkno,
1879 */ 1878 */
1880 if ((error = xfs_bunmapi(tp, dp, dead_blkno, count, 1879 if ((error = xfs_bunmapi(tp, dp, dead_blkno, count,
1881 xfs_bmapi_aflag(w)|XFS_BMAPI_METADATA, 1880 xfs_bmapi_aflag(w)|XFS_BMAPI_METADATA,
1882 0, args->firstblock, args->flist, NULL, 1881 0, args->firstblock, args->flist,
1883 &done)) == ENOSPC) { 1882 &done)) == ENOSPC) {
1884 if (w != XFS_DATA_FORK) 1883 if (w != XFS_DATA_FORK)
1885 break; 1884 break;
@@ -1984,7 +1983,7 @@ xfs_da_do_buf(
1984 nfsb, 1983 nfsb,
1985 XFS_BMAPI_METADATA | 1984 XFS_BMAPI_METADATA |
1986 xfs_bmapi_aflag(whichfork), 1985 xfs_bmapi_aflag(whichfork),
1987 NULL, 0, mapp, &nmap, NULL, NULL))) 1986 NULL, 0, mapp, &nmap, NULL)))
1988 goto exit0; 1987 goto exit0;
1989 } 1988 }
1990 } else { 1989 } else {
diff --git a/fs/xfs/xfs_dir2.c b/fs/xfs/xfs_dir2.c
index 9c279ede05c5..b53960a5f41e 100644
--- a/fs/xfs/xfs_dir2.c
+++ b/fs/xfs/xfs_dir2.c
@@ -547,7 +547,7 @@ xfs_dir2_grow_inode(
547 if ((error = xfs_bmapi(tp, dp, bno, count, 547 if ((error = xfs_bmapi(tp, dp, bno, count,
548 XFS_BMAPI_WRITE|XFS_BMAPI_METADATA|XFS_BMAPI_CONTIG, 548 XFS_BMAPI_WRITE|XFS_BMAPI_METADATA|XFS_BMAPI_CONTIG,
549 args->firstblock, args->total, &map, &nmap, 549 args->firstblock, args->total, &map, &nmap,
550 args->flist, NULL))) 550 args->flist)))
551 return error; 551 return error;
552 ASSERT(nmap <= 1); 552 ASSERT(nmap <= 1);
553 if (nmap == 1) { 553 if (nmap == 1) {
@@ -579,8 +579,7 @@ xfs_dir2_grow_inode(
579 if ((error = xfs_bmapi(tp, dp, b, c, 579 if ((error = xfs_bmapi(tp, dp, b, c,
580 XFS_BMAPI_WRITE|XFS_BMAPI_METADATA, 580 XFS_BMAPI_WRITE|XFS_BMAPI_METADATA,
581 args->firstblock, args->total, 581 args->firstblock, args->total,
582 &mapp[mapi], &nmap, args->flist, 582 &mapp[mapi], &nmap, args->flist))) {
583 NULL))) {
584 kmem_free(mapp); 583 kmem_free(mapp);
585 return error; 584 return error;
586 } 585 }
@@ -713,7 +712,7 @@ xfs_dir2_shrink_inode(
713 */ 712 */
714 if ((error = xfs_bunmapi(tp, dp, da, mp->m_dirblkfsbs, 713 if ((error = xfs_bunmapi(tp, dp, da, mp->m_dirblkfsbs,
715 XFS_BMAPI_METADATA, 0, args->firstblock, args->flist, 714 XFS_BMAPI_METADATA, 0, args->firstblock, args->flist,
716 NULL, &done))) { 715 &done))) {
717 /* 716 /*
718 * ENOSPC actually can happen if we're in a removename with 717 * ENOSPC actually can happen if we're in a removename with
719 * no space reservation, and the resulting block removal 718 * no space reservation, and the resulting block removal
diff --git a/fs/xfs/xfs_dir2_leaf.c b/fs/xfs/xfs_dir2_leaf.c
index 586b010e58b4..504be8640e91 100644
--- a/fs/xfs/xfs_dir2_leaf.c
+++ b/fs/xfs/xfs_dir2_leaf.c
@@ -873,7 +873,7 @@ xfs_dir2_leaf_getdents(
873 xfs_dir2_byte_to_da(mp, 873 xfs_dir2_byte_to_da(mp,
874 XFS_DIR2_LEAF_OFFSET) - map_off, 874 XFS_DIR2_LEAF_OFFSET) - map_off,
875 XFS_BMAPI_METADATA, NULL, 0, 875 XFS_BMAPI_METADATA, NULL, 0,
876 &map[map_valid], &nmap, NULL, NULL); 876 &map[map_valid], &nmap, NULL);
877 /* 877 /*
878 * Don't know if we should ignore this or 878 * Don't know if we should ignore this or
879 * try to return an error. 879 * try to return an error.
diff --git a/fs/xfs/xfs_inode.c b/fs/xfs/xfs_inode.c
index 1e6ae68f91af..5715a9d8bcd6 100644
--- a/fs/xfs/xfs_inode.c
+++ b/fs/xfs/xfs_inode.c
@@ -1222,7 +1222,7 @@ xfs_isize_check(
1222 (xfs_ufsize_t)XFS_MAXIOFFSET(mp)) - 1222 (xfs_ufsize_t)XFS_MAXIOFFSET(mp)) -
1223 map_first), 1223 map_first),
1224 XFS_BMAPI_ENTIRE, NULL, 0, imaps, &nimaps, 1224 XFS_BMAPI_ENTIRE, NULL, 0, imaps, &nimaps,
1225 NULL, NULL)) 1225 NULL))
1226 return; 1226 return;
1227 ASSERT(nimaps == 1); 1227 ASSERT(nimaps == 1);
1228 ASSERT(imaps[0].br_startblock == HOLESTARTBLOCK); 1228 ASSERT(imaps[0].br_startblock == HOLESTARTBLOCK);
@@ -1588,7 +1588,7 @@ xfs_itruncate_finish(
1588 xfs_bmapi_aflag(fork), 1588 xfs_bmapi_aflag(fork),
1589 XFS_ITRUNC_MAX_EXTENTS, 1589 XFS_ITRUNC_MAX_EXTENTS,
1590 &first_block, &free_list, 1590 &first_block, &free_list,
1591 NULL, &done); 1591 &done);
1592 if (error) { 1592 if (error) {
1593 /* 1593 /*
1594 * If the bunmapi call encounters an error, 1594 * If the bunmapi call encounters an error,
diff --git a/fs/xfs/xfs_iomap.c b/fs/xfs/xfs_iomap.c
index aeac00294a18..39ad46b3ed46 100644
--- a/fs/xfs/xfs_iomap.c
+++ b/fs/xfs/xfs_iomap.c
@@ -118,7 +118,7 @@ xfs_iomap(
118 error = xfs_bmapi(NULL, ip, offset_fsb, 118 error = xfs_bmapi(NULL, ip, offset_fsb,
119 (xfs_filblks_t)(end_fsb - offset_fsb), 119 (xfs_filblks_t)(end_fsb - offset_fsb),
120 bmapi_flags, NULL, 0, imap, 120 bmapi_flags, NULL, 0, imap,
121 nimaps, NULL, NULL); 121 nimaps, NULL);
122 122
123 if (error) 123 if (error)
124 goto out; 124 goto out;
@@ -341,7 +341,7 @@ xfs_iomap_write_direct(
341 xfs_bmap_init(&free_list, &firstfsb); 341 xfs_bmap_init(&free_list, &firstfsb);
342 nimaps = 1; 342 nimaps = 1;
343 error = xfs_bmapi(tp, ip, offset_fsb, count_fsb, bmapi_flag, 343 error = xfs_bmapi(tp, ip, offset_fsb, count_fsb, bmapi_flag,
344 &firstfsb, 0, &imap, &nimaps, &free_list, NULL); 344 &firstfsb, 0, &imap, &nimaps, &free_list);
345 if (error) 345 if (error)
346 goto error0; 346 goto error0;
347 347
@@ -419,7 +419,7 @@ xfs_iomap_eof_want_preallocate(
419 imaps = nimaps; 419 imaps = nimaps;
420 firstblock = NULLFSBLOCK; 420 firstblock = NULLFSBLOCK;
421 error = xfs_bmapi(NULL, ip, start_fsb, count_fsb, 0, 421 error = xfs_bmapi(NULL, ip, start_fsb, count_fsb, 0,
422 &firstblock, 0, imap, &imaps, NULL, NULL); 422 &firstblock, 0, imap, &imaps, NULL);
423 if (error) 423 if (error)
424 return error; 424 return error;
425 for (n = 0; n < imaps; n++) { 425 for (n = 0; n < imaps; n++) {
@@ -494,7 +494,7 @@ retry:
494 (xfs_filblks_t)(last_fsb - offset_fsb), 494 (xfs_filblks_t)(last_fsb - offset_fsb),
495 XFS_BMAPI_DELAY | XFS_BMAPI_WRITE | 495 XFS_BMAPI_DELAY | XFS_BMAPI_WRITE |
496 XFS_BMAPI_ENTIRE, &firstblock, 1, imap, 496 XFS_BMAPI_ENTIRE, &firstblock, 1, imap,
497 &nimaps, NULL, NULL); 497 &nimaps, NULL);
498 if (error && (error != ENOSPC)) 498 if (error && (error != ENOSPC))
499 return XFS_ERROR(error); 499 return XFS_ERROR(error);
500 500
@@ -650,7 +650,7 @@ xfs_iomap_write_allocate(
650 /* Go get the actual blocks */ 650 /* Go get the actual blocks */
651 error = xfs_bmapi(tp, ip, map_start_fsb, count_fsb, 651 error = xfs_bmapi(tp, ip, map_start_fsb, count_fsb,
652 XFS_BMAPI_WRITE, &first_block, 1, 652 XFS_BMAPI_WRITE, &first_block, 1,
653 &imap, &nimaps, &free_list, NULL); 653 &imap, &nimaps, &free_list);
654 if (error) 654 if (error)
655 goto trans_cancel; 655 goto trans_cancel;
656 656
@@ -768,7 +768,7 @@ xfs_iomap_write_unwritten(
768 nimaps = 1; 768 nimaps = 1;
769 error = xfs_bmapi(tp, ip, offset_fsb, count_fsb, 769 error = xfs_bmapi(tp, ip, offset_fsb, count_fsb,
770 XFS_BMAPI_WRITE|XFS_BMAPI_CONVERT, &firstfsb, 770 XFS_BMAPI_WRITE|XFS_BMAPI_CONVERT, &firstfsb,
771 1, &imap, &nimaps, &free_list, NULL); 771 1, &imap, &nimaps, &free_list);
772 if (error) 772 if (error)
773 goto error_on_bmapi_transaction; 773 goto error_on_bmapi_transaction;
774 774
diff --git a/fs/xfs/xfs_rtalloc.c b/fs/xfs/xfs_rtalloc.c
index 8da5d89dcbcd..891260fea11e 100644
--- a/fs/xfs/xfs_rtalloc.c
+++ b/fs/xfs/xfs_rtalloc.c
@@ -122,7 +122,7 @@ xfs_growfs_rt_alloc(
122 cancelflags |= XFS_TRANS_ABORT; 122 cancelflags |= XFS_TRANS_ABORT;
123 error = xfs_bmapi(tp, ip, oblocks, nblocks - oblocks, 123 error = xfs_bmapi(tp, ip, oblocks, nblocks - oblocks,
124 XFS_BMAPI_WRITE | XFS_BMAPI_METADATA, &firstblock, 124 XFS_BMAPI_WRITE | XFS_BMAPI_METADATA, &firstblock,
125 resblks, &map, &nmap, &flist, NULL); 125 resblks, &map, &nmap, &flist);
126 if (!error && nmap < 1) 126 if (!error && nmap < 1)
127 error = XFS_ERROR(ENOSPC); 127 error = XFS_ERROR(ENOSPC);
128 if (error) 128 if (error)
diff --git a/fs/xfs/xfs_vnodeops.c b/fs/xfs/xfs_vnodeops.c
index 130343a5d22d..ad599ccc416b 100644
--- a/fs/xfs/xfs_vnodeops.c
+++ b/fs/xfs/xfs_vnodeops.c
@@ -492,7 +492,7 @@ xfs_readlink_bmap(
492 int error = 0; 492 int error = 0;
493 493
494 error = xfs_bmapi(NULL, ip, 0, XFS_B_TO_FSB(mp, pathlen), 0, NULL, 0, 494 error = xfs_bmapi(NULL, ip, 0, XFS_B_TO_FSB(mp, pathlen), 0, NULL, 0,
495 mval, &nmaps, NULL, NULL); 495 mval, &nmaps, NULL);
496 if (error) 496 if (error)
497 goto out; 497 goto out;
498 498
@@ -596,7 +596,7 @@ xfs_free_eofblocks(
596 nimaps = 1; 596 nimaps = 1;
597 xfs_ilock(ip, XFS_ILOCK_SHARED); 597 xfs_ilock(ip, XFS_ILOCK_SHARED);
598 error = xfs_bmapi(NULL, ip, end_fsb, map_len, 0, 598 error = xfs_bmapi(NULL, ip, end_fsb, map_len, 0,
599 NULL, 0, &imap, &nimaps, NULL, NULL); 599 NULL, 0, &imap, &nimaps, NULL);
600 xfs_iunlock(ip, XFS_ILOCK_SHARED); 600 xfs_iunlock(ip, XFS_ILOCK_SHARED);
601 601
602 if (!error && (nimaps != 0) && 602 if (!error && (nimaps != 0) &&
@@ -733,7 +733,7 @@ xfs_inactive_symlink_rmt(
733 nmaps = ARRAY_SIZE(mval); 733 nmaps = ARRAY_SIZE(mval);
734 if ((error = xfs_bmapi(tp, ip, 0, XFS_B_TO_FSB(mp, size), 734 if ((error = xfs_bmapi(tp, ip, 0, XFS_B_TO_FSB(mp, size),
735 XFS_BMAPI_METADATA, &first_block, 0, mval, &nmaps, 735 XFS_BMAPI_METADATA, &first_block, 0, mval, &nmaps,
736 &free_list, NULL))) 736 &free_list)))
737 goto error0; 737 goto error0;
738 /* 738 /*
739 * Invalidate the block(s). 739 * Invalidate the block(s).
@@ -748,7 +748,7 @@ xfs_inactive_symlink_rmt(
748 * Unmap the dead block(s) to the free_list. 748 * Unmap the dead block(s) to the free_list.
749 */ 749 */
750 if ((error = xfs_bunmapi(tp, ip, 0, size, XFS_BMAPI_METADATA, nmaps, 750 if ((error = xfs_bunmapi(tp, ip, 0, size, XFS_BMAPI_METADATA, nmaps,
751 &first_block, &free_list, NULL, &done))) 751 &first_block, &free_list, &done)))
752 goto error1; 752 goto error1;
753 ASSERT(done); 753 ASSERT(done);
754 /* 754 /*
@@ -2095,7 +2095,7 @@ xfs_symlink(
2095 error = xfs_bmapi(tp, ip, first_fsb, fs_blocks, 2095 error = xfs_bmapi(tp, ip, first_fsb, fs_blocks,
2096 XFS_BMAPI_WRITE | XFS_BMAPI_METADATA, 2096 XFS_BMAPI_WRITE | XFS_BMAPI_METADATA,
2097 &first_block, resblks, mval, &nmaps, 2097 &first_block, resblks, mval, &nmaps,
2098 &free_list, NULL); 2098 &free_list);
2099 if (error) { 2099 if (error) {
2100 goto error1; 2100 goto error1;
2101 } 2101 }
@@ -2347,7 +2347,7 @@ xfs_alloc_file_space(
2347 error = xfs_bmapi(tp, ip, startoffset_fsb, 2347 error = xfs_bmapi(tp, ip, startoffset_fsb,
2348 allocatesize_fsb, bmapi_flag, 2348 allocatesize_fsb, bmapi_flag,
2349 &firstfsb, 0, imapp, &nimaps, 2349 &firstfsb, 0, imapp, &nimaps,
2350 &free_list, NULL); 2350 &free_list);
2351 if (error) { 2351 if (error) {
2352 goto error0; 2352 goto error0;
2353 } 2353 }
@@ -2436,7 +2436,7 @@ xfs_zero_remaining_bytes(
2436 offset_fsb = XFS_B_TO_FSBT(mp, offset); 2436 offset_fsb = XFS_B_TO_FSBT(mp, offset);
2437 nimap = 1; 2437 nimap = 1;
2438 error = xfs_bmapi(NULL, ip, offset_fsb, 1, 0, 2438 error = xfs_bmapi(NULL, ip, offset_fsb, 1, 0,
2439 NULL, 0, &imap, &nimap, NULL, NULL); 2439 NULL, 0, &imap, &nimap, NULL);
2440 if (error || nimap < 1) 2440 if (error || nimap < 1)
2441 break; 2441 break;
2442 ASSERT(imap.br_blockcount >= 1); 2442 ASSERT(imap.br_blockcount >= 1);
@@ -2556,7 +2556,7 @@ xfs_free_file_space(
2556 if (rt && !xfs_sb_version_hasextflgbit(&mp->m_sb)) { 2556 if (rt && !xfs_sb_version_hasextflgbit(&mp->m_sb)) {
2557 nimap = 1; 2557 nimap = 1;
2558 error = xfs_bmapi(NULL, ip, startoffset_fsb, 2558 error = xfs_bmapi(NULL, ip, startoffset_fsb,
2559 1, 0, NULL, 0, &imap, &nimap, NULL, NULL); 2559 1, 0, NULL, 0, &imap, &nimap, NULL);
2560 if (error) 2560 if (error)
2561 goto out_unlock_iolock; 2561 goto out_unlock_iolock;
2562 ASSERT(nimap == 0 || nimap == 1); 2562 ASSERT(nimap == 0 || nimap == 1);
@@ -2571,7 +2571,7 @@ xfs_free_file_space(
2571 } 2571 }
2572 nimap = 1; 2572 nimap = 1;
2573 error = xfs_bmapi(NULL, ip, endoffset_fsb - 1, 2573 error = xfs_bmapi(NULL, ip, endoffset_fsb - 1,
2574 1, 0, NULL, 0, &imap, &nimap, NULL, NULL); 2574 1, 0, NULL, 0, &imap, &nimap, NULL);
2575 if (error) 2575 if (error)
2576 goto out_unlock_iolock; 2576 goto out_unlock_iolock;
2577 ASSERT(nimap == 0 || nimap == 1); 2577 ASSERT(nimap == 0 || nimap == 1);
@@ -2647,7 +2647,7 @@ xfs_free_file_space(
2647 xfs_bmap_init(&free_list, &firstfsb); 2647 xfs_bmap_init(&free_list, &firstfsb);
2648 error = xfs_bunmapi(tp, ip, startoffset_fsb, 2648 error = xfs_bunmapi(tp, ip, startoffset_fsb,
2649 endoffset_fsb - startoffset_fsb, 2649 endoffset_fsb - startoffset_fsb,
2650 0, 2, &firstfsb, &free_list, NULL, &done); 2650 0, 2, &firstfsb, &free_list, &done);
2651 if (error) { 2651 if (error) {
2652 goto error0; 2652 goto error0;
2653 } 2653 }