aboutsummaryrefslogtreecommitdiffstats
path: root/module/zfs/abd.c
diff options
context:
space:
mode:
Diffstat (limited to 'module/zfs/abd.c')
-rw-r--r--module/zfs/abd.c14
1 files changed, 5 insertions, 9 deletions
diff --git a/module/zfs/abd.c b/module/zfs/abd.c
index 3c7893dcd..5e31d192e 100644
--- a/module/zfs/abd.c
+++ b/module/zfs/abd.c
@@ -581,14 +581,12 @@ abd_free_struct(abd_t *abd)
abd_t *
abd_alloc(size_t size, boolean_t is_metadata)
{
- abd_t *abd;
-
if (!zfs_abd_scatter_enabled || size <= PAGESIZE)
return (abd_alloc_linear(size, is_metadata));
VERIFY3U(size, <=, SPA_MAXBLOCKSIZE);
- abd = abd_alloc_struct();
+ abd_t *abd = abd_alloc_struct();
abd->abd_flags = ABD_FLAG_OWNER;
abd_alloc_pages(abd, size);
@@ -1108,10 +1106,9 @@ abd_iterate_func(abd_t *abd, size_t off, size_t size,
abd_iter_advance(&aiter, off);
while (size > 0) {
- size_t len;
abd_iter_map(&aiter);
- len = MIN(aiter.iter_mapsize, size);
+ size_t len = MIN(aiter.iter_mapsize, size);
ASSERT3U(len, >, 0);
ret = func(aiter.iter_mapaddr, len, private);
@@ -1242,13 +1239,12 @@ abd_iterate_func2(abd_t *dabd, abd_t *sabd, size_t doff, size_t soff,
abd_iter_advance(&saiter, soff);
while (size > 0) {
- size_t dlen, slen, len;
abd_iter_map(&daiter);
abd_iter_map(&saiter);
- dlen = MIN(daiter.iter_mapsize, size);
- slen = MIN(saiter.iter_mapsize, size);
- len = MIN(dlen, slen);
+ size_t dlen = MIN(daiter.iter_mapsize, size);
+ size_t slen = MIN(saiter.iter_mapsize, size);
+ size_t len = MIN(dlen, slen);
ASSERT(dlen > 0 || slen > 0);
ret = func(daiter.iter_mapaddr, saiter.iter_mapaddr, len,