From d901cc916102f1aaccfb73396b48aa303e5b8cd7 Mon Sep 17 00:00:00 2001 From: "Richard W.M. Jones" Date: Thu, 14 May 2009 23:47:17 +0100 Subject: Add support for zerofree command. --- java/com/redhat/et/libguestfs/GuestFS.java | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) (limited to 'java/com') diff --git a/java/com/redhat/et/libguestfs/GuestFS.java b/java/com/redhat/et/libguestfs/GuestFS.java index c816baa0..76ada908 100644 --- a/java/com/redhat/et/libguestfs/GuestFS.java +++ b/java/com/redhat/et/libguestfs/GuestFS.java @@ -2729,4 +2729,30 @@ public class GuestFS { private native String _hexdump (long g, String path) throws LibGuestFSException; + /** + * zero unused inodes and disk blocks on ext2/3 filesystem + * + * This runs the *zerofree* program on "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 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. + * + * @throws LibGuestFSException + */ + public void zerofree (String device) + throws LibGuestFSException + { + if (g == 0) + throw new LibGuestFSException ("zerofree: handle is closed"); + _zerofree (g, device); + } + private native void _zerofree (long g, String device) + throws LibGuestFSException; + } -- cgit