diff options
author | Dave Chinner <dchinner@redhat.com> | 2014-06-06 01:15:59 -0400 |
---|---|---|
committer | Dave Chinner <david@fromorbit.com> | 2014-06-06 01:15:59 -0400 |
commit | 8f66193c89f0b0259db6b27b4df3deb828c294f9 (patch) | |
tree | 333c24e2c4d901d044e5b2c3c820cb680919f73c /fs/xfs/xfs_dir2_block.c | |
parent | d6cf13051f31bf1a54b65643d0e578b3ca2f0692 (diff) |
xfs: convert m_dirblksize to xfs_da_geometry
Signed-off-by: Dave Chinner <dchinner@redhat.com>
Reviewed-by: Brian Foster <bfoster@redhat.com>
Signed-off-by: Dave Chinner <david@fromorbit.com>
Diffstat (limited to 'fs/xfs/xfs_dir2_block.c')
-rw-r--r-- | fs/xfs/xfs_dir2_block.c | 32 |
1 files changed, 16 insertions, 16 deletions
diff --git a/fs/xfs/xfs_dir2_block.c b/fs/xfs/xfs_dir2_block.c index d950cde3afeb..4204df966980 100644 --- a/fs/xfs/xfs_dir2_block.c +++ b/fs/xfs/xfs_dir2_block.c | |||
@@ -377,7 +377,7 @@ xfs_dir2_block_addname( | |||
377 | * Set up pointers to parts of the block. | 377 | * Set up pointers to parts of the block. |
378 | */ | 378 | */ |
379 | hdr = bp->b_addr; | 379 | hdr = bp->b_addr; |
380 | btp = xfs_dir2_block_tail_p(mp, hdr); | 380 | btp = xfs_dir2_block_tail_p(args->geo, hdr); |
381 | blp = xfs_dir2_block_leaf_p(btp); | 381 | blp = xfs_dir2_block_leaf_p(btp); |
382 | 382 | ||
383 | /* | 383 | /* |
@@ -581,7 +581,7 @@ xfs_dir2_block_log_leaf( | |||
581 | xfs_dir2_leaf_entry_t *blp; | 581 | xfs_dir2_leaf_entry_t *blp; |
582 | xfs_dir2_block_tail_t *btp; | 582 | xfs_dir2_block_tail_t *btp; |
583 | 583 | ||
584 | btp = xfs_dir2_block_tail_p(tp->t_mountp, hdr); | 584 | btp = xfs_dir2_block_tail_p(tp->t_mountp->m_dir_geo, hdr); |
585 | blp = xfs_dir2_block_leaf_p(btp); | 585 | blp = xfs_dir2_block_leaf_p(btp); |
586 | xfs_trans_log_buf(tp, bp, (uint)((char *)&blp[first] - (char *)hdr), | 586 | xfs_trans_log_buf(tp, bp, (uint)((char *)&blp[first] - (char *)hdr), |
587 | (uint)((char *)&blp[last + 1] - (char *)hdr - 1)); | 587 | (uint)((char *)&blp[last + 1] - (char *)hdr - 1)); |
@@ -598,7 +598,7 @@ xfs_dir2_block_log_tail( | |||
598 | xfs_dir2_data_hdr_t *hdr = bp->b_addr; | 598 | xfs_dir2_data_hdr_t *hdr = bp->b_addr; |
599 | xfs_dir2_block_tail_t *btp; | 599 | xfs_dir2_block_tail_t *btp; |
600 | 600 | ||
601 | btp = xfs_dir2_block_tail_p(tp->t_mountp, hdr); | 601 | btp = xfs_dir2_block_tail_p(tp->t_mountp->m_dir_geo, hdr); |
602 | xfs_trans_log_buf(tp, bp, (uint)((char *)btp - (char *)hdr), | 602 | xfs_trans_log_buf(tp, bp, (uint)((char *)btp - (char *)hdr), |
603 | (uint)((char *)(btp + 1) - (char *)hdr - 1)); | 603 | (uint)((char *)(btp + 1) - (char *)hdr - 1)); |
604 | } | 604 | } |
@@ -633,7 +633,7 @@ xfs_dir2_block_lookup( | |||
633 | mp = dp->i_mount; | 633 | mp = dp->i_mount; |
634 | hdr = bp->b_addr; | 634 | hdr = bp->b_addr; |
635 | xfs_dir3_data_check(dp, bp); | 635 | xfs_dir3_data_check(dp, bp); |
636 | btp = xfs_dir2_block_tail_p(mp, hdr); | 636 | btp = xfs_dir2_block_tail_p(args->geo, hdr); |
637 | blp = xfs_dir2_block_leaf_p(btp); | 637 | blp = xfs_dir2_block_leaf_p(btp); |
638 | /* | 638 | /* |
639 | * Get the offset from the leaf entry, to point to the data. | 639 | * Get the offset from the leaf entry, to point to the data. |
@@ -686,7 +686,7 @@ xfs_dir2_block_lookup_int( | |||
686 | 686 | ||
687 | hdr = bp->b_addr; | 687 | hdr = bp->b_addr; |
688 | xfs_dir3_data_check(dp, bp); | 688 | xfs_dir3_data_check(dp, bp); |
689 | btp = xfs_dir2_block_tail_p(mp, hdr); | 689 | btp = xfs_dir2_block_tail_p(args->geo, hdr); |
690 | blp = xfs_dir2_block_leaf_p(btp); | 690 | blp = xfs_dir2_block_leaf_p(btp); |
691 | /* | 691 | /* |
692 | * Loop doing a binary search for our hash value. | 692 | * Loop doing a binary search for our hash value. |
@@ -791,7 +791,7 @@ xfs_dir2_block_removename( | |||
791 | tp = args->trans; | 791 | tp = args->trans; |
792 | mp = dp->i_mount; | 792 | mp = dp->i_mount; |
793 | hdr = bp->b_addr; | 793 | hdr = bp->b_addr; |
794 | btp = xfs_dir2_block_tail_p(mp, hdr); | 794 | btp = xfs_dir2_block_tail_p(args->geo, hdr); |
795 | blp = xfs_dir2_block_leaf_p(btp); | 795 | blp = xfs_dir2_block_leaf_p(btp); |
796 | /* | 796 | /* |
797 | * Point to the data entry using the leaf entry. | 797 | * Point to the data entry using the leaf entry. |
@@ -867,7 +867,7 @@ xfs_dir2_block_replace( | |||
867 | dp = args->dp; | 867 | dp = args->dp; |
868 | mp = dp->i_mount; | 868 | mp = dp->i_mount; |
869 | hdr = bp->b_addr; | 869 | hdr = bp->b_addr; |
870 | btp = xfs_dir2_block_tail_p(mp, hdr); | 870 | btp = xfs_dir2_block_tail_p(args->geo, hdr); |
871 | blp = xfs_dir2_block_leaf_p(btp); | 871 | blp = xfs_dir2_block_leaf_p(btp); |
872 | /* | 872 | /* |
873 | * Point to the data entry we need to change. | 873 | * Point to the data entry we need to change. |
@@ -941,7 +941,7 @@ xfs_dir2_leaf_to_block( | |||
941 | leaf = lbp->b_addr; | 941 | leaf = lbp->b_addr; |
942 | dp->d_ops->leaf_hdr_from_disk(&leafhdr, leaf); | 942 | dp->d_ops->leaf_hdr_from_disk(&leafhdr, leaf); |
943 | ents = dp->d_ops->leaf_ents_p(leaf); | 943 | ents = dp->d_ops->leaf_ents_p(leaf); |
944 | ltp = xfs_dir2_leaf_tail_p(mp, leaf); | 944 | ltp = xfs_dir2_leaf_tail_p(args->geo, leaf); |
945 | 945 | ||
946 | ASSERT(leafhdr.magic == XFS_DIR2_LEAF1_MAGIC || | 946 | ASSERT(leafhdr.magic == XFS_DIR2_LEAF1_MAGIC || |
947 | leafhdr.magic == XFS_DIR3_LEAF1_MAGIC); | 947 | leafhdr.magic == XFS_DIR3_LEAF1_MAGIC); |
@@ -951,13 +951,13 @@ xfs_dir2_leaf_to_block( | |||
951 | * been left behind during no-space-reservation operations. | 951 | * been left behind during no-space-reservation operations. |
952 | * These will show up in the leaf bests table. | 952 | * These will show up in the leaf bests table. |
953 | */ | 953 | */ |
954 | while (dp->i_d.di_size > mp->m_dirblksize) { | 954 | while (dp->i_d.di_size > args->geo->blksize) { |
955 | int hdrsz; | 955 | int hdrsz; |
956 | 956 | ||
957 | hdrsz = dp->d_ops->data_entry_offset; | 957 | hdrsz = dp->d_ops->data_entry_offset; |
958 | bestsp = xfs_dir2_leaf_bests_p(ltp); | 958 | bestsp = xfs_dir2_leaf_bests_p(ltp); |
959 | if (be16_to_cpu(bestsp[be32_to_cpu(ltp->bestcount) - 1]) == | 959 | if (be16_to_cpu(bestsp[be32_to_cpu(ltp->bestcount) - 1]) == |
960 | mp->m_dirblksize - hdrsz) { | 960 | args->geo->blksize - hdrsz) { |
961 | if ((error = | 961 | if ((error = |
962 | xfs_dir2_leaf_trim_data(args, lbp, | 962 | xfs_dir2_leaf_trim_data(args, lbp, |
963 | (xfs_dir2_db_t)(be32_to_cpu(ltp->bestcount) - 1)))) | 963 | (xfs_dir2_db_t)(be32_to_cpu(ltp->bestcount) - 1)))) |
@@ -985,7 +985,7 @@ xfs_dir2_leaf_to_block( | |||
985 | /* | 985 | /* |
986 | * Look at the last data entry. | 986 | * Look at the last data entry. |
987 | */ | 987 | */ |
988 | tagp = (__be16 *)((char *)hdr + mp->m_dirblksize) - 1; | 988 | tagp = (__be16 *)((char *)hdr + args->geo->blksize) - 1; |
989 | dup = (xfs_dir2_data_unused_t *)((char *)hdr + be16_to_cpu(*tagp)); | 989 | dup = (xfs_dir2_data_unused_t *)((char *)hdr + be16_to_cpu(*tagp)); |
990 | /* | 990 | /* |
991 | * If it's not free or is too short we can't do it. | 991 | * If it's not free or is too short we can't do it. |
@@ -1004,12 +1004,12 @@ xfs_dir2_leaf_to_block( | |||
1004 | /* | 1004 | /* |
1005 | * Use up the space at the end of the block (blp/btp). | 1005 | * Use up the space at the end of the block (blp/btp). |
1006 | */ | 1006 | */ |
1007 | xfs_dir2_data_use_free(tp, dp, dbp, dup, mp->m_dirblksize - size, size, | 1007 | xfs_dir2_data_use_free(tp, dp, dbp, dup, args->geo->blksize - size, size, |
1008 | &needlog, &needscan); | 1008 | &needlog, &needscan); |
1009 | /* | 1009 | /* |
1010 | * Initialize the block tail. | 1010 | * Initialize the block tail. |
1011 | */ | 1011 | */ |
1012 | btp = xfs_dir2_block_tail_p(mp, hdr); | 1012 | btp = xfs_dir2_block_tail_p(args->geo, hdr); |
1013 | btp->count = cpu_to_be32(leafhdr.count - leafhdr.stale); | 1013 | btp->count = cpu_to_be32(leafhdr.count - leafhdr.stale); |
1014 | btp->stale = 0; | 1014 | btp->stale = 0; |
1015 | xfs_dir2_block_log_tail(tp, dbp); | 1015 | xfs_dir2_block_log_tail(tp, dbp); |
@@ -1143,13 +1143,13 @@ xfs_dir2_sf_to_block( | |||
1143 | */ | 1143 | */ |
1144 | dup = dp->d_ops->data_unused_p(hdr); | 1144 | dup = dp->d_ops->data_unused_p(hdr); |
1145 | needlog = needscan = 0; | 1145 | needlog = needscan = 0; |
1146 | xfs_dir2_data_use_free(tp, dp, bp, dup, mp->m_dirblksize - i, i, &needlog, | 1146 | xfs_dir2_data_use_free(tp, dp, bp, dup, args->geo->blksize - i, |
1147 | &needscan); | 1147 | i, &needlog, &needscan); |
1148 | ASSERT(needscan == 0); | 1148 | ASSERT(needscan == 0); |
1149 | /* | 1149 | /* |
1150 | * Fill in the tail. | 1150 | * Fill in the tail. |
1151 | */ | 1151 | */ |
1152 | btp = xfs_dir2_block_tail_p(mp, hdr); | 1152 | btp = xfs_dir2_block_tail_p(args->geo, hdr); |
1153 | btp->count = cpu_to_be32(sfp->count + 2); /* ., .. */ | 1153 | btp->count = cpu_to_be32(sfp->count + 2); /* ., .. */ |
1154 | btp->stale = 0; | 1154 | btp->stale = 0; |
1155 | blp = xfs_dir2_block_leaf_p(btp); | 1155 | blp = xfs_dir2_block_leaf_p(btp); |