From owner-freebsd-hackers@FreeBSD.ORG Sat Jun 16 20:04:28 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 D97E01065680 for ; Sat, 16 Jun 2012 20:04:27 +0000 (UTC) (envelope-from utisoft@gmail.com) Received: from mail-bk0-f54.google.com (mail-bk0-f54.google.com [209.85.214.54]) by mx1.freebsd.org (Postfix) with ESMTP id 56F468FC1E for ; Sat, 16 Jun 2012 20:04:27 +0000 (UTC) Received: by bkvi18 with SMTP id i18so3901657bkv.13 for ; Sat, 16 Jun 2012 13:04:26 -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=oJ+04lISYXklqGKd0Yg1+YaR5+Z40b9Uk/6CfSo6kDA=; b=yyqduNfMSxXio611KRYxx5wNBmbGXDbx1+vDIr4NpmxPCVp9K4VhjLc/Vkbbdrtnza 1KFqi+WTVpwErgaF4ssf63QLAeIqPzLzk0Twk/9rYNKUnlQTPJKNDLftVmP2wVlZL30x m97jpIg2QoYUB4ap4JQvJbGa/KbcVFKWvp7UqwJJTJTFkgBf9Q+jpCI9qFO0TgBFHbJi 8JsmYUGssRik2xtSrrm59rUs2LG3hxO7AO4qPfLoBJx07E8sO0R/AvNIL+Egxj2BDysV 9HvsGPA9G8lfe4jVs5j2T+wprmpgM/voJLxx+De40Nl2brFkVt6nRxunF0ya2PsQto9S 6fmg== MIME-Version: 1.0 Received: by 10.204.154.214 with SMTP id p22mr4294498bkw.115.1339877066222; Sat, 16 Jun 2012 13:04:26 -0700 (PDT) Received: by 10.204.171.138 with HTTP; Sat, 16 Jun 2012 13:04:26 -0700 (PDT) Received: by 10.204.171.138 with HTTP; Sat, 16 Jun 2012 13:04:26 -0700 (PDT) In-Reply-To: References: <4FD94240.6060806@delphij.net> Date: Sat, 16 Jun 2012 21:04:26 +0100 Message-ID: From: Chris Rees To: Xin LI Content-Type: text/plain; charset=ISO-8859-1 X-Content-Filtered-By: Mailman/MimeDel 2.1.5 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 20:04:28 -0000 On Jun 16, 2012 8:37 PM, "Xin LI" wrote: > > On Sat, Jun 16, 2012 at 12:01 PM, Chris Rees wrote: > > On Jun 14, 2012 5:49 AM, "Wojciech Puchar" < wojtek@wojtek.tensor.gdynia.pl> > > 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. Sorry, I must have misread. I take it cp would take a file with holes and only copy the data part? i.e. take a 10G file of which 5G is a hole, you'd end up with a 5G file? Chris