diff options
author | Dave Chinner <dchinner@redhat.com> | 2016-12-05 14:38:58 +1100 |
---|---|---|
committer | Dave Chinner <david@fromorbit.com> | 2016-12-05 14:38:58 +1100 |
commit | 11ef38afe98cc7ad1a46ef24945232ec1760d5e2 (patch) | |
tree | b198c9b46f06a7bcac329cd9d9a6a913ae3312ad /fs/xfs/libxfs/xfs_inode_buf.c | |
parent | 1bb33a98702d8360947f18a44349df75ba555d5d (diff) | |
download | talos-obmc-linux-11ef38afe98cc7ad1a46ef24945232ec1760d5e2.tar.gz talos-obmc-linux-11ef38afe98cc7ad1a46ef24945232ec1760d5e2.zip |
xfs: make xfs btree stats less huge
Embedding a switch statement in every btree stats inc/add adds a lot
of code overhead to the core btree infrastructure paths. Stats are
supposed to be small and lightweight, but the btree stats have
become big and bloated as we've added more btrees. It needs fixing
because the reflink code will just add more overhead again.
Convert the v2 btree stats to arrays instead of independent
variables, and instead use the type to index the specific btree
array via an enum. This allows us to use array based indexing
to update the stats, rather than having to derefence variables
specific to the btree type.
If we then wrap the xfsstats structure in a union and place uint32_t
array beside it, and calculate the correct btree stats array base
array index when creating a btree cursor, we can easily access
entries in the stats structure without having to switch names based
on the btree type.
We then replace with the switch statement with a simple set of stats
wrapper macros, resulting in a significant simplification of the
btree stats code, and:
text data bss dec hex filename
48905 144 8 49057 bfa1 fs/xfs/libxfs/xfs_btree.o.old
36793 144 8 36945 9051 fs/xfs/libxfs/xfs_btree.o
it reduces the core btree infrastructure code size by close to 25%!
Signed-off-by: Dave Chinner <dchinner@redhat.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Dave Chinner <david@fromorbit.com>
Diffstat (limited to 'fs/xfs/libxfs/xfs_inode_buf.c')
0 files changed, 0 insertions, 0 deletions