~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

TOMOYO Linux Cross Reference
Linux/include/uapi/linux/loop.h

Version: ~ [ linux-6.11.5 ] ~ [ linux-6.10.14 ] ~ [ linux-6.9.12 ] ~ [ linux-6.8.12 ] ~ [ linux-6.7.12 ] ~ [ linux-6.6.58 ] ~ [ linux-6.5.13 ] ~ [ linux-6.4.16 ] ~ [ linux-6.3.13 ] ~ [ linux-6.2.16 ] ~ [ linux-6.1.114 ] ~ [ linux-6.0.19 ] ~ [ linux-5.19.17 ] ~ [ linux-5.18.19 ] ~ [ linux-5.17.15 ] ~ [ linux-5.16.20 ] ~ [ linux-5.15.169 ] ~ [ linux-5.14.21 ] ~ [ linux-5.13.19 ] ~ [ linux-5.12.19 ] ~ [ linux-5.11.22 ] ~ [ linux-5.10.228 ] ~ [ linux-5.9.16 ] ~ [ linux-5.8.18 ] ~ [ linux-5.7.19 ] ~ [ linux-5.6.19 ] ~ [ linux-5.5.19 ] ~ [ linux-5.4.284 ] ~ [ linux-5.3.18 ] ~ [ linux-5.2.21 ] ~ [ linux-5.1.21 ] ~ [ linux-5.0.21 ] ~ [ linux-4.20.17 ] ~ [ linux-4.19.322 ] ~ [ linux-4.18.20 ] ~ [ linux-4.17.19 ] ~ [ linux-4.16.18 ] ~ [ linux-4.15.18 ] ~ [ linux-4.14.336 ] ~ [ linux-4.13.16 ] ~ [ linux-4.12.14 ] ~ [ linux-4.11.12 ] ~ [ linux-4.10.17 ] ~ [ linux-4.9.337 ] ~ [ linux-4.4.302 ] ~ [ linux-3.10.108 ] ~ [ linux-2.6.32.71 ] ~ [ linux-2.6.0 ] ~ [ linux-2.4.37.11 ] ~ [ unix-v6-master ] ~ [ ccs-tools-1.8.9 ] ~ [ policy-sample ] ~
Architecture: ~ [ i386 ] ~ [ alpha ] ~ [ m68k ] ~ [ mips ] ~ [ ppc ] ~ [ sparc ] ~ [ sparc64 ] ~

  1 /* SPDX-License-Identifier: GPL-1.0+ WITH Linux-syscall-note */
  2 /*
  3  * Copyright 1993 by Theodore Ts'o.
  4  */
  5 #ifndef _UAPI_LINUX_LOOP_H
  6 #define _UAPI_LINUX_LOOP_H
  7 
  8 
  9 #define LO_NAME_SIZE    64
 10 #define LO_KEY_SIZE     32
 11 
 12 
 13 /*
 14  * Loop flags
 15  */
 16 enum {
 17         LO_FLAGS_READ_ONLY      = 1,
 18         LO_FLAGS_AUTOCLEAR      = 4,
 19         LO_FLAGS_PARTSCAN       = 8,
 20         LO_FLAGS_DIRECT_IO      = 16,
 21 };
 22 
 23 /* LO_FLAGS that can be set using LOOP_SET_STATUS(64) */
 24 #define LOOP_SET_STATUS_SETTABLE_FLAGS (LO_FLAGS_AUTOCLEAR | LO_FLAGS_PARTSCAN)
 25 
 26 /* LO_FLAGS that can be cleared using LOOP_SET_STATUS(64) */
 27 #define LOOP_SET_STATUS_CLEARABLE_FLAGS (LO_FLAGS_AUTOCLEAR)
 28 
 29 /* LO_FLAGS that can be set using LOOP_CONFIGURE */
 30 #define LOOP_CONFIGURE_SETTABLE_FLAGS (LO_FLAGS_READ_ONLY | LO_FLAGS_AUTOCLEAR \
 31                                        | LO_FLAGS_PARTSCAN | LO_FLAGS_DIRECT_IO)
 32 
 33 #include <asm/posix_types.h>    /* for __kernel_old_dev_t */
 34 #include <linux/types.h>        /* for __u64 */
 35 
 36 /* Backwards compatibility version */
 37 struct loop_info {
 38         int                lo_number;           /* ioctl r/o */
 39         __kernel_old_dev_t lo_device;           /* ioctl r/o */
 40         unsigned long      lo_inode;            /* ioctl r/o */
 41         __kernel_old_dev_t lo_rdevice;          /* ioctl r/o */
 42         int                lo_offset;
 43         int                lo_encrypt_type;             /* obsolete, ignored */
 44         int                lo_encrypt_key_size;         /* ioctl w/o */
 45         int                lo_flags;
 46         char               lo_name[LO_NAME_SIZE];
 47         unsigned char      lo_encrypt_key[LO_KEY_SIZE]; /* ioctl w/o */
 48         unsigned long      lo_init[2];
 49         char               reserved[4];
 50 };
 51 
 52 struct loop_info64 {
 53         __u64              lo_device;                   /* ioctl r/o */
 54         __u64              lo_inode;                    /* ioctl r/o */
 55         __u64              lo_rdevice;                  /* ioctl r/o */
 56         __u64              lo_offset;
 57         __u64              lo_sizelimit;/* bytes, 0 == max available */
 58         __u32              lo_number;                   /* ioctl r/o */
 59         __u32              lo_encrypt_type;             /* obsolete, ignored */
 60         __u32              lo_encrypt_key_size;         /* ioctl w/o */
 61         __u32              lo_flags;
 62         __u8               lo_file_name[LO_NAME_SIZE];
 63         __u8               lo_crypt_name[LO_NAME_SIZE];
 64         __u8               lo_encrypt_key[LO_KEY_SIZE]; /* ioctl w/o */
 65         __u64              lo_init[2];
 66 };
 67 
 68 /**
 69  * struct loop_config - Complete configuration for a loop device.
 70  * @fd: fd of the file to be used as a backing file for the loop device.
 71  * @block_size: block size to use; ignored if 0.
 72  * @info: struct loop_info64 to configure the loop device with.
 73  *
 74  * This structure is used with the LOOP_CONFIGURE ioctl, and can be used to
 75  * atomically setup and configure all loop device parameters at once.
 76  */
 77 struct loop_config {
 78         __u32                   fd;
 79         __u32                   block_size;
 80         struct loop_info64      info;
 81         __u64                   __reserved[8];
 82 };
 83 
 84 /*
 85  * Loop filter types
 86  */
 87 
 88 #define LO_CRYPT_NONE           0
 89 #define LO_CRYPT_XOR            1
 90 #define LO_CRYPT_DES            2
 91 #define LO_CRYPT_FISH2          3    /* Twofish encryption */
 92 #define LO_CRYPT_BLOW           4
 93 #define LO_CRYPT_CAST128        5
 94 #define LO_CRYPT_IDEA           6
 95 #define LO_CRYPT_DUMMY          9
 96 #define LO_CRYPT_SKIPJACK       10
 97 #define LO_CRYPT_CRYPTOAPI      18
 98 #define MAX_LO_CRYPT            20
 99 
100 /*
101  * IOCTL commands --- we will commandeer 0x4C ('L')
102  */
103 
104 #define LOOP_SET_FD             0x4C00
105 #define LOOP_CLR_FD             0x4C01
106 #define LOOP_SET_STATUS         0x4C02
107 #define LOOP_GET_STATUS         0x4C03
108 #define LOOP_SET_STATUS64       0x4C04
109 #define LOOP_GET_STATUS64       0x4C05
110 #define LOOP_CHANGE_FD          0x4C06
111 #define LOOP_SET_CAPACITY       0x4C07
112 #define LOOP_SET_DIRECT_IO      0x4C08
113 #define LOOP_SET_BLOCK_SIZE     0x4C09
114 #define LOOP_CONFIGURE          0x4C0A
115 
116 /* /dev/loop-control interface */
117 #define LOOP_CTL_ADD            0x4C80
118 #define LOOP_CTL_REMOVE         0x4C81
119 #define LOOP_CTL_GET_FREE       0x4C82
120 #endif /* _UAPI_LINUX_LOOP_H */
121 

~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

kernel.org | git.kernel.org | LWN.net | Project Home | SVN repository | Mail admin

Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.

sflogo.php