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 429e80c
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 6 deletions.
2 changes: 0 additions & 2 deletions include/os/linux/kernel/linux/kmap_compat.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,6 @@
#include <linux/uaccess.h>

/* 2.6.37 API change */
#define zfs_kmap_atomic(page) kmap_atomic(page)
#define zfs_kunmap_atomic(addr) kunmap_atomic(addr)
#define zfs_kmap(page) kmap(page)
#define zfs_kunmap(page) kunmap(page)

Expand Down
6 changes: 2 additions & 4 deletions module/os/linux/zfs/abd_os.c
Original file line number Diff line number Diff line change
Expand Up @@ -534,10 +534,8 @@ abd_alloc_zero_scatter(void)
#define PAGE_SHIFT (highbit64(PAGESIZE)-1)
#endif

#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 +1061,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 Down
7 changes: 7 additions & 0 deletions module/zfs/zia.c
Original file line number Diff line number Diff line change
Expand Up @@ -655,6 +655,13 @@ 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);
ret = dpusm_to_ret(ret);
} else {
ret = abd_iterate_func(abd, offset, size,
zia_offload_generic_cb, &mv);
Expand Down

0 comments on commit 429e80c

Please sign in to comment.