diff options
Diffstat (limited to 'fs/xfs/xfs_attr_leaf.c')
-rw-r--r-- | fs/xfs/xfs_attr_leaf.c | 29 |
1 files changed, 16 insertions, 13 deletions
diff --git a/fs/xfs/xfs_attr_leaf.c b/fs/xfs/xfs_attr_leaf.c index aa4765f15cbe..54b0dc8cc82c 100644 --- a/fs/xfs/xfs_attr_leaf.c +++ b/fs/xfs/xfs_attr_leaf.c | |||
@@ -910,6 +910,7 @@ xfs_attr_leaf_to_node(xfs_da_args_t *args) | |||
910 | struct xfs_buf *bp1, *bp2; | 910 | struct xfs_buf *bp1, *bp2; |
911 | xfs_dablk_t blkno; | 911 | xfs_dablk_t blkno; |
912 | int error; | 912 | int error; |
913 | struct xfs_da_node_entry *btree; | ||
913 | 914 | ||
914 | trace_xfs_attr_leaf_to_node(args); | 915 | trace_xfs_attr_leaf_to_node(args); |
915 | 916 | ||
@@ -935,16 +936,16 @@ xfs_attr_leaf_to_node(xfs_da_args_t *args) | |||
935 | /* | 936 | /* |
936 | * Set up the new root node. | 937 | * Set up the new root node. |
937 | */ | 938 | */ |
938 | error = xfs_da_node_create(args, 0, 1, &bp1, XFS_ATTR_FORK); | 939 | error = xfs_da3_node_create(args, 0, 1, &bp1, XFS_ATTR_FORK); |
939 | if (error) | 940 | if (error) |
940 | goto out; | 941 | goto out; |
941 | node = bp1->b_addr; | 942 | node = bp1->b_addr; |
942 | leaf = bp2->b_addr; | 943 | leaf = bp2->b_addr; |
943 | ASSERT(leaf->hdr.info.magic == cpu_to_be16(XFS_ATTR_LEAF_MAGIC)); | 944 | ASSERT(leaf->hdr.info.magic == cpu_to_be16(XFS_ATTR_LEAF_MAGIC)); |
944 | /* both on-disk, don't endian-flip twice */ | 945 | /* both on-disk, don't endian-flip twice */ |
945 | node->btree[0].hashval = | 946 | btree = xfs_da3_node_tree_p(node); |
946 | leaf->entries[be16_to_cpu(leaf->hdr.count)-1 ].hashval; | 947 | btree[0].hashval = leaf->entries[be16_to_cpu(leaf->hdr.count)-1 ].hashval; |
947 | node->btree[0].before = cpu_to_be32(blkno); | 948 | btree[0].before = cpu_to_be32(blkno); |
948 | node->hdr.count = cpu_to_be16(1); | 949 | node->hdr.count = cpu_to_be16(1); |
949 | xfs_trans_log_buf(args->trans, bp1, 0, XFS_LBSIZE(dp->i_mount) - 1); | 950 | xfs_trans_log_buf(args->trans, bp1, 0, XFS_LBSIZE(dp->i_mount) - 1); |
950 | error = 0; | 951 | error = 0; |
@@ -1032,7 +1033,7 @@ xfs_attr_leaf_split(xfs_da_state_t *state, xfs_da_state_blk_t *oldblk, | |||
1032 | * NOTE: rebalance() currently depends on the 2nd block being empty. | 1033 | * NOTE: rebalance() currently depends on the 2nd block being empty. |
1033 | */ | 1034 | */ |
1034 | xfs_attr_leaf_rebalance(state, oldblk, newblk); | 1035 | xfs_attr_leaf_rebalance(state, oldblk, newblk); |
1035 | error = xfs_da_blk_link(state, oldblk, newblk); | 1036 | error = xfs_da3_blk_link(state, oldblk, newblk); |
1036 | if (error) | 1037 | if (error) |
1037 | return(error); | 1038 | return(error); |
1038 | 1039 | ||
@@ -1660,7 +1661,7 @@ xfs_attr_leaf_toosmall(xfs_da_state_t *state, int *action) | |||
1660 | */ | 1661 | */ |
1661 | forward = (info->forw != 0); | 1662 | forward = (info->forw != 0); |
1662 | memcpy(&state->altpath, &state->path, sizeof(state->path)); | 1663 | memcpy(&state->altpath, &state->path, sizeof(state->path)); |
1663 | error = xfs_da_path_shift(state, &state->altpath, forward, | 1664 | error = xfs_da3_path_shift(state, &state->altpath, forward, |
1664 | 0, &retval); | 1665 | 0, &retval); |
1665 | if (error) | 1666 | if (error) |
1666 | return(error); | 1667 | return(error); |
@@ -1717,10 +1718,10 @@ xfs_attr_leaf_toosmall(xfs_da_state_t *state, int *action) | |||
1717 | */ | 1718 | */ |
1718 | memcpy(&state->altpath, &state->path, sizeof(state->path)); | 1719 | memcpy(&state->altpath, &state->path, sizeof(state->path)); |
1719 | if (blkno < blk->blkno) { | 1720 | if (blkno < blk->blkno) { |
1720 | error = xfs_da_path_shift(state, &state->altpath, forward, | 1721 | error = xfs_da3_path_shift(state, &state->altpath, forward, |
1721 | 0, &retval); | 1722 | 0, &retval); |
1722 | } else { | 1723 | } else { |
1723 | error = xfs_da_path_shift(state, &state->path, forward, | 1724 | error = xfs_da3_path_shift(state, &state->path, forward, |
1724 | 0, &retval); | 1725 | 0, &retval); |
1725 | } | 1726 | } |
1726 | if (error) | 1727 | if (error) |
@@ -2783,7 +2784,7 @@ xfs_attr_root_inactive(xfs_trans_t **trans, xfs_inode_t *dp) | |||
2783 | * the extents in reverse order the extent containing | 2784 | * the extents in reverse order the extent containing |
2784 | * block 0 must still be there. | 2785 | * block 0 must still be there. |
2785 | */ | 2786 | */ |
2786 | error = xfs_da_node_read(*trans, dp, 0, -1, &bp, XFS_ATTR_FORK); | 2787 | error = xfs_da3_node_read(*trans, dp, 0, -1, &bp, XFS_ATTR_FORK); |
2787 | if (error) | 2788 | if (error) |
2788 | return(error); | 2789 | return(error); |
2789 | blkno = XFS_BUF_ADDR(bp); | 2790 | blkno = XFS_BUF_ADDR(bp); |
@@ -2836,6 +2837,7 @@ xfs_attr_node_inactive( | |||
2836 | xfs_daddr_t parent_blkno, child_blkno; | 2837 | xfs_daddr_t parent_blkno, child_blkno; |
2837 | int error, count, i; | 2838 | int error, count, i; |
2838 | struct xfs_buf *child_bp; | 2839 | struct xfs_buf *child_bp; |
2840 | struct xfs_da_node_entry *btree; | ||
2839 | 2841 | ||
2840 | /* | 2842 | /* |
2841 | * Since this code is recursive (gasp!) we must protect ourselves. | 2843 | * Since this code is recursive (gasp!) we must protect ourselves. |
@@ -2853,7 +2855,8 @@ xfs_attr_node_inactive( | |||
2853 | xfs_trans_brelse(*trans, bp); | 2855 | xfs_trans_brelse(*trans, bp); |
2854 | return(0); | 2856 | return(0); |
2855 | } | 2857 | } |
2856 | child_fsb = be32_to_cpu(node->btree[0].before); | 2858 | btree = xfs_da3_node_tree_p(node); |
2859 | child_fsb = be32_to_cpu(btree[0].before); | ||
2857 | xfs_trans_brelse(*trans, bp); /* no locks for later trans */ | 2860 | xfs_trans_brelse(*trans, bp); /* no locks for later trans */ |
2858 | 2861 | ||
2859 | /* | 2862 | /* |
@@ -2868,7 +2871,7 @@ xfs_attr_node_inactive( | |||
2868 | * traversal of the tree so we may deal with many blocks | 2871 | * traversal of the tree so we may deal with many blocks |
2869 | * before we come back to this one. | 2872 | * before we come back to this one. |
2870 | */ | 2873 | */ |
2871 | error = xfs_da_node_read(*trans, dp, child_fsb, -2, &child_bp, | 2874 | error = xfs_da3_node_read(*trans, dp, child_fsb, -2, &child_bp, |
2872 | XFS_ATTR_FORK); | 2875 | XFS_ATTR_FORK); |
2873 | if (error) | 2876 | if (error) |
2874 | return(error); | 2877 | return(error); |
@@ -2909,11 +2912,11 @@ xfs_attr_node_inactive( | |||
2909 | * child block number. | 2912 | * child block number. |
2910 | */ | 2913 | */ |
2911 | if ((i+1) < count) { | 2914 | if ((i+1) < count) { |
2912 | error = xfs_da_node_read(*trans, dp, 0, parent_blkno, | 2915 | error = xfs_da3_node_read(*trans, dp, 0, parent_blkno, |
2913 | &bp, XFS_ATTR_FORK); | 2916 | &bp, XFS_ATTR_FORK); |
2914 | if (error) | 2917 | if (error) |
2915 | return(error); | 2918 | return(error); |
2916 | child_fsb = be32_to_cpu(node->btree[i+1].before); | 2919 | child_fsb = be32_to_cpu(btree[i+1].before); |
2917 | xfs_trans_brelse(*trans, bp); | 2920 | xfs_trans_brelse(*trans, bp); |
2918 | } | 2921 | } |
2919 | /* | 2922 | /* |