On Thu, Nov 23, 2017 at 8:05 AM, Andriy Gapon <[email protected]> wrote:

>
> I've done a little experimentation with a version of abd_alloc_for_io()
> that
> returns a chunked abd. zio_checksum_compute() couldn't cope with that in
> the
> ZCHECKSUM_FLAG_EMBEDDED case.
> At present the function uses abd_to_buf() and that requires a linear abd.
> The use of abd_to_buf() can be replaced with some calls to
> abd_copy_to_buf_off()
> and abd_copy_from_buf_off().  But the code would become a bit "heavier"
> and uglier.
>
> Are there any other ways to get a small buffer view into a chunked abd?
> Size of zio_eck_t is just 40 bytes.  It's located either near the begnning
> of a
> block or at the end of it.  I think that it is not likely to ever cross
> chunk
> boundaries unless an insane chunk size is used.
>

Maybe something like:

void *get_small_buf(abd, offset, len) {
  subabd = abd_get_offset(abd, offset);
  return abd_borrow_buf_copy(subabd, len);
}

It isn't a pointer directly to the zio_eck_t, but at least you're only
copying a small bit.

--matt


> 
> Thanks!
> --
> Andriy Gapon

------------------------------------------
openzfs-developer
Archives: 
https://openzfs.topicbox.com/groups/developer/discussions/Tdc55c3947a3b78d0-M9d46531a2693149917b15151
Powered by Topicbox: https://topicbox.com

Reply via email to