diff options
| author | Filipe Manana <fdmanana@suse.com> | 2024-09-24 17:12:32 +0100 |
|---|---|---|
| committer | David Sterba <dsterba@suse.com> | 2024-11-11 14:34:13 +0100 |
| commit | c28b97f53be7b598ae5fb47cc9dc80912019d7a8 (patch) | |
| tree | ae1134bdedea9b4193e2ee7ddd9e99593c0897e4 /fs/btrfs/qgroup.h | |
| parent | 2206265f41e979b37213fa6da14e73f837c57a54 (diff) | |
| download | linux-next-c28b97f53be7b598ae5fb47cc9dc80912019d7a8.tar.gz linux-next-c28b97f53be7b598ae5fb47cc9dc80912019d7a8.zip | |
btrfs: qgroups: remove bytenr field from struct btrfs_qgroup_extent_record
Now that we track qgroup extent records in a xarray we don't need to have
a "bytenr" field in struct btrfs_qgroup_extent_record, since we can get
it from the index of the record in the xarray.
So remove the field and grab the bytenr from either the index key or any
other place where it's available (delayed refs). This reduces the size of
struct btrfs_qgroup_extent_record from 40 bytes down to 32 bytes, meaning
that we now can store 128 instances of this structure instead of 102 per
4K page.
Reviewed-by: Qu Wenruo <wqu@suse.com>
Signed-off-by: Filipe Manana <fdmanana@suse.com>
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
Diffstat (limited to 'fs/btrfs/qgroup.h')
| -rw-r--r-- | fs/btrfs/qgroup.h | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/fs/btrfs/qgroup.h b/fs/btrfs/qgroup.h index c229256d6fd5..c36019abc82f 100644 --- a/fs/btrfs/qgroup.h +++ b/fs/btrfs/qgroup.h @@ -127,7 +127,12 @@ struct btrfs_inode; * Record a dirty extent, and info qgroup to update quota on it */ struct btrfs_qgroup_extent_record { - u64 bytenr; + /* + * The bytenr of the extent is given by its index in the dirty_extents + * xarray of struct btrfs_delayed_ref_root left shifted by + * fs_info->sectorsize_bits. + */ + u64 num_bytes; /* @@ -345,9 +350,11 @@ void btrfs_free_qgroup_config(struct btrfs_fs_info *fs_info); int btrfs_qgroup_trace_extent_nolock( struct btrfs_fs_info *fs_info, struct btrfs_delayed_ref_root *delayed_refs, - struct btrfs_qgroup_extent_record *record); + struct btrfs_qgroup_extent_record *record, + u64 bytenr); int btrfs_qgroup_trace_extent_post(struct btrfs_trans_handle *trans, - struct btrfs_qgroup_extent_record *qrecord); + struct btrfs_qgroup_extent_record *qrecord, + u64 bytenr); int btrfs_qgroup_trace_extent(struct btrfs_trans_handle *trans, u64 bytenr, u64 num_bytes); int btrfs_qgroup_trace_leaf_items(struct btrfs_trans_handle *trans, |
