unix: add constants and types to work with Linux loop devices
Change-Id: I0996df39a561b50822a6e42e770d96421d6b4965
Reviewed-on: https://go-review.googlesource.com/c/sys/+/185498
Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
diff --git a/unix/ztypes_linux_s390x.go b/unix/ztypes_linux_s390x.go
index 90bf5dc..d8fc0bc 100644
--- a/unix/ztypes_linux_s390x.go
+++ b/unix/ztypes_linux_s390x.go
@@ -2500,3 +2500,41 @@
LINUX_CAPABILITY_VERSION_2 = 0x20071026
LINUX_CAPABILITY_VERSION_3 = 0x20080522
)
+
+const (
+ LO_FLAGS_READ_ONLY = 0x1
+ LO_FLAGS_AUTOCLEAR = 0x4
+ LO_FLAGS_PARTSCAN = 0x8
+ LO_FLAGS_DIRECT_IO = 0x10
+)
+
+type LoopInfo struct {
+ Number int32
+ Device uint16
+ Inode uint64
+ Rdevice uint16
+ Offset int32
+ Encrypt_type int32
+ Encrypt_key_size int32
+ Flags int32
+ Name [64]int8
+ Encrypt_key [32]uint8
+ Init [2]uint64
+ Reserved [4]int8
+ _ [4]byte
+}
+type LoopInfo64 struct {
+ Device uint64
+ Inode uint64
+ Rdevice uint64
+ Offset uint64
+ Sizelimit uint64
+ Number uint32
+ Encrypt_type uint32
+ Encrypt_key_size uint32
+ Flags uint32
+ File_name [64]uint8
+ Crypt_name [64]uint8
+ Encrypt_key [32]uint8
+ Init [2]uint64
+}