xfs: move the dir2 data block fixed offsets to struct xfs_da_geometry
Move the data block fixed offsets towards our structure for dir/attr geometry parameters. Signed-off-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Darrick J. Wong <darrick.wong@oracle.com> Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
This commit is contained in:

committed by
Darrick J. Wong

parent
7e8ae7bd1c
commit
d73e1cee8a
@@ -126,16 +126,24 @@ xfs_da_mount(
|
||||
dageo->node_hdr_size = sizeof(struct xfs_da3_node_hdr);
|
||||
dageo->leaf_hdr_size = sizeof(struct xfs_dir3_leaf_hdr);
|
||||
dageo->free_hdr_size = sizeof(struct xfs_dir3_free_hdr);
|
||||
dageo->data_entry_offset =
|
||||
sizeof(struct xfs_dir3_data_hdr);
|
||||
} else {
|
||||
dageo->node_hdr_size = sizeof(struct xfs_da_node_hdr);
|
||||
dageo->leaf_hdr_size = sizeof(struct xfs_dir2_leaf_hdr);
|
||||
dageo->free_hdr_size = sizeof(struct xfs_dir2_free_hdr);
|
||||
dageo->data_entry_offset =
|
||||
sizeof(struct xfs_dir2_data_hdr);
|
||||
}
|
||||
dageo->leaf_max_ents = (dageo->blksize - dageo->leaf_hdr_size) /
|
||||
sizeof(struct xfs_dir2_leaf_entry);
|
||||
dageo->free_max_bests = (dageo->blksize - dageo->free_hdr_size) /
|
||||
sizeof(xfs_dir2_data_off_t);
|
||||
|
||||
dageo->data_first_offset = dageo->data_entry_offset +
|
||||
xfs_dir2_data_entsize(mp, 1) +
|
||||
xfs_dir2_data_entsize(mp, 2);
|
||||
|
||||
/*
|
||||
* Now we've set up the block conversion variables, we can calculate the
|
||||
* segment block constants using the geometry structure.
|
||||
|
Reference in New Issue
Block a user