linux-btrfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Josef Bacik <josef@toxicpanda.com>
To: Johannes Thumshirn <johannes.thumshirn@wdc.com>
Cc: linux-btrfs@vger.kernel.org
Subject: Re: [RFC v3 01/11] btrfs: add raid stripe tree definitions
Date: Thu, 20 Oct 2022 11:21:07 -0400	[thread overview]
Message-ID: <Y1FnY2PAe14ClUNm@localhost.localdomain> (raw)
In-Reply-To: <6ca9b49af62a15f7a3482aca3f2566cc10ce8330.1666007330.git.johannes.thumshirn@wdc.com>

On Mon, Oct 17, 2022 at 04:55:19AM -0700, Johannes Thumshirn wrote:
> Add definitions for the raid stripe tree. This tree will hold information
> about the on-disk layout of the stripes in a RAID set.
> 
> Each stripe extent has a 1:1 relationship with an on-disk extent item and
> is doing the logical to per-drive physical address translation for the
> extent item in question.
> 
> Signed-off-by: Johannes Thumshirn <johannes.thumshirn@wdc.com>
> ---
>  fs/btrfs/ctree.h                | 29 +++++++++++++++++++++++++++++
>  include/uapi/linux/btrfs_tree.h | 20 ++++++++++++++++++--
>  2 files changed, 47 insertions(+), 2 deletions(-)
> 
> diff --git a/fs/btrfs/ctree.h b/fs/btrfs/ctree.h
> index 87bb4218276b..80ead27299dc 100644
> --- a/fs/btrfs/ctree.h
> +++ b/fs/btrfs/ctree.h
> @@ -1992,6 +1992,35 @@ BTRFS_SETGET_FUNCS(timespec_nsec, struct btrfs_timespec, nsec, 32);
>  BTRFS_SETGET_STACK_FUNCS(stack_timespec_sec, struct btrfs_timespec, sec, 64);
>  BTRFS_SETGET_STACK_FUNCS(stack_timespec_nsec, struct btrfs_timespec, nsec, 32);
>  
> +BTRFS_SETGET_FUNCS(stripe_extent_devid, struct btrfs_stripe_extent, devid, 64);
> +BTRFS_SETGET_FUNCS(stripe_extent_physical, struct btrfs_stripe_extent, physical, 64);
> +BTRFS_SETGET_STACK_FUNCS(stack_stripe_extent_devid, struct btrfs_stripe_extent, devid, 64);
> +BTRFS_SETGET_STACK_FUNCS(stack_stripe_extent_physical, struct btrfs_stripe_extent, physical, 64);
> +
> +static inline struct btrfs_stripe_extent *btrfs_stripe_extent_nr(
> +					 struct btrfs_dp_stripe *dps, int nr)
> +{
> +	unsigned long offset = (unsigned long)dps;
> +
> +	offset += offsetof(struct btrfs_dp_stripe, extents);
> +	offset += nr * sizeof(struct btrfs_stripe_extent);
> +	return (struct btrfs_stripe_extent *)offset;
> +}
> +
> +static inline u64 btrfs_stripe_extent_devid_nr(const struct extent_buffer *eb,
> +					       struct btrfs_dp_stripe *dps,
> +					       int nr)
> +{
> +	return btrfs_stripe_extent_devid(eb, btrfs_stripe_extent_nr(dps, nr));
> +}
> +
> +static inline u64 btrfs_stripe_extent_physical_nr(const struct extent_buffer *eb,
> +						  struct btrfs_dp_stripe *dps,
> +						  int nr)
> +{
> +	return btrfs_stripe_extent_physical(eb, btrfs_stripe_extent_nr(dps, nr));
> +}
> +
>  /* struct btrfs_dev_extent */
>  BTRFS_SETGET_FUNCS(dev_extent_chunk_tree, struct btrfs_dev_extent,
>  		   chunk_tree, 64);
> diff --git a/include/uapi/linux/btrfs_tree.h b/include/uapi/linux/btrfs_tree.h
> index 5f32a2a495dc..047e1d0b2ff6 100644
> --- a/include/uapi/linux/btrfs_tree.h
> +++ b/include/uapi/linux/btrfs_tree.h
> @@ -4,9 +4,8 @@
>  
>  #include <linux/btrfs.h>
>  #include <linux/types.h>
> -#ifdef __KERNEL__
>  #include <linux/stddef.h>
> -#else
> +#ifndef __KERNEL__
>  #include <stddef.h>
>  #endif
> 

Gotta act like I did something, this is unrelated and should probably be it's
own thing separate from the raid stripe tree.  Thanks,

Josef

  reply	other threads:[~2022-10-20 15:21 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-10-17 11:55 [RFC v3 00/11] btrfs: raid-stripe-tree draft patches Johannes Thumshirn
2022-10-17 11:55 ` [RFC v3 01/11] btrfs: add raid stripe tree definitions Johannes Thumshirn
2022-10-20 15:21   ` Josef Bacik [this message]
2022-10-20 15:49     ` Johannes Thumshirn
2022-10-17 11:55 ` [RFC v3 02/11] btrfs: read raid-stripe-tree from disk Johannes Thumshirn
2022-10-17 11:55 ` [RFC v3 03/11] btrfs: add support for inserting raid stripe extents Johannes Thumshirn
2022-10-20 15:24   ` Josef Bacik
2022-10-20 15:30   ` Josef Bacik
2022-10-21  8:13     ` Johannes Thumshirn
2022-10-17 11:55 ` [RFC v3 04/11] btrfs: delete stripe extent on extent deletion Johannes Thumshirn
2022-10-17 11:55 ` [RFC v3 05/11] btrfs: lookup physical address from stripe extent Johannes Thumshirn
2022-10-20 15:34   ` Josef Bacik
2022-10-21  8:16     ` Johannes Thumshirn
2022-10-17 11:55 ` [RFC v3 06/11] btrfs: add raid stripe tree pretty printer Johannes Thumshirn
2022-10-20 15:34   ` Josef Bacik
2022-10-17 11:55 ` [RFC v3 07/11] btrfs: zoned: allow zoned RAID1 Johannes Thumshirn
2022-10-20 15:35   ` Josef Bacik
2022-10-17 11:55 ` [RFC v3 08/11] btrfs: allow zoned RAID0 and 10 Johannes Thumshirn
2022-10-20 15:36   ` Josef Bacik
2022-10-17 11:55 ` [RFC v3 09/11] btrfs: fix striping with RST Johannes Thumshirn
2022-10-20 15:36   ` Josef Bacik
2022-10-17 11:55 ` [RFC v3 10/11] btrfs: check for leaks of ordered stripes on umount Johannes Thumshirn
2022-10-20 15:37   ` Josef Bacik
2022-10-21  8:17     ` Johannes Thumshirn
2022-10-17 11:55 ` [RFC v3 11/11] btrfs: add tracepoints for ordered stripes Johannes Thumshirn
2022-10-20 15:38   ` Josef Bacik
2022-10-20 15:42 ` [RFC v3 00/11] btrfs: raid-stripe-tree draft patches Josef Bacik
2022-10-21  8:40   ` 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=Y1FnY2PAe14ClUNm@localhost.localdomain \
    --to=josef@toxicpanda.com \
    --cc=johannes.thumshirn@wdc.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;
as well as URLs for NNTP newsgroup(s).