All of lore.kernel.org
 help / color / mirror / Atom feed
From: Christoph Hellwig <hch@lst.de>
To: Johannes Thumshirn <Johannes.Thumshirn@wdc.com>
Cc: "hch@infradead.org" <hch@infradead.org>,
	Qu Wenruo <quwenruo.btrfs@gmx.com>,
	David Sterba <dsterba@suse.cz>,
	"linux-btrfs@vger.kernel.org" <linux-btrfs@vger.kernel.org>,
	Josef Bacik <josef@toxicpanda.com>,
	Christoph Hellwig <hch@lst.de>
Subject: Re: [PATCH v7 04/13] btrfs: add support for inserting raid stripe extents
Date: Wed, 8 Mar 2023 15:33:30 +0100	[thread overview]
Message-ID: <20230308143330.GB14929@lst.de> (raw)
In-Reply-To: <e9e7820b-9cf3-8361-cf3c-e4d59baa5b21@wdc.com>

On Wed, Mar 08, 2023 at 09:11:54AM +0000, Johannes Thumshirn wrote:
> @@ -393,10 +378,12 @@ static void btrfs_orig_write_end_io(struct bio *bio)
>                 stripe->physical = bio->bi_iter.bi_sector << SECTOR_SHIFT;
>  
>         if (btrfs_need_stripe_tree_update(bioc->fs_info, bioc->map_type)) {
> +               struct btrfs_ordered_extent *oe;
> +
> +               oe = btrfs_lookup_ordered_extent(bbio->inode, bbio->file_offset);
> +               btrfs_get_bioc(bioc);
> +               oe->bioc = bioc;
> +               btrfs_put_ordered_extent(oe);


> +       } else if (ordered_extent->bioc) {
> +               ret = btrfs_add_ordered_stripe(ordered_extent->bioc);
> +               btrfs_put_bioc(ordered_extent->bioc);
> +               if (ret)
> +                       goto out;

Given that btrfs_add_ordered_stripe only really builds the
btrfs_ordered_stripe structure and inserts it into the tree,
can't we just allocate the btrfs_ordered_stripe structure
in the end_io handler and have the ordered_extent point to it?

Also if you don't to split the ordered_extent for each bio,
you could instead have a list of btrfs_ordered_stripes in the
ordered_extent and then process all of them in the ordered_extent
completion handling.

  parent reply	other threads:[~2023-03-08 14:33 UTC|newest]

Thread overview: 49+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-03-02  9:45 [PATCH v7 00/13] btrfs: introduce RAID stripe tree Johannes Thumshirn
2023-03-02  9:45 ` [PATCH v7 01/13] btrfs: re-add trans parameter to insert_delayed_ref Johannes Thumshirn
2023-03-02 13:36   ` Anand Jain
2023-03-02  9:45 ` [PATCH v7 02/13] btrfs: add raid stripe tree definitions Johannes Thumshirn
2023-03-02  9:45 ` [PATCH v7 03/13] btrfs: read raid-stripe-tree from disk Johannes Thumshirn
2023-03-02  9:45 ` [PATCH v7 04/13] btrfs: add support for inserting raid stripe extents Johannes Thumshirn
2023-03-02 10:58   ` Qu Wenruo
2023-03-02 11:25     ` Johannes Thumshirn
2023-03-02 11:45       ` Qu Wenruo
2023-03-02 11:58         ` Johannes Thumshirn
2023-03-02 12:01           ` Qu Wenruo
2023-03-02 14:01           ` Christoph Hellwig
2023-03-02 15:31             ` Johannes Thumshirn
2023-03-02 22:35               ` Qu Wenruo
2023-03-03 11:15                 ` Johannes Thumshirn
2023-03-03 11:42                   ` Qu Wenruo
2023-03-03 14:21                     ` hch
2023-03-06 10:58                       ` Johannes Thumshirn
2023-03-03 14:17                   ` hch
2023-03-03 14:16                 ` hch
2023-03-08  9:11                   ` Johannes Thumshirn
2023-03-08 12:01                     ` Qu Wenruo
2023-03-08 14:33                     ` Christoph Hellwig [this message]
2023-03-09 10:53                       ` Johannes Thumshirn
2023-03-09 15:20                         ` Christoph Hellwig
2023-03-03 14:15               ` hch
2023-03-02 11:45       ` Johannes Thumshirn
2023-03-02 14:03         ` Christoph Hellwig
2023-03-02 13:59       ` Christoph Hellwig
2023-03-02 15:29         ` Johannes Thumshirn
2023-03-03  0:13         ` Qu Wenruo
2023-03-03 14:15           ` Christoph Hellwig
2023-03-03 23:03             ` Qu Wenruo
2023-03-06 17:11               ` Christoph Hellwig
2023-03-02  9:45 ` [PATCH v7 05/13] btrfs: delete stripe extent on extent deletion Johannes Thumshirn
2023-03-02  9:45 ` [PATCH v7 06/13] btrfs: lookup physical address from stripe extent Johannes Thumshirn
2023-03-02  9:45 ` [PATCH v7 07/13] btrfs: add raid stripe tree pretty printer Johannes Thumshirn
2023-03-02  9:45 ` [PATCH v7 08/13] btrfs: zoned: allow zoned RAID Johannes Thumshirn
2023-03-02  9:45 ` [PATCH v7 09/13] btrfs: check for leaks of ordered stripes on umount Johannes Thumshirn
2023-03-02  9:45 ` [PATCH v7 10/13] btrfs: add tracepoints for ordered stripes Johannes Thumshirn
2023-03-02  9:45 ` [PATCH v7 11/13] btrfs: announce presence of raid-stripe-tree in sysfs Johannes Thumshirn
2023-03-02  9:45 ` [PATCH v7 12/13] btrfs: consult raid-stripe-tree when scrubbing Johannes Thumshirn
2023-03-02  9:45 ` [PATCH v7 13/13] btrfs: add raid-stripe-tree to features enabled with debug Johannes Thumshirn
2023-03-03 23:27   ` Anand Jain
2023-03-09  7:08   ` Naohiro Aota
2023-03-02 19:38 ` [PATCH v7 00/13] btrfs: introduce RAID stripe tree Neal Gompa
2023-03-03  8:45   ` Johannes Thumshirn
2023-03-03  9:29 ` Anand Jain
2023-03-03 10:32   ` Johannes Thumshirn

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=20230308143330.GB14929@lst.de \
    --to=hch@lst.de \
    --cc=Johannes.Thumshirn@wdc.com \
    --cc=dsterba@suse.cz \
    --cc=hch@infradead.org \
    --cc=josef@toxicpanda.com \
    --cc=linux-btrfs@vger.kernel.org \
    --cc=quwenruo.btrfs@gmx.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.