aboutsummaryrefslogtreecommitdiffstats
path: root/fs/xfs/xfs_dir2_data.c
diff options
context:
space:
mode:
authorDave Chinner <dchinner@redhat.com>2014-06-06 01:15:59 -0400
committerDave Chinner <david@fromorbit.com>2014-06-06 01:15:59 -0400
commit8f66193c89f0b0259db6b27b4df3deb828c294f9 (patch)
tree333c24e2c4d901d044e5b2c3c820cb680919f73c /fs/xfs/xfs_dir2_data.c
parentd6cf13051f31bf1a54b65643d0e578b3ca2f0692 (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_data.c')
-rw-r--r--fs/xfs/xfs_dir2_data.c17
1 files changed, 10 insertions, 7 deletions
diff --git a/fs/xfs/xfs_dir2_data.c b/fs/xfs/xfs_dir2_data.c
index 6c23f86e0148..b73d61adf104 100644
--- a/fs/xfs/xfs_dir2_data.c
+++ b/fs/xfs/xfs_dir2_data.c
@@ -80,7 +80,7 @@ __xfs_dir3_data_check(
80 switch (hdr->magic) { 80 switch (hdr->magic) {
81 case cpu_to_be32(XFS_DIR3_BLOCK_MAGIC): 81 case cpu_to_be32(XFS_DIR3_BLOCK_MAGIC):
82 case cpu_to_be32(XFS_DIR2_BLOCK_MAGIC): 82 case cpu_to_be32(XFS_DIR2_BLOCK_MAGIC):
83 btp = xfs_dir2_block_tail_p(mp, hdr); 83 btp = xfs_dir2_block_tail_p(geo, hdr);
84 lep = xfs_dir2_block_leaf_p(btp); 84 lep = xfs_dir2_block_leaf_p(btp);
85 endp = (char *)lep; 85 endp = (char *)lep;
86 86
@@ -96,7 +96,7 @@ __xfs_dir3_data_check(
96 break; 96 break;
97 case cpu_to_be32(XFS_DIR3_DATA_MAGIC): 97 case cpu_to_be32(XFS_DIR3_DATA_MAGIC):
98 case cpu_to_be32(XFS_DIR2_DATA_MAGIC): 98 case cpu_to_be32(XFS_DIR2_DATA_MAGIC):
99 endp = (char *)hdr + mp->m_dirblksize; 99 endp = (char *)hdr + geo->blksize;
100 break; 100 break;
101 default: 101 default:
102 XFS_ERROR_REPORT("Bad Magic", XFS_ERRLEVEL_LOW, mp); 102 XFS_ERROR_REPORT("Bad Magic", XFS_ERRLEVEL_LOW, mp);
@@ -511,6 +511,7 @@ xfs_dir2_data_freescan(
511 struct xfs_dir2_data_free *bf; 511 struct xfs_dir2_data_free *bf;
512 char *endp; /* end of block's data */ 512 char *endp; /* end of block's data */
513 char *p; /* current entry pointer */ 513 char *p; /* current entry pointer */
514 struct xfs_da_geometry *geo = dp->i_mount->m_dir_geo;
514 515
515 ASSERT(hdr->magic == cpu_to_be32(XFS_DIR2_DATA_MAGIC) || 516 ASSERT(hdr->magic == cpu_to_be32(XFS_DIR2_DATA_MAGIC) ||
516 hdr->magic == cpu_to_be32(XFS_DIR3_DATA_MAGIC) || 517 hdr->magic == cpu_to_be32(XFS_DIR3_DATA_MAGIC) ||
@@ -529,10 +530,10 @@ xfs_dir2_data_freescan(
529 p = (char *)dp->d_ops->data_entry_p(hdr); 530 p = (char *)dp->d_ops->data_entry_p(hdr);
530 if (hdr->magic == cpu_to_be32(XFS_DIR2_BLOCK_MAGIC) || 531 if (hdr->magic == cpu_to_be32(XFS_DIR2_BLOCK_MAGIC) ||
531 hdr->magic == cpu_to_be32(XFS_DIR3_BLOCK_MAGIC)) { 532 hdr->magic == cpu_to_be32(XFS_DIR3_BLOCK_MAGIC)) {
532 btp = xfs_dir2_block_tail_p(dp->i_mount, hdr); 533 btp = xfs_dir2_block_tail_p(geo, hdr);
533 endp = (char *)xfs_dir2_block_leaf_p(btp); 534 endp = (char *)xfs_dir2_block_leaf_p(btp);
534 } else 535 } else
535 endp = (char *)hdr + dp->i_mount->m_dirblksize; 536 endp = (char *)hdr + geo->blksize;
536 /* 537 /*
537 * Loop over the block's entries. 538 * Loop over the block's entries.
538 */ 539 */
@@ -622,7 +623,7 @@ xfs_dir3_data_init(
622 dup = dp->d_ops->data_unused_p(hdr); 623 dup = dp->d_ops->data_unused_p(hdr);
623 dup->freetag = cpu_to_be16(XFS_DIR2_DATA_FREE_TAG); 624 dup->freetag = cpu_to_be16(XFS_DIR2_DATA_FREE_TAG);
624 625
625 t = mp->m_dirblksize - (uint)dp->d_ops->data_entry_offset; 626 t = args->geo->blksize - (uint)dp->d_ops->data_entry_offset;
626 bf[0].length = cpu_to_be16(t); 627 bf[0].length = cpu_to_be16(t);
627 dup->length = cpu_to_be16(t); 628 dup->length = cpu_to_be16(t);
628 *xfs_dir2_data_unused_tag_p(dup) = cpu_to_be16((char *)dup - (char *)hdr); 629 *xfs_dir2_data_unused_tag_p(dup) = cpu_to_be16((char *)dup - (char *)hdr);
@@ -732,22 +733,24 @@ xfs_dir2_data_make_free(
732 xfs_dir2_data_unused_t *postdup; /* unused entry after us */ 733 xfs_dir2_data_unused_t *postdup; /* unused entry after us */
733 xfs_dir2_data_unused_t *prevdup; /* unused entry before us */ 734 xfs_dir2_data_unused_t *prevdup; /* unused entry before us */
734 struct xfs_dir2_data_free *bf; 735 struct xfs_dir2_data_free *bf;
736 struct xfs_da_geometry *geo;
735 737
736 mp = tp->t_mountp; 738 mp = tp->t_mountp;
737 hdr = bp->b_addr; 739 hdr = bp->b_addr;
740 geo = mp->m_dir_geo;
738 741
739 /* 742 /*
740 * Figure out where the end of the data area is. 743 * Figure out where the end of the data area is.
741 */ 744 */
742 if (hdr->magic == cpu_to_be32(XFS_DIR2_DATA_MAGIC) || 745 if (hdr->magic == cpu_to_be32(XFS_DIR2_DATA_MAGIC) ||
743 hdr->magic == cpu_to_be32(XFS_DIR3_DATA_MAGIC)) 746 hdr->magic == cpu_to_be32(XFS_DIR3_DATA_MAGIC))
744 endptr = (char *)hdr + mp->m_dirblksize; 747 endptr = (char *)hdr + geo->blksize;
745 else { 748 else {
746 xfs_dir2_block_tail_t *btp; /* block tail */ 749 xfs_dir2_block_tail_t *btp; /* block tail */
747 750
748 ASSERT(hdr->magic == cpu_to_be32(XFS_DIR2_BLOCK_MAGIC) || 751 ASSERT(hdr->magic == cpu_to_be32(XFS_DIR2_BLOCK_MAGIC) ||
749 hdr->magic == cpu_to_be32(XFS_DIR3_BLOCK_MAGIC)); 752 hdr->magic == cpu_to_be32(XFS_DIR3_BLOCK_MAGIC));
750 btp = xfs_dir2_block_tail_p(mp, hdr); 753 btp = xfs_dir2_block_tail_p(geo, hdr);
751 endptr = (char *)xfs_dir2_block_leaf_p(btp); 754 endptr = (char *)xfs_dir2_block_leaf_p(btp);
752 } 755 }
753 /* 756 /*