aboutsummaryrefslogtreecommitdiffstats
path: root/fs/xfs/xfs_dir2.c
diff options
context:
space:
mode:
authorDave Chinner <dchinner@redhat.com>2014-06-06 01:08:18 -0400
committerDave Chinner <david@fromorbit.com>2014-06-06 01:08:18 -0400
commit30028030b14d083123c88e3ab45990a8c375abf1 (patch)
treec6787bd71e8b29f7acf675500a899e4154e0b951 /fs/xfs/xfs_dir2.c
parent2998ab1d450a526a9a3a6292f91239b4fc209db0 (diff)
xfs: convert directory db conversion 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.c')
-rw-r--r--fs/xfs/xfs_dir2.c13
1 files changed, 9 insertions, 4 deletions
diff --git a/fs/xfs/xfs_dir2.c b/fs/xfs/xfs_dir2.c
index 9a2f5532fd9f..886a67d92f63 100644
--- a/fs/xfs/xfs_dir2.c
+++ b/fs/xfs/xfs_dir2.c
@@ -117,9 +117,14 @@ xfs_da_mount(
117 dageo->fsblog = mp->m_sb.sb_blocklog; 117 dageo->fsblog = mp->m_sb.sb_blocklog;
118 dageo->blksize = 1 << dageo->blklog; 118 dageo->blksize = 1 << dageo->blklog;
119 dageo->fsbcount = 1 << mp->m_sb.sb_dirblklog; 119 dageo->fsbcount = 1 << mp->m_sb.sb_dirblklog;
120 dageo->datablk = xfs_dir2_byte_to_da(mp, XFS_DIR2_DATA_OFFSET); 120
121 dageo->leafblk = xfs_dir2_byte_to_da(mp, XFS_DIR2_LEAF_OFFSET); 121 /*
122 dageo->freeblk = xfs_dir2_byte_to_da(mp, XFS_DIR2_FREE_OFFSET); 122 * Now we've set up the block conversion variables, we can calculate the
123 * segment block constants using the geometry structure.
124 */
125 dageo->datablk = xfs_dir2_byte_to_da(dageo, XFS_DIR2_DATA_OFFSET);
126 dageo->leafblk = xfs_dir2_byte_to_da(dageo, XFS_DIR2_LEAF_OFFSET);
127 dageo->freeblk = xfs_dir2_byte_to_da(dageo, XFS_DIR2_FREE_OFFSET);
123 dageo->node_ents = (dageo->blksize - nodehdr_size) / 128 dageo->node_ents = (dageo->blksize - nodehdr_size) /
124 (uint)sizeof(xfs_da_node_entry_t); 129 (uint)sizeof(xfs_da_node_entry_t);
125 dageo->magicpct = (dageo->blksize * 37) / 100; 130 dageo->magicpct = (dageo->blksize * 37) / 100;
@@ -744,7 +749,7 @@ xfs_dir2_shrink_inode(
744 /* 749 /*
745 * If it's not a data block, we're done. 750 * If it's not a data block, we're done.
746 */ 751 */
747 if (db >= xfs_dir2_byte_to_db(mp, XFS_DIR2_LEAF_OFFSET)) 752 if (db >= xfs_dir2_byte_to_db(args->geo, XFS_DIR2_LEAF_OFFSET))
748 return 0; 753 return 0;
749 /* 754 /*
750 * If the block isn't the last one in the directory, we're done. 755 * If the block isn't the last one in the directory, we're done.