From 3e408f493496597dc026d20778837f421f05a9dd Mon Sep 17 00:00:00 2001 From: Richard Jones Date: Thu, 21 May 2009 16:18:16 +0100 Subject: Generated code for e2fsck-f command. --- ocaml/guestfs.ml | 1 + ocaml/guestfs.mli | 3 +++ ocaml/guestfs_c_actions.c | 23 +++++++++++++++++++++++ 3 files changed, 27 insertions(+) (limited to 'ocaml') diff --git a/ocaml/guestfs.ml b/ocaml/guestfs.ml index 0fe2d821..48dae203 100644 --- a/ocaml/guestfs.ml +++ b/ocaml/guestfs.ml @@ -246,3 +246,4 @@ external vg_activate : t -> bool -> string array -> unit = "ocaml_guestfs_vg_act external lvresize : t -> string -> int -> unit = "ocaml_guestfs_lvresize" external resize2fs : t -> string -> unit = "ocaml_guestfs_resize2fs" external find : t -> string -> string array = "ocaml_guestfs_find" +external e2fsck_f : t -> string -> unit = "ocaml_guestfs_e2fsck_f" diff --git a/ocaml/guestfs.mli b/ocaml/guestfs.mli index f7585527..e115a793 100644 --- a/ocaml/guestfs.mli +++ b/ocaml/guestfs.mli @@ -517,3 +517,6 @@ val resize2fs : t -> string -> unit val find : t -> string -> string array (** find all files and directories *) +val e2fsck_f : t -> string -> unit +(** check an ext2/ext3 filesystem *) + diff --git a/ocaml/guestfs_c_actions.c b/ocaml/guestfs_c_actions.c index 0dcaf3f3..795a0f36 100644 --- a/ocaml/guestfs_c_actions.c +++ b/ocaml/guestfs_c_actions.c @@ -3452,3 +3452,26 @@ ocaml_guestfs_find (value gv, value directoryv) CAMLreturn (rv); } +CAMLprim value +ocaml_guestfs_e2fsck_f (value gv, value devicev) +{ + CAMLparam2 (gv, devicev); + CAMLlocal1 (rv); + + guestfs_h *g = Guestfs_val (gv); + if (g == NULL) + caml_failwith ("e2fsck_f: used handle after closing it"); + + const char *device = String_val (devicev); + int r; + + caml_enter_blocking_section (); + r = guestfs_e2fsck_f (g, device); + caml_leave_blocking_section (); + if (r == -1) + ocaml_guestfs_raise_error (g, "e2fsck_f"); + + rv = Val_unit; + CAMLreturn (rv); +} + -- cgit