1 /*
2  * This file is auto-generated. Modifications will be lost.
3  *
4  * See https://android.googlesource.com/platform/bionic/+/master/libc/kernel/
5  * for more information.
6  */
7 #ifndef _UAPI_LINUX_LOOP_H
8 #define _UAPI_LINUX_LOOP_H
9 #define LO_NAME_SIZE 64
10 #define LO_KEY_SIZE 32
11 enum {
12   LO_FLAGS_READ_ONLY = 1,
13   LO_FLAGS_AUTOCLEAR = 4,
14   LO_FLAGS_PARTSCAN = 8,
15   LO_FLAGS_DIRECT_IO = 16,
16 };
17 #define LOOP_SET_STATUS_SETTABLE_FLAGS (LO_FLAGS_AUTOCLEAR | LO_FLAGS_PARTSCAN)
18 #define LOOP_SET_STATUS_CLEARABLE_FLAGS (LO_FLAGS_AUTOCLEAR)
19 #define LOOP_CONFIGURE_SETTABLE_FLAGS (LO_FLAGS_READ_ONLY | LO_FLAGS_AUTOCLEAR | LO_FLAGS_PARTSCAN | LO_FLAGS_DIRECT_IO)
20 #include <asm/posix_types.h>
21 #include <linux/types.h>
22 struct loop_info {
23   int lo_number;
24   __kernel_old_dev_t lo_device;
25   unsigned long lo_inode;
26   __kernel_old_dev_t lo_rdevice;
27   int lo_offset;
28   int lo_encrypt_type;
29   int lo_encrypt_key_size;
30   int lo_flags;
31   char lo_name[LO_NAME_SIZE];
32   unsigned char lo_encrypt_key[LO_KEY_SIZE];
33   unsigned long lo_init[2];
34   char reserved[4];
35 };
36 struct loop_info64 {
37   __u64 lo_device;
38   __u64 lo_inode;
39   __u64 lo_rdevice;
40   __u64 lo_offset;
41   __u64 lo_sizelimit;
42   __u32 lo_number;
43   __u32 lo_encrypt_type;
44   __u32 lo_encrypt_key_size;
45   __u32 lo_flags;
46   __u8 lo_file_name[LO_NAME_SIZE];
47   __u8 lo_crypt_name[LO_NAME_SIZE];
48   __u8 lo_encrypt_key[LO_KEY_SIZE];
49   __u64 lo_init[2];
50 };
51 struct loop_config {
52   __u32 fd;
53   __u32 block_size;
54   struct loop_info64 info;
55   __u64 __reserved[8];
56 };
57 #define LO_CRYPT_NONE 0
58 #define LO_CRYPT_XOR 1
59 #define LO_CRYPT_DES 2
60 #define LO_CRYPT_FISH2 3
61 #define LO_CRYPT_BLOW 4
62 #define LO_CRYPT_CAST128 5
63 #define LO_CRYPT_IDEA 6
64 #define LO_CRYPT_DUMMY 9
65 #define LO_CRYPT_SKIPJACK 10
66 #define LO_CRYPT_CRYPTOAPI 18
67 #define MAX_LO_CRYPT 20
68 #define LOOP_SET_FD 0x4C00
69 #define LOOP_CLR_FD 0x4C01
70 #define LOOP_SET_STATUS 0x4C02
71 #define LOOP_GET_STATUS 0x4C03
72 #define LOOP_SET_STATUS64 0x4C04
73 #define LOOP_GET_STATUS64 0x4C05
74 #define LOOP_CHANGE_FD 0x4C06
75 #define LOOP_SET_CAPACITY 0x4C07
76 #define LOOP_SET_DIRECT_IO 0x4C08
77 #define LOOP_SET_BLOCK_SIZE 0x4C09
78 #define LOOP_CONFIGURE 0x4C0A
79 #define LOOP_CTL_ADD 0x4C80
80 #define LOOP_CTL_REMOVE 0x4C81
81 #define LOOP_CTL_GET_FREE 0x4C82
82 #endif
83