Skip to content

Commit

Permalink
fixup: Implement the "get" path of raidz_impl for Linux
Browse files Browse the repository at this point in the history
Signed-off-by:  Alan Somers <[email protected]>
  • Loading branch information
asomers committed Jan 23, 2025
1 parent 13b506c commit 6a214e6
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 3 deletions.
3 changes: 3 additions & 0 deletions include/sys/vdev_raidz.h
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,9 @@ extern const zio_vsd_ops_t vdev_raidz_vsd_ops;
/*
* vdev_raidz_math interface
*/
#if defined(__linux__)
extern const char *zfs_vdev_raidz_impl;
#endif
void vdev_raidz_math_init(void);
void vdev_raidz_math_fini(void);
const struct raidz_impl_ops *vdev_raidz_math_get_ops(void);
Expand Down
3 changes: 0 additions & 3 deletions module/os/linux/zfs/vdev_disk.c
Original file line number Diff line number Diff line change
Expand Up @@ -1637,15 +1637,12 @@ param_set_max_auto_ashift(const char *buf, zfs_kernel_param_t *kp)
return (0);
}

const char *zfs_vdev_raidz_impl = "TODO";

int
param_set_raidz_impl(const char *val, zfs_kernel_param_t *kp)
{
int error;

error = vdev_raidz_impl_set(val);

return (error);
}

Expand Down
6 changes: 6 additions & 0 deletions module/zfs/vdev_raidz_math.c
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,9 @@ static boolean_t raidz_math_initialized = B_FALSE;

static uint32_t zfs_vdev_raidz_impl_setting = IMPL_SCALAR;
static uint32_t user_sel_impl = IMPL_FASTEST;
#if defined(__linux__)
const char *zfs_vdev_raidz_impl = "fastest";
#endif

/* Hold all supported implementations */
static size_t raidz_supp_impl_cnt = 0;
Expand Down Expand Up @@ -628,6 +631,9 @@ vdev_raidz_impl_set(const char *val)
atomic_swap_32(&zfs_vdev_raidz_impl_setting, impl);
else
atomic_swap_32(&user_sel_impl, impl);
#if defined(__linux__)
zfs_vdev_raidz_impl = raidz_supp_impl[i]->name;
#endif
}

return (err);
Expand Down

0 comments on commit 6a214e6

Please sign in to comment.