this repo has no description
at main 4.6 kB view raw
1module Types : sig 2 type t = private int 3 4 val empty : int 5 val of_int : 'a -> 'a 6 val ( + ) : int -> int -> int 7 val mem : int -> int -> bool 8 val vdev : t 9 val pool : t 10 val volume : t 11 val invalid : t 12 val bookmark : t 13 val snapshot : t 14 val filesystem : t 15 val dataset : t 16end 17 18module Handle : sig 19 type t 20 (** An instance handle for the ZFS library *) 21end 22 23val init : unit -> Handle.t 24(** Initialise the library *) 25 26val debug : Handle.t -> bool -> unit 27(** Enable/disable printing on error from ZFS *) 28 29val errno : Handle.t -> int 30(** Check for errors on the handle *) 31 32module Zpool : sig 33 type t 34 (** A Zpool handle *) 35 36 val open_ : Handle.t -> string -> t 37 (** Open a Zpool *) 38 39 val close : t -> unit 40 (** Close an open Zpool *) 41 42 val get_name : t -> string 43 (** The name of an open Zpool *) 44end 45 46module Nvlist : sig 47 type t 48 (** Generic name-value lists used by ZFS *) 49 50 type nvlist = 51 (string 52 * [ `Bool of bool 53 | `Byte of Unsigned.uchar 54 | `String of string 55 | `Int64 of int64 ]) 56 list 57 (** A partial OCaml representation of an NV list *) 58 59 val v : nvlist -> t 60 (** Convert the OCaml representation to the C representation *) 61end 62 63type t 64(** A ZFS Dataset *) 65 66val create_ancestors : Handle.t -> string -> unit 67(** Often called before {! create} *) 68 69val create : ?props:Nvlist.nvlist -> Handle.t -> string -> Types.t -> unit 70(** Create a new ZFS dataset *) 71 72val open_ : Handle.t -> string -> Types.t -> t 73(** Open an existing ZFS dataset *) 74 75val close : t -> unit 76(** Close a dataset *) 77 78val destroy : t -> bool -> unit 79(** Destroy a dataset *) 80 81val exists : Handle.t -> string -> Types.t -> bool 82(** Check if a dataset of a specific type exists *) 83 84val is_mounted : Handle.t -> string -> string option 85(** [is_mounted h d = None] if [d] is not mounted, otherwise 86 [is_mounted h d = Some mountpoint]. *) 87 88val mount : ?mount_opts:string -> ?mount_flags:int -> t -> unit 89(** Mount a dataset *) 90 91val unmount : ?mount_opts:string -> ?mount_flags:int -> t -> unit 92(** Unmount a dataset *) 93 94val get_type : t -> Types.t 95(** Get the type of the dataset *) 96 97val clone : ?options:Nvlist.t -> t -> string -> unit 98(** Clone an open dataset *) 99 100val snapshot : ?options:Nvlist.t -> Handle.t -> string -> bool -> unit 101(** Snapshot a dataset *) 102 103val show_diff : ?to_:string -> t -> from_:string -> Unix.file_descr -> unit 104(** Output diff to the file descriptor *) 105 106module Error : sig 107 type t = int 108 109 val unknown : t 110 val sharefailed : t 111 val resume_exists : t 112 val cksum : t 113 val not_user_namespace : t 114 val vdev_notsup : t 115 val rebuilding : t 116 val export_in_progress : t 117 val no_resilver_defer : t 118 val trim_notsup : t 119 val no_trim : t 120 val trimming : t 121 val wrong_parent : t 122 val no_initialize : t 123 val initializing : t 124 val toomany : t 125 val ioc_notsupported : t 126 val vdev_too_big : t 127 val devrm_in_progress : t 128 val no_checkpoint : t 129 val discarding_checkpoint : t 130 val checkpoint_exists : t 131 val no_pending : t 132 val cryptofailed : t 133 val active_pool : t 134 val scrub_paused_to_cancel : t 135 val scrub_paused : t 136 val poolreadonly : t 137 val diffdata : t 138 val diff : t 139 val no_scrub : t 140 val errorscrub_paused : t 141 val errorscrubbing : t 142 val scrubbing : t 143 val postsplit_online : t 144 val threadcreatefailed : t 145 val pipefailed : t 146 val tagtoolong : t 147 val reftag_hold : t 148 val reftag_rele : t 149 val unplayed_logs : t 150 val active_spare : t 151 val notsup : t 152 val vdevnotsup : t 153 val isl2cache : t 154 val badcache : t 155 val sharesmbfailed : t 156 val unsharesmbfailed : t 157 val nodelegation : t 158 val badpermset : t 159 val badperm : t 160 val badwho : t 161 val labelfailed : t 162 val nocap : t 163 val openfailed : t 164 val nametoolong : t 165 val pool_invalarg : t 166 val pool_notsup : t 167 val poolprops : t 168 val nohistory : t 169 val recursive : t 170 val invalconfig : t 171 val isspare : t 172 val intr : t 173 val io : t 174 val fault : t 175 val nospc : t 176 val perm : t 177 val sharenfsfailed : t 178 val unsharenfsfailed : t 179 val umountfailed : t 180 val mountfailed : t 181 val zoned : t 182 val crosstarget : t 183 val badpath : t 184 val devoverflow : t 185 val poolunavail : t 186 val badversion : t 187 val resilvering : t 188 val noreplicas : t 189 val baddev : t 190 val nodevice : t 191 val badtarget : t 192 val badbackup : t 193 val badrestore : t 194 val invalidname : t 195 val voltoobig : t 196 val dsreadonly : t 197 val badstream : t 198 val noent : t 199 val exists : t 200 val busy : t 201 val badtype : t 202 val propspace : t 203 val propnoninherit : t 204 val proptype : t 205 val propreadonly : t 206 val badprop : t 207 val nomem : t 208 val success : t 209end