From: David Sterba <dsterba@suse.cz>
To: Christoph Hellwig <hch@lst.de>
Cc: josef@toxicpanda.com, dsterba@suse.com, linux-btrfs@vger.kernel.org
Subject: Re: [PATCH] btrfs: split discard handling out of btrfs_map_block
Date: Tue, 7 Jun 2022 18:06:34 +0200 [thread overview]
Message-ID: <20220607160634.GN20633@twin.jikos.cz> (raw)
In-Reply-To: <20220603065725.40708-1-hch@lst.de>
On Fri, Jun 03, 2022 at 08:57:25AM +0200, Christoph Hellwig wrote:
> Mapping block for discard doesn't really share any code with the regular
> block mapping case. Split it out into an entirely separate helper
> that just returns an array of btrfs_discard_stripe structures and the
> number of stripes.
>
> This removes the need for the length field in the btrfs_io_context
> structure, so remove tht.
>
> Signed-off-by: Christoph Hellwig <hch@lst.de>
Added to misc-next, thanks.
> /* we don't discard raid56 yet */
> - if (map->type & BTRFS_BLOCK_GROUP_RAID56_MASK) {
> - ret = -EOPNOTSUPP;
> - goto out;
> - }
> + ret = -EOPNOTSUPP;
> + if (map->type & BTRFS_BLOCK_GROUP_RAID56_MASK)
> + goto out_free_map;
Please don't use this error value pattern in btrfs code, the preferred
style is
if (condition()) {
ret = ERROR;
goto label;
}
prev parent reply other threads:[~2022-06-07 16:11 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-06-03 6:57 [PATCH] btrfs: split discard handling out of btrfs_map_block Christoph Hellwig
2022-06-06 13:17 ` Nikolay Borisov
2022-06-07 16:06 ` David Sterba [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=20220607160634.GN20633@twin.jikos.cz \
--to=dsterba@suse.cz \
--cc=dsterba@suse.com \
--cc=hch@lst.de \
--cc=josef@toxicpanda.com \
--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