variables fixes in compression.c
Get series with b4
b4 am [email protected]Versions newest first
- v1 Latest4 patches 1 replyIn review
Patches in v1 No applies recorded yet
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/4 | btrfs: reduce the variable size to fit nr_pagesfs/ | +3 | 0 replies | |
| 2/4 | btrfs: optimize variables size in btrfs_submit_compressed_readfs/ | +3 | 0 replies | |
| 3/4 | btrfs: optimize variables size in btrfs_submit_compressed_writefs/ fs/ | +6 | 0 replies | |
| 4/4 | btrfs: fix comment about max_out in btrfs_compress_pagesfs/ | +0 | 0 replies |
Reviews trailers per patch
No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.
Cover letter [PATCH 0/4] variables fixes in compression.c
Patch (btrfs: reduce compressed_bio member's types) reduced the size to unsigned int as in [1]. Fix its cascading effects here. And one stale comment in the patch 4/4.
[1]
- unsigned long len;
+ unsigned int len;
- int compress_type;
+ u8 compress_type;
- unsigned long nr_pages;
+ unsigned int nr_pages;
- unsigned long compressed_len;
+ unsigned int compressed_len;
- int errors;
+ u8 errors;
As shown in [2], we set the max compressable block size to 128K. So struct async_extent can reduce some of its members to unsigned int as well.
[2]
static noinline int compress_file_range(struct async_chunk *async_chunk) ::
617 total_compressed = min_t(unsigned long, total_compressed,
618 BTRFS_MAX_UNCOMPRESSED);
But changes touches too many places, and my first attempt to fix is unsatisfactory to me, so I am just sending the changes limited to the file compression.c.
Anand Jain (4):
btrfs: optimize users of members of the struct compressed_bio
btrfs: optimize variables size in btrfs_submit_compressed_read
btrfs: optimize variables size in btrfs_submit_compressed_write
btrfs: fix comment about max_out in btrfs_compress_pages
fs/btrfs/compression.c | 21 +++++++++------------ fs/btrfs/compression.h | 6 +++--- 2 files changed, 12 insertions(+), 15 deletions(-)
Signature · 1 line
2.30.2