X-Git-Url: http://git.annexia.org/?p=libguestfs.git;a=blobdiff_plain;f=java%2Fcom%2Fredhat%2Fet%2Flibguestfs%2FGuestFS.java;h=c29789c095cfa2c74c38bb48d2e55f085570f4b4;hp=515fc77b57d907b9cfb93fda4011aed156f70d19;hb=9222136ac9b2e404dba128b1ac74dacaa8bf1038;hpb=2dc9e8a858b62830d15a8186fe575eb7903d2171 diff --git a/java/com/redhat/et/libguestfs/GuestFS.java b/java/com/redhat/et/libguestfs/GuestFS.java index 515fc77..c29789c 100644 --- a/java/com/redhat/et/libguestfs/GuestFS.java +++ b/java/com/redhat/et/libguestfs/GuestFS.java @@ -2487,4 +2487,29 @@ public class GuestFS { private native void _mv (long g, String src, String dest) throws LibGuestFSException; + /** + * drop kernel page cache, dentries and inodes + * + * This instructs the guest kernel to drop its page cache, + * and/or dentries and inode caches. The parameter + * "whattodrop" tells the kernel what precisely to drop, + * see + * + * Setting "whattodrop" to 3 should drop everything. + * + * This automatically calls sync(2) before the operation, + * so that the maximum guest memory is freed. + * + * @throws LibGuestFSException + */ + public void drop_caches (int whattodrop) + throws LibGuestFSException + { + if (g == 0) + throw new LibGuestFSException ("drop_caches: handle is closed"); + _drop_caches (g, whattodrop); + } + private native void _drop_caches (long g, int whattodrop) + throws LibGuestFSException; + }