On 06/04/2020 13:51, Anand Jain wrote:
> +static ssize_t btrfs_read_policy_store(struct kobject *kobj,
> + struct kobj_attribute *a,
> + const char *buf, size_t len)
> +{
> + int i;
> + struct btrfs_fs_devices *fs_devices = to_fs_devs(kobj);
> +
> + for (i = 0; i < BTRFS_NR_READ_POLICY; i++) {
> + if (btrfs_strmatch(buf, btrfs_read_policy_name[i]) == 0) {
> + if (i != fs_devices->read_policy) {
> + fs_devices->read_policy = i;
> + btrfs_info(fs_devices->fs_info,
> + "read policy set to '%s'",
> + btrfs_read_policy_name[i]);
> + }
> + return len;
> + }
> + }
Naive question, what's the advantage over sysfs_match_string()?