Skip to content

Commit 0a288bb

Browse files
committed
Remove unused Unixext.Direct module
Signed-off-by: Rob Hoes <[email protected]>
1 parent f58d8d3 commit 0a288bb

File tree

6 files changed

+6
-202
lines changed

6 files changed

+6
-202
lines changed

ocaml/libs/xapi-stdext/lib/xapi-stdext-unix/dune

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,5 @@
1616
(language c)
1717
(names
1818
blkgetsize_stubs
19-
unixext_open_stubs
20-
unixext_stubs
21-
unixext_write_stubs))
19+
unixext_stubs))
2220
)

ocaml/libs/xapi-stdext/lib/xapi-stdext-unix/unixext.ml

Lines changed: 0 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -925,35 +925,6 @@ let test_open n =
925925
done
926926
)
927927
928-
module Direct = struct
929-
type t = Unix.file_descr
930-
931-
external openfile : string -> Unix.open_flag list -> Unix.file_perm -> t
932-
= "stub_stdext_unix_open_direct"
933-
934-
let close = Unix.close
935-
936-
let with_openfile path flags perms f =
937-
let t = openfile path flags perms in
938-
finally (fun () -> f t) (fun () -> close t)
939-
940-
external unsafe_write : t -> bytes -> int -> int -> int
941-
= "stub_stdext_unix_write"
942-
943-
let write fd buf ofs len =
944-
if ofs < 0 || len < 0 || ofs > Bytes.length buf - len then
945-
invalid_arg "Unixext.write"
946-
else
947-
unsafe_write fd buf ofs len
948-
949-
let copy_from_fd ?limit socket fd =
950-
copy_file_internal ?limit (Unix.read socket) (write fd)
951-
952-
let fsync x = fsync x
953-
954-
let lseek fd x cmd = Unix.LargeFile.lseek fd x cmd
955-
end
956-
957928
(* --------------------------------------------------------------------------------------- *)
958929
959930
module Daemon = struct

ocaml/libs/xapi-stdext/lib/xapi-stdext-unix/unixext.mli

Lines changed: 0 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -266,36 +266,6 @@ val test_open : int -> unit
266266
The file descriptors will stay open until the program exits.
267267
*)
268268

269-
module Direct : sig
270-
(** Perform I/O in O_DIRECT mode using 4KiB page-aligned buffers *)
271-
272-
(** represents a file open in O_DIRECT mode *)
273-
type t
274-
275-
val openfile : string -> Unix.open_flag list -> Unix.file_perm -> t
276-
(** [openfile name flags perm] behaves the same as [Unix.openfile] but includes the O_DIRECT flag *)
277-
278-
val close : t -> unit
279-
(** [close t] closes [t], a file open in O_DIRECT mode *)
280-
281-
val with_openfile :
282-
string -> Unix.open_flag list -> Unix.file_perm -> (t -> 'a) -> 'a
283-
(** [with_openfile name flags perm f] opens [name], applies the result to [f] and closes *)
284-
285-
val write : t -> bytes -> int -> int -> int
286-
(** [write t buf ofs len] writes [len] bytes at offset [ofs] from buffer [buf] to
287-
[t] using page-aligned buffers. *)
288-
289-
val copy_from_fd : ?limit:int64 -> Unix.file_descr -> t -> int64
290-
(** [copy_from_fd ?limit fd t] copies from [fd] to [t] up to [limit] *)
291-
292-
val fsync : t -> unit
293-
(** [fsync t] commits all outstanding writes, throwing an error if necessary. *)
294-
295-
val lseek : t -> int64 -> Unix.seek_command -> int64
296-
(** [lseek t offset command]: see Unix.LargeFile.lseek *)
297-
end
298-
299269
module Daemon : sig
300270
(** OCaml interface to libsystemd.
301271

ocaml/libs/xapi-stdext/lib/xapi-stdext-unix/unixext_open_stubs.c

Lines changed: 0 additions & 75 deletions
This file was deleted.

ocaml/libs/xapi-stdext/lib/xapi-stdext-unix/unixext_write_stubs.c

Lines changed: 0 additions & 65 deletions
This file was deleted.

ocaml/sdk-gen/csharp/XE_SR_ERRORCODES.xml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -534,6 +534,11 @@
534534
<description>A Failure occurred accessing an API object</description>
535535
<value>153</value>
536536
</code>
537+
<code>
538+
<name>APIProtocolError</name>
539+
<description>A protocol error was received when accessing the API</description>
540+
<value>154</value>
541+
</code>
537542

538543
<!-- Netapp Specific Error codes -->
539544
<code>

0 commit comments

Comments
 (0)