Re: Next ZFSv28 patchset ready for testing.

From: Pawel Jakub Dawidek <pjd_at_FreeBSD.org>
Date: Tue, 14 Dec 2010 08:03:59 +0100
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                       http://www.wheelsystems.com
pjd_at_FreeBSD.org                           http://www.FreeBSD.org
FreeBSD committer                         Am I Evil? Yes, I Am!

Received on Tue Dec 14 2010 - 06:04:11 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:40:10 UTC