From: Josef Bacik <josef@toxicpanda.com>
To: Goffredo Baroncelli <kreijack@libero.it>, linux-btrfs@vger.kernel.org
Cc: Zygo Blaxell <ce3g8jdj@umail.furryterror.org>,
Goffredo Baroncelli <kreijack@inwind.it>
Subject: Re: [PATCH 2/5] btrfs: add flags to give an hint to the chunk allocator
Date: Wed, 10 Feb 2021 11:09:45 -0500 [thread overview]
Message-ID: <3f283f4c-889f-aec1-7906-69fa72d1c09d@toxicpanda.com> (raw)
In-Reply-To: <20210201212820.64381-3-kreijack@libero.it>
On 2/1/21 4:28 PM, Goffredo Baroncelli wrote:
> From: Goffredo Baroncelli <kreijack@inwind.it>
>
> Add the following flags to give an hint about which chunk should be
> allocated in which a disk.
> The following flags are created:
>
> - BTRFS_DEV_ALLOCATION_PREFERRED_DATA
> preferred data chunk, but metadata chunk allowed
> - BTRFS_DEV_ALLOCATION_PREFERRED_METADATA
> preferred metadata chunk, but data chunk allowed
> - BTRFS_DEV_ALLOCATION_METADATA_ONLY
> only metadata chunk allowed
> - BTRFS_DEV_ALLOCATION_DATA_ONLY
> only data chunk allowed
>
> Signed-off-by: Goffredo Baroncelli <kreijack@inwid.it>
> ---
> include/uapi/linux/btrfs_tree.h | 18 ++++++++++++++++++
> 1 file changed, 18 insertions(+)
>
> diff --git a/include/uapi/linux/btrfs_tree.h b/include/uapi/linux/btrfs_tree.h
> index 58d7cff9afb1..bd3af853df0c 100644
> --- a/include/uapi/linux/btrfs_tree.h
> +++ b/include/uapi/linux/btrfs_tree.h
> @@ -361,6 +361,24 @@ struct btrfs_key {
> __u64 offset;
> } __attribute__ ((__packed__));
>
> +/* dev_item.type */
> +
> +/* btrfs chunk allocation hints */
> +#define BTRFS_DEV_ALLOCATION_MASK_BIT_COUNT 3
> +#define BTRFS_DEV_ALLOCATION_MASK ((1ULL << \
> + BTRFS_DEV_ALLOCATION_MASK_BIT_COUNT) -1)
> +#define BTRFS_DEV_ALLOCATION_MASK_COUNT (1ULL << \
> + BTRFS_DEV_ALLOCATION_MASK_BIT_COUNT)
We just want to define the actual values that are going to disk, helpers can be
defined elsewhere. Thanks,
Josef
next prev parent reply other threads:[~2021-02-10 16:10 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-02-01 21:28 [RFC][PATCH V6] btrfs: allocation_hint mode Goffredo Baroncelli
2021-02-01 21:28 ` [PATCH 1/5] btrfs: add ioctl BTRFS_IOC_DEV_PROPERTIES Goffredo Baroncelli
2021-02-10 16:08 ` Josef Bacik
2021-02-11 18:47 ` Goffredo Baroncelli
2021-02-01 21:28 ` [PATCH 2/5] btrfs: add flags to give an hint to the chunk allocator Goffredo Baroncelli
2021-02-10 16:09 ` Josef Bacik [this message]
2021-02-11 18:47 ` Goffredo Baroncelli
2021-02-01 21:28 ` [PATCH 3/5] btrfs: export dev_item.type in /sys/fs/btrfs/<uuid>/devinfo/<devid>/type Goffredo Baroncelli
2021-02-01 21:28 ` [PATCH 4/5] btrfs: add allocation_hint option Goffredo Baroncelli
2021-02-10 16:14 ` Josef Bacik
2021-02-11 18:46 ` Goffredo Baroncelli
2021-02-01 21:28 ` [PATCH 5/5] btrfs: add allocator_hint mode Goffredo Baroncelli
2021-02-04 23:24 ` Zygo Blaxell
2021-02-05 18:01 ` Goffredo Baroncelli
2021-02-10 16:12 ` Josef Bacik
2021-02-11 18:46 ` Goffredo Baroncelli
2021-02-19 18:51 ` Goffredo Baroncelli
2021-02-10 16:04 ` [RFC][PATCH V6] btrfs: allocation_hint mode Josef Bacik
2021-02-11 18:47 ` Goffredo Baroncelli
2021-02-11 18:58 ` Josef Bacik
2021-02-16 22:27 ` Josef Bacik
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=3f283f4c-889f-aec1-7906-69fa72d1c09d@toxicpanda.com \
--to=josef@toxicpanda.com \
--cc=ce3g8jdj@umail.furryterror.org \
--cc=kreijack@inwind.it \
--cc=kreijack@libero.it \
--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