From owner-freebsd-hackers@FreeBSD.ORG Sat Jun 16 19:38:00 2012 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id F23AE106566B for ; Sat, 16 Jun 2012 19:37:59 +0000 (UTC) (envelope-from delphij@gmail.com) Received: from mail-qc0-f182.google.com (mail-qc0-f182.google.com [209.85.216.182]) by mx1.freebsd.org (Postfix) with ESMTP id A92AA8FC08 for ; Sat, 16 Jun 2012 19:37:59 +0000 (UTC) Received: by qcsg15 with SMTP id g15so2726127qcs.13 for ; Sat, 16 Jun 2012 12:37:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=n6W0q4arSmKZ8hhdlS3J0SydkxU2OrdTeHiaqeEOefo=; b=y7z5hlndOstWwIwyMnDERKaWqGU6s/Y/MFUu3mdIFpiv+6dwBUuzEJA8W3azq9dm9S T6S19NeJR+Z9Z20JRwfmUHuwdxnhgOia78GQi75V4cXEiYKuOTTA3qLVUDio549icMzy RYl2aBN1fmR+IViF+hicv7bc6zHDNGiPBPUlRdC++c5Ed45hVtH6fbndms9otMwZju8/ 82mZ0IZ2305JJ7mwtcOtDmh+y0ocPJ4aHAYWlSh5hYTGFJV0/ljE6xaLw3fxKpalw+66 U1DgN31jSb/2tRdRgVo6sv21E1W57Pzq+tjAY0943uRbz+i/01jYYv3gjUQs+NmH73bi lxIA== MIME-Version: 1.0 Received: by 10.224.182.13 with SMTP id ca13mr18577374qab.60.1339875478645; Sat, 16 Jun 2012 12:37:58 -0700 (PDT) Received: by 10.229.81.1 with HTTP; Sat, 16 Jun 2012 12:37:58 -0700 (PDT) In-Reply-To: References: <4FD94240.6060806@delphij.net> Date: Sat, 16 Jun 2012 12:37:58 -0700 Message-ID: From: Xin LI To: Chris Rees Content-Type: text/plain; charset=UTF-8 Cc: Wojciech Puchar , freebsd-hackers@freebsd.org Subject: Re: BIO_DELETE equivalent for file on FFS filesystem X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 16 Jun 2012 19:38:00 -0000 On Sat, Jun 16, 2012 at 12:01 PM, Chris Rees wrote: > On Jun 14, 2012 5:49 AM, "Wojciech Puchar" > wrote: >>>> >>>> file to take 900MB or... can i call some system function to "punch" >>>> holes? >>> >>> >>> I think you can only truncate the file at this time, pretty much like >>> brk() works for memory. >> >> >> >> BAD. suppose i keep windoze VM image on filesystem which takes 10GB but > uses 5GB. >> >> i could write simple program to find out what blocks are unused and > then...do nothing. >> > > What if you cp it? That would be a dd(1) unless we teach cp(1) how to do sparse. I think what he wanted is to tell the OS "I don't need block XX - YY anymore" and the OS creates a sparse hole, which is not available at this time. Cheers, -- Xin LI https://www.delphij.net/ FreeBSD - The Power to Serve! Live free or die