diff options
author | Filipe Manana <fdmanana@suse.com> | 2022-08-17 12:22:42 +0100 |
---|---|---|
committer | David Sterba <dsterba@suse.com> | 2022-09-26 12:27:56 +0200 |
commit | 4c469798eee5c63dea359dbd39dc4efcf96ec0ba (patch) | |
tree | f0b65f854cff3af713071d03f4c8ff43f103f1da /fs/btrfs/tree-log.c | |
parent | 4cbf37f504a5c4a9d1c695a8552be6025f37d668 (diff) |
btrfs: shrink the size of struct btrfs_delayed_item
Currently struct btrfs_delayed_item has a base size of 96 bytes, but its
size can be decreased by doing the following 2 tweaks:
1) Change data_len from u32 to u16. Our maximum possible leaf size is 64K,
so the data_len can never be larger than that, and in fact it is always
much smaller than that. The max length for a dentry's name is ensured
at the VFS level (PATH_MAX, 4096 bytes) and in struct btrfs_inode_ref
and btrfs_dir_item we use a u16 to store the name's length;
2) Change 'ins_or_del' to a 1 bit enum, which is all we need since it
can only have 2 values. After this there's also no longer the need to
BUG_ON() before using 'ins_or_del' in several places. Also rename the
field from 'ins_or_del' to 'type', which is more clear.
These two tweaks decrease the size of struct btrfs_delayed_item from 96
bytes down to 88 bytes. A previous patch already reduced the size of this
structure by 16 bytes, but an upcoming change will increase its size by
16 bytes (adding a struct list_head element).
Signed-off-by: Filipe Manana <fdmanana@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
Diffstat (limited to 'fs/btrfs/tree-log.c')
0 files changed, 0 insertions, 0 deletions