git.annexia.org
/
mclu.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Allow use of virtio-blk disk bus.
[mclu.git]
/
utils.ml
diff --git
a/utils.ml
b/utils.ml
index
fd92b79
..
87c4002
100644
(file)
--- a/
utils.ml
+++ b/
utils.ml
@@
-33,6
+33,13
@@
let ( /^ ) = Int64.div
let ( &^ ) = Int64.logand
let ( ~^ ) = Int64.lognot
let ( &^ ) = Int64.logand
let ( ~^ ) = Int64.lognot
+let rec filter_map f = function
+ | [] -> []
+ | x :: xs ->
+ match f x with
+ | Some y -> y :: filter_map f xs
+ | None -> filter_map f xs
+
let human_size i =
let sign, i = if i < 0L then "-", Int64.neg i else "", i in
let human_size i =
let sign, i = if i < 0L then "-", Int64.neg i else "", i in