From: Qu Wenruo <quwenruo.btrfs@gmx.com>
To: Adarsh Das <adarshdas950@gmail.com>, clm@fb.com, dsterba@suse.com
Cc: terrelln@fb.com, linux-btrfs@vger.kernel.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH 2/4] btrfs: clean coding style errors and warnings in compression.c
Date: Sat, 28 Feb 2026 07:13:50 +1030 [thread overview]
Message-ID: <76483879-54b1-4cea-ab1c-4642283093bc@gmx.com> (raw)
In-Reply-To: <20260227183111.9311-3-adarshdas950@gmail.com>
在 2026/2/28 05:01, Adarsh Das 写道:
> As the previous patch is making changes to compression.c, this patch
> takes the oppurtunity to fix errors and warning in compression.c
>
> Signed-off-by: Adarsh Das <adarshdas950@gmail.com>
This minor cleanup should be folded into the previous patch.
Thanks,
Qu
> ---
> fs/btrfs/compression.c | 24 +++++++++++++-----------
> 1 file changed, 13 insertions(+), 11 deletions(-)
>
> diff --git a/fs/btrfs/compression.c b/fs/btrfs/compression.c
> index 29281aba925e..6c3be3550442 100644
> --- a/fs/btrfs/compression.c
> +++ b/fs/btrfs/compression.c
> @@ -36,9 +36,9 @@
>
> static struct bio_set btrfs_compressed_bioset;
>
> -static const char* const btrfs_compress_types[] = { "", "zlib", "lzo", "zstd" };
> +static const char * const btrfs_compress_types[] = { "", "zlib", "lzo", "zstd" };
>
> -const char* btrfs_compress_type2str(enum btrfs_compression_type type)
> +const char *btrfs_compress_type2str(enum btrfs_compression_type type)
> {
> switch (type) {
> case BTRFS_COMPRESS_ZLIB:
> @@ -478,6 +478,7 @@ static noinline int add_ra_bio_pages(struct inode *inode,
>
> if (zero_offset) {
> int zeros;
> +
> zeros = folio_size(folio) - zero_offset;
> folio_zero_range(folio, zero_offset, zeros);
> }
> @@ -780,7 +781,7 @@ struct list_head *btrfs_get_workspace(struct btrfs_fs_info *fs_info, int type, i
> struct workspace_manager *wsm = fs_info->compr_wsm[type];
> struct list_head *workspace;
> int cpus = num_online_cpus();
> - unsigned nofs_flag;
> + unsigned int nofs_flag;
> struct list_head *idle_ws;
> spinlock_t *ws_lock;
> atomic_t *total_ws;
> @@ -1163,17 +1164,17 @@ static u64 file_offset_from_bvec(const struct bio_vec *bvec)
> * @buf: The decompressed data buffer
> * @buf_len: The decompressed data length
> * @decompressed: Number of bytes that are already decompressed inside the
> - * compressed extent
> + * compressed extent
> * @cb: The compressed extent descriptor
> * @orig_bio: The original bio that the caller wants to read for
> *
> * An easier to understand graph is like below:
> *
> - * |<- orig_bio ->| |<- orig_bio->|
> - * |<------- full decompressed extent ----->|
> - * |<----------- @cb range ---->|
> - * | |<-- @buf_len -->|
> - * |<--- @decompressed --->|
> + * |<- orig_bio ->| |<- orig_bio->|
> + * |<------- full decompressed extent ----->|
> + * |<----------- @cb range ---->|
> + * | |<-- @buf_len -->|
> + * |<--- @decompressed --->|
> *
> * Note that, @cb can be a subpage of the full decompressed extent, but
> * @cb->start always has the same as the orig_file_offset value of the full
> @@ -1295,7 +1296,8 @@ static u32 shannon_entropy(struct heuristic_ws *ws)
> #define RADIX_BASE 4U
> #define COUNTERS_SIZE (1U << RADIX_BASE)
>
> -static u8 get4bits(u64 num, int shift) {
> +static u8 get4bits(u64 num, int shift)
> +{
> u8 low4bits;
>
> num >>= shift;
> @@ -1370,7 +1372,7 @@ static void radix_sort(struct bucket_item *array, struct bucket_item *array_buf,
> */
> memset(counters, 0, sizeof(counters));
>
> - for (i = 0; i < num; i ++) {
> + for (i = 0; i < num; i++) {
> buf_num = array_buf[i].count;
> addr = get4bits(buf_num, shift);
> counters[addr]++;
next prev parent reply other threads:[~2026-02-27 20:44 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-02-27 18:31 [PATCH 0/4] btrfs: replace BUG() and BUG_ON() with error handling Adarsh Das
2026-02-27 18:31 ` [PATCH 1/4] btrfs: replace BUG() with error handling in compression.c Adarsh Das
2026-02-27 20:22 ` Qu Wenruo
2026-02-27 18:31 ` [PATCH 2/4] btrfs: clean coding style errors and warnings " Adarsh Das
2026-02-27 20:43 ` Qu Wenruo [this message]
2026-02-27 18:31 ` [PATCH 3/4] btrfs: replace BUG() and BUG_ON() with error handling in extent-tree.c Adarsh Das
2026-02-27 20:43 ` Qu Wenruo
2026-02-27 18:31 ` [PATCH 4/4] btrfs: clean coding style errors " Adarsh Das
2026-02-27 20:44 ` Qu Wenruo
2026-02-27 21:01 ` [PATCH 0/4] btrfs: replace BUG() and BUG_ON() with error handling Qu Wenruo
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=76483879-54b1-4cea-ab1c-4642283093bc@gmx.com \
--to=quwenruo.btrfs@gmx.com \
--cc=adarshdas950@gmail.com \
--cc=clm@fb.com \
--cc=dsterba@suse.com \
--cc=linux-btrfs@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=terrelln@fb.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox