Skip to content

Commit

Permalink
reenable scatterlist offloading
Browse files Browse the repository at this point in the history
  • Loading branch information
calccrypto committed Jul 17, 2024
1 parent 917c443 commit f45c00f
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 3 deletions.
6 changes: 3 additions & 3 deletions module/os/linux/zfs/abd_os.c
Original file line number Diff line number Diff line change
Expand Up @@ -537,7 +537,7 @@ abd_alloc_zero_scatter(void)
#define zfs_kmap_atomic(chunk) ((void *)chunk)
#define zfs_kunmap_atomic(addr) do { (void)(addr); } while (0)
#define zfs_kmap(chunk) ((void *)chunk)
#define zfs_kunmap(chunk) ((void *)chunk)
#define zfs_kunmap(addr) do { (void)(addr); } while (0)
#define zfs_kmap_local(chunk) ((void *)chunk)
#define zfs_kunmap_local(addr) do { (void)(addr); } while (0)
#define local_irq_save(flags) do { (void)(flags); } while (0)
Expand Down Expand Up @@ -1063,7 +1063,7 @@ abd_iter_map(struct abd_iter *aiter)
aiter->iter_mapsize = MIN(aiter->iter_sg->length - offset,
aiter->iter_abd->abd_size - aiter->iter_pos);

paddr = zfs_kmap_local(sg_page(aiter->iter_sg));
paddr = zfs_kmap(sg_page(aiter->iter_sg));
}

aiter->iter_mapaddr = (char *)paddr + offset;
Expand All @@ -1082,7 +1082,7 @@ abd_iter_unmap(struct abd_iter *aiter)

if (!abd_is_linear(aiter->iter_abd)) {
/* LINTED E_FUNC_SET_NOT_USED */
zfs_kunmap_local(aiter->iter_mapaddr - aiter->iter_offset);
zfs_kunmap(aiter->iter_mapaddr - aiter->iter_offset);
}

ASSERT3P(aiter->iter_mapaddr, !=, NULL);
Expand Down
9 changes: 9 additions & 0 deletions module/zfs/zia.c
Original file line number Diff line number Diff line change
Expand Up @@ -655,6 +655,15 @@ zia_offload_abd_offset(void *provider, abd_t *abd,
ret = dpusm->copy.from.generic(&mv,
ABD_LINEAR_BUF(abd), size);
ret = dpusm_to_ret(ret);
}
else if (abd_is_from_pages(abd) == B_TRUE) {
ret = dpusm->copy.from.scatterlist(&mv,
ABD_SCATTER(abd).abd_sgl,
ABD_SCATTER(abd).abd_nents,
size);
if (ret == 0) {
ret = ZIA_OK;
}
} else {
ret = abd_iterate_func(abd, offset, size,
zia_offload_generic_cb, &mv);
Expand Down

0 comments on commit f45c00f

Please sign in to comment.