7 * Written by Theodore Ts'o, 3/29/93.
9 * Copyright 1993 by Theodore Ts'o. Redistribution of this file is
10 * permitted under the GNU General Public License.
13 #define LO_NAME_SIZE 64
14 #define LO_KEY_SIZE 32
21 LO_FLAGS_READ_ONLY
= 1,
22 LO_FLAGS_USE_AOPS
= 2,
23 LO_FLAGS_AUTOCLEAR
= 4,
26 #include <asm/posix_types.h> /* for __kernel_old_dev_t */
27 #include <linux/types.h> /* for __u64 */
28 #include <linux/version.h> /* version of Linux kernel headers */
30 #if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0)
31 /* We have truly ancient Linux kernel headers installed */
32 typedef __kernel_dev_t __kernel_old_dev_t
;
35 /* Backwards compatibility version */
37 int lo_number
; /* ioctl r/o */
38 __kernel_old_dev_t lo_device
; /* ioctl r/o */
39 unsigned long lo_inode
; /* ioctl r/o */
40 __kernel_old_dev_t lo_rdevice
; /* ioctl r/o */
43 int lo_encrypt_key_size
; /* ioctl w/o */
44 int lo_flags
; /* ioctl r/o */
45 char lo_name
[LO_NAME_SIZE
];
46 unsigned char lo_encrypt_key
[LO_KEY_SIZE
]; /* ioctl w/o */
47 unsigned long lo_init
[2];
52 __u64 lo_device
; /* ioctl r/o */
53 __u64 lo_inode
; /* ioctl r/o */
54 __u64 lo_rdevice
; /* ioctl r/o */
56 __u64 lo_sizelimit
;/* bytes, 0 == max available */
57 __u32 lo_number
; /* ioctl r/o */
58 __u32 lo_encrypt_type
;
59 __u32 lo_encrypt_key_size
; /* ioctl w/o */
60 __u32 lo_flags
; /* ioctl r/o */
61 __u8 lo_file_name
[LO_NAME_SIZE
];
62 __u8 lo_crypt_name
[LO_NAME_SIZE
];
63 __u8 lo_encrypt_key
[LO_KEY_SIZE
]; /* ioctl w/o */
71 #define LO_CRYPT_NONE 0
72 #define LO_CRYPT_XOR 1
73 #define LO_CRYPT_DES 2
74 #define LO_CRYPT_FISH2 3 /* Twofish encryption */
75 #define LO_CRYPT_BLOW 4
76 #define LO_CRYPT_CAST128 5
77 #define LO_CRYPT_IDEA 6
78 #define LO_CRYPT_DUMMY 9
79 #define LO_CRYPT_SKIPJACK 10
80 #define LO_CRYPT_CRYPTOAPI 18
81 #define MAX_LO_CRYPT 20
84 * IOCTL commands --- we will commandeer 0x4C ('L')
87 #define LOOP_SET_FD 0x4C00
88 #define LOOP_CLR_FD 0x4C01
89 #define LOOP_SET_STATUS 0x4C02
90 #define LOOP_GET_STATUS 0x4C03
91 #define LOOP_SET_STATUS64 0x4C04
92 #define LOOP_GET_STATUS64 0x4C05
93 #define LOOP_CHANGE_FD 0x4C06
94 #define LOOP_SET_CAPACITY 0x4C07