Date: Fri, 15 Apr 2011 16:19:46 +0200 From: Pawel Jakub Dawidek <pjd@FreeBSD.org> To: Gleb Kurtsou <gleb.kurtsou@gmail.com> Cc: mdf@FreeBSD.org, FreeBSD Arch <freebsd-arch@freebsd.org> Subject: Re: posix_fallocate(2) Message-ID: <20110415141946.GB4526@garage.freebsd.pl> In-Reply-To: <20110415105409.GA14344@tops> References: <BANLkTimYzJ11w9X1OHShEn2wi6gjHx=YjA@mail.gmail.com> <20110414213610.GB92382@tops> <BANLkTi=OWUnB_ue3RT4bzGNvivZwW_ofkA@mail.gmail.com> <20110415105409.GA14344@tops>
next in thread | previous in thread | raw e-mail | index | archive | help
--KFztAG8eRSV9hGtP Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Fri, Apr 15, 2011 at 01:54:09PM +0300, Gleb Kurtsou wrote: [...] > As far as I understand ZFS caches large chunk of changes and than writes > all of them at once. I doubt blocks can be preallocated. You preallocate > block, it's marked as used in file systems meta data, changes to meta > data are written to disk -- it results in inconsistency because > preallocated block is marked as "used" in meta data and thus can't > be overwritten. I might be absolutely wrong, ZFS experts are > better answer this. Grepping reveals no fallocate support in ZFS. [...] > Why wouldn't you just call VOP_SETATTR(newsize) in dumb implementation. > File systems expect files such behavior, cp is using mmap for a while > already. The idea behind posix_fallocate(2) is to guarantee that there will be enough space for future writes. It does make sense for ZFS too, because it will at least reserve space. VOP_SETATTR(newsize) won't reserve any space, it will just create a hole. --=20 Pawel Jakub Dawidek http://www.wheelsystems.com FreeBSD committer http://www.FreeBSD.org Am I Evil? Yes, I Am! http://yomoli.com --KFztAG8eRSV9hGtP Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.14 (FreeBSD) iEYEARECAAYFAk2oVAIACgkQForvXbEpPzTQigCgrM8GOvos6Ln/TyXJe/wH+GN7 FnEAoMJrDO3tRM6sNLZOmSoZedohVZN5 =+FhW -----END PGP SIGNATURE----- --KFztAG8eRSV9hGtP--
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20110415141946.GB4526>