Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 14 Dec 2010 08:03:59 +0100
From:      Pawel Jakub Dawidek <pjd@FreeBSD.org>
To:        Steven Hartland <killing@multiplay.co.uk>
Cc:        freebsd-fs@FreeBSD.org, freebsd-current@FreeBSD.org
Subject:   Re: Next ZFSv28 patchset ready for testing.
Message-ID:  <20101214070359.GL2038@garage.freebsd.pl>
In-Reply-To: <461DD46B04234127AC0984F945FF6CA6@multiplay.co.uk>
References:  <20101213214556.GC2038@garage.freebsd.pl> <461DD46B04234127AC0984F945FF6CA6@multiplay.co.uk>

next in thread | previous in thread | raw e-mail | index | archive | help

--2YJj5f1P6Th4nBRw
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

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 =3D MIN(n, zfs_read_chunk_size -
>            P2PHASE(uio->uio_loffset, zfs_read_chunk_size));
>=20
> +#ifdef __FreeBSD__
> +       if (uio->uio_segflg =3D=3D UIO_NOCOPY)
> +           error =3D mappedread_sf(vp, nbytes, uio);
> +       else
> +#endif /* __FreeBSD__ */
>        if (vn_has_cached_data(vp))
>            error =3D mappedread(vp, nbytes, uio);
>        else
>=20
> 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.

--=20
Pawel Jakub Dawidek                       http://www.wheelsystems.com
pjd@FreeBSD.org                           http://www.FreeBSD.org
FreeBSD committer                         Am I Evil? Yes, I Am!

--2YJj5f1P6Th4nBRw
Content-Type: application/pgp-signature
Content-Disposition: inline

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.14 (FreeBSD)

iEYEARECAAYFAk0HFt8ACgkQForvXbEpPzQv7ACg8/MXfzFBhw/3Anqp662p9S9a
AqQAoNJBzLjkCHVVWerdU1PCfI1oGUFG
=5U9O
-----END PGP SIGNATURE-----

--2YJj5f1P6Th4nBRw--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20101214070359.GL2038>