diff options
author | Chandan Babu R <chandanrlinux@gmail.com> | 2021-04-02 15:07:33 -0700 |
---|---|---|
committer | Darrick J. Wong <djwong@kernel.org> | 2021-04-07 14:37:06 -0700 |
commit | b6785e279d53ca5c4fa6be1146e85000870d73ef (patch) | |
tree | 1f291cb412bcb39236133f1ca5d1f944f345ab8b /tools/perf/scripts/python/export-to-postgresql.py | |
parent | fcb62c28031eeeb626392e6a338a90dedbdecf1c (diff) |
xfs: Use struct xfs_bmdr_block instead of struct xfs_btree_block to calculate root node size
The incore data fork of an inode stores the bmap btree root node as 'struct
xfs_btree_block'. However, the ondisk version of the inode stores the bmap
btree root node as a 'struct xfs_bmdr_block'.
xfs_bmap_add_attrfork_btree() checks if the btree root node fits inside the
data fork of the inode. However, it incorrectly uses 'struct xfs_btree_block'
to compute the size of the bmap btree root node. Since size of 'struct
xfs_btree_block' is larger than that of 'struct xfs_bmdr_block',
xfs_bmap_add_attrfork_btree() could end up unnecessarily demoting the current
root node as the child of newly allocated root node.
This commit optimizes space usage by modifying xfs_bmap_add_attrfork_btree()
to use 'struct xfs_bmdr_block' to check if the bmap btree root node fits
inside the data fork of the inode.
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Chandan Babu R <chandanrlinux@gmail.com>
Reviewed-by: Darrick J. Wong <djwong@kernel.org>
Signed-off-by: Darrick J. Wong <djwong@kernel.org>
Diffstat (limited to 'tools/perf/scripts/python/export-to-postgresql.py')
0 files changed, 0 insertions, 0 deletions