Next ZFSv28 patchset ready for testing.

Pawel Jakub Dawidek pjd at
Tue Dec 14 07:04:11 UTC 2010

On Mon, Dec 13, 2010 at 11:00:31PM -0000, Steven Hartland wrote:
> What's the expected behaviour for the sendfile changes as
> sendfile is one of the problems we have here with the
> double memory allocation required for it under ZFS compared
> to UFS. Does this patch address that?

No. The patch doesn't address that. It only adds support for
sendfile(2), as it was commented out in the previous patchset.

> Inspecting the patch the following segment looks odd:-
> --- sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c.orig
> +++ sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c
> ...
>    while (n > 0) {
>        nbytes = MIN(n, zfs_read_chunk_size -
>            P2PHASE(uio->uio_loffset, zfs_read_chunk_size));
> +#ifdef __FreeBSD__
> +       if (uio->uio_segflg == UIO_NOCOPY)
> +           error = mappedread_sf(vp, nbytes, uio);
> +       else
> +#endif /* __FreeBSD__ */
>        if (vn_has_cached_data(vp))
>            error = mappedread(vp, nbytes, uio);
>        else
> Is there an extra "else" in there which will break things or should
> the __FreeBSD__ mappedread_sf block replace the standard mappedread
> call or is the indentation just a bit weird?

The code is correct. It is just hard to split 'else' and 'if' with a
'#endif' and keep the indentation pretty. Depends on the conditions we
use one of the three methods to read the data.

Pawel Jakub Dawidek             
pjd at                 
FreeBSD committer                         Am I Evil? Yes, I Am!
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 196 bytes
Desc: not available
Url :

More information about the freebsd-current mailing list