]> www.infradead.org Git - users/jedix/linux-maple.git/commit
btrfs: sysfs: add btrfs_read_policy_to_enum() helper and refactor read policy store
authorAnand Jain <anand.jain@oracle.com>
Wed, 1 Jan 2025 18:06:32 +0000 (02:06 +0800)
committerDavid Sterba <dsterba@suse.com>
Mon, 13 Jan 2025 13:53:21 +0000 (14:53 +0100)
commit38cae63137d5e13dc3c2ba88c4f393be4a6bf4bb
tree34a7b0ac6b018a3e8016e5d1ba21472fa3c63c2d
parent83be7f8b9c24bd040a348577c7c84fd08911707f
btrfs: sysfs: add btrfs_read_policy_to_enum() helper and refactor read policy store

Introduce btrfs_read_policy_to_enum() helper to simplify the conversion
of a string read policy to its corresponding enum value. This reduces
duplication and improves code clarity in btrfs_read_policy_store().

The parameter is copied locally to allow modification, enabling the
separation of the method and its value. This prepares for the addition of
more functionality in subsequent patches.

Signed-off-by: Anand Jain <anand.jain@oracle.com>
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
fs/btrfs/sysfs.c