summaryrefslogtreecommitdiffstats
path: root/perl
diff options
context:
space:
mode:
authorRichard W.M. Jones <rjones@redhat.com>2009-05-14 23:47:17 +0100
committerRichard W.M. Jones <rjones@redhat.com>2009-05-14 23:47:17 +0100
commitd901cc916102f1aaccfb73396b48aa303e5b8cd7 (patch)
tree7c2fd470088874ab99b5922393327170e653cf01 /perl
parent4aa4ecc380edc509aba886417c67d9c39ab51c9a (diff)
downloadlibguestfs-d901cc916102f1aaccfb73396b48aa303e5b8cd7.tar.gz
libguestfs-d901cc916102f1aaccfb73396b48aa303e5b8cd7.tar.xz
libguestfs-d901cc916102f1aaccfb73396b48aa303e5b8cd7.zip
Add support for zerofree command.
Diffstat (limited to 'perl')
-rw-r--r--perl/Guestfs.xs11
-rw-r--r--perl/lib/Sys/Guestfs.pm13
2 files changed, 24 insertions, 0 deletions
diff --git a/perl/Guestfs.xs b/perl/Guestfs.xs
index 973f56e5..e87131bd 100644
--- a/perl/Guestfs.xs
+++ b/perl/Guestfs.xs
@@ -1787,3 +1787,14 @@ PREINIT:
OUTPUT:
RETVAL
+void
+zerofree (g, device)
+ guestfs_h *g;
+ char *device;
+PREINIT:
+ int r;
+ PPCODE:
+ r = guestfs_zerofree (g, device);
+ if (r == -1)
+ croak ("zerofree: %s", guestfs_last_error (g));
+
diff --git a/perl/lib/Sys/Guestfs.pm b/perl/lib/Sys/Guestfs.pm
index 13c084f7..b11594f2 100644
--- a/perl/lib/Sys/Guestfs.pm
+++ b/perl/lib/Sys/Guestfs.pm
@@ -1162,6 +1162,19 @@ How many blocks are zeroed isn't specified (but it's I<not> enough
to securely wipe the device). It should be sufficient to remove
any partition tables, filesystem superblocks and so on.
+=item $h->zerofree ($device);
+
+This runs the I<zerofree> program on C<device>. This program
+claims to zero unused inodes and disk blocks on an ext2/3
+filesystem, thus making it possible to compress the filesystem
+more effectively.
+
+You should B<not> run this program if the filesystem is
+mounted.
+
+It is possible that using this program can damage the filesystem
+or data on the filesystem.
+
=cut
1;