From owner-freebsd-arch@FreeBSD.ORG Fri Apr 15 14:20:03 2011 Return-Path: Delivered-To: freebsd-arch@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CD5B6106566C for ; Fri, 15 Apr 2011 14:20:03 +0000 (UTC) (envelope-from pawel@dawidek.net) Received: from mail.garage.freebsd.pl (60.wheelsystems.com [83.12.187.60]) by mx1.freebsd.org (Postfix) with ESMTP id 641438FC0A for ; Fri, 15 Apr 2011 14:20:02 +0000 (UTC) Received: by mail.garage.freebsd.pl (Postfix, from userid 65534) id 0947145FA5; Fri, 15 Apr 2011 16:20:01 +0200 (CEST) Received: from localhost (89-73-195-149.dynamic.chello.pl [89.73.195.149]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.garage.freebsd.pl (Postfix) with ESMTP id E083C45C8A; Fri, 15 Apr 2011 16:19:55 +0200 (CEST) Date: Fri, 15 Apr 2011 16:19:46 +0200 From: Pawel Jakub Dawidek To: Gleb Kurtsou Message-ID: <20110415141946.GB4526@garage.freebsd.pl> References: <20110414213610.GB92382@tops> <20110415105409.GA14344@tops> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="KFztAG8eRSV9hGtP" Content-Disposition: inline In-Reply-To: <20110415105409.GA14344@tops> X-OS: FreeBSD 9.0-CURRENT amd64 User-Agent: Mutt/1.5.21 (2010-09-15) X-Spam-Checker-Version: SpamAssassin 3.0.4 (2005-06-05) on mail.garage.freebsd.pl X-Spam-Level: X-Spam-Status: No, score=-0.6 required=4.5 tests=BAYES_00,RCVD_IN_SORBS_DUL autolearn=no version=3.0.4 Cc: mdf@FreeBSD.org, FreeBSD Arch Subject: Re: posix_fallocate(2) X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 15 Apr 2011 14:20:03 -0000 --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--