linux-btrfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/4] variables fixes in compression.c
@ 2021-05-29  9:48 Anand Jain
  2021-05-29  9:48 ` [PATCH 1/4] btrfs: reduce the variable size to fit nr_pages Anand Jain
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: Anand Jain @ 2021-05-29  9:48 UTC (permalink / raw)
  To: linux-btrfs; +Cc: Anand Jain

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(-)

-- 
2.30.2


^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2021-05-31 18:40 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-05-29  9:48 [PATCH 0/4] variables fixes in compression.c Anand Jain
2021-05-29  9:48 ` [PATCH 1/4] btrfs: reduce the variable size to fit nr_pages Anand Jain
2021-05-29  9:48 ` [PATCH 2/4] btrfs: optimize variables size in btrfs_submit_compressed_read Anand Jain
2021-05-29  9:48 ` [PATCH 3/4] btrfs: optimize variables size in btrfs_submit_compressed_write Anand Jain
2021-05-29  9:48 ` [PATCH 4/4] btrfs: fix comment about max_out in btrfs_compress_pages Anand Jain
2021-05-31 18:37 ` [PATCH 0/4] variables fixes in compression.c David Sterba

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).