blob: 56eba91083607ea3c7b484ebb448bb28d4a74031 [file] [log] [blame]
Ben Cheng655a7c02013-10-16 16:09:24 -07001/****************************************************************************
2 ****************************************************************************
3 ***
4 *** This header was automatically generated from a Linux kernel header
5 *** of the same name, to make information necessary for userspace to
6 *** call into the kernel available to libc. It contains only constants,
7 *** structures, and macros generated from the original header, and thus,
8 *** contains no copyrightable information.
9 ***
10 *** To edit the content of this header, modify the corresponding
11 *** source file (e.g. under external/kernel-headers/original/) then
12 *** run bionic/libc/kernel/tools/update_all.py
13 ***
14 *** Any manual change here will be lost the next time this script will
15 *** be run. You've been warned!
16 ***
17 ****************************************************************************
18 ****************************************************************************/
19#ifndef _UAPI_LINUX_LOOP_H
20#define _UAPI_LINUX_LOOP_H
21#define LO_NAME_SIZE 64
22#define LO_KEY_SIZE 32
Ben Cheng655a7c02013-10-16 16:09:24 -070023enum {
Tao Baod7db5942015-01-28 10:07:51 -080024 LO_FLAGS_READ_ONLY = 1,
25 LO_FLAGS_AUTOCLEAR = 4,
26 LO_FLAGS_PARTSCAN = 8,
Christopher Ferris05d08e92016-02-04 13:16:38 -080027 LO_FLAGS_DIRECT_IO = 16,
Ben Cheng655a7c02013-10-16 16:09:24 -070028};
Christopher Ferris8177cdf2020-08-03 11:53:55 -070029#define LOOP_SET_STATUS_SETTABLE_FLAGS (LO_FLAGS_AUTOCLEAR | LO_FLAGS_PARTSCAN)
30#define LOOP_SET_STATUS_CLEARABLE_FLAGS (LO_FLAGS_AUTOCLEAR)
31#define LOOP_CONFIGURE_SETTABLE_FLAGS (LO_FLAGS_READ_ONLY | LO_FLAGS_AUTOCLEAR | LO_FLAGS_PARTSCAN | LO_FLAGS_DIRECT_IO)
Ben Cheng655a7c02013-10-16 16:09:24 -070032#include <asm/posix_types.h>
33#include <linux/types.h>
Christopher Ferris05d08e92016-02-04 13:16:38 -080034struct loop_info {
Tao Baod7db5942015-01-28 10:07:51 -080035 int lo_number;
36 __kernel_old_dev_t lo_device;
37 unsigned long lo_inode;
Christopher Ferris05d08e92016-02-04 13:16:38 -080038 __kernel_old_dev_t lo_rdevice;
Tao Baod7db5942015-01-28 10:07:51 -080039 int lo_offset;
40 int lo_encrypt_type;
41 int lo_encrypt_key_size;
Christopher Ferris05d08e92016-02-04 13:16:38 -080042 int lo_flags;
Tao Baod7db5942015-01-28 10:07:51 -080043 char lo_name[LO_NAME_SIZE];
44 unsigned char lo_encrypt_key[LO_KEY_SIZE];
45 unsigned long lo_init[2];
Christopher Ferris05d08e92016-02-04 13:16:38 -080046 char reserved[4];
Ben Cheng655a7c02013-10-16 16:09:24 -070047};
48struct loop_info64 {
Tao Baod7db5942015-01-28 10:07:51 -080049 __u64 lo_device;
Christopher Ferris05d08e92016-02-04 13:16:38 -080050 __u64 lo_inode;
Tao Baod7db5942015-01-28 10:07:51 -080051 __u64 lo_rdevice;
52 __u64 lo_offset;
53 __u64 lo_sizelimit;
Christopher Ferris05d08e92016-02-04 13:16:38 -080054 __u32 lo_number;
Tao Baod7db5942015-01-28 10:07:51 -080055 __u32 lo_encrypt_type;
56 __u32 lo_encrypt_key_size;
57 __u32 lo_flags;
Christopher Ferris05d08e92016-02-04 13:16:38 -080058 __u8 lo_file_name[LO_NAME_SIZE];
Tao Baod7db5942015-01-28 10:07:51 -080059 __u8 lo_crypt_name[LO_NAME_SIZE];
60 __u8 lo_encrypt_key[LO_KEY_SIZE];
61 __u64 lo_init[2];
Christopher Ferris05d08e92016-02-04 13:16:38 -080062};
Christopher Ferris8177cdf2020-08-03 11:53:55 -070063struct loop_config {
64 __u32 fd;
65 __u32 block_size;
66 struct loop_info64 info;
67 __u64 __reserved[8];
68};
Ben Cheng655a7c02013-10-16 16:09:24 -070069#define LO_CRYPT_NONE 0
70#define LO_CRYPT_XOR 1
71#define LO_CRYPT_DES 2
Christopher Ferris05d08e92016-02-04 13:16:38 -080072#define LO_CRYPT_FISH2 3
Ben Cheng655a7c02013-10-16 16:09:24 -070073#define LO_CRYPT_BLOW 4
74#define LO_CRYPT_CAST128 5
75#define LO_CRYPT_IDEA 6
Christopher Ferris05d08e92016-02-04 13:16:38 -080076#define LO_CRYPT_DUMMY 9
Ben Cheng655a7c02013-10-16 16:09:24 -070077#define LO_CRYPT_SKIPJACK 10
78#define LO_CRYPT_CRYPTOAPI 18
79#define MAX_LO_CRYPT 20
Christopher Ferris05d08e92016-02-04 13:16:38 -080080#define LOOP_SET_FD 0x4C00
Ben Cheng655a7c02013-10-16 16:09:24 -070081#define LOOP_CLR_FD 0x4C01
82#define LOOP_SET_STATUS 0x4C02
83#define LOOP_GET_STATUS 0x4C03
Christopher Ferris05d08e92016-02-04 13:16:38 -080084#define LOOP_SET_STATUS64 0x4C04
Ben Cheng655a7c02013-10-16 16:09:24 -070085#define LOOP_GET_STATUS64 0x4C05
86#define LOOP_CHANGE_FD 0x4C06
87#define LOOP_SET_CAPACITY 0x4C07
Christopher Ferris05d08e92016-02-04 13:16:38 -080088#define LOOP_SET_DIRECT_IO 0x4C08
Christopher Ferris1308ad32017-11-14 17:32:13 -080089#define LOOP_SET_BLOCK_SIZE 0x4C09
Christopher Ferris8177cdf2020-08-03 11:53:55 -070090#define LOOP_CONFIGURE 0x4C0A
Christopher Ferris05d08e92016-02-04 13:16:38 -080091#define LOOP_CTL_ADD 0x4C80
Ben Cheng655a7c02013-10-16 16:09:24 -070092#define LOOP_CTL_REMOVE 0x4C81
93#define LOOP_CTL_GET_FREE 0x4C82
Ben Cheng655a7c02013-10-16 16:09:24 -070094#endif