Re: [PATCH v7 3/5] btrfs: create read policy sysfs attribute, pid

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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()?




[Index of Archives]     [Linux Filesystem Development]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux