From: Goldwyn Rodrigues <rgoldwyn@suse.de>
To: dsterba@suse.cz, linux-btrfs@vger.kernel.org
Subject: Re: [PATCH 1/3] btrfs: Initialize btrfs_io_ctl instead of memsetting it
Date: Wed, 27 Feb 2019 11:02:25 -0600 [thread overview]
Message-ID: <20190227170225.ew57rgkm4linbafj@merlin> (raw)
In-Reply-To: <20190227154705.GR24609@twin.jikos.cz>
On 16:47 27/02, David Sterba wrote:
> On Mon, Feb 25, 2019 at 01:07:42PM -0600, Goldwyn Rodrigues wrote:
> > From: Goldwyn Rodrigues <rgoldwyn@suse.com>
> >
> > io_ctl_init() memsets it to zero anyways. However, I presume the
> > memset was added to avoid the WARN_ON in io_ctl_init().
>
> I don't see any WARN_ON in io_ctl_init, you probably mean
> __btrfs_write_out_cache.
Yes, __btrfs_write_out_cache.
> >
> > Signed-off-by: Goldwyn Rodrigues <rgoldwyn@suse.com>
> > ---
> > fs/btrfs/free-space-cache.c | 3 +--
> > 1 file changed, 1 insertion(+), 2 deletions(-)
> >
> > diff --git a/fs/btrfs/free-space-cache.c b/fs/btrfs/free-space-cache.c
> > index 74aa552f4793..c813378ebf08 100644
> > --- a/fs/btrfs/free-space-cache.c
> > +++ b/fs/btrfs/free-space-cache.c
> > @@ -3544,13 +3544,12 @@ int btrfs_write_out_ino_cache(struct btrfs_root *root,
> > struct btrfs_fs_info *fs_info = root->fs_info;
> > struct btrfs_free_space_ctl *ctl = root->free_ino_ctl;
> > int ret;
> > - struct btrfs_io_ctl io_ctl;
> > + struct btrfs_io_ctl io_ctl = {0};
>
> Doesn't this zero the bytes unconditionally? The memset below happens
> only when the inode cache is on.
Yes, but does it matter. I assumed assignment is faster than memset, but
a google search says gcc optimization is smart enough now. So, this patch
seems irrelevant.
--
Goldwyn
prev parent reply other threads:[~2019-02-27 17:02 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-02-25 19:07 [PATCH 1/3] btrfs: Initialize btrfs_io_ctl instead of memsetting it Goldwyn Rodrigues
2019-02-25 19:07 ` [PATCH 2/3] btrfs: Initialize inode->i_op once in btrfs_symlink Goldwyn Rodrigues
2019-02-27 15:39 ` David Sterba
2019-02-25 19:07 ` [PATCH 3/3] btrfs: Perform locking/unlocking in btrfs_remap_file_range() Goldwyn Rodrigues
2019-02-26 12:08 ` Filipe Manana
2019-02-26 12:57 ` Goldwyn Rodrigues
2019-02-27 14:52 ` David Sterba
2019-02-27 15:06 ` David Sterba
2019-03-25 19:22 ` David Sterba
2019-02-27 15:47 ` [PATCH 1/3] btrfs: Initialize btrfs_io_ctl instead of memsetting it David Sterba
2019-02-27 17:02 ` Goldwyn Rodrigues [this message]
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=20190227170225.ew57rgkm4linbafj@merlin \
--to=rgoldwyn@suse.de \
--cc=dsterba@suse.cz \
--cc=linux-btrfs@vger.kernel.org \
/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;
as well as URLs for NNTP newsgroup(s).