summaryrefslogtreecommitdiff
path: root/fs/xfs/xfs_dir2_priv.h
diff options
context:
space:
mode:
Diffstat (limited to 'fs/xfs/xfs_dir2_priv.h')
-rw-r--r--fs/xfs/xfs_dir2_priv.h18
1 files changed, 9 insertions, 9 deletions
diff --git a/fs/xfs/xfs_dir2_priv.h b/fs/xfs/xfs_dir2_priv.h
index 492edb6e07a7..683828942de1 100644
--- a/fs/xfs/xfs_dir2_priv.h
+++ b/fs/xfs/xfs_dir2_priv.h
@@ -67,10 +67,9 @@ xfs_dir2_dataptr_to_db(struct xfs_mount *mp, xfs_dir2_dataptr_t dp)
* Convert byte in space to offset in a block
*/
static inline xfs_dir2_data_aoff_t
-xfs_dir2_byte_to_off(struct xfs_mount *mp, xfs_dir2_off_t by)
+xfs_dir2_byte_to_off(struct xfs_da_geometry *geo, xfs_dir2_off_t by)
{
- return (xfs_dir2_data_aoff_t)(by &
- ((1 << (mp->m_sb.sb_blocklog + mp->m_sb.sb_dirblklog)) - 1));
+ return (xfs_dir2_data_aoff_t)(by & (geo->blksize - 1));
}
/*
@@ -79,18 +78,17 @@ xfs_dir2_byte_to_off(struct xfs_mount *mp, xfs_dir2_off_t by)
static inline xfs_dir2_data_aoff_t
xfs_dir2_dataptr_to_off(struct xfs_mount *mp, xfs_dir2_dataptr_t dp)
{
- return xfs_dir2_byte_to_off(mp, xfs_dir2_dataptr_to_byte(dp));
+ return xfs_dir2_byte_to_off(mp->m_dir_geo, xfs_dir2_dataptr_to_byte(dp));
}
/*
* Convert block and offset to byte in space
*/
static inline xfs_dir2_off_t
-xfs_dir2_db_off_to_byte(struct xfs_mount *mp, xfs_dir2_db_t db,
+xfs_dir2_db_off_to_byte(struct xfs_da_geometry *geo, xfs_dir2_db_t db,
xfs_dir2_data_aoff_t o)
{
- return ((xfs_dir2_off_t)db <<
- (mp->m_sb.sb_blocklog + mp->m_sb.sb_dirblklog)) + o;
+ return ((xfs_dir2_off_t)db << geo->blklog) + o;
}
/*
@@ -118,7 +116,8 @@ static inline xfs_dir2_dataptr_t
xfs_dir2_db_off_to_dataptr(struct xfs_mount *mp, xfs_dir2_db_t db,
xfs_dir2_data_aoff_t o)
{
- return xfs_dir2_byte_to_dataptr(xfs_dir2_db_off_to_byte(mp, db, o));
+ return xfs_dir2_byte_to_dataptr(
+ xfs_dir2_db_off_to_byte(mp->m_dir_geo, db, o));
}
/*
@@ -136,7 +135,8 @@ xfs_dir2_da_to_db(struct xfs_mount *mp, xfs_dablk_t da)
static inline xfs_dir2_off_t
xfs_dir2_da_to_byte(struct xfs_mount *mp, xfs_dablk_t da)
{
- return xfs_dir2_db_off_to_byte(mp, xfs_dir2_da_to_db(mp, da), 0);
+ return xfs_dir2_db_off_to_byte(mp->m_dir_geo,
+ xfs_dir2_da_to_db(mp, da), 0);
}
/*