@@ -81,7 +81,7 @@ static boolean_t raidz_math_initialized = B_FALSE;
8181
8282#define RAIDZ_IMPL_READ (i ) (*(volatile uint32_t *) &(i))
8383
84- static uint32_t zfs_vdev_raidz_impl = IMPL_SCALAR ;
84+ uint32_t zfs_vdev_raidz_impl = IMPL_SCALAR ;
8585static uint32_t user_sel_impl = IMPL_FASTEST ;
8686
8787/* Hold all supported implementations */
@@ -634,16 +634,8 @@ vdev_raidz_impl_set(const char *val)
634634}
635635
636636#if defined(_KERNEL )
637- #if defined(__linux__ ) || defined(_WIN32 )
638-
639- static int
640- zfs_vdev_raidz_impl_set (const char * val , zfs_kernel_param_t * kp )
641- {
642- return (vdev_raidz_impl_set (val ));
643- }
644-
645- static int
646- zfs_vdev_raidz_impl_get (char * buffer , zfs_kernel_param_t * kp )
637+ int
638+ vdev_raidz_impl_get (char * buffer , size_t size )
647639{
648640 int i , cnt = 0 ;
649641 char * fmt ;
@@ -654,20 +646,19 @@ zfs_vdev_raidz_impl_get(char *buffer, zfs_kernel_param_t *kp)
654646 /* list mandatory options */
655647 for (i = 0 ; i < ARRAY_SIZE (math_impl_opts ) - 2 ; i ++ ) {
656648 fmt = (impl == math_impl_opts [i ].sel ) ? "[%s] " : "%s " ;
657- cnt += kmem_scnprintf (buffer + cnt , PAGE_SIZE - cnt , fmt ,
649+ cnt += kmem_scnprintf (buffer + cnt , size - cnt , fmt ,
658650 math_impl_opts [i ].name );
659651 }
660652
661653 /* list all supported implementations */
662654 for (i = 0 ; i < raidz_supp_impl_cnt ; i ++ ) {
663655 fmt = (i == impl ) ? "[%s] " : "%s " ;
664- cnt += kmem_scnprintf (buffer + cnt , PAGE_SIZE - cnt , fmt ,
656+ cnt += kmem_scnprintf (buffer + cnt , size - cnt , fmt ,
665657 raidz_supp_impl [i ]-> name );
666658 }
667659
668660 return (cnt );
669661}
670- #endif /* Linux || Windows */
671662
672663#ifdef _WIN32
673664int
@@ -693,7 +684,4 @@ win32_zfs_vdev_raidz_impl_set(ZFS_MODULE_PARAM_ARGS)
693684}
694685#endif
695686
696- module_param_call (zfs_vdev_raidz_impl , zfs_vdev_raidz_impl_set ,
697- zfs_vdev_raidz_impl_get , NULL , 0644 );
698- MODULE_PARM_DESC (zfs_vdev_raidz_impl , "Select raidz implementation." );
699687#endif
0 commit comments