aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDave Chinner <david@fromorbit.com>2014-05-14 19:36:35 -0400
committerDave Chinner <david@fromorbit.com>2014-05-14 19:36:35 -0400
commitfdd3a2ae2e48310491e605c46201c95629dd450b (patch)
tree2a9361017d5fad1b39e77b8bb5eb1fd45cea0597
parentee4eec478be4677b93775d17bc079efb5922b276 (diff)
parent5e06d148949bb79af429c46afb4b81bc31308f6e (diff)
Merge branch 'xfs-unused-args-cleanup' into for-next
-rw-r--r--fs/xfs/xfs_alloc_btree.c1
-rw-r--r--fs/xfs/xfs_attr_remote.c3
-rw-r--r--fs/xfs/xfs_bmap.c6
-rw-r--r--fs/xfs/xfs_bmap.h4
-rw-r--r--fs/xfs/xfs_bmap_btree.c9
-rw-r--r--fs/xfs/xfs_bmap_btree.h2
-rw-r--r--fs/xfs/xfs_btree.c38
-rw-r--r--fs/xfs/xfs_btree.h2
-rw-r--r--fs/xfs/xfs_buf.c17
-rw-r--r--fs/xfs/xfs_buf.h4
-rw-r--r--fs/xfs/xfs_buf_item.c3
-rw-r--r--fs/xfs/xfs_da_btree.c8
-rw-r--r--fs/xfs/xfs_da_btree.h6
-rw-r--r--fs/xfs/xfs_da_format.h10
-rw-r--r--fs/xfs/xfs_dir2.c26
-rw-r--r--fs/xfs/xfs_dir2.h4
-rw-r--r--fs/xfs/xfs_dir2_block.c9
-rw-r--r--fs/xfs/xfs_dir2_data.c3
-rw-r--r--fs/xfs/xfs_dir2_leaf.c2
-rw-r--r--fs/xfs/xfs_dir2_node.c2
-rw-r--r--fs/xfs/xfs_dir2_priv.h4
-rw-r--r--fs/xfs/xfs_dir2_readdir.c14
-rw-r--r--fs/xfs/xfs_dir2_sf.c21
-rw-r--r--fs/xfs/xfs_dquot_buf.c5
-rw-r--r--fs/xfs/xfs_file.c2
-rw-r--r--fs/xfs/xfs_ialloc_btree.c1
-rw-r--r--fs/xfs/xfs_icache.c12
-rw-r--r--fs/xfs/xfs_icache.h6
-rw-r--r--fs/xfs/xfs_inode.c4
-rw-r--r--fs/xfs/xfs_inode_fork.c3
-rw-r--r--fs/xfs/xfs_inode_fork.h3
-rw-r--r--fs/xfs/xfs_iomap.c2
-rw-r--r--fs/xfs/xfs_log_recover.c9
-rw-r--r--fs/xfs/xfs_qm.c3
-rw-r--r--fs/xfs/xfs_qm_syscalls.c1
-rw-r--r--fs/xfs/xfs_quota_defs.h2
-rw-r--r--fs/xfs/xfs_shared.h2
-rw-r--r--fs/xfs/xfs_super.c13
-rw-r--r--fs/xfs/xfs_symlink.c2
-rw-r--r--fs/xfs/xfs_symlink_remote.c1
-rw-r--r--fs/xfs/xfs_trans.c2
-rw-r--r--fs/xfs/xfs_trans_ail.c5
-rw-r--r--fs/xfs/xfs_trans_priv.h3
43 files changed, 113 insertions, 166 deletions
diff --git a/fs/xfs/xfs_alloc_btree.c b/fs/xfs/xfs_alloc_btree.c
index cc1eadcbb049..8358f1ded94d 100644
--- a/fs/xfs/xfs_alloc_btree.c
+++ b/fs/xfs/xfs_alloc_btree.c
@@ -70,7 +70,6 @@ xfs_allocbt_alloc_block(
70 struct xfs_btree_cur *cur, 70 struct xfs_btree_cur *cur,
71 union xfs_btree_ptr *start, 71 union xfs_btree_ptr *start,
72 union xfs_btree_ptr *new, 72 union xfs_btree_ptr *new,
73 int length,
74 int *stat) 73 int *stat)
75{ 74{
76 int error; 75 int error;
diff --git a/fs/xfs/xfs_attr_remote.c b/fs/xfs/xfs_attr_remote.c
index d2e6e948cec7..0f0679a134e2 100644
--- a/fs/xfs/xfs_attr_remote.c
+++ b/fs/xfs/xfs_attr_remote.c
@@ -68,7 +68,6 @@ xfs_attr3_rmt_blocks(
68 */ 68 */
69static bool 69static bool
70xfs_attr3_rmt_hdr_ok( 70xfs_attr3_rmt_hdr_ok(
71 struct xfs_mount *mp,
72 void *ptr, 71 void *ptr,
73 xfs_ino_t ino, 72 xfs_ino_t ino,
74 uint32_t offset, 73 uint32_t offset,
@@ -251,7 +250,7 @@ xfs_attr_rmtval_copyout(
251 byte_cnt = min(*valuelen, byte_cnt); 250 byte_cnt = min(*valuelen, byte_cnt);
252 251
253 if (xfs_sb_version_hascrc(&mp->m_sb)) { 252 if (xfs_sb_version_hascrc(&mp->m_sb)) {
254 if (!xfs_attr3_rmt_hdr_ok(mp, src, ino, *offset, 253 if (!xfs_attr3_rmt_hdr_ok(src, ino, *offset,
255 byte_cnt, bno)) { 254 byte_cnt, bno)) {
256 xfs_alert(mp, 255 xfs_alert(mp,
257"remote attribute header mismatch bno/off/len/owner (0x%llx/0x%x/Ox%x/0x%llx)", 256"remote attribute header mismatch bno/off/len/owner (0x%llx/0x%x/Ox%x/0x%llx)",
diff --git a/fs/xfs/xfs_bmap.c b/fs/xfs/xfs_bmap.c
index f0efc7e970ef..37b8d3c66745 100644
--- a/fs/xfs/xfs_bmap.c
+++ b/fs/xfs/xfs_bmap.c
@@ -94,7 +94,7 @@ xfs_bmap_compute_maxlevels(
94 maxleafents = MAXAEXTNUM; 94 maxleafents = MAXAEXTNUM;
95 sz = XFS_BMDR_SPACE_CALC(MINABTPTRS); 95 sz = XFS_BMDR_SPACE_CALC(MINABTPTRS);
96 } 96 }
97 maxrootrecs = xfs_bmdr_maxrecs(mp, sz, 0); 97 maxrootrecs = xfs_bmdr_maxrecs(sz, 0);
98 minleafrecs = mp->m_bmap_dmnr[0]; 98 minleafrecs = mp->m_bmap_dmnr[0];
99 minnoderecs = mp->m_bmap_dmnr[1]; 99 minnoderecs = mp->m_bmap_dmnr[1];
100 maxblocks = (maxleafents + minleafrecs - 1) / minleafrecs; 100 maxblocks = (maxleafents + minleafrecs - 1) / minleafrecs;
@@ -233,7 +233,6 @@ xfs_default_attroffset(
233 */ 233 */
234STATIC void 234STATIC void
235xfs_bmap_forkoff_reset( 235xfs_bmap_forkoff_reset(
236 xfs_mount_t *mp,
237 xfs_inode_t *ip, 236 xfs_inode_t *ip,
238 int whichfork) 237 int whichfork)
239{ 238{
@@ -905,7 +904,7 @@ xfs_bmap_local_to_extents_empty(
905 ASSERT(ifp->if_bytes == 0); 904 ASSERT(ifp->if_bytes == 0);
906 ASSERT(XFS_IFORK_NEXTENTS(ip, whichfork) == 0); 905 ASSERT(XFS_IFORK_NEXTENTS(ip, whichfork) == 0);
907 906
908 xfs_bmap_forkoff_reset(ip->i_mount, ip, whichfork); 907 xfs_bmap_forkoff_reset(ip, whichfork);
909 ifp->if_flags &= ~XFS_IFINLINE; 908 ifp->if_flags &= ~XFS_IFINLINE;
910 ifp->if_flags |= XFS_IFEXTENTS; 909 ifp->if_flags |= XFS_IFEXTENTS;
911 XFS_IFORK_FMT_SET(ip, whichfork, XFS_DINODE_FMT_EXTENTS); 910 XFS_IFORK_FMT_SET(ip, whichfork, XFS_DINODE_FMT_EXTENTS);
@@ -1675,7 +1674,6 @@ xfs_bmap_isaeof(
1675 */ 1674 */
1676int 1675int
1677xfs_bmap_last_offset( 1676xfs_bmap_last_offset(
1678 struct xfs_trans *tp,
1679 struct xfs_inode *ip, 1677 struct xfs_inode *ip,
1680 xfs_fileoff_t *last_block, 1678 xfs_fileoff_t *last_block,
1681 int whichfork) 1679 int whichfork)
diff --git a/fs/xfs/xfs_bmap.h b/fs/xfs/xfs_bmap.h
index f84bd7af43be..38ba36e9b2f0 100644
--- a/fs/xfs/xfs_bmap.h
+++ b/fs/xfs/xfs_bmap.h
@@ -156,8 +156,8 @@ int xfs_bmap_first_unused(struct xfs_trans *tp, struct xfs_inode *ip,
156 xfs_extlen_t len, xfs_fileoff_t *unused, int whichfork); 156 xfs_extlen_t len, xfs_fileoff_t *unused, int whichfork);
157int xfs_bmap_last_before(struct xfs_trans *tp, struct xfs_inode *ip, 157int xfs_bmap_last_before(struct xfs_trans *tp, struct xfs_inode *ip,
158 xfs_fileoff_t *last_block, int whichfork); 158 xfs_fileoff_t *last_block, int whichfork);
159int xfs_bmap_last_offset(struct xfs_trans *tp, struct xfs_inode *ip, 159int xfs_bmap_last_offset(struct xfs_inode *ip, xfs_fileoff_t *unused,
160 xfs_fileoff_t *unused, int whichfork); 160 int whichfork);
161int xfs_bmap_one_block(struct xfs_inode *ip, int whichfork); 161int xfs_bmap_one_block(struct xfs_inode *ip, int whichfork);
162int xfs_bmap_read_extents(struct xfs_trans *tp, struct xfs_inode *ip, 162int xfs_bmap_read_extents(struct xfs_trans *tp, struct xfs_inode *ip,
163 int whichfork); 163 int whichfork);
diff --git a/fs/xfs/xfs_bmap_btree.c b/fs/xfs/xfs_bmap_btree.c
index 818d546664e7..948836c4fd90 100644
--- a/fs/xfs/xfs_bmap_btree.c
+++ b/fs/xfs/xfs_bmap_btree.c
@@ -84,7 +84,7 @@ xfs_bmdr_to_bmbt(
84 rblock->bb_level = dblock->bb_level; 84 rblock->bb_level = dblock->bb_level;
85 ASSERT(be16_to_cpu(rblock->bb_level) > 0); 85 ASSERT(be16_to_cpu(rblock->bb_level) > 0);
86 rblock->bb_numrecs = dblock->bb_numrecs; 86 rblock->bb_numrecs = dblock->bb_numrecs;
87 dmxr = xfs_bmdr_maxrecs(mp, dblocklen, 0); 87 dmxr = xfs_bmdr_maxrecs(dblocklen, 0);
88 fkp = XFS_BMDR_KEY_ADDR(dblock, 1); 88 fkp = XFS_BMDR_KEY_ADDR(dblock, 1);
89 tkp = XFS_BMBT_KEY_ADDR(mp, rblock, 1); 89 tkp = XFS_BMBT_KEY_ADDR(mp, rblock, 1);
90 fpp = XFS_BMDR_PTR_ADDR(dblock, 1, dmxr); 90 fpp = XFS_BMDR_PTR_ADDR(dblock, 1, dmxr);
@@ -443,7 +443,7 @@ xfs_bmbt_to_bmdr(
443 ASSERT(rblock->bb_level != 0); 443 ASSERT(rblock->bb_level != 0);
444 dblock->bb_level = rblock->bb_level; 444 dblock->bb_level = rblock->bb_level;
445 dblock->bb_numrecs = rblock->bb_numrecs; 445 dblock->bb_numrecs = rblock->bb_numrecs;
446 dmxr = xfs_bmdr_maxrecs(mp, dblocklen, 0); 446 dmxr = xfs_bmdr_maxrecs(dblocklen, 0);
447 fkp = XFS_BMBT_KEY_ADDR(mp, rblock, 1); 447 fkp = XFS_BMBT_KEY_ADDR(mp, rblock, 1);
448 tkp = XFS_BMDR_KEY_ADDR(dblock, 1); 448 tkp = XFS_BMDR_KEY_ADDR(dblock, 1);
449 fpp = XFS_BMAP_BROOT_PTR_ADDR(mp, rblock, 1, rblocklen); 449 fpp = XFS_BMAP_BROOT_PTR_ADDR(mp, rblock, 1, rblocklen);
@@ -519,7 +519,6 @@ xfs_bmbt_alloc_block(
519 struct xfs_btree_cur *cur, 519 struct xfs_btree_cur *cur,
520 union xfs_btree_ptr *start, 520 union xfs_btree_ptr *start,
521 union xfs_btree_ptr *new, 521 union xfs_btree_ptr *new,
522 int length,
523 int *stat) 522 int *stat)
524{ 523{
525 xfs_alloc_arg_t args; /* block allocation args */ 524 xfs_alloc_arg_t args; /* block allocation args */
@@ -672,8 +671,7 @@ xfs_bmbt_get_dmaxrecs(
672{ 671{
673 if (level != cur->bc_nlevels - 1) 672 if (level != cur->bc_nlevels - 1)
674 return cur->bc_mp->m_bmap_dmxr[level != 0]; 673 return cur->bc_mp->m_bmap_dmxr[level != 0];
675 return xfs_bmdr_maxrecs(cur->bc_mp, cur->bc_private.b.forksize, 674 return xfs_bmdr_maxrecs(cur->bc_private.b.forksize, level == 0);
676 level == 0);
677} 675}
678 676
679STATIC void 677STATIC void
@@ -914,7 +912,6 @@ xfs_bmbt_maxrecs(
914 */ 912 */
915int 913int
916xfs_bmdr_maxrecs( 914xfs_bmdr_maxrecs(
917 struct xfs_mount *mp,
918 int blocklen, 915 int blocklen,
919 int leaf) 916 int leaf)
920{ 917{
diff --git a/fs/xfs/xfs_bmap_btree.h b/fs/xfs/xfs_bmap_btree.h
index 6e42e1e50b89..819a8a4dee95 100644
--- a/fs/xfs/xfs_bmap_btree.h
+++ b/fs/xfs/xfs_bmap_btree.h
@@ -130,7 +130,7 @@ extern void xfs_bmbt_to_bmdr(struct xfs_mount *, struct xfs_btree_block *, int,
130 xfs_bmdr_block_t *, int); 130 xfs_bmdr_block_t *, int);
131 131
132extern int xfs_bmbt_get_maxrecs(struct xfs_btree_cur *, int level); 132extern int xfs_bmbt_get_maxrecs(struct xfs_btree_cur *, int level);
133extern int xfs_bmdr_maxrecs(struct xfs_mount *, int blocklen, int leaf); 133extern int xfs_bmdr_maxrecs(int blocklen, int leaf);
134extern int xfs_bmbt_maxrecs(struct xfs_mount *, int blocklen, int leaf); 134extern int xfs_bmbt_maxrecs(struct xfs_mount *, int blocklen, int leaf);
135 135
136extern int xfs_bmbt_change_owner(struct xfs_trans *tp, struct xfs_inode *ip, 136extern int xfs_bmbt_change_owner(struct xfs_trans *tp, struct xfs_inode *ip,
diff --git a/fs/xfs/xfs_btree.c b/fs/xfs/xfs_btree.c
index e80d59fdf89a..c13d650fdb99 100644
--- a/fs/xfs/xfs_btree.c
+++ b/fs/xfs/xfs_btree.c
@@ -1159,7 +1159,6 @@ STATIC int
1159xfs_btree_read_buf_block( 1159xfs_btree_read_buf_block(
1160 struct xfs_btree_cur *cur, 1160 struct xfs_btree_cur *cur,
1161 union xfs_btree_ptr *ptr, 1161 union xfs_btree_ptr *ptr,
1162 int level,
1163 int flags, 1162 int flags,
1164 struct xfs_btree_block **block, 1163 struct xfs_btree_block **block,
1165 struct xfs_buf **bpp) 1164 struct xfs_buf **bpp)
@@ -1517,8 +1516,8 @@ xfs_btree_increment(
1517 union xfs_btree_ptr *ptrp; 1516 union xfs_btree_ptr *ptrp;
1518 1517
1519 ptrp = xfs_btree_ptr_addr(cur, cur->bc_ptrs[lev], block); 1518 ptrp = xfs_btree_ptr_addr(cur, cur->bc_ptrs[lev], block);
1520 error = xfs_btree_read_buf_block(cur, ptrp, --lev, 1519 --lev;
1521 0, &block, &bp); 1520 error = xfs_btree_read_buf_block(cur, ptrp, 0, &block, &bp);
1522 if (error) 1521 if (error)
1523 goto error0; 1522 goto error0;
1524 1523
@@ -1616,8 +1615,8 @@ xfs_btree_decrement(
1616 union xfs_btree_ptr *ptrp; 1615 union xfs_btree_ptr *ptrp;
1617 1616
1618 ptrp = xfs_btree_ptr_addr(cur, cur->bc_ptrs[lev], block); 1617 ptrp = xfs_btree_ptr_addr(cur, cur->bc_ptrs[lev], block);
1619 error = xfs_btree_read_buf_block(cur, ptrp, --lev, 1618 --lev;
1620 0, &block, &bp); 1619 error = xfs_btree_read_buf_block(cur, ptrp, 0, &block, &bp);
1621 if (error) 1620 if (error)
1622 goto error0; 1621 goto error0;
1623 xfs_btree_setbuf(cur, lev, bp); 1622 xfs_btree_setbuf(cur, lev, bp);
@@ -1667,7 +1666,7 @@ xfs_btree_lookup_get_block(
1667 return 0; 1666 return 0;
1668 } 1667 }
1669 1668
1670 error = xfs_btree_read_buf_block(cur, pp, level, 0, blkp, &bp); 1669 error = xfs_btree_read_buf_block(cur, pp, 0, blkp, &bp);
1671 if (error) 1670 if (error)
1672 return error; 1671 return error;
1673 1672
@@ -2018,7 +2017,7 @@ xfs_btree_lshift(
2018 goto out0; 2017 goto out0;
2019 2018
2020 /* Set up the left neighbor as "left". */ 2019 /* Set up the left neighbor as "left". */
2021 error = xfs_btree_read_buf_block(cur, &lptr, level, 0, &left, &lbp); 2020 error = xfs_btree_read_buf_block(cur, &lptr, 0, &left, &lbp);
2022 if (error) 2021 if (error)
2023 goto error0; 2022 goto error0;
2024 2023
@@ -2202,7 +2201,7 @@ xfs_btree_rshift(
2202 goto out0; 2201 goto out0;
2203 2202
2204 /* Set up the right neighbor as "right". */ 2203 /* Set up the right neighbor as "right". */
2205 error = xfs_btree_read_buf_block(cur, &rptr, level, 0, &right, &rbp); 2204 error = xfs_btree_read_buf_block(cur, &rptr, 0, &right, &rbp);
2206 if (error) 2205 if (error)
2207 goto error0; 2206 goto error0;
2208 2207
@@ -2372,7 +2371,7 @@ xfs_btree_split(
2372 xfs_btree_buf_to_ptr(cur, lbp, &lptr); 2371 xfs_btree_buf_to_ptr(cur, lbp, &lptr);
2373 2372
2374 /* Allocate the new block. If we can't do it, we're toast. Give up. */ 2373 /* Allocate the new block. If we can't do it, we're toast. Give up. */
2375 error = cur->bc_ops->alloc_block(cur, &lptr, &rptr, 1, stat); 2374 error = cur->bc_ops->alloc_block(cur, &lptr, &rptr, stat);
2376 if (error) 2375 if (error)
2377 goto error0; 2376 goto error0;
2378 if (*stat == 0) 2377 if (*stat == 0)
@@ -2470,7 +2469,7 @@ xfs_btree_split(
2470 * point back to right instead of to left. 2469 * point back to right instead of to left.
2471 */ 2470 */
2472 if (!xfs_btree_ptr_is_null(cur, &rrptr)) { 2471 if (!xfs_btree_ptr_is_null(cur, &rrptr)) {
2473 error = xfs_btree_read_buf_block(cur, &rrptr, level, 2472 error = xfs_btree_read_buf_block(cur, &rrptr,
2474 0, &rrblock, &rrbp); 2473 0, &rrblock, &rrbp);
2475 if (error) 2474 if (error)
2476 goto error0; 2475 goto error0;
@@ -2545,7 +2544,7 @@ xfs_btree_new_iroot(
2545 pp = xfs_btree_ptr_addr(cur, 1, block); 2544 pp = xfs_btree_ptr_addr(cur, 1, block);
2546 2545
2547 /* Allocate the new block. If we can't do it, we're toast. Give up. */ 2546 /* Allocate the new block. If we can't do it, we're toast. Give up. */
2548 error = cur->bc_ops->alloc_block(cur, pp, &nptr, 1, stat); 2547 error = cur->bc_ops->alloc_block(cur, pp, &nptr, stat);
2549 if (error) 2548 if (error)
2550 goto error0; 2549 goto error0;
2551 if (*stat == 0) { 2550 if (*stat == 0) {
@@ -2649,7 +2648,7 @@ xfs_btree_new_root(
2649 cur->bc_ops->init_ptr_from_cur(cur, &rptr); 2648 cur->bc_ops->init_ptr_from_cur(cur, &rptr);
2650 2649
2651 /* Allocate the new block. If we can't do it, we're toast. Give up. */ 2650 /* Allocate the new block. If we can't do it, we're toast. Give up. */
2652 error = cur->bc_ops->alloc_block(cur, &rptr, &lptr, 1, stat); 2651 error = cur->bc_ops->alloc_block(cur, &rptr, &lptr, stat);
2653 if (error) 2652 if (error)
2654 goto error0; 2653 goto error0;
2655 if (*stat == 0) 2654 if (*stat == 0)
@@ -2684,8 +2683,7 @@ xfs_btree_new_root(
2684 lbp = bp; 2683 lbp = bp;
2685 xfs_btree_buf_to_ptr(cur, lbp, &lptr); 2684 xfs_btree_buf_to_ptr(cur, lbp, &lptr);
2686 left = block; 2685 left = block;
2687 error = xfs_btree_read_buf_block(cur, &rptr, 2686 error = xfs_btree_read_buf_block(cur, &rptr, 0, &right, &rbp);
2688 cur->bc_nlevels - 1, 0, &right, &rbp);
2689 if (error) 2687 if (error)
2690 goto error0; 2688 goto error0;
2691 bp = rbp; 2689 bp = rbp;
@@ -2696,8 +2694,7 @@ xfs_btree_new_root(
2696 xfs_btree_buf_to_ptr(cur, rbp, &rptr); 2694 xfs_btree_buf_to_ptr(cur, rbp, &rptr);
2697 right = block; 2695 right = block;
2698 xfs_btree_get_sibling(cur, right, &lptr, XFS_BB_LEFTSIB); 2696 xfs_btree_get_sibling(cur, right, &lptr, XFS_BB_LEFTSIB);
2699 error = xfs_btree_read_buf_block(cur, &lptr, 2697 error = xfs_btree_read_buf_block(cur, &lptr, 0, &left, &lbp);
2700 cur->bc_nlevels - 1, 0, &left, &lbp);
2701 if (error) 2698 if (error)
2702 goto error0; 2699 goto error0;
2703 bp = lbp; 2700 bp = lbp;
@@ -3649,8 +3646,7 @@ xfs_btree_delrec(
3649 rptr = cptr; 3646 rptr = cptr;
3650 right = block; 3647 right = block;
3651 rbp = bp; 3648 rbp = bp;
3652 error = xfs_btree_read_buf_block(cur, &lptr, level, 3649 error = xfs_btree_read_buf_block(cur, &lptr, 0, &left, &lbp);
3653 0, &left, &lbp);
3654 if (error) 3650 if (error)
3655 goto error0; 3651 goto error0;
3656 3652
@@ -3667,8 +3663,7 @@ xfs_btree_delrec(
3667 lptr = cptr; 3663 lptr = cptr;
3668 left = block; 3664 left = block;
3669 lbp = bp; 3665 lbp = bp;
3670 error = xfs_btree_read_buf_block(cur, &rptr, level, 3666 error = xfs_btree_read_buf_block(cur, &rptr, 0, &right, &rbp);
3671 0, &right, &rbp);
3672 if (error) 3667 if (error)
3673 goto error0; 3668 goto error0;
3674 3669
@@ -3740,8 +3735,7 @@ xfs_btree_delrec(
3740 /* If there is a right sibling, point it to the remaining block. */ 3735 /* If there is a right sibling, point it to the remaining block. */
3741 xfs_btree_get_sibling(cur, left, &cptr, XFS_BB_RIGHTSIB); 3736 xfs_btree_get_sibling(cur, left, &cptr, XFS_BB_RIGHTSIB);
3742 if (!xfs_btree_ptr_is_null(cur, &cptr)) { 3737 if (!xfs_btree_ptr_is_null(cur, &cptr)) {
3743 error = xfs_btree_read_buf_block(cur, &cptr, level, 3738 error = xfs_btree_read_buf_block(cur, &cptr, 0, &rrblock, &rrbp);
3744 0, &rrblock, &rrbp);
3745 if (error) 3739 if (error)
3746 goto error0; 3740 goto error0;
3747 xfs_btree_set_sibling(cur, rrblock, &lptr, XFS_BB_LEFTSIB); 3741 xfs_btree_set_sibling(cur, rrblock, &lptr, XFS_BB_LEFTSIB);
diff --git a/fs/xfs/xfs_btree.h b/fs/xfs/xfs_btree.h
index 91e34f21bace..875f6876ff48 100644
--- a/fs/xfs/xfs_btree.h
+++ b/fs/xfs/xfs_btree.h
@@ -129,7 +129,7 @@ struct xfs_btree_ops {
129 int (*alloc_block)(struct xfs_btree_cur *cur, 129 int (*alloc_block)(struct xfs_btree_cur *cur,
130 union xfs_btree_ptr *start_bno, 130 union xfs_btree_ptr *start_bno,
131 union xfs_btree_ptr *new_bno, 131 union xfs_btree_ptr *new_bno,
132 int length, int *stat); 132 int *stat);
133 int (*free_block)(struct xfs_btree_cur *cur, struct xfs_buf *bp); 133 int (*free_block)(struct xfs_btree_cur *cur, struct xfs_buf *bp);
134 134
135 /* update last record information */ 135 /* update last record information */
diff --git a/fs/xfs/xfs_buf.c b/fs/xfs/xfs_buf.c
index cb10a0aaab3a..7a34a1ae6552 100644
--- a/fs/xfs/xfs_buf.c
+++ b/fs/xfs/xfs_buf.c
@@ -216,8 +216,7 @@ _xfs_buf_alloc(
216STATIC int 216STATIC int
217_xfs_buf_get_pages( 217_xfs_buf_get_pages(
218 xfs_buf_t *bp, 218 xfs_buf_t *bp,
219 int page_count, 219 int page_count)
220 xfs_buf_flags_t flags)
221{ 220{
222 /* Make sure that we have a page list */ 221 /* Make sure that we have a page list */
223 if (bp->b_pages == NULL) { 222 if (bp->b_pages == NULL) {
@@ -330,7 +329,7 @@ use_alloc_page:
330 end = (BBTOB(bp->b_maps[0].bm_bn + bp->b_length) + PAGE_SIZE - 1) 329 end = (BBTOB(bp->b_maps[0].bm_bn + bp->b_length) + PAGE_SIZE - 1)
331 >> PAGE_SHIFT; 330 >> PAGE_SHIFT;
332 page_count = end - start; 331 page_count = end - start;
333 error = _xfs_buf_get_pages(bp, page_count, flags); 332 error = _xfs_buf_get_pages(bp, page_count);
334 if (unlikely(error)) 333 if (unlikely(error))
335 return error; 334 return error;
336 335
@@ -778,7 +777,7 @@ xfs_buf_associate_memory(
778 bp->b_pages = NULL; 777 bp->b_pages = NULL;
779 bp->b_addr = mem; 778 bp->b_addr = mem;
780 779
781 rval = _xfs_buf_get_pages(bp, page_count, 0); 780 rval = _xfs_buf_get_pages(bp, page_count);
782 if (rval) 781 if (rval)
783 return rval; 782 return rval;
784 783
@@ -811,7 +810,7 @@ xfs_buf_get_uncached(
811 goto fail; 810 goto fail;
812 811
813 page_count = PAGE_ALIGN(numblks << BBSHIFT) >> PAGE_SHIFT; 812 page_count = PAGE_ALIGN(numblks << BBSHIFT) >> PAGE_SHIFT;
814 error = _xfs_buf_get_pages(bp, page_count, 0); 813 error = _xfs_buf_get_pages(bp, page_count);
815 if (error) 814 if (error)
816 goto fail_free_buf; 815 goto fail_free_buf;
817 816
@@ -1615,7 +1614,6 @@ xfs_free_buftarg(
1615int 1614int
1616xfs_setsize_buftarg( 1615xfs_setsize_buftarg(
1617 xfs_buftarg_t *btp, 1616 xfs_buftarg_t *btp,
1618 unsigned int blocksize,
1619 unsigned int sectorsize) 1617 unsigned int sectorsize)
1620{ 1618{
1621 /* Set up metadata sector size info */ 1619 /* Set up metadata sector size info */
@@ -1650,16 +1648,13 @@ xfs_setsize_buftarg_early(
1650 xfs_buftarg_t *btp, 1648 xfs_buftarg_t *btp,
1651 struct block_device *bdev) 1649 struct block_device *bdev)
1652{ 1650{
1653 return xfs_setsize_buftarg(btp, PAGE_SIZE, 1651 return xfs_setsize_buftarg(btp, bdev_logical_block_size(bdev));
1654 bdev_logical_block_size(bdev));
1655} 1652}
1656 1653
1657xfs_buftarg_t * 1654xfs_buftarg_t *
1658xfs_alloc_buftarg( 1655xfs_alloc_buftarg(
1659 struct xfs_mount *mp, 1656 struct xfs_mount *mp,
1660 struct block_device *bdev, 1657 struct block_device *bdev)
1661 int external,
1662 const char *fsname)
1663{ 1658{
1664 xfs_buftarg_t *btp; 1659 xfs_buftarg_t *btp;
1665 1660
diff --git a/fs/xfs/xfs_buf.h b/fs/xfs/xfs_buf.h
index b8a3abf6cf47..0e47fd1fedba 100644
--- a/fs/xfs/xfs_buf.h
+++ b/fs/xfs/xfs_buf.h
@@ -387,10 +387,10 @@ xfs_buf_update_cksum(struct xfs_buf *bp, unsigned long cksum_offset)
387 * Handling of buftargs. 387 * Handling of buftargs.
388 */ 388 */
389extern xfs_buftarg_t *xfs_alloc_buftarg(struct xfs_mount *, 389extern xfs_buftarg_t *xfs_alloc_buftarg(struct xfs_mount *,
390 struct block_device *, int, const char *); 390 struct block_device *);
391extern void xfs_free_buftarg(struct xfs_mount *, struct xfs_buftarg *); 391extern void xfs_free_buftarg(struct xfs_mount *, struct xfs_buftarg *);
392extern void xfs_wait_buftarg(xfs_buftarg_t *); 392extern void xfs_wait_buftarg(xfs_buftarg_t *);
393extern int xfs_setsize_buftarg(xfs_buftarg_t *, unsigned int, unsigned int); 393extern int xfs_setsize_buftarg(xfs_buftarg_t *, unsigned int);
394 394
395#define xfs_getsize_buftarg(buftarg) block_size((buftarg)->bt_bdev) 395#define xfs_getsize_buftarg(buftarg) block_size((buftarg)->bt_bdev)
396#define xfs_readonly_buftarg(buftarg) bdev_read_only((buftarg)->bt_bdev) 396#define xfs_readonly_buftarg(buftarg) bdev_read_only((buftarg)->bt_bdev)
diff --git a/fs/xfs/xfs_buf_item.c b/fs/xfs/xfs_buf_item.c
index 8752821443be..64b17f5bed9a 100644
--- a/fs/xfs/xfs_buf_item.c
+++ b/fs/xfs/xfs_buf_item.c
@@ -812,7 +812,6 @@ xfs_buf_item_init(
812 */ 812 */
813static void 813static void
814xfs_buf_item_log_segment( 814xfs_buf_item_log_segment(
815 struct xfs_buf_log_item *bip,
816 uint first, 815 uint first,
817 uint last, 816 uint last,
818 uint *map) 817 uint *map)
@@ -920,7 +919,7 @@ xfs_buf_item_log(
920 if (end > last) 919 if (end > last)
921 end = last; 920 end = last;
922 921
923 xfs_buf_item_log_segment(bip, first, end, 922 xfs_buf_item_log_segment(first, end,
924 &bip->bli_formats[i].blf_data_map[0]); 923 &bip->bli_formats[i].blf_data_map[0]);
925 924
926 start += bp->b_maps[i].bm_len; 925 start += bp->b_maps[i].bm_len;
diff --git a/fs/xfs/xfs_da_btree.c b/fs/xfs/xfs_da_btree.c
index 6cc5f6785a77..9eec594cc25a 100644
--- a/fs/xfs/xfs_da_btree.c
+++ b/fs/xfs/xfs_da_btree.c
@@ -2462,7 +2462,6 @@ xfs_buf_map_from_irec(
2462 */ 2462 */
2463static int 2463static int
2464xfs_dabuf_map( 2464xfs_dabuf_map(
2465 struct xfs_trans *trans,
2466 struct xfs_inode *dp, 2465 struct xfs_inode *dp,
2467 xfs_dablk_t bno, 2466 xfs_dablk_t bno,
2468 xfs_daddr_t mappedbno, 2467 xfs_daddr_t mappedbno,
@@ -2558,7 +2557,7 @@ xfs_da_get_buf(
2558 *bpp = NULL; 2557 *bpp = NULL;
2559 mapp = &map; 2558 mapp = &map;
2560 nmap = 1; 2559 nmap = 1;
2561 error = xfs_dabuf_map(trans, dp, bno, mappedbno, whichfork, 2560 error = xfs_dabuf_map(dp, bno, mappedbno, whichfork,
2562 &mapp, &nmap); 2561 &mapp, &nmap);
2563 if (error) { 2562 if (error) {
2564 /* mapping a hole is not an error, but we don't continue */ 2563 /* mapping a hole is not an error, but we don't continue */
@@ -2606,7 +2605,7 @@ xfs_da_read_buf(
2606 *bpp = NULL; 2605 *bpp = NULL;
2607 mapp = &map; 2606 mapp = &map;
2608 nmap = 1; 2607 nmap = 1;
2609 error = xfs_dabuf_map(trans, dp, bno, mappedbno, whichfork, 2608 error = xfs_dabuf_map(dp, bno, mappedbno, whichfork,
2610 &mapp, &nmap); 2609 &mapp, &nmap);
2611 if (error) { 2610 if (error) {
2612 /* mapping a hole is not an error, but we don't continue */ 2611 /* mapping a hole is not an error, but we don't continue */
@@ -2679,7 +2678,6 @@ out_free:
2679 */ 2678 */
2680xfs_daddr_t 2679xfs_daddr_t
2681xfs_da_reada_buf( 2680xfs_da_reada_buf(
2682 struct xfs_trans *trans,
2683 struct xfs_inode *dp, 2681 struct xfs_inode *dp,
2684 xfs_dablk_t bno, 2682 xfs_dablk_t bno,
2685 xfs_daddr_t mappedbno, 2683 xfs_daddr_t mappedbno,
@@ -2693,7 +2691,7 @@ xfs_da_reada_buf(
2693 2691
2694 mapp = &map; 2692 mapp = &map;
2695 nmap = 1; 2693 nmap = 1;
2696 error = xfs_dabuf_map(trans, dp, bno, mappedbno, whichfork, 2694 error = xfs_dabuf_map(dp, bno, mappedbno, whichfork,
2697 &mapp, &nmap); 2695 &mapp, &nmap);
2698 if (error) { 2696 if (error) {
2699 /* mapping a hole is not an error, but we don't continue */ 2697 /* mapping a hole is not an error, but we don't continue */
diff --git a/fs/xfs/xfs_da_btree.h b/fs/xfs/xfs_da_btree.h
index 201c6091d26a..c824a0aa039f 100644
--- a/fs/xfs/xfs_da_btree.h
+++ b/fs/xfs/xfs_da_btree.h
@@ -185,9 +185,9 @@ int xfs_da_read_buf(struct xfs_trans *trans, struct xfs_inode *dp,
185 xfs_dablk_t bno, xfs_daddr_t mappedbno, 185 xfs_dablk_t bno, xfs_daddr_t mappedbno,
186 struct xfs_buf **bpp, int whichfork, 186 struct xfs_buf **bpp, int whichfork,
187 const struct xfs_buf_ops *ops); 187 const struct xfs_buf_ops *ops);
188xfs_daddr_t xfs_da_reada_buf(struct xfs_trans *trans, struct xfs_inode *dp, 188xfs_daddr_t xfs_da_reada_buf(struct xfs_inode *dp, xfs_dablk_t bno,
189 xfs_dablk_t bno, xfs_daddr_t mapped_bno, 189 xfs_daddr_t mapped_bno, int whichfork,
190 int whichfork, const struct xfs_buf_ops *ops); 190 const struct xfs_buf_ops *ops);
191int xfs_da_shrink_inode(xfs_da_args_t *args, xfs_dablk_t dead_blkno, 191int xfs_da_shrink_inode(xfs_da_args_t *args, xfs_dablk_t dead_blkno,
192 struct xfs_buf *dead_buf); 192 struct xfs_buf *dead_buf);
193 193
diff --git a/fs/xfs/xfs_da_format.h b/fs/xfs/xfs_da_format.h
index a19d3f8f639c..1432b576b4a7 100644
--- a/fs/xfs/xfs_da_format.h
+++ b/fs/xfs/xfs_da_format.h
@@ -541,7 +541,7 @@ xfs_dir2_leaf_bests_p(struct xfs_dir2_leaf_tail *ltp)
541 * Convert dataptr to byte in file space 541 * Convert dataptr to byte in file space
542 */ 542 */
543static inline xfs_dir2_off_t 543static inline xfs_dir2_off_t
544xfs_dir2_dataptr_to_byte(struct xfs_mount *mp, xfs_dir2_dataptr_t dp) 544xfs_dir2_dataptr_to_byte(xfs_dir2_dataptr_t dp)
545{ 545{
546 return (xfs_dir2_off_t)dp << XFS_DIR2_DATA_ALIGN_LOG; 546 return (xfs_dir2_off_t)dp << XFS_DIR2_DATA_ALIGN_LOG;
547} 547}
@@ -550,7 +550,7 @@ xfs_dir2_dataptr_to_byte(struct xfs_mount *mp, xfs_dir2_dataptr_t dp)
550 * Convert byte in file space to dataptr. It had better be aligned. 550 * Convert byte in file space to dataptr. It had better be aligned.
551 */ 551 */
552static inline xfs_dir2_dataptr_t 552static inline xfs_dir2_dataptr_t
553xfs_dir2_byte_to_dataptr(struct xfs_mount *mp, xfs_dir2_off_t by) 553xfs_dir2_byte_to_dataptr(xfs_dir2_off_t by)
554{ 554{
555 return (xfs_dir2_dataptr_t)(by >> XFS_DIR2_DATA_ALIGN_LOG); 555 return (xfs_dir2_dataptr_t)(by >> XFS_DIR2_DATA_ALIGN_LOG);
556} 556}
@@ -571,7 +571,7 @@ xfs_dir2_byte_to_db(struct xfs_mount *mp, xfs_dir2_off_t by)
571static inline xfs_dir2_db_t 571static inline xfs_dir2_db_t
572xfs_dir2_dataptr_to_db(struct xfs_mount *mp, xfs_dir2_dataptr_t dp) 572xfs_dir2_dataptr_to_db(struct xfs_mount *mp, xfs_dir2_dataptr_t dp)
573{ 573{
574 return xfs_dir2_byte_to_db(mp, xfs_dir2_dataptr_to_byte(mp, dp)); 574 return xfs_dir2_byte_to_db(mp, xfs_dir2_dataptr_to_byte(dp));
575} 575}
576 576
577/* 577/*
@@ -590,7 +590,7 @@ xfs_dir2_byte_to_off(struct xfs_mount *mp, xfs_dir2_off_t by)
590static inline xfs_dir2_data_aoff_t 590static inline xfs_dir2_data_aoff_t
591xfs_dir2_dataptr_to_off(struct xfs_mount *mp, xfs_dir2_dataptr_t dp) 591xfs_dir2_dataptr_to_off(struct xfs_mount *mp, xfs_dir2_dataptr_t dp)
592{ 592{
593 return xfs_dir2_byte_to_off(mp, xfs_dir2_dataptr_to_byte(mp, dp)); 593 return xfs_dir2_byte_to_off(mp, xfs_dir2_dataptr_to_byte(dp));
594} 594}
595 595
596/* 596/*
@@ -629,7 +629,7 @@ static inline xfs_dir2_dataptr_t
629xfs_dir2_db_off_to_dataptr(struct xfs_mount *mp, xfs_dir2_db_t db, 629xfs_dir2_db_off_to_dataptr(struct xfs_mount *mp, xfs_dir2_db_t db,
630 xfs_dir2_data_aoff_t o) 630 xfs_dir2_data_aoff_t o)
631{ 631{
632 return xfs_dir2_byte_to_dataptr(mp, xfs_dir2_db_off_to_byte(mp, db, o)); 632 return xfs_dir2_byte_to_dataptr(xfs_dir2_db_off_to_byte(mp, db, o));
633} 633}
634 634
635/* 635/*
diff --git a/fs/xfs/xfs_dir2.c b/fs/xfs/xfs_dir2.c
index fda46253966a..e365c98c0f1e 100644
--- a/fs/xfs/xfs_dir2.c
+++ b/fs/xfs/xfs_dir2.c
@@ -244,7 +244,7 @@ xfs_dir_createname(
244 goto out_free; 244 goto out_free;
245 } 245 }
246 246
247 rval = xfs_dir2_isblock(tp, dp, &v); 247 rval = xfs_dir2_isblock(dp, &v);
248 if (rval) 248 if (rval)
249 goto out_free; 249 goto out_free;
250 if (v) { 250 if (v) {
@@ -252,7 +252,7 @@ xfs_dir_createname(
252 goto out_free; 252 goto out_free;
253 } 253 }
254 254
255 rval = xfs_dir2_isleaf(tp, dp, &v); 255 rval = xfs_dir2_isleaf(dp, &v);
256 if (rval) 256 if (rval)
257 goto out_free; 257 goto out_free;
258 if (v) 258 if (v)
@@ -336,7 +336,7 @@ xfs_dir_lookup(
336 goto out_check_rval; 336 goto out_check_rval;
337 } 337 }
338 338
339 rval = xfs_dir2_isblock(tp, dp, &v); 339 rval = xfs_dir2_isblock(dp, &v);
340 if (rval) 340 if (rval)
341 goto out_free; 341 goto out_free;
342 if (v) { 342 if (v) {
@@ -344,7 +344,7 @@ xfs_dir_lookup(
344 goto out_check_rval; 344 goto out_check_rval;
345 } 345 }
346 346
347 rval = xfs_dir2_isleaf(tp, dp, &v); 347 rval = xfs_dir2_isleaf(dp, &v);
348 if (rval) 348 if (rval)
349 goto out_free; 349 goto out_free;
350 if (v) 350 if (v)
@@ -408,7 +408,7 @@ xfs_dir_removename(
408 goto out_free; 408 goto out_free;
409 } 409 }
410 410
411 rval = xfs_dir2_isblock(tp, dp, &v); 411 rval = xfs_dir2_isblock(dp, &v);
412 if (rval) 412 if (rval)
413 goto out_free; 413 goto out_free;
414 if (v) { 414 if (v) {
@@ -416,7 +416,7 @@ xfs_dir_removename(
416 goto out_free; 416 goto out_free;
417 } 417 }
418 418
419 rval = xfs_dir2_isleaf(tp, dp, &v); 419 rval = xfs_dir2_isleaf(dp, &v);
420 if (rval) 420 if (rval)
421 goto out_free; 421 goto out_free;
422 if (v) 422 if (v)
@@ -472,7 +472,7 @@ xfs_dir_replace(
472 goto out_free; 472 goto out_free;
473 } 473 }
474 474
475 rval = xfs_dir2_isblock(tp, dp, &v); 475 rval = xfs_dir2_isblock(dp, &v);
476 if (rval) 476 if (rval)
477 goto out_free; 477 goto out_free;
478 if (v) { 478 if (v) {
@@ -480,7 +480,7 @@ xfs_dir_replace(
480 goto out_free; 480 goto out_free;
481 } 481 }
482 482
483 rval = xfs_dir2_isleaf(tp, dp, &v); 483 rval = xfs_dir2_isleaf(dp, &v);
484 if (rval) 484 if (rval)
485 goto out_free; 485 goto out_free;
486 if (v) 486 if (v)
@@ -531,7 +531,7 @@ xfs_dir_canenter(
531 goto out_free; 531 goto out_free;
532 } 532 }
533 533
534 rval = xfs_dir2_isblock(tp, dp, &v); 534 rval = xfs_dir2_isblock(dp, &v);
535 if (rval) 535 if (rval)
536 goto out_free; 536 goto out_free;
537 if (v) { 537 if (v) {
@@ -539,7 +539,7 @@ xfs_dir_canenter(
539 goto out_free; 539 goto out_free;
540 } 540 }
541 541
542 rval = xfs_dir2_isleaf(tp, dp, &v); 542 rval = xfs_dir2_isleaf(dp, &v);
543 if (rval) 543 if (rval)
544 goto out_free; 544 goto out_free;
545 if (v) 545 if (v)
@@ -607,7 +607,6 @@ xfs_dir2_grow_inode(
607 */ 607 */
608int 608int
609xfs_dir2_isblock( 609xfs_dir2_isblock(
610 xfs_trans_t *tp,
611 xfs_inode_t *dp, 610 xfs_inode_t *dp,
612 int *vp) /* out: 1 is block, 0 is not block */ 611 int *vp) /* out: 1 is block, 0 is not block */
613{ 612{
@@ -616,7 +615,7 @@ xfs_dir2_isblock(
616 int rval; 615 int rval;
617 616
618 mp = dp->i_mount; 617 mp = dp->i_mount;
619 if ((rval = xfs_bmap_last_offset(tp, dp, &last, XFS_DATA_FORK))) 618 if ((rval = xfs_bmap_last_offset(dp, &last, XFS_DATA_FORK)))
620 return rval; 619 return rval;
621 rval = XFS_FSB_TO_B(mp, last) == mp->m_dirblksize; 620 rval = XFS_FSB_TO_B(mp, last) == mp->m_dirblksize;
622 ASSERT(rval == 0 || dp->i_d.di_size == mp->m_dirblksize); 621 ASSERT(rval == 0 || dp->i_d.di_size == mp->m_dirblksize);
@@ -629,7 +628,6 @@ xfs_dir2_isblock(
629 */ 628 */
630int 629int
631xfs_dir2_isleaf( 630xfs_dir2_isleaf(
632 xfs_trans_t *tp,
633 xfs_inode_t *dp, 631 xfs_inode_t *dp,
634 int *vp) /* out: 1 is leaf, 0 is not leaf */ 632 int *vp) /* out: 1 is leaf, 0 is not leaf */
635{ 633{
@@ -638,7 +636,7 @@ xfs_dir2_isleaf(
638 int rval; 636 int rval;
639 637
640 mp = dp->i_mount; 638 mp = dp->i_mount;
641 if ((rval = xfs_bmap_last_offset(tp, dp, &last, XFS_DATA_FORK))) 639 if ((rval = xfs_bmap_last_offset(dp, &last, XFS_DATA_FORK)))
642 return rval; 640 return rval;
643 *vp = last == mp->m_dirleafblk + (1 << mp->m_sb.sb_dirblklog); 641 *vp = last == mp->m_dirleafblk + (1 << mp->m_sb.sb_dirblklog);
644 return 0; 642 return 0;
diff --git a/fs/xfs/xfs_dir2.h b/fs/xfs/xfs_dir2.h
index cec70e0781ab..64a6b19c2fd0 100644
--- a/fs/xfs/xfs_dir2.h
+++ b/fs/xfs/xfs_dir2.h
@@ -142,8 +142,8 @@ extern int xfs_dir2_sf_to_block(struct xfs_da_args *args);
142/* 142/*
143 * Interface routines used by userspace utilities 143 * Interface routines used by userspace utilities
144 */ 144 */
145extern int xfs_dir2_isblock(struct xfs_trans *tp, struct xfs_inode *dp, int *r); 145extern int xfs_dir2_isblock(struct xfs_inode *dp, int *r);
146extern int xfs_dir2_isleaf(struct xfs_trans *tp, struct xfs_inode *dp, int *r); 146extern int xfs_dir2_isleaf(struct xfs_inode *dp, int *r);
147extern int xfs_dir2_shrink_inode(struct xfs_da_args *args, xfs_dir2_db_t db, 147extern int xfs_dir2_shrink_inode(struct xfs_da_args *args, xfs_dir2_db_t db,
148 struct xfs_buf *bp); 148 struct xfs_buf *bp);
149 149
diff --git a/fs/xfs/xfs_dir2_block.c b/fs/xfs/xfs_dir2_block.c
index 4f6a38cb83a4..dd9d00515582 100644
--- a/fs/xfs/xfs_dir2_block.c
+++ b/fs/xfs/xfs_dir2_block.c
@@ -319,7 +319,6 @@ xfs_dir2_block_compact(
319 (xfs_dir2_data_aoff_t)((char *)blp - (char *)hdr), 319 (xfs_dir2_data_aoff_t)((char *)blp - (char *)hdr),
320 (xfs_dir2_data_aoff_t)((be32_to_cpu(btp->stale) - 1) * sizeof(*blp)), 320 (xfs_dir2_data_aoff_t)((be32_to_cpu(btp->stale) - 1) * sizeof(*blp)),
321 needlog, &needscan); 321 needlog, &needscan);
322 blp += be32_to_cpu(btp->stale) - 1;
323 btp->stale = cpu_to_be32(1); 322 btp->stale = cpu_to_be32(1);
324 /* 323 /*
325 * If we now need to rebuild the bestfree map, do so. 324 * If we now need to rebuild the bestfree map, do so.
@@ -537,7 +536,7 @@ xfs_dir2_block_addname(
537 * Fill in the leaf entry. 536 * Fill in the leaf entry.
538 */ 537 */
539 blp[mid].hashval = cpu_to_be32(args->hashval); 538 blp[mid].hashval = cpu_to_be32(args->hashval);
540 blp[mid].address = cpu_to_be32(xfs_dir2_byte_to_dataptr(mp, 539 blp[mid].address = cpu_to_be32(xfs_dir2_byte_to_dataptr(
541 (char *)dep - (char *)hdr)); 540 (char *)dep - (char *)hdr));
542 xfs_dir2_block_log_leaf(tp, bp, lfloglow, lfloghigh); 541 xfs_dir2_block_log_leaf(tp, bp, lfloglow, lfloghigh);
543 /* 542 /*
@@ -1170,7 +1169,7 @@ xfs_dir2_sf_to_block(
1170 *tagp = cpu_to_be16((char *)dep - (char *)hdr); 1169 *tagp = cpu_to_be16((char *)dep - (char *)hdr);
1171 xfs_dir2_data_log_entry(tp, dp, bp, dep); 1170 xfs_dir2_data_log_entry(tp, dp, bp, dep);
1172 blp[0].hashval = cpu_to_be32(xfs_dir_hash_dot); 1171 blp[0].hashval = cpu_to_be32(xfs_dir_hash_dot);
1173 blp[0].address = cpu_to_be32(xfs_dir2_byte_to_dataptr(mp, 1172 blp[0].address = cpu_to_be32(xfs_dir2_byte_to_dataptr(
1174 (char *)dep - (char *)hdr)); 1173 (char *)dep - (char *)hdr));
1175 /* 1174 /*
1176 * Create entry for .. 1175 * Create entry for ..
@@ -1184,7 +1183,7 @@ xfs_dir2_sf_to_block(
1184 *tagp = cpu_to_be16((char *)dep - (char *)hdr); 1183 *tagp = cpu_to_be16((char *)dep - (char *)hdr);
1185 xfs_dir2_data_log_entry(tp, dp, bp, dep); 1184 xfs_dir2_data_log_entry(tp, dp, bp, dep);
1186 blp[1].hashval = cpu_to_be32(xfs_dir_hash_dotdot); 1185 blp[1].hashval = cpu_to_be32(xfs_dir_hash_dotdot);
1187 blp[1].address = cpu_to_be32(xfs_dir2_byte_to_dataptr(mp, 1186 blp[1].address = cpu_to_be32(xfs_dir2_byte_to_dataptr(
1188 (char *)dep - (char *)hdr)); 1187 (char *)dep - (char *)hdr));
1189 offset = dp->d_ops->data_first_offset; 1188 offset = dp->d_ops->data_first_offset;
1190 /* 1189 /*
@@ -1238,7 +1237,7 @@ xfs_dir2_sf_to_block(
1238 name.len = sfep->namelen; 1237 name.len = sfep->namelen;
1239 blp[2 + i].hashval = cpu_to_be32(mp->m_dirnameops-> 1238 blp[2 + i].hashval = cpu_to_be32(mp->m_dirnameops->
1240 hashname(&name)); 1239 hashname(&name));
1241 blp[2 + i].address = cpu_to_be32(xfs_dir2_byte_to_dataptr(mp, 1240 blp[2 + i].address = cpu_to_be32(xfs_dir2_byte_to_dataptr(
1242 (char *)dep - (char *)hdr)); 1241 (char *)dep - (char *)hdr));
1243 offset = (int)((char *)(tagp + 1) - (char *)hdr); 1242 offset = (int)((char *)(tagp + 1) - (char *)hdr);
1244 if (++i == sfp->count) 1243 if (++i == sfp->count)
diff --git a/fs/xfs/xfs_dir2_data.c b/fs/xfs/xfs_dir2_data.c
index afa4ad523f3f..bae8b5b8d1c2 100644
--- a/fs/xfs/xfs_dir2_data.c
+++ b/fs/xfs/xfs_dir2_data.c
@@ -329,12 +329,11 @@ xfs_dir3_data_read(
329 329
330int 330int
331xfs_dir3_data_readahead( 331xfs_dir3_data_readahead(
332 struct xfs_trans *tp,
333 struct xfs_inode *dp, 332 struct xfs_inode *dp,
334 xfs_dablk_t bno, 333 xfs_dablk_t bno,
335 xfs_daddr_t mapped_bno) 334 xfs_daddr_t mapped_bno)
336{ 335{
337 return xfs_da_reada_buf(tp, dp, bno, mapped_bno, 336 return xfs_da_reada_buf(dp, bno, mapped_bno,
338 XFS_DATA_FORK, &xfs_dir3_data_reada_buf_ops); 337 XFS_DATA_FORK, &xfs_dir3_data_reada_buf_ops);
339} 338}
340 339
diff --git a/fs/xfs/xfs_dir2_leaf.c b/fs/xfs/xfs_dir2_leaf.c
index d36e97df1187..f571723e2378 100644
--- a/fs/xfs/xfs_dir2_leaf.c
+++ b/fs/xfs/xfs_dir2_leaf.c
@@ -1708,7 +1708,7 @@ xfs_dir2_node_to_leaf(
1708 /* 1708 /*
1709 * Get the last offset in the file. 1709 * Get the last offset in the file.
1710 */ 1710 */
1711 if ((error = xfs_bmap_last_offset(tp, dp, &fo, XFS_DATA_FORK))) { 1711 if ((error = xfs_bmap_last_offset(dp, &fo, XFS_DATA_FORK))) {
1712 return error; 1712 return error;
1713 } 1713 }
1714 fo -= mp->m_dirblkfsbs; 1714 fo -= mp->m_dirblkfsbs;
diff --git a/fs/xfs/xfs_dir2_node.c b/fs/xfs/xfs_dir2_node.c
index cb434d732681..9cb91ee0914b 100644
--- a/fs/xfs/xfs_dir2_node.c
+++ b/fs/xfs/xfs_dir2_node.c
@@ -1727,7 +1727,7 @@ xfs_dir2_node_addname_int(
1727 if (dbno == -1) { 1727 if (dbno == -1) {
1728 xfs_fileoff_t fo; /* freespace block number */ 1728 xfs_fileoff_t fo; /* freespace block number */
1729 1729
1730 if ((error = xfs_bmap_last_offset(tp, dp, &fo, XFS_DATA_FORK))) 1730 if ((error = xfs_bmap_last_offset(dp, &fo, XFS_DATA_FORK)))
1731 return error; 1731 return error;
1732 lastfbno = xfs_dir2_da_to_db(mp, (xfs_dablk_t)fo); 1732 lastfbno = xfs_dir2_da_to_db(mp, (xfs_dablk_t)fo);
1733 fbno = ifbno; 1733 fbno = ifbno;
diff --git a/fs/xfs/xfs_dir2_priv.h b/fs/xfs/xfs_dir2_priv.h
index 8b9d2281f85b..2429960739e9 100644
--- a/fs/xfs/xfs_dir2_priv.h
+++ b/fs/xfs/xfs_dir2_priv.h
@@ -54,8 +54,8 @@ extern int xfs_dir2_leaf_to_block(struct xfs_da_args *args,
54extern int __xfs_dir3_data_check(struct xfs_inode *dp, struct xfs_buf *bp); 54extern int __xfs_dir3_data_check(struct xfs_inode *dp, struct xfs_buf *bp);
55extern int xfs_dir3_data_read(struct xfs_trans *tp, struct xfs_inode *dp, 55extern int xfs_dir3_data_read(struct xfs_trans *tp, struct xfs_inode *dp,
56 xfs_dablk_t bno, xfs_daddr_t mapped_bno, struct xfs_buf **bpp); 56 xfs_dablk_t bno, xfs_daddr_t mapped_bno, struct xfs_buf **bpp);
57extern int xfs_dir3_data_readahead(struct xfs_trans *tp, struct xfs_inode *dp, 57extern int xfs_dir3_data_readahead(struct xfs_inode *dp, xfs_dablk_t bno,
58 xfs_dablk_t bno, xfs_daddr_t mapped_bno); 58 xfs_daddr_t mapped_bno);
59 59
60extern struct xfs_dir2_data_free * 60extern struct xfs_dir2_data_free *
61xfs_dir2_data_freeinsert(struct xfs_dir2_data_hdr *hdr, 61xfs_dir2_data_freeinsert(struct xfs_dir2_data_hdr *hdr,
diff --git a/fs/xfs/xfs_dir2_readdir.c b/fs/xfs/xfs_dir2_readdir.c
index aead369e1c30..50b72f7b8787 100644
--- a/fs/xfs/xfs_dir2_readdir.c
+++ b/fs/xfs/xfs_dir2_readdir.c
@@ -434,7 +434,7 @@ xfs_dir2_leaf_readbuf(
434 */ 434 */
435 if (i > mip->ra_current && 435 if (i > mip->ra_current &&
436 map[mip->ra_index].br_blockcount >= mp->m_dirblkfsbs) { 436 map[mip->ra_index].br_blockcount >= mp->m_dirblkfsbs) {
437 xfs_dir3_data_readahead(NULL, dp, 437 xfs_dir3_data_readahead(dp,
438 map[mip->ra_index].br_startoff + mip->ra_offset, 438 map[mip->ra_index].br_startoff + mip->ra_offset,
439 XFS_FSB_TO_DADDR(mp, 439 XFS_FSB_TO_DADDR(mp,
440 map[mip->ra_index].br_startblock + 440 map[mip->ra_index].br_startblock +
@@ -447,7 +447,7 @@ xfs_dir2_leaf_readbuf(
447 * use our mapping, but this is a very rare case. 447 * use our mapping, but this is a very rare case.
448 */ 448 */
449 else if (i > mip->ra_current) { 449 else if (i > mip->ra_current) {
450 xfs_dir3_data_readahead(NULL, dp, 450 xfs_dir3_data_readahead(dp,
451 map[mip->ra_index].br_startoff + 451 map[mip->ra_index].br_startoff +
452 mip->ra_offset, -1); 452 mip->ra_offset, -1);
453 mip->ra_current = i; 453 mip->ra_current = i;
@@ -531,7 +531,7 @@ xfs_dir2_leaf_getdents(
531 * Inside the loop we keep the main offset value as a byte offset 531 * Inside the loop we keep the main offset value as a byte offset
532 * in the directory file. 532 * in the directory file.
533 */ 533 */
534 curoff = xfs_dir2_dataptr_to_byte(mp, ctx->pos); 534 curoff = xfs_dir2_dataptr_to_byte(ctx->pos);
535 535
536 /* 536 /*
537 * Force this conversion through db so we truncate the offset 537 * Force this conversion through db so we truncate the offset
@@ -635,7 +635,7 @@ xfs_dir2_leaf_getdents(
635 length = dp->d_ops->data_entsize(dep->namelen); 635 length = dp->d_ops->data_entsize(dep->namelen);
636 filetype = dp->d_ops->data_get_ftype(dep); 636 filetype = dp->d_ops->data_get_ftype(dep);
637 637
638 ctx->pos = xfs_dir2_byte_to_dataptr(mp, curoff) & 0x7fffffff; 638 ctx->pos = xfs_dir2_byte_to_dataptr(curoff) & 0x7fffffff;
639 if (!dir_emit(ctx, (char *)dep->name, dep->namelen, 639 if (!dir_emit(ctx, (char *)dep->name, dep->namelen,
640 be64_to_cpu(dep->inumber), 640 be64_to_cpu(dep->inumber),
641 xfs_dir3_get_dtype(mp, filetype))) 641 xfs_dir3_get_dtype(mp, filetype)))
@@ -653,10 +653,10 @@ xfs_dir2_leaf_getdents(
653 /* 653 /*
654 * All done. Set output offset value to current offset. 654 * All done. Set output offset value to current offset.
655 */ 655 */
656 if (curoff > xfs_dir2_dataptr_to_byte(mp, XFS_DIR2_MAX_DATAPTR)) 656 if (curoff > xfs_dir2_dataptr_to_byte(XFS_DIR2_MAX_DATAPTR))
657 ctx->pos = XFS_DIR2_MAX_DATAPTR & 0x7fffffff; 657 ctx->pos = XFS_DIR2_MAX_DATAPTR & 0x7fffffff;
658 else 658 else
659 ctx->pos = xfs_dir2_byte_to_dataptr(mp, curoff) & 0x7fffffff; 659 ctx->pos = xfs_dir2_byte_to_dataptr(curoff) & 0x7fffffff;
660 kmem_free(map_info); 660 kmem_free(map_info);
661 if (bp) 661 if (bp)
662 xfs_trans_brelse(NULL, bp); 662 xfs_trans_brelse(NULL, bp);
@@ -687,7 +687,7 @@ xfs_readdir(
687 lock_mode = xfs_ilock_data_map_shared(dp); 687 lock_mode = xfs_ilock_data_map_shared(dp);
688 if (dp->i_d.di_format == XFS_DINODE_FMT_LOCAL) 688 if (dp->i_d.di_format == XFS_DINODE_FMT_LOCAL)
689 rval = xfs_dir2_sf_getdents(dp, ctx); 689 rval = xfs_dir2_sf_getdents(dp, ctx);
690 else if ((rval = xfs_dir2_isblock(NULL, dp, &v))) 690 else if ((rval = xfs_dir2_isblock(dp, &v)))
691 ; 691 ;
692 else if (v) 692 else if (v)
693 rval = xfs_dir2_block_getdents(dp, ctx); 693 rval = xfs_dir2_block_getdents(dp, ctx);
diff --git a/fs/xfs/xfs_dir2_sf.c b/fs/xfs/xfs_dir2_sf.c
index 3725fb1b902b..7aab8ec117ad 100644
--- a/fs/xfs/xfs_dir2_sf.c
+++ b/fs/xfs/xfs_dir2_sf.c
@@ -285,14 +285,12 @@ int /* error */
285xfs_dir2_sf_addname( 285xfs_dir2_sf_addname(
286 xfs_da_args_t *args) /* operation arguments */ 286 xfs_da_args_t *args) /* operation arguments */
287{ 287{
288 int add_entsize; /* size of the new entry */
289 xfs_inode_t *dp; /* incore directory inode */ 288 xfs_inode_t *dp; /* incore directory inode */
290 int error; /* error return value */ 289 int error; /* error return value */
291 int incr_isize; /* total change in size */ 290 int incr_isize; /* total change in size */
292 int new_isize; /* di_size after adding name */ 291 int new_isize; /* di_size after adding name */
293 int objchange; /* changing to 8-byte inodes */ 292 int objchange; /* changing to 8-byte inodes */
294 xfs_dir2_data_aoff_t offset = 0; /* offset for new entry */ 293 xfs_dir2_data_aoff_t offset = 0; /* offset for new entry */
295 int old_isize; /* di_size before adding name */
296 int pick; /* which algorithm to use */ 294 int pick; /* which algorithm to use */
297 xfs_dir2_sf_hdr_t *sfp; /* shortform structure */ 295 xfs_dir2_sf_hdr_t *sfp; /* shortform structure */
298 xfs_dir2_sf_entry_t *sfep = NULL; /* shortform entry */ 296 xfs_dir2_sf_entry_t *sfep = NULL; /* shortform entry */
@@ -316,8 +314,7 @@ xfs_dir2_sf_addname(
316 /* 314 /*
317 * Compute entry (and change in) size. 315 * Compute entry (and change in) size.
318 */ 316 */
319 add_entsize = dp->d_ops->sf_entsize(sfp, args->namelen); 317 incr_isize = dp->d_ops->sf_entsize(sfp, args->namelen);
320 incr_isize = add_entsize;
321 objchange = 0; 318 objchange = 0;
322#if XFS_BIG_INUMS 319#if XFS_BIG_INUMS
323 /* 320 /*
@@ -325,11 +322,8 @@ xfs_dir2_sf_addname(
325 */ 322 */
326 if (args->inumber > XFS_DIR2_MAX_SHORT_INUM && sfp->i8count == 0) { 323 if (args->inumber > XFS_DIR2_MAX_SHORT_INUM && sfp->i8count == 0) {
327 /* 324 /*
328 * Yes, adjust the entry size and the total size. 325 * Yes, adjust the inode size. old count + (parent + new)
329 */ 326 */
330 add_entsize +=
331 (uint)sizeof(xfs_dir2_ino8_t) -
332 (uint)sizeof(xfs_dir2_ino4_t);
333 incr_isize += 327 incr_isize +=
334 (sfp->count + 2) * 328 (sfp->count + 2) *
335 ((uint)sizeof(xfs_dir2_ino8_t) - 329 ((uint)sizeof(xfs_dir2_ino8_t) -
@@ -337,8 +331,7 @@ xfs_dir2_sf_addname(
337 objchange = 1; 331 objchange = 1;
338 } 332 }
339#endif 333#endif
340 old_isize = (int)dp->i_d.di_size; 334 new_isize = (int)dp->i_d.di_size + incr_isize;
341 new_isize = old_isize + incr_isize;
342 /* 335 /*
343 * Won't fit as shortform any more (due to size), 336 * Won't fit as shortform any more (due to size),
344 * or the pick routine says it won't (due to offset values). 337 * or the pick routine says it won't (due to offset values).
@@ -1110,9 +1103,9 @@ xfs_dir2_sf_toino4(
1110} 1103}
1111 1104
1112/* 1105/*
1113 * Convert from 4-byte inode numbers to 8-byte inode numbers. 1106 * Convert existing entries from 4-byte inode numbers to 8-byte inode numbers.
1114 * The new 8-byte inode number is not there yet, we leave with the 1107 * The new entry w/ an 8-byte inode number is not there yet; we leave with
1115 * count 1 but no corresponding entry. 1108 * i8count set to 1, but no corresponding 8-byte entry.
1116 */ 1109 */
1117static void 1110static void
1118xfs_dir2_sf_toino8( 1111xfs_dir2_sf_toino8(
@@ -1145,7 +1138,7 @@ xfs_dir2_sf_toino8(
1145 ASSERT(oldsfp->i8count == 0); 1138 ASSERT(oldsfp->i8count == 0);
1146 memcpy(buf, oldsfp, oldsize); 1139 memcpy(buf, oldsfp, oldsize);
1147 /* 1140 /*
1148 * Compute the new inode size. 1141 * Compute the new inode size (nb: entry count + 1 for parent)
1149 */ 1142 */
1150 newsize = 1143 newsize =
1151 oldsize + 1144 oldsize +
diff --git a/fs/xfs/xfs_dquot_buf.c b/fs/xfs/xfs_dquot_buf.c
index 610da8177737..c2ac0c611ad8 100644
--- a/fs/xfs/xfs_dquot_buf.c
+++ b/fs/xfs/xfs_dquot_buf.c
@@ -35,7 +35,6 @@
35 35
36int 36int
37xfs_calc_dquots_per_chunk( 37xfs_calc_dquots_per_chunk(
38 struct xfs_mount *mp,
39 unsigned int nbblks) /* basic block units */ 38 unsigned int nbblks) /* basic block units */
40{ 39{
41 unsigned int ndquots; 40 unsigned int ndquots;
@@ -194,7 +193,7 @@ xfs_dquot_buf_verify_crc(
194 if (mp->m_quotainfo) 193 if (mp->m_quotainfo)
195 ndquots = mp->m_quotainfo->qi_dqperchunk; 194 ndquots = mp->m_quotainfo->qi_dqperchunk;
196 else 195 else
197 ndquots = xfs_calc_dquots_per_chunk(mp, 196 ndquots = xfs_calc_dquots_per_chunk(
198 XFS_BB_TO_FSB(mp, bp->b_length)); 197 XFS_BB_TO_FSB(mp, bp->b_length));
199 198
200 for (i = 0; i < ndquots; i++, d++) { 199 for (i = 0; i < ndquots; i++, d++) {
@@ -225,7 +224,7 @@ xfs_dquot_buf_verify(
225 if (mp->m_quotainfo) 224 if (mp->m_quotainfo)
226 ndquots = mp->m_quotainfo->qi_dqperchunk; 225 ndquots = mp->m_quotainfo->qi_dqperchunk;
227 else 226 else
228 ndquots = xfs_calc_dquots_per_chunk(mp, bp->b_length); 227 ndquots = xfs_calc_dquots_per_chunk(bp->b_length);
229 228
230 /* 229 /*
231 * On the first read of the buffer, verify that each dquot is valid. 230 * On the first read of the buffer, verify that each dquot is valid.
diff --git a/fs/xfs/xfs_file.c b/fs/xfs/xfs_file.c
index 830c1c937b88..1b8160dc04d1 100644
--- a/fs/xfs/xfs_file.c
+++ b/fs/xfs/xfs_file.c
@@ -944,7 +944,7 @@ xfs_dir_open(
944 */ 944 */
945 mode = xfs_ilock_data_map_shared(ip); 945 mode = xfs_ilock_data_map_shared(ip);
946 if (ip->i_d.di_nextents > 0) 946 if (ip->i_d.di_nextents > 0)
947 xfs_dir3_data_readahead(NULL, ip, 0, -1); 947 xfs_dir3_data_readahead(ip, 0, -1);
948 xfs_iunlock(ip, mode); 948 xfs_iunlock(ip, mode);
949 return 0; 949 return 0;
950} 950}
diff --git a/fs/xfs/xfs_ialloc_btree.c b/fs/xfs/xfs_ialloc_btree.c
index 7e309b11e87d..f1630ff619dd 100644
--- a/fs/xfs/xfs_ialloc_btree.c
+++ b/fs/xfs/xfs_ialloc_btree.c
@@ -71,7 +71,6 @@ xfs_inobt_alloc_block(
71 struct xfs_btree_cur *cur, 71 struct xfs_btree_cur *cur,
72 union xfs_btree_ptr *start, 72 union xfs_btree_ptr *start,
73 union xfs_btree_ptr *new, 73 union xfs_btree_ptr *new,
74 int length,
75 int *stat) 74 int *stat)
76{ 75{
77 xfs_alloc_arg_t args; /* block allocation args */ 76 xfs_alloc_arg_t args; /* block allocation args */
diff --git a/fs/xfs/xfs_icache.c b/fs/xfs/xfs_icache.c
index 98d35244eecc..c48df5f25b9f 100644
--- a/fs/xfs/xfs_icache.c
+++ b/fs/xfs/xfs_icache.c
@@ -507,8 +507,7 @@ STATIC int
507xfs_inode_ag_walk( 507xfs_inode_ag_walk(
508 struct xfs_mount *mp, 508 struct xfs_mount *mp,
509 struct xfs_perag *pag, 509 struct xfs_perag *pag,
510 int (*execute)(struct xfs_inode *ip, 510 int (*execute)(struct xfs_inode *ip, int flags,
511 struct xfs_perag *pag, int flags,
512 void *args), 511 void *args),
513 int flags, 512 int flags,
514 void *args, 513 void *args,
@@ -582,7 +581,7 @@ restart:
582 for (i = 0; i < nr_found; i++) { 581 for (i = 0; i < nr_found; i++) {
583 if (!batch[i]) 582 if (!batch[i])
584 continue; 583 continue;
585 error = execute(batch[i], pag, flags, args); 584 error = execute(batch[i], flags, args);
586 IRELE(batch[i]); 585 IRELE(batch[i]);
587 if (error == EAGAIN) { 586 if (error == EAGAIN) {
588 skipped++; 587 skipped++;
@@ -636,8 +635,7 @@ xfs_eofblocks_worker(
636int 635int
637xfs_inode_ag_iterator( 636xfs_inode_ag_iterator(
638 struct xfs_mount *mp, 637 struct xfs_mount *mp,
639 int (*execute)(struct xfs_inode *ip, 638 int (*execute)(struct xfs_inode *ip, int flags,
640 struct xfs_perag *pag, int flags,
641 void *args), 639 void *args),
642 int flags, 640 int flags,
643 void *args) 641 void *args)
@@ -664,8 +662,7 @@ xfs_inode_ag_iterator(
664int 662int
665xfs_inode_ag_iterator_tag( 663xfs_inode_ag_iterator_tag(
666 struct xfs_mount *mp, 664 struct xfs_mount *mp,
667 int (*execute)(struct xfs_inode *ip, 665 int (*execute)(struct xfs_inode *ip, int flags,
668 struct xfs_perag *pag, int flags,
669 void *args), 666 void *args),
670 int flags, 667 int flags,
671 void *args, 668 void *args,
@@ -1209,7 +1206,6 @@ xfs_inode_match_id(
1209STATIC int 1206STATIC int
1210xfs_inode_free_eofblocks( 1207xfs_inode_free_eofblocks(
1211 struct xfs_inode *ip, 1208 struct xfs_inode *ip,
1212 struct xfs_perag *pag,
1213 int flags, 1209 int flags,
1214 void *args) 1210 void *args)
1215{ 1211{
diff --git a/fs/xfs/xfs_icache.h b/fs/xfs/xfs_icache.h
index 9ed68bb750f5..9cf017b899be 100644
--- a/fs/xfs/xfs_icache.h
+++ b/fs/xfs/xfs_icache.h
@@ -60,12 +60,10 @@ int xfs_icache_free_eofblocks(struct xfs_mount *, struct xfs_eofblocks *);
60void xfs_eofblocks_worker(struct work_struct *); 60void xfs_eofblocks_worker(struct work_struct *);
61 61
62int xfs_inode_ag_iterator(struct xfs_mount *mp, 62int xfs_inode_ag_iterator(struct xfs_mount *mp,
63 int (*execute)(struct xfs_inode *ip, struct xfs_perag *pag, 63 int (*execute)(struct xfs_inode *ip, int flags, void *args),
64 int flags, void *args),
65 int flags, void *args); 64 int flags, void *args);
66int xfs_inode_ag_iterator_tag(struct xfs_mount *mp, 65int xfs_inode_ag_iterator_tag(struct xfs_mount *mp,
67 int (*execute)(struct xfs_inode *ip, struct xfs_perag *pag, 66 int (*execute)(struct xfs_inode *ip, int flags, void *args),
68 int flags, void *args),
69 int flags, void *args, int tag); 67 int flags, void *args, int tag);
70 68
71static inline int 69static inline int
diff --git a/fs/xfs/xfs_inode.c b/fs/xfs/xfs_inode.c
index 768087bedbac..4e3b7ad7ac8f 100644
--- a/fs/xfs/xfs_inode.c
+++ b/fs/xfs/xfs_inode.c
@@ -3372,9 +3372,9 @@ xfs_iflush_int(
3372 } 3372 }
3373 } 3373 }
3374 3374
3375 xfs_iflush_fork(ip, dip, iip, XFS_DATA_FORK, bp); 3375 xfs_iflush_fork(ip, dip, iip, XFS_DATA_FORK);
3376 if (XFS_IFORK_Q(ip)) 3376 if (XFS_IFORK_Q(ip))
3377 xfs_iflush_fork(ip, dip, iip, XFS_ATTR_FORK, bp); 3377 xfs_iflush_fork(ip, dip, iip, XFS_ATTR_FORK);
3378 xfs_inobp_check(mp, bp); 3378 xfs_inobp_check(mp, bp);
3379 3379
3380 /* 3380 /*
diff --git a/fs/xfs/xfs_inode_fork.c b/fs/xfs/xfs_inode_fork.c
index 73514c0486b7..b031e8d0d928 100644
--- a/fs/xfs/xfs_inode_fork.c
+++ b/fs/xfs/xfs_inode_fork.c
@@ -798,8 +798,7 @@ xfs_iflush_fork(
798 xfs_inode_t *ip, 798 xfs_inode_t *ip,
799 xfs_dinode_t *dip, 799 xfs_dinode_t *dip,
800 xfs_inode_log_item_t *iip, 800 xfs_inode_log_item_t *iip,
801 int whichfork, 801 int whichfork)
802 xfs_buf_t *bp)
803{ 802{
804 char *cp; 803 char *cp;
805 xfs_ifork_t *ifp; 804 xfs_ifork_t *ifp;
diff --git a/fs/xfs/xfs_inode_fork.h b/fs/xfs/xfs_inode_fork.h
index eb329a1ea888..7d3b1ed6dcbe 100644
--- a/fs/xfs/xfs_inode_fork.h
+++ b/fs/xfs/xfs_inode_fork.h
@@ -127,8 +127,7 @@ typedef struct xfs_ifork {
127 127
128int xfs_iformat_fork(struct xfs_inode *, struct xfs_dinode *); 128int xfs_iformat_fork(struct xfs_inode *, struct xfs_dinode *);
129void xfs_iflush_fork(struct xfs_inode *, struct xfs_dinode *, 129void xfs_iflush_fork(struct xfs_inode *, struct xfs_dinode *,
130 struct xfs_inode_log_item *, int, 130 struct xfs_inode_log_item *, int);
131 struct xfs_buf *);
132void xfs_idestroy_fork(struct xfs_inode *, int); 131void xfs_idestroy_fork(struct xfs_inode *, int);
133void xfs_idata_realloc(struct xfs_inode *, int, int); 132void xfs_idata_realloc(struct xfs_inode *, int, int);
134void xfs_iroot_realloc(struct xfs_inode *, int, int); 133void xfs_iroot_realloc(struct xfs_inode *, int, int);
diff --git a/fs/xfs/xfs_iomap.c b/fs/xfs/xfs_iomap.c
index 3b80ebae05f5..6c5eb4c551e3 100644
--- a/fs/xfs/xfs_iomap.c
+++ b/fs/xfs/xfs_iomap.c
@@ -730,7 +730,7 @@ xfs_iomap_write_allocate(
730 */ 730 */
731 nimaps = 1; 731 nimaps = 1;
732 end_fsb = XFS_B_TO_FSB(mp, XFS_ISIZE(ip)); 732 end_fsb = XFS_B_TO_FSB(mp, XFS_ISIZE(ip));
733 error = xfs_bmap_last_offset(NULL, ip, &last_block, 733 error = xfs_bmap_last_offset(ip, &last_block,
734 XFS_DATA_FORK); 734 XFS_DATA_FORK);
735 if (error) 735 if (error)
736 goto trans_cancel; 736 goto trans_cancel;
diff --git a/fs/xfs/xfs_log_recover.c b/fs/xfs/xfs_log_recover.c
index bce53ac81096..690a64d4444e 100644
--- a/fs/xfs/xfs_log_recover.c
+++ b/fs/xfs/xfs_log_recover.c
@@ -3145,7 +3145,7 @@ xlog_recover_efd_pass2(
3145 } 3145 }
3146 lip = xfs_trans_ail_cursor_next(ailp, &cur); 3146 lip = xfs_trans_ail_cursor_next(ailp, &cur);
3147 } 3147 }
3148 xfs_trans_ail_cursor_done(ailp, &cur); 3148 xfs_trans_ail_cursor_done(&cur);
3149 spin_unlock(&ailp->xa_lock); 3149 spin_unlock(&ailp->xa_lock);
3150 3150
3151 return 0; 3151 return 0;
@@ -3520,8 +3520,7 @@ out:
3520 3520
3521STATIC int 3521STATIC int
3522xlog_recover_unmount_trans( 3522xlog_recover_unmount_trans(
3523 struct xlog *log, 3523 struct xlog *log)
3524 struct xlog_recover *trans)
3525{ 3524{
3526 /* Do nothing now */ 3525 /* Do nothing now */
3527 xfs_warn(log->l_mp, "%s: Unmount LR", __func__); 3526 xfs_warn(log->l_mp, "%s: Unmount LR", __func__);
@@ -3595,7 +3594,7 @@ xlog_recover_process_data(
3595 trans, pass); 3594 trans, pass);
3596 break; 3595 break;
3597 case XLOG_UNMOUNT_TRANS: 3596 case XLOG_UNMOUNT_TRANS:
3598 error = xlog_recover_unmount_trans(log, trans); 3597 error = xlog_recover_unmount_trans(log);
3599 break; 3598 break;
3600 case XLOG_WAS_CONT_TRANS: 3599 case XLOG_WAS_CONT_TRANS:
3601 error = xlog_recover_add_to_cont_trans(log, 3600 error = xlog_recover_add_to_cont_trans(log,
@@ -3757,7 +3756,7 @@ xlog_recover_process_efis(
3757 lip = xfs_trans_ail_cursor_next(ailp, &cur); 3756 lip = xfs_trans_ail_cursor_next(ailp, &cur);
3758 } 3757 }
3759out: 3758out:
3760 xfs_trans_ail_cursor_done(ailp, &cur); 3759 xfs_trans_ail_cursor_done(&cur);
3761 spin_unlock(&ailp->xa_lock); 3760 spin_unlock(&ailp->xa_lock);
3762 return error; 3761 return error;
3763} 3762}
diff --git a/fs/xfs/xfs_qm.c b/fs/xfs/xfs_qm.c
index dc977b6e6a36..061fad7ca820 100644
--- a/fs/xfs/xfs_qm.c
+++ b/fs/xfs/xfs_qm.c
@@ -865,8 +865,7 @@ xfs_qm_init_quotainfo(
865 865
866 /* Precalc some constants */ 866 /* Precalc some constants */
867 qinf->qi_dqchunklen = XFS_FSB_TO_BB(mp, XFS_DQUOT_CLUSTER_SIZE_FSB); 867 qinf->qi_dqchunklen = XFS_FSB_TO_BB(mp, XFS_DQUOT_CLUSTER_SIZE_FSB);
868 qinf->qi_dqperchunk = xfs_calc_dquots_per_chunk(mp, 868 qinf->qi_dqperchunk = xfs_calc_dquots_per_chunk(qinf->qi_dqchunklen);
869 qinf->qi_dqchunklen);
870 869
871 mp->m_qflags |= (mp->m_sb.sb_qflags & XFS_ALL_QUOTA_CHKD); 870 mp->m_qflags |= (mp->m_sb.sb_qflags & XFS_ALL_QUOTA_CHKD);
872 871
diff --git a/fs/xfs/xfs_qm_syscalls.c b/fs/xfs/xfs_qm_syscalls.c
index 3daf5ea1eb8d..72cbe65e5e75 100644
--- a/fs/xfs/xfs_qm_syscalls.c
+++ b/fs/xfs/xfs_qm_syscalls.c
@@ -959,7 +959,6 @@ xfs_qm_export_flags(
959STATIC int 959STATIC int
960xfs_dqrele_inode( 960xfs_dqrele_inode(
961 struct xfs_inode *ip, 961 struct xfs_inode *ip,
962 struct xfs_perag *pag,
963 int flags, 962 int flags,
964 void *args) 963 void *args)
965{ 964{
diff --git a/fs/xfs/xfs_quota_defs.h b/fs/xfs/xfs_quota_defs.h
index b3b2b1065c0f..137e20937077 100644
--- a/fs/xfs/xfs_quota_defs.h
+++ b/fs/xfs/xfs_quota_defs.h
@@ -156,6 +156,6 @@ typedef __uint16_t xfs_qwarncnt_t;
156 156
157extern int xfs_dqcheck(struct xfs_mount *mp, xfs_disk_dquot_t *ddq, 157extern int xfs_dqcheck(struct xfs_mount *mp, xfs_disk_dquot_t *ddq,
158 xfs_dqid_t id, uint type, uint flags, char *str); 158 xfs_dqid_t id, uint type, uint flags, char *str);
159extern int xfs_calc_dquots_per_chunk(struct xfs_mount *mp, unsigned int nbblks); 159extern int xfs_calc_dquots_per_chunk(unsigned int nbblks);
160 160
161#endif /* __XFS_QUOTA_H__ */ 161#endif /* __XFS_QUOTA_H__ */
diff --git a/fs/xfs/xfs_shared.h b/fs/xfs/xfs_shared.h
index 4484e5151395..82404da2ca67 100644
--- a/fs/xfs/xfs_shared.h
+++ b/fs/xfs/xfs_shared.h
@@ -238,7 +238,7 @@ int xfs_log_calc_minimum_size(struct xfs_mount *);
238int xfs_symlink_blocks(struct xfs_mount *mp, int pathlen); 238int xfs_symlink_blocks(struct xfs_mount *mp, int pathlen);
239int xfs_symlink_hdr_set(struct xfs_mount *mp, xfs_ino_t ino, uint32_t offset, 239int xfs_symlink_hdr_set(struct xfs_mount *mp, xfs_ino_t ino, uint32_t offset,
240 uint32_t size, struct xfs_buf *bp); 240 uint32_t size, struct xfs_buf *bp);
241bool xfs_symlink_hdr_ok(struct xfs_mount *mp, xfs_ino_t ino, uint32_t offset, 241bool xfs_symlink_hdr_ok(xfs_ino_t ino, uint32_t offset,
242 uint32_t size, struct xfs_buf *bp); 242 uint32_t size, struct xfs_buf *bp);
243void xfs_symlink_local_to_remote(struct xfs_trans *tp, struct xfs_buf *bp, 243void xfs_symlink_local_to_remote(struct xfs_trans *tp, struct xfs_buf *bp,
244 struct xfs_inode *ip, struct xfs_ifork *ifp); 244 struct xfs_inode *ip, struct xfs_ifork *ifp);
diff --git a/fs/xfs/xfs_super.c b/fs/xfs/xfs_super.c
index 3494eff8e4eb..6e6673543777 100644
--- a/fs/xfs/xfs_super.c
+++ b/fs/xfs/xfs_super.c
@@ -765,20 +765,18 @@ xfs_open_devices(
765 * Setup xfs_mount buffer target pointers 765 * Setup xfs_mount buffer target pointers
766 */ 766 */
767 error = ENOMEM; 767 error = ENOMEM;
768 mp->m_ddev_targp = xfs_alloc_buftarg(mp, ddev, 0, mp->m_fsname); 768 mp->m_ddev_targp = xfs_alloc_buftarg(mp, ddev);
769 if (!mp->m_ddev_targp) 769 if (!mp->m_ddev_targp)
770 goto out_close_rtdev; 770 goto out_close_rtdev;
771 771
772 if (rtdev) { 772 if (rtdev) {
773 mp->m_rtdev_targp = xfs_alloc_buftarg(mp, rtdev, 1, 773 mp->m_rtdev_targp = xfs_alloc_buftarg(mp, rtdev);
774 mp->m_fsname);
775 if (!mp->m_rtdev_targp) 774 if (!mp->m_rtdev_targp)
776 goto out_free_ddev_targ; 775 goto out_free_ddev_targ;
777 } 776 }
778 777
779 if (logdev && logdev != ddev) { 778 if (logdev && logdev != ddev) {
780 mp->m_logdev_targp = xfs_alloc_buftarg(mp, logdev, 1, 779 mp->m_logdev_targp = xfs_alloc_buftarg(mp, logdev);
781 mp->m_fsname);
782 if (!mp->m_logdev_targp) 780 if (!mp->m_logdev_targp)
783 goto out_free_rtdev_targ; 781 goto out_free_rtdev_targ;
784 } else { 782 } else {
@@ -811,8 +809,7 @@ xfs_setup_devices(
811{ 809{
812 int error; 810 int error;
813 811
814 error = xfs_setsize_buftarg(mp->m_ddev_targp, mp->m_sb.sb_blocksize, 812 error = xfs_setsize_buftarg(mp->m_ddev_targp, mp->m_sb.sb_sectsize);
815 mp->m_sb.sb_sectsize);
816 if (error) 813 if (error)
817 return error; 814 return error;
818 815
@@ -822,14 +819,12 @@ xfs_setup_devices(
822 if (xfs_sb_version_hassector(&mp->m_sb)) 819 if (xfs_sb_version_hassector(&mp->m_sb))
823 log_sector_size = mp->m_sb.sb_logsectsize; 820 log_sector_size = mp->m_sb.sb_logsectsize;
824 error = xfs_setsize_buftarg(mp->m_logdev_targp, 821 error = xfs_setsize_buftarg(mp->m_logdev_targp,
825 mp->m_sb.sb_blocksize,
826 log_sector_size); 822 log_sector_size);
827 if (error) 823 if (error)
828 return error; 824 return error;
829 } 825 }
830 if (mp->m_rtdev_targp) { 826 if (mp->m_rtdev_targp) {
831 error = xfs_setsize_buftarg(mp->m_rtdev_targp, 827 error = xfs_setsize_buftarg(mp->m_rtdev_targp,
832 mp->m_sb.sb_blocksize,
833 mp->m_sb.sb_sectsize); 828 mp->m_sb.sb_sectsize);
834 if (error) 829 if (error)
835 return error; 830 return error;
diff --git a/fs/xfs/xfs_symlink.c b/fs/xfs/xfs_symlink.c
index 52979aa90986..0816b4018dfc 100644
--- a/fs/xfs/xfs_symlink.c
+++ b/fs/xfs/xfs_symlink.c
@@ -92,7 +92,7 @@ xfs_readlink_bmap(
92 92
93 cur_chunk = bp->b_addr; 93 cur_chunk = bp->b_addr;
94 if (xfs_sb_version_hascrc(&mp->m_sb)) { 94 if (xfs_sb_version_hascrc(&mp->m_sb)) {
95 if (!xfs_symlink_hdr_ok(mp, ip->i_ino, offset, 95 if (!xfs_symlink_hdr_ok(ip->i_ino, offset,
96 byte_cnt, bp)) { 96 byte_cnt, bp)) {
97 error = EFSCORRUPTED; 97 error = EFSCORRUPTED;
98 xfs_alert(mp, 98 xfs_alert(mp,
diff --git a/fs/xfs/xfs_symlink_remote.c b/fs/xfs/xfs_symlink_remote.c
index 9b32052ff65e..23c2f2577c8d 100644
--- a/fs/xfs/xfs_symlink_remote.c
+++ b/fs/xfs/xfs_symlink_remote.c
@@ -80,7 +80,6 @@ xfs_symlink_hdr_set(
80 */ 80 */
81bool 81bool
82xfs_symlink_hdr_ok( 82xfs_symlink_hdr_ok(
83 struct xfs_mount *mp,
84 xfs_ino_t ino, 83 xfs_ino_t ino,
85 uint32_t offset, 84 uint32_t offset,
86 uint32_t size, 85 uint32_t size,
diff --git a/fs/xfs/xfs_trans.c b/fs/xfs/xfs_trans.c
index 54a57326d85b..d03932564ccb 100644
--- a/fs/xfs/xfs_trans.c
+++ b/fs/xfs/xfs_trans.c
@@ -827,7 +827,7 @@ xfs_trans_committed_bulk(
827 xfs_log_item_batch_insert(ailp, &cur, log_items, i, commit_lsn); 827 xfs_log_item_batch_insert(ailp, &cur, log_items, i, commit_lsn);
828 828
829 spin_lock(&ailp->xa_lock); 829 spin_lock(&ailp->xa_lock);
830 xfs_trans_ail_cursor_done(ailp, &cur); 830 xfs_trans_ail_cursor_done(&cur);
831 spin_unlock(&ailp->xa_lock); 831 spin_unlock(&ailp->xa_lock);
832} 832}
833 833
diff --git a/fs/xfs/xfs_trans_ail.c b/fs/xfs/xfs_trans_ail.c
index a7287354e535..cb0f3a84cc68 100644
--- a/fs/xfs/xfs_trans_ail.c
+++ b/fs/xfs/xfs_trans_ail.c
@@ -173,7 +173,6 @@ xfs_trans_ail_cursor_next(
173 */ 173 */
174void 174void
175xfs_trans_ail_cursor_done( 175xfs_trans_ail_cursor_done(
176 struct xfs_ail *ailp,
177 struct xfs_ail_cursor *cur) 176 struct xfs_ail_cursor *cur)
178{ 177{
179 cur->item = NULL; 178 cur->item = NULL;
@@ -368,7 +367,7 @@ xfsaild_push(
368 * If the AIL is empty or our push has reached the end we are 367 * If the AIL is empty or our push has reached the end we are
369 * done now. 368 * done now.
370 */ 369 */
371 xfs_trans_ail_cursor_done(ailp, &cur); 370 xfs_trans_ail_cursor_done(&cur);
372 spin_unlock(&ailp->xa_lock); 371 spin_unlock(&ailp->xa_lock);
373 goto out_done; 372 goto out_done;
374 } 373 }
@@ -453,7 +452,7 @@ xfsaild_push(
453 break; 452 break;
454 lsn = lip->li_lsn; 453 lsn = lip->li_lsn;
455 } 454 }
456 xfs_trans_ail_cursor_done(ailp, &cur); 455 xfs_trans_ail_cursor_done(&cur);
457 spin_unlock(&ailp->xa_lock); 456 spin_unlock(&ailp->xa_lock);
458 457
459 if (xfs_buf_delwri_submit_nowait(&ailp->xa_buf_list)) 458 if (xfs_buf_delwri_submit_nowait(&ailp->xa_buf_list))
diff --git a/fs/xfs/xfs_trans_priv.h b/fs/xfs/xfs_trans_priv.h
index 12e86af9d9b9..bd1281862ad7 100644
--- a/fs/xfs/xfs_trans_priv.h
+++ b/fs/xfs/xfs_trans_priv.h
@@ -133,8 +133,7 @@ struct xfs_log_item * xfs_trans_ail_cursor_last(struct xfs_ail *ailp,
133 xfs_lsn_t lsn); 133 xfs_lsn_t lsn);
134struct xfs_log_item * xfs_trans_ail_cursor_next(struct xfs_ail *ailp, 134struct xfs_log_item * xfs_trans_ail_cursor_next(struct xfs_ail *ailp,
135 struct xfs_ail_cursor *cur); 135 struct xfs_ail_cursor *cur);
136void xfs_trans_ail_cursor_done(struct xfs_ail *ailp, 136void xfs_trans_ail_cursor_done(struct xfs_ail_cursor *cur);
137 struct xfs_ail_cursor *cur);
138 137
139#if BITS_PER_LONG != 64 138#if BITS_PER_LONG != 64
140static inline void 139static inline void