1 /* 2 * This header was generated from the Linux kernel headers by update_headers.py, 3 * to provide necessary information from kernel to userspace, such as constants, 4 * structures, and macros, and thus, contains no copyrightable information. 5 */ 6 #ifndef _UAPI_LINUX_LOOP_H 7 #define _UAPI_LINUX_LOOP_H 8 #define LO_NAME_SIZE 64 9 #define LO_KEY_SIZE 32 10 enum { 11 LO_FLAGS_READ_ONLY = 1, 12 LO_FLAGS_AUTOCLEAR = 4, 13 LO_FLAGS_PARTSCAN = 8, 14 LO_FLAGS_DIRECT_IO = 16, 15 }; 16 #include <asm/posix_types.h> 17 #include <linux/types.h> 18 struct loop_info { 19 int lo_number; 20 __kernel_old_dev_t lo_device; 21 unsigned long lo_inode; 22 __kernel_old_dev_t lo_rdevice; 23 int lo_offset; 24 int lo_encrypt_type; 25 int lo_encrypt_key_size; 26 int lo_flags; 27 char lo_name[LO_NAME_SIZE]; 28 unsigned char lo_encrypt_key[LO_KEY_SIZE]; 29 unsigned long lo_init[2]; 30 char reserved[4]; 31 }; 32 struct loop_info64 { 33 __u64 lo_device; 34 __u64 lo_inode; 35 __u64 lo_rdevice; 36 __u64 lo_offset; 37 __u64 lo_sizelimit; 38 __u32 lo_number; 39 __u32 lo_encrypt_type; 40 __u32 lo_encrypt_key_size; 41 __u32 lo_flags; 42 __u8 lo_file_name[LO_NAME_SIZE]; 43 __u8 lo_crypt_name[LO_NAME_SIZE]; 44 __u8 lo_encrypt_key[LO_KEY_SIZE]; 45 __u64 lo_init[2]; 46 }; 47 #define LO_CRYPT_NONE 0 48 #define LO_CRYPT_XOR 1 49 #define LO_CRYPT_DES 2 50 #define LO_CRYPT_FISH2 3 51 #define LO_CRYPT_BLOW 4 52 #define LO_CRYPT_CAST128 5 53 #define LO_CRYPT_IDEA 6 54 #define LO_CRYPT_DUMMY 9 55 #define LO_CRYPT_SKIPJACK 10 56 #define LO_CRYPT_CRYPTOAPI 18 57 #define MAX_LO_CRYPT 20 58 #define LOOP_SET_FD 0x4C00 59 #define LOOP_CLR_FD 0x4C01 60 #define LOOP_SET_STATUS 0x4C02 61 #define LOOP_GET_STATUS 0x4C03 62 #define LOOP_SET_STATUS64 0x4C04 63 #define LOOP_GET_STATUS64 0x4C05 64 #define LOOP_CHANGE_FD 0x4C06 65 #define LOOP_SET_CAPACITY 0x4C07 66 #define LOOP_SET_DIRECT_IO 0x4C08 67 #define LOOP_SET_BLOCK_SIZE 0x4C09 68 #define LOOP_CTL_ADD 0x4C80 69 #define LOOP_CTL_REMOVE 0x4C81 70 #define LOOP_CTL_GET_FREE 0x4C82 71 #endif 72