public inbox for linux-ext4@vger.kernel.org
 help / color / mirror / Atom feed
From: "Darrick J. Wong" <djwong@kernel.org>
To: Theodore Ts'o <tytso@mit.edu>
Cc: Ext4 Developers List <linux-ext4@vger.kernel.org>
Subject: Re: [PATCH 3/7] libsupport: don't use bzero in cache.c
Date: Mon, 4 May 2026 17:15:02 -0700	[thread overview]
Message-ID: <20260505001502.GD1101423@frogsfrogsfrogs> (raw)
In-Reply-To: <20260504233301.2345652-4-tytso@mit.edu>

On Mon, May 04, 2026 at 07:32:57PM -0400, Theodore Ts'o wrote:
> The bzero() function is deprecated and not available in some
> platforms.  It's not needed in any case because we can just use an
> automatic initializer.
> 
> Signed-off-by: Theodore Ts'o <tytso@mit.edu>
> Fixes: 30b3c80ed6bc ("libsupport: add a cache")

Yeesh.  What a sordid legacy this function has (see manpage). :(
Reviewed-by: "Darrick J. Wong" <djwong@kernel.org>

--D

> ---
>  lib/support/cache.c | 4 +---
>  1 file changed, 1 insertion(+), 3 deletions(-)
> 
> diff --git a/lib/support/cache.c b/lib/support/cache.c
> index f9669e3fc..aec785347 100644
> --- a/lib/support/cache.c
> +++ b/lib/support/cache.c
> @@ -850,7 +850,7 @@ cache_report(
>  {
>  	int		i;
>  	unsigned long	count, index, total;
> -	unsigned long	hash_bucket_lengths[HASH_REPORT + 2];
> +	unsigned long	hash_bucket_lengths[HASH_REPORT + 2] = { 0 };
>  
>  	if ((cache->c_hits + cache->c_misses) == 0)
>  		return;
> @@ -886,8 +886,6 @@ cache_report(
>  		cache->c_mrus[i].cm_count * 100 / cache->c_count);
>  
>  	/* report hash bucket lengths */
> -	bzero(hash_bucket_lengths, sizeof(hash_bucket_lengths));
> -
>  	for (i = 0; i < cache->c_hashsize; i++) {
>  		count = cache->c_hash[i].ch_count;
>  		if (count > HASH_REPORT)
> -- 
> 2.53.0
> 
> 

  reply	other threads:[~2026-05-05  0:15 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-05-04 23:32 [PATCH 0/7] fix up issues from djwong/fuse4fs-fork Theodore Ts'o
2026-05-04 23:32 ` [PATCH 1/7] libsupport: drop xbitops.h and define fls() if necessary Theodore Ts'o
2026-05-05  0:11   ` Darrick J. Wong
2026-05-04 23:32 ` [PATCH 2/7] configure.ac: fix disable fuse2fs/fuse4fs by default path Theodore Ts'o
2026-05-05  0:13   ` Darrick J. Wong
2026-05-04 23:32 ` [PATCH 3/7] libsupport: don't use bzero in cache.c Theodore Ts'o
2026-05-05  0:15   ` Darrick J. Wong [this message]
2026-05-04 23:32 ` [PATCH 4/7] fuse[24]fs: suppress clang warnings which were breaking the github CI Theodore Ts'o
2026-05-05  0:20   ` Darrick J. Wong
2026-05-04 23:32 ` [PATCH 5/7] libsupport: remove the LIST_HEAD macro from list.h Theodore Ts'o
2026-05-05  0:20   ` Darrick J. Wong
2026-05-04 23:33 ` [PATCH 6/7] libsupport: fix gcc -Wall warnings Theodore Ts'o
2026-05-05  0:20   ` Darrick J. Wong
2026-05-04 23:33 ` [PATCH 7/7] fuse2fs: fix uninitialized variable warnings Theodore Ts'o
2026-05-05  0:26   ` Darrick J. Wong
2026-05-05  0:08 ` [PATCH 0/7] fix up issues from djwong/fuse4fs-fork Darrick J. Wong
2026-05-05  7:21   ` Theodore Tso

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=20260505001502.GD1101423@frogsfrogsfrogs \
    --to=djwong@kernel.org \
    --cc=linux-ext4@vger.kernel.org \
    --cc=tytso@mit.edu \
    /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