1 #ifndef _LINUX_LOOP_H
2 #define _LINUX_LOOP_H
3
4
5
6
7
8
9
10
11
12
13 #define LO_NAME_SIZE 64
14 #define LO_KEY_SIZE 32
15
16 #ifdef __KERNEL__
17
18 struct loop_device {
19 int lo_number;
20 struct inode *lo_inode;
21 int lo_refcnt;
22 kdev_t lo_device;
23 int lo_offset;
24 int lo_encrypt_type;
25 int lo_encrypt_key_size;
26 int lo_flags;
27 int (*transfer)(struct loop_device *, int cmd,
28 char *raw_buf, char *loop_buf, int size);
29 char lo_name[LO_NAME_SIZE];
30 char lo_encrypt_key[LO_KEY_SIZE];
31 #ifdef DES_AVAILABLE
32 des_key_schedule lo_des_key;
33 unsigned long lo_des_init[2];
34 #endif
35 };
36
37 typedef int (* transfer_proc_t)(struct loop_device *, int cmd,
38 char *raw_buf, char *loop_buf, int size);
39
40
41
42
43 #define LO_FLAGS_DO_BMAP 0x00000001
44 #define LO_FLAGS_READ_ONLY 0x00000002
45
46 #endif
47
48 struct loop_info {
49 int lo_number;
50 dev_t lo_device;
51 unsigned long lo_inode;
52 dev_t lo_rdevice;
53 int lo_offset;
54 int lo_encrypt_type;
55 int lo_encrypt_key_size;
56 int lo_flags;
57 char lo_name[LO_NAME_SIZE];
58 unsigned char lo_encrypt_key[LO_KEY_SIZE];
59 unsigned long lo_init[2];
60 char reserved[4];
61 };
62
63
64
65
66
67 #define LO_CRYPT_NONE 0
68 #define LO_CRYPT_XOR 1
69 #define LO_CRYPT_DES 2
70 #define LO_CRYPT_IDEA 3
71 #define MAX_LO_CRYPT 4
72
73
74
75
76
77 #define LOOP_SET_FD 0x4C00
78 #define LOOP_CLR_FD 0x4C01
79 #define LOOP_SET_STATUS 0x4C02
80 #define LOOP_GET_STATUS 0x4C03
81
82 #endif