Skip to content

Commit 95e0d31

Browse files
Ryan MoellerRyan Moeller
authored andcommitted
Simplify out blake3_impl_module
Signed-off-by: Ryan Moeller <ryan@iXsystems.com>
1 parent 8a93cb8 commit 95e0d31

File tree

2 files changed

+3
-16
lines changed

2 files changed

+3
-16
lines changed

module/icp/algs/blake3/blake3_impl.c

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -70,9 +70,6 @@ static uint32_t blake3_supp_impls_cnt = 0;
7070
/* Currently selected implementation */
7171
static uint32_t blake3_impl_chosen = IMPL_FASTEST;
7272

73-
/* Implementation given via module paramter */
74-
static uint32_t blake3_impl_module = IMPL_FASTEST;
75-
7673
static struct blake3_impl_selector {
7774
const char *name;
7875
uint32_t sel;
@@ -143,13 +140,6 @@ blake3_impl_set_fastest(uint32_t id)
143140
/* setup fastest impl */
144141
memcpy(&blake3_fastest_impl, blake3_supp_impls[id],
145142
sizeof (blake3_fastest_impl));
146-
147-
/* when module paramter was set, take this impl */
148-
if (blake3_impl_module != IMPL_FASTEST) {
149-
blake3_impl_setid(blake3_impl_module);
150-
} else {
151-
blake3_impl_setid(IMPL_FASTEST);
152-
}
153143
}
154144

155145
/* set implementation by id */
@@ -314,10 +304,7 @@ static int
314304
blake3_param_set(const char *val, zfs_kernel_param_t *unused)
315305
{
316306
(void) unused;
317-
int err;
318-
err = blake3_impl_setname(val);
319-
atomic_swap_32(&blake3_impl_module, blake3_impl_chosen);
320-
return (err);
307+
return (blake3_impl_setname(val));
321308
}
322309

323310
#elif defined(__FreeBSD__)

module/zfs/zfs_chksum.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -291,6 +291,7 @@ chksum_benchmark(void)
291291
chksum_benchit(cs);
292292

293293
/* blake3 */
294+
uint32_t sel_save = blake3_impl_getid();
294295
for (id = 0; id < blake3_impl_getcnt(); id++) {
295296
blake3_impl_setid(id);
296297
cs = &chksum_stat_data[cbid++];
@@ -305,9 +306,8 @@ chksum_benchmark(void)
305306
fid = id;
306307
}
307308
}
308-
309-
/* init blake3 fastest impl and setup default one */
310309
blake3_impl_set_fastest(fid);
310+
blake3_impl_setid(sel_save);
311311
}
312312

313313
void

0 commit comments

Comments
 (0)