aboutsummaryrefslogtreecommitdiffstats
path: root/fs/xfs/xfs_attr_leaf.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/xfs/xfs_attr_leaf.c')
-rw-r--r--fs/xfs/xfs_attr_leaf.c19
1 files changed, 10 insertions, 9 deletions
diff --git a/fs/xfs/xfs_attr_leaf.c b/fs/xfs/xfs_attr_leaf.c
index ae33b141342b..28712d29e43c 100644
--- a/fs/xfs/xfs_attr_leaf.c
+++ b/fs/xfs/xfs_attr_leaf.c
@@ -1494,8 +1494,8 @@ xfs_attr3_leaf_rebalance(
1494 1494
1495 xfs_attr3_leaf_hdr_to_disk(leaf1, &ichdr1); 1495 xfs_attr3_leaf_hdr_to_disk(leaf1, &ichdr1);
1496 xfs_attr3_leaf_hdr_to_disk(leaf2, &ichdr2); 1496 xfs_attr3_leaf_hdr_to_disk(leaf2, &ichdr2);
1497 xfs_trans_log_buf(args->trans, blk1->bp, 0, state->blocksize-1); 1497 xfs_trans_log_buf(args->trans, blk1->bp, 0, args->geo->blksize - 1);
1498 xfs_trans_log_buf(args->trans, blk2->bp, 0, state->blocksize-1); 1498 xfs_trans_log_buf(args->trans, blk2->bp, 0, args->geo->blksize - 1);
1499 1499
1500 /* 1500 /*
1501 * Copy out last hashval in each block for B-tree code. 1501 * Copy out last hashval in each block for B-tree code.
@@ -1592,7 +1592,7 @@ xfs_attr3_leaf_figure_balance(
1592 half += ichdr1->usedbytes + ichdr2->usedbytes + 1592 half += ichdr1->usedbytes + ichdr2->usedbytes +
1593 xfs_attr_leaf_newentsize(state->args, NULL); 1593 xfs_attr_leaf_newentsize(state->args, NULL);
1594 half /= 2; 1594 half /= 2;
1595 lastdelta = state->blocksize; 1595 lastdelta = state->args->geo->blksize;
1596 entry = xfs_attr3_leaf_entryp(leaf1); 1596 entry = xfs_attr3_leaf_entryp(leaf1);
1597 for (count = index = 0; count < max; entry++, index++, count++) { 1597 for (count = index = 0; count < max; entry++, index++, count++) {
1598 1598
@@ -1690,7 +1690,7 @@ xfs_attr3_leaf_toosmall(
1690 bytes = xfs_attr3_leaf_hdr_size(leaf) + 1690 bytes = xfs_attr3_leaf_hdr_size(leaf) +
1691 ichdr.count * sizeof(xfs_attr_leaf_entry_t) + 1691 ichdr.count * sizeof(xfs_attr_leaf_entry_t) +
1692 ichdr.usedbytes; 1692 ichdr.usedbytes;
1693 if (bytes > (state->blocksize >> 1)) { 1693 if (bytes > (state->args->geo->blksize >> 1)) {
1694 *action = 0; /* blk over 50%, don't try to join */ 1694 *action = 0; /* blk over 50%, don't try to join */
1695 return(0); 1695 return(0);
1696 } 1696 }
@@ -1744,7 +1744,8 @@ xfs_attr3_leaf_toosmall(
1744 1744
1745 xfs_attr3_leaf_hdr_from_disk(&ichdr2, bp->b_addr); 1745 xfs_attr3_leaf_hdr_from_disk(&ichdr2, bp->b_addr);
1746 1746
1747 bytes = state->blocksize - (state->blocksize >> 2) - 1747 bytes = state->args->geo->blksize -
1748 (state->args->geo->blksize >> 2) -
1748 ichdr.usedbytes - ichdr2.usedbytes - 1749 ichdr.usedbytes - ichdr2.usedbytes -
1749 ((ichdr.count + ichdr2.count) * 1750 ((ichdr.count + ichdr2.count) *
1750 sizeof(xfs_attr_leaf_entry_t)) - 1751 sizeof(xfs_attr_leaf_entry_t)) -
@@ -1997,7 +1998,7 @@ xfs_attr3_leaf_unbalance(
1997 struct xfs_attr_leafblock *tmp_leaf; 1998 struct xfs_attr_leafblock *tmp_leaf;
1998 struct xfs_attr3_icleaf_hdr tmphdr; 1999 struct xfs_attr3_icleaf_hdr tmphdr;
1999 2000
2000 tmp_leaf = kmem_zalloc(state->blocksize, KM_SLEEP); 2001 tmp_leaf = kmem_zalloc(state->args->geo->blksize, KM_SLEEP);
2001 2002
2002 /* 2003 /*
2003 * Copy the header into the temp leaf so that all the stuff 2004 * Copy the header into the temp leaf so that all the stuff
@@ -2010,7 +2011,7 @@ xfs_attr3_leaf_unbalance(
2010 tmphdr.magic = savehdr.magic; 2011 tmphdr.magic = savehdr.magic;
2011 tmphdr.forw = savehdr.forw; 2012 tmphdr.forw = savehdr.forw;
2012 tmphdr.back = savehdr.back; 2013 tmphdr.back = savehdr.back;
2013 tmphdr.firstused = state->blocksize; 2014 tmphdr.firstused = state->args->geo->blksize;
2014 2015
2015 /* write the header to the temp buffer to initialise it */ 2016 /* write the header to the temp buffer to initialise it */
2016 xfs_attr3_leaf_hdr_to_disk(tmp_leaf, &tmphdr); 2017 xfs_attr3_leaf_hdr_to_disk(tmp_leaf, &tmphdr);
@@ -2035,14 +2036,14 @@ xfs_attr3_leaf_unbalance(
2035 tmp_leaf, &tmphdr, tmphdr.count, 2036 tmp_leaf, &tmphdr, tmphdr.count,
2036 drophdr.count); 2037 drophdr.count);
2037 } 2038 }
2038 memcpy(save_leaf, tmp_leaf, state->blocksize); 2039 memcpy(save_leaf, tmp_leaf, state->args->geo->blksize);
2039 savehdr = tmphdr; /* struct copy */ 2040 savehdr = tmphdr; /* struct copy */
2040 kmem_free(tmp_leaf); 2041 kmem_free(tmp_leaf);
2041 } 2042 }
2042 2043
2043 xfs_attr3_leaf_hdr_to_disk(save_leaf, &savehdr); 2044 xfs_attr3_leaf_hdr_to_disk(save_leaf, &savehdr);
2044 xfs_trans_log_buf(state->args->trans, save_blk->bp, 0, 2045 xfs_trans_log_buf(state->args->trans, save_blk->bp, 0,
2045 state->blocksize - 1); 2046 state->args->geo->blksize - 1);
2046 2047
2047 /* 2048 /*
2048 * Copy out last hashval in each block for B-tree code. 2049 * Copy out last hashval in each block for B-tree code.