diff options
| author | David Sterba <[email protected]> | 2023-09-07 23:09:40 +0000 |
|---|---|---|
| committer | David Sterba <[email protected]> | 2023-10-12 14:44:04 +0000 |
| commit | 321f4992c127458e51009b5160567b72e3442ff3 (patch) | |
| tree | eadd80fb5e1807ed1602334abd610b88805d6bfe /fs/btrfs/dev-replace.c | |
| parent | btrfs: reduce size and reorder compression members in struct btrfs_inode (diff) | |
| download | kernel-321f4992c127458e51009b5160567b72e3442ff3.tar.gz kernel-321f4992c127458e51009b5160567b72e3442ff3.zip | |
btrfs: reduce size of struct btrfs_ref
We can reduce two members' size that in turn reduce size of struct
btrfs_ref from 64 to 56 bytes. As the structure is often used as a local
variable several functions reduce their stack usage.
- make enum btrfs_ref_type packed, there are only 4 values
- switch action and its values to a packed enum
Final structure layout:
struct btrfs_ref {
enum btrfs_ref_type type; /* 0 1 */
enum btrfs_delayed_ref_action action; /* 1 1 */
bool skip_qgroup; /* 2 1 */
/* XXX 5 bytes hole, try to pack */
u64 bytenr; /* 8 8 */
u64 len; /* 16 8 */
u64 parent; /* 24 8 */
union {
struct btrfs_data_ref data_ref; /* 32 24 */
struct btrfs_tree_ref tree_ref; /* 32 16 */
}; /* 32 24 */
/* size: 56, cachelines: 1, members: 7 */
/* sum members: 51, holes: 1, sum holes: 5 */
/* last cacheline: 56 bytes */
};
Reviewed-by: Qu Wenruo <[email protected]>
Signed-off-by: David Sterba <[email protected]>
Diffstat (limited to 'fs/btrfs/dev-replace.c')
0 files changed, 0 insertions, 0 deletions
