Re: [PATCH] btrfs: sysfs: set / query btrfs stripe size
From: Johannes Thumshirn <hidden>
Date: 2021-10-27 07:20:29
From: Johannes Thumshirn <hidden>
Date: 2021-10-27 07:20:29
On 27/10/2021 08:51, Damien Le Moal wrote:
quoted
static ssize_t btrfs_stripe_size_show(struct kobject *kobj, struct kobj_attribute *a, char *buf) { struct btrfs_space_info *sinfo = to_space_info(kobj); struct btrfs_fs_info *fs_info = to_fs_info(get_btrfs_kobj(kobj)); u64 max_stripe_size; spin_lock(&sinfo->lock); if (btrfs_is_zoned(fs_info)) max_stripe_size = fs_info->zone_size; else max_stripe_size = sinfo->max_stripe_size; spin_unlock(&sinfo->lock);This will not work once we have stripped zoned volume though, won't it ? Why is not max_stripe_size set to zone size for a simple zoned btrfs volume ?
The other possibility would be to have compute_stripe_size() fan out into compute_stripe_size_regular() or compute_stripe_size_zoned() which will do the right thing for each.