diff options
author | Gvozden Neskovic <[email protected]> | 2016-07-17 19:41:11 +0200 |
---|---|---|
committer | Brian Behlendorf <[email protected]> | 2016-07-19 16:43:07 -0700 |
commit | c9187d867fee3972de48b71762407ae7dabb2563 (patch) | |
tree | c1d7fdb7f5761cba9aa14f0743b8c3a57def392f /include | |
parent | 1d9b3bd8fb2b633b7523d9f39149d76e24ffb535 (diff) |
Fixes and enhancements of SIMD raidz parity
- Implementation lock replaced with atomic variable
- Trailing whitespace is removed from user specified parameter, to enhance
experience when using commands that add newline, e.g. `echo`
- raidz_test: remove dependency on `getrusage()` and RUSAGE_THREAD, Issue #4813
- silence `cppcheck` in vdev_raidz, partial solution of Issue #1392
- Minor fixes and cleanups
- Enable use of original parity methods in [fastest] configuration.
New opaque original ops structure, representing native methods, is added
to supported raidz methods. Original parity methods are executed if selected
implementation has NULL fn pointer.
Signed-off-by: Gvozden Neskovic <[email protected]>
Signed-off-by: Brian Behlendorf <[email protected]>
Issue #4813
Issue #1392
Diffstat (limited to 'include')
-rw-r--r-- | include/sys/vdev_raidz.h | 18 | ||||
-rw-r--r-- | include/sys/vdev_raidz_impl.h | 6 |
2 files changed, 14 insertions, 10 deletions
diff --git a/include/sys/vdev_raidz.h b/include/sys/vdev_raidz.h index d0c682ee4..06e21af41 100644 --- a/include/sys/vdev_raidz.h +++ b/include/sys/vdev_raidz.h @@ -40,8 +40,8 @@ struct kernel_param {}; /* * vdev_raidz interface */ -struct raidz_map * vdev_raidz_map_alloc(struct zio *, uint64_t, uint64_t, - uint64_t); +struct raidz_map * vdev_raidz_map_alloc(struct zio *, uint64_t, uint64_t, + uint64_t); void vdev_raidz_map_free(struct raidz_map *); void vdev_raidz_generate_parity(struct raidz_map *); int vdev_raidz_reconstruct(struct raidz_map *, const int *, int); @@ -49,13 +49,13 @@ int vdev_raidz_reconstruct(struct raidz_map *, const int *, int); /* * vdev_raidz_math interface */ -void vdev_raidz_math_init(void); -void vdev_raidz_math_fini(void); -void vdev_raidz_math_get_ops(struct raidz_map *); -void vdev_raidz_math_generate(struct raidz_map *); -int vdev_raidz_math_reconstruct(struct raidz_map *, const int *, - const int *, const int); -int vdev_raidz_impl_set(const char *); +void vdev_raidz_math_init(void); +void vdev_raidz_math_fini(void); +struct raidz_impl_ops * vdev_raidz_math_get_ops(void); +int vdev_raidz_math_generate(struct raidz_map *); +int vdev_raidz_math_reconstruct(struct raidz_map *, + const int *, const int *, const int); +int vdev_raidz_impl_set(const char *); #ifdef __cplusplus } diff --git a/include/sys/vdev_raidz_impl.h b/include/sys/vdev_raidz_impl.h index ddb590c5c..2b3694f0a 100644 --- a/include/sys/vdev_raidz_impl.h +++ b/include/sys/vdev_raidz_impl.h @@ -89,13 +89,15 @@ typedef boolean_t (*will_work_f)(void); typedef void (*init_impl_f)(void); typedef void (*fini_impl_f)(void); +#define RAIDZ_IMPL_NAME_MAX (16) + typedef struct raidz_impl_ops { init_impl_f init; fini_impl_f fini; raidz_gen_f gen[RAIDZ_GEN_NUM]; /* Parity generate functions */ raidz_rec_f rec[RAIDZ_REC_NUM]; /* Data reconstruction functions */ will_work_f is_supported; /* Support check function */ - char *name; /* Name of the implementation */ + char name[RAIDZ_IMPL_NAME_MAX]; /* Name of the implementation */ } raidz_impl_ops_t; typedef struct raidz_col { @@ -127,6 +129,8 @@ typedef struct raidz_map { raidz_col_t rm_col[1]; /* Flexible array of I/O columns */ } raidz_map_t; +#define RAIDZ_ORIGINAL_IMPL (INT_MAX) + extern const raidz_impl_ops_t vdev_raidz_scalar_impl; #if defined(__x86_64) && defined(HAVE_SSE2) /* only x86_64 for now */ extern const raidz_impl_ops_t vdev_raidz_sse2_impl; |