public inbox for util-linux@vger.kernel.org
 help / color / mirror / Atom feed
From: Rodrigo Campos <rodrigo@sdfg.com.ar>
To: util-linux@vger.kernel.org
Subject: drill: Make a file sparse without using extra disk space
Date: Thu, 23 Jan 2014 21:28:13 +0000	[thread overview]
Message-ID: <20140123212813.GE20054@sdfg.com.ar> (raw)

Hi!

I've written a small simple tool to make a file sparse without using extra disk
space, it just digs holes on the file when possible. To dig the hole uses the
Linux-specific fallocate(2) syscall with FALLOC_FL_PUNCH_HOLE. So, also, it only
works on some file-systems.

Do you think that util-linux would be a good place for such a simple, linux-only
program ? The case I see it can be useful is to use on VM images file backed (or
I wrote it with this in mind, at least :)).

The code is quite simple, it's written in plain C (C99 actually) and doesn't
have any external dependencies. You can see the gitweb here:

	http://sdfg.com.ar/git/?p=drill.git

or just clone it from:

	git://sdfg.com.ar/drill.git


Given that there is a fallocate tool that uses the other mode of fallocate(2)
already, all the detection for fallocate is already there. So it should, I
guess, be easy to integrate to the code-base, adding also the #ifndef
fallocate.c has and that compatibility stuff.

Also, as you can see in the commits, I just started it some days ago. So if
you think it should have some other feature, or something else, please let me
know :)

I'm not sure how this work, but I can write a patch against util-linux if you
think it can be added. If you know there is something I should particulary take
into account for that, I will really appreciate if you let me know :)




Thanks a lot,
Rodrigo

             reply	other threads:[~2014-01-23 22:06 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-01-23 21:28 Rodrigo Campos [this message]
2014-01-24  1:00 ` drill: Make a file sparse without using extra disk space Pádraig Brady
2014-01-24  2:16   ` Rodrigo Campos
2014-01-24  9:34     ` Karel Zak
2014-01-24 14:04       ` Rodrigo Campos

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20140123212813.GE20054@sdfg.com.ar \
    --to=rodrigo@sdfg.com.ar \
    --cc=util-linux@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox