Skip to content

Commit

Permalink
RAIDZ ABD changes
Browse files Browse the repository at this point in the history
new iterator functions for raidz gen and rec (max 6 mapped pages at once)
abd iter now handles irq_save/restore if needed
make abd iterator precise: iter.length always shows real value (0 when exhausted)
pass size on abd_get_offset
  • Loading branch information
ironMann committed Jun 30, 2016
1 parent 7db5384 commit 84adc45
Show file tree
Hide file tree
Showing 5 changed files with 253 additions and 50 deletions.
24 changes: 17 additions & 7 deletions include/sys/abd.h
Original file line number Diff line number Diff line change
Expand Up @@ -56,13 +56,13 @@ typedef struct arc_buf_data {
};
} abd_t;

#define ABD_F_SCATTER (0) /* abd is scatter */
#define ABD_F_LINEAR (1) /* abd is linear */
#define ABD_F_OWNER (1<<1) /* abd owns the buffer */
#define ABD_F_HIGHMEM (1<<2) /* abd uses highmem */
#define ABD_F_SCATTER (1U << 0) /* abd is scatter */
#define ABD_F_LINEAR (1U << 1) /* abd is linear */
#define ABD_F_OWNER (1U << 2) /* abd owns the buffer */
#define ABD_F_HIGHMEM (1U << 3) /* abd uses highmem */

#define ABD_IS_SCATTER(abd) (!((abd)->abd_flags & ABD_F_LINEAR))
#define ABD_IS_LINEAR(abd) (!ABD_IS_SCATTER(abd))
#define ABD_IS_SCATTER(abd) (!!((abd)->abd_flags & ABD_F_SCATTER))
#define ABD_IS_LINEAR(abd) (!!((abd)->abd_flags & ABD_F_LINEAR))
#define ASSERT_ABD_SCATTER(abd) ASSERT(ABD_IS_SCATTER(abd))
#define ASSERT_ABD_LINEAR(abd) ASSERT(ABD_IS_LINEAR(abd))

Expand All @@ -89,7 +89,7 @@ abd_t *_abd_alloc_scatter(size_t, int);
#define abd_alloc_meta_scatter(s) _abd_alloc_scatter(s, 0)
abd_t *abd_alloc_linear(size_t);
void abd_free(abd_t *, size_t);
abd_t *abd_get_offset(abd_t *, size_t);
abd_t *abd_get_offset(abd_t *, size_t, size_t);
abd_t *abd_get_from_buf(void *, size_t);
void abd_put(abd_t *);

Expand All @@ -111,6 +111,16 @@ int abd_cmp(abd_t *, abd_t *, size_t);
int abd_cmp_buf_off(abd_t *, const void *, size_t, size_t);
void abd_zero_off(abd_t *, size_t, size_t);
void *abd_buf_segment(abd_t *, size_t, size_t);

/*
* ABD operations for RAIDZ vdev
*/
void abd_raidz_gen_iterate(abd_t **, abd_t *, ssize_t, ssize_t, const unsigned,
void (*)(void **, const void *, size_t, size_t));
void abd_raidz_rec_iterate(abd_t **, abd_t **, ssize_t, const unsigned,
void (*)(void **, const size_t, void **, const unsigned *),
const unsigned *);

/*
* abd_array_off - returns an object in an array contained in @abd
*
Expand Down
Loading

0 comments on commit 84adc45

Please sign in to comment.