xref: /linux/include/uapi/linux/dm-ioctl.h (revision 1ac731c529cd4d6adbce134754b51ff7d822b145)
1e2be04c7SGreg Kroah-Hartman /* SPDX-License-Identifier: LGPL-2.0+ WITH Linux-syscall-note */
2607ca46eSDavid Howells /*
3607ca46eSDavid Howells  * Copyright (C) 2001 - 2003 Sistina Software (UK) Limited.
4607ca46eSDavid Howells  * Copyright (C) 2004 - 2009 Red Hat, Inc. All rights reserved.
5607ca46eSDavid Howells  *
6607ca46eSDavid Howells  * This file is released under the LGPL.
7607ca46eSDavid Howells  */
8607ca46eSDavid Howells 
9607ca46eSDavid Howells #ifndef _LINUX_DM_IOCTL_V4_H
10607ca46eSDavid Howells #define _LINUX_DM_IOCTL_V4_H
11607ca46eSDavid Howells 
12607ca46eSDavid Howells #include <linux/types.h>
13607ca46eSDavid Howells 
14607ca46eSDavid Howells #define DM_DIR "mapper"		/* Slashes not supported */
15607ca46eSDavid Howells #define DM_CONTROL_NODE "control"
16607ca46eSDavid Howells #define DM_MAX_TYPE_NAME 16
17607ca46eSDavid Howells #define DM_NAME_LEN 128
18607ca46eSDavid Howells #define DM_UUID_LEN 129
19607ca46eSDavid Howells 
20607ca46eSDavid Howells /*
21607ca46eSDavid Howells  * A traditional ioctl interface for the device mapper.
22607ca46eSDavid Howells  *
23607ca46eSDavid Howells  * Each device can have two tables associated with it, an
24607ca46eSDavid Howells  * 'active' table which is the one currently used by io passing
25607ca46eSDavid Howells  * through the device, and an 'inactive' one which is a table
26607ca46eSDavid Howells  * that is being prepared as a replacement for the 'active' one.
27607ca46eSDavid Howells  *
28607ca46eSDavid Howells  * DM_VERSION:
29607ca46eSDavid Howells  * Just get the version information for the ioctl interface.
30607ca46eSDavid Howells  *
31607ca46eSDavid Howells  * DM_REMOVE_ALL:
32607ca46eSDavid Howells  * Remove all dm devices, destroy all tables.  Only really used
33607ca46eSDavid Howells  * for debug.
34607ca46eSDavid Howells  *
35607ca46eSDavid Howells  * DM_LIST_DEVICES:
36607ca46eSDavid Howells  * Get a list of all the dm device names.
37607ca46eSDavid Howells  *
38607ca46eSDavid Howells  * DM_DEV_CREATE:
39607ca46eSDavid Howells  * Create a new device, neither the 'active' or 'inactive' table
40607ca46eSDavid Howells  * slots will be filled.  The device will be in suspended state
41607ca46eSDavid Howells  * after creation, however any io to the device will get errored
42607ca46eSDavid Howells  * since it will be out-of-bounds.
43607ca46eSDavid Howells  *
44607ca46eSDavid Howells  * DM_DEV_REMOVE:
45607ca46eSDavid Howells  * Remove a device, destroy any tables.
46607ca46eSDavid Howells  *
47607ca46eSDavid Howells  * DM_DEV_RENAME:
48607ca46eSDavid Howells  * Rename a device or set its uuid if none was previously supplied.
49607ca46eSDavid Howells  *
50607ca46eSDavid Howells  * DM_SUSPEND:
51607ca46eSDavid Howells  * This performs both suspend and resume, depending which flag is
52607ca46eSDavid Howells  * passed in.
53607ca46eSDavid Howells  * Suspend: This command will not return until all pending io to
54607ca46eSDavid Howells  * the device has completed.  Further io will be deferred until
55607ca46eSDavid Howells  * the device is resumed.
56607ca46eSDavid Howells  * Resume: It is no longer an error to issue this command on an
57607ca46eSDavid Howells  * unsuspended device.  If a table is present in the 'inactive'
58607ca46eSDavid Howells  * slot, it will be moved to the active slot, then the old table
59607ca46eSDavid Howells  * from the active slot will be _destroyed_.  Finally the device
60607ca46eSDavid Howells  * is resumed.
61607ca46eSDavid Howells  *
62607ca46eSDavid Howells  * DM_DEV_STATUS:
63607ca46eSDavid Howells  * Retrieves the status for the table in the 'active' slot.
64607ca46eSDavid Howells  *
65607ca46eSDavid Howells  * DM_DEV_WAIT:
66607ca46eSDavid Howells  * Wait for a significant event to occur to the device.  This
67607ca46eSDavid Howells  * could either be caused by an event triggered by one of the
68607ca46eSDavid Howells  * targets of the table in the 'active' slot, or a table change.
69607ca46eSDavid Howells  *
70607ca46eSDavid Howells  * DM_TABLE_LOAD:
71607ca46eSDavid Howells  * Load a table into the 'inactive' slot for the device.  The
72607ca46eSDavid Howells  * device does _not_ need to be suspended prior to this command.
73607ca46eSDavid Howells  *
74607ca46eSDavid Howells  * DM_TABLE_CLEAR:
75607ca46eSDavid Howells  * Destroy any table in the 'inactive' slot (ie. abort).
76607ca46eSDavid Howells  *
77607ca46eSDavid Howells  * DM_TABLE_DEPS:
78607ca46eSDavid Howells  * Return a set of device dependencies for the 'active' table.
79607ca46eSDavid Howells  *
80607ca46eSDavid Howells  * DM_TABLE_STATUS:
81607ca46eSDavid Howells  * Return the targets status for the 'active' table.
82607ca46eSDavid Howells  *
83607ca46eSDavid Howells  * DM_TARGET_MSG:
84607ca46eSDavid Howells  * Pass a message string to the target at a specific offset of a device.
85607ca46eSDavid Howells  *
86607ca46eSDavid Howells  * DM_DEV_SET_GEOMETRY:
87607ca46eSDavid Howells  * Set the geometry of a device by passing in a string in this format:
88607ca46eSDavid Howells  *
89607ca46eSDavid Howells  * "cylinders heads sectors_per_track start_sector"
90607ca46eSDavid Howells  *
91607ca46eSDavid Howells  * Beware that CHS geometry is nearly obsolete and only provided
92607ca46eSDavid Howells  * for compatibility with dm devices that can be booted by a PC
93607ca46eSDavid Howells  * BIOS.  See struct hd_geometry for range limits.  Also note that
94607ca46eSDavid Howells  * the geometry is erased if the device size changes.
95607ca46eSDavid Howells  */
96607ca46eSDavid Howells 
97607ca46eSDavid Howells /*
98607ca46eSDavid Howells  * All ioctl arguments consist of a single chunk of memory, with
99607ca46eSDavid Howells  * this structure at the start.  If a uuid is specified any
100607ca46eSDavid Howells  * lookup (eg. for a DM_INFO) will be done on that, *not* the
101607ca46eSDavid Howells  * name.
102607ca46eSDavid Howells  */
103607ca46eSDavid Howells struct dm_ioctl {
104607ca46eSDavid Howells 	/*
105607ca46eSDavid Howells 	 * The version number is made up of three parts:
106607ca46eSDavid Howells 	 * major - no backward or forward compatibility,
107607ca46eSDavid Howells 	 * minor - only backwards compatible,
108607ca46eSDavid Howells 	 * patch - both backwards and forwards compatible.
109607ca46eSDavid Howells 	 *
110607ca46eSDavid Howells 	 * All clients of the ioctl interface should fill in the
111607ca46eSDavid Howells 	 * version number of the interface that they were
112607ca46eSDavid Howells 	 * compiled with.
113607ca46eSDavid Howells 	 *
114607ca46eSDavid Howells 	 * All recognised ioctl commands (ie. those that don't
115607ca46eSDavid Howells 	 * return -ENOTTY) fill out this field, even if the
116607ca46eSDavid Howells 	 * command failed.
117607ca46eSDavid Howells 	 */
118607ca46eSDavid Howells 	__u32 version[3];	/* in/out */
119607ca46eSDavid Howells 	__u32 data_size;	/* total size of data passed in
120607ca46eSDavid Howells 				 * including this struct */
121607ca46eSDavid Howells 
122607ca46eSDavid Howells 	__u32 data_start;	/* offset to start of data
123607ca46eSDavid Howells 				 * relative to start of this struct */
124607ca46eSDavid Howells 
125607ca46eSDavid Howells 	__u32 target_count;	/* in/out */
126607ca46eSDavid Howells 	__s32 open_count;	/* out */
127607ca46eSDavid Howells 	__u32 flags;		/* in/out */
128607ca46eSDavid Howells 
129607ca46eSDavid Howells 	/*
130607ca46eSDavid Howells 	 * event_nr holds either the event number (input and output) or the
131607ca46eSDavid Howells 	 * udev cookie value (input only).
132607ca46eSDavid Howells 	 * The DM_DEV_WAIT ioctl takes an event number as input.
133607ca46eSDavid Howells 	 * The DM_SUSPEND, DM_DEV_REMOVE and DM_DEV_RENAME ioctls
134607ca46eSDavid Howells 	 * use the field as a cookie to return in the DM_COOKIE
135607ca46eSDavid Howells 	 * variable with the uevents they issue.
136607ca46eSDavid Howells 	 * For output, the ioctls return the event number, not the cookie.
137607ca46eSDavid Howells 	 */
138607ca46eSDavid Howells 	__u32 event_nr;      	/* in/out */
139607ca46eSDavid Howells 	__u32 padding;
140607ca46eSDavid Howells 
141607ca46eSDavid Howells 	__u64 dev;		/* in/out */
142607ca46eSDavid Howells 
143607ca46eSDavid Howells 	char name[DM_NAME_LEN];	/* device name */
144607ca46eSDavid Howells 	char uuid[DM_UUID_LEN];	/* unique identifier for
145607ca46eSDavid Howells 				 * the block device */
146607ca46eSDavid Howells 	char data[7];		/* padding or data */
147607ca46eSDavid Howells };
148607ca46eSDavid Howells 
149607ca46eSDavid Howells /*
150607ca46eSDavid Howells  * Used to specify tables.  These structures appear after the
151607ca46eSDavid Howells  * dm_ioctl.
152607ca46eSDavid Howells  */
153607ca46eSDavid Howells struct dm_target_spec {
154607ca46eSDavid Howells 	__u64 sector_start;
155607ca46eSDavid Howells 	__u64 length;
156607ca46eSDavid Howells 	__s32 status;		/* used when reading from kernel only */
157607ca46eSDavid Howells 
158607ca46eSDavid Howells 	/*
159607ca46eSDavid Howells 	 * Location of the next dm_target_spec.
160607ca46eSDavid Howells 	 * - When specifying targets on a DM_TABLE_LOAD command, this value is
161607ca46eSDavid Howells 	 *   the number of bytes from the start of the "current" dm_target_spec
162607ca46eSDavid Howells 	 *   to the start of the "next" dm_target_spec.
163607ca46eSDavid Howells 	 * - When retrieving targets on a DM_TABLE_STATUS command, this value
164607ca46eSDavid Howells 	 *   is the number of bytes from the start of the first dm_target_spec
165607ca46eSDavid Howells 	 *   (that follows the dm_ioctl struct) to the start of the "next"
166607ca46eSDavid Howells 	 *   dm_target_spec.
167607ca46eSDavid Howells 	 */
168607ca46eSDavid Howells 	__u32 next;
169607ca46eSDavid Howells 
170607ca46eSDavid Howells 	char target_type[DM_MAX_TYPE_NAME];
171607ca46eSDavid Howells 
172607ca46eSDavid Howells 	/*
173607ca46eSDavid Howells 	 * Parameter string starts immediately after this object.
174607ca46eSDavid Howells 	 * Be careful to add padding after string to ensure correct
175607ca46eSDavid Howells 	 * alignment of subsequent dm_target_spec.
176607ca46eSDavid Howells 	 */
177607ca46eSDavid Howells };
178607ca46eSDavid Howells 
179607ca46eSDavid Howells /*
180607ca46eSDavid Howells  * Used to retrieve the target dependencies.
181607ca46eSDavid Howells  */
182607ca46eSDavid Howells struct dm_target_deps {
183607ca46eSDavid Howells 	__u32 count;	/* Array size */
184607ca46eSDavid Howells 	__u32 padding;	/* unused */
18594dfc73eSGustavo A. R. Silva 	__u64 dev[];	/* out */
186607ca46eSDavid Howells };
187607ca46eSDavid Howells 
188607ca46eSDavid Howells /*
189607ca46eSDavid Howells  * Used to get a list of all dm devices.
190607ca46eSDavid Howells  */
191607ca46eSDavid Howells struct dm_name_list {
192607ca46eSDavid Howells 	__u64 dev;
193607ca46eSDavid Howells 	__u32 next;		/* offset to the next record from
194607ca46eSDavid Howells 				   the _start_ of this */
19594dfc73eSGustavo A. R. Silva 	char name[];
1968b638081SMikulas Patocka 
1978b638081SMikulas Patocka 	/*
1988b638081SMikulas Patocka 	 * The following members can be accessed by taking a pointer that
1998b638081SMikulas Patocka 	 * points immediately after the terminating zero character in "name"
2008b638081SMikulas Patocka 	 * and aligning this pointer to next 8-byte boundary.
2018b638081SMikulas Patocka 	 * Uuid is present if the flag DM_NAME_LIST_FLAG_HAS_UUID is set.
2028b638081SMikulas Patocka 	 *
2038b638081SMikulas Patocka 	 * __u32 event_nr;
2048b638081SMikulas Patocka 	 * __u32 flags;
2058b638081SMikulas Patocka 	 * char uuid[0];
2068b638081SMikulas Patocka 	 */
207607ca46eSDavid Howells };
208607ca46eSDavid Howells 
2098b638081SMikulas Patocka #define DM_NAME_LIST_FLAG_HAS_UUID		1
2108b638081SMikulas Patocka #define DM_NAME_LIST_FLAG_DOESNT_HAVE_UUID	2
2118b638081SMikulas Patocka 
212607ca46eSDavid Howells /*
213607ca46eSDavid Howells  * Used to retrieve the target versions
214607ca46eSDavid Howells  */
215607ca46eSDavid Howells struct dm_target_versions {
216607ca46eSDavid Howells         __u32 next;
217607ca46eSDavid Howells         __u32 version[3];
218607ca46eSDavid Howells 
21994dfc73eSGustavo A. R. Silva         char name[];
220607ca46eSDavid Howells };
221607ca46eSDavid Howells 
222607ca46eSDavid Howells /*
223607ca46eSDavid Howells  * Used to pass message to a target
224607ca46eSDavid Howells  */
225607ca46eSDavid Howells struct dm_target_msg {
226607ca46eSDavid Howells 	__u64 sector;	/* Device sector */
227607ca46eSDavid Howells 
22894dfc73eSGustavo A. R. Silva 	char message[];
229607ca46eSDavid Howells };
230607ca46eSDavid Howells 
231607ca46eSDavid Howells /*
232607ca46eSDavid Howells  * If you change this make sure you make the corresponding change
233607ca46eSDavid Howells  * to dm-ioctl.c:lookup_ioctl()
234607ca46eSDavid Howells  */
235607ca46eSDavid Howells enum {
236607ca46eSDavid Howells 	/* Top level cmds */
237607ca46eSDavid Howells 	DM_VERSION_CMD = 0,
238607ca46eSDavid Howells 	DM_REMOVE_ALL_CMD,
239607ca46eSDavid Howells 	DM_LIST_DEVICES_CMD,
240607ca46eSDavid Howells 
241607ca46eSDavid Howells 	/* device level cmds */
242607ca46eSDavid Howells 	DM_DEV_CREATE_CMD,
243607ca46eSDavid Howells 	DM_DEV_REMOVE_CMD,
244607ca46eSDavid Howells 	DM_DEV_RENAME_CMD,
245607ca46eSDavid Howells 	DM_DEV_SUSPEND_CMD,
246607ca46eSDavid Howells 	DM_DEV_STATUS_CMD,
247607ca46eSDavid Howells 	DM_DEV_WAIT_CMD,
248607ca46eSDavid Howells 
249607ca46eSDavid Howells 	/* Table level cmds */
250607ca46eSDavid Howells 	DM_TABLE_LOAD_CMD,
251607ca46eSDavid Howells 	DM_TABLE_CLEAR_CMD,
252607ca46eSDavid Howells 	DM_TABLE_DEPS_CMD,
253607ca46eSDavid Howells 	DM_TABLE_STATUS_CMD,
254607ca46eSDavid Howells 
255607ca46eSDavid Howells 	/* Added later */
256607ca46eSDavid Howells 	DM_LIST_VERSIONS_CMD,
257607ca46eSDavid Howells 	DM_TARGET_MSG_CMD,
258fc1841e1SMikulas Patocka 	DM_DEV_SET_GEOMETRY_CMD,
259fc1841e1SMikulas Patocka 	DM_DEV_ARM_POLL_CMD,
260afa179ebSMikulas Patocka 	DM_GET_TARGET_VERSION_CMD,
261607ca46eSDavid Howells };
262607ca46eSDavid Howells 
263607ca46eSDavid Howells #define DM_IOCTL 0xfd
264607ca46eSDavid Howells 
265607ca46eSDavid Howells #define DM_VERSION       _IOWR(DM_IOCTL, DM_VERSION_CMD, struct dm_ioctl)
266607ca46eSDavid Howells #define DM_REMOVE_ALL    _IOWR(DM_IOCTL, DM_REMOVE_ALL_CMD, struct dm_ioctl)
267607ca46eSDavid Howells #define DM_LIST_DEVICES  _IOWR(DM_IOCTL, DM_LIST_DEVICES_CMD, struct dm_ioctl)
268607ca46eSDavid Howells 
269607ca46eSDavid Howells #define DM_DEV_CREATE    _IOWR(DM_IOCTL, DM_DEV_CREATE_CMD, struct dm_ioctl)
270607ca46eSDavid Howells #define DM_DEV_REMOVE    _IOWR(DM_IOCTL, DM_DEV_REMOVE_CMD, struct dm_ioctl)
271607ca46eSDavid Howells #define DM_DEV_RENAME    _IOWR(DM_IOCTL, DM_DEV_RENAME_CMD, struct dm_ioctl)
272607ca46eSDavid Howells #define DM_DEV_SUSPEND   _IOWR(DM_IOCTL, DM_DEV_SUSPEND_CMD, struct dm_ioctl)
273607ca46eSDavid Howells #define DM_DEV_STATUS    _IOWR(DM_IOCTL, DM_DEV_STATUS_CMD, struct dm_ioctl)
274607ca46eSDavid Howells #define DM_DEV_WAIT      _IOWR(DM_IOCTL, DM_DEV_WAIT_CMD, struct dm_ioctl)
275fc1841e1SMikulas Patocka #define DM_DEV_ARM_POLL  _IOWR(DM_IOCTL, DM_DEV_ARM_POLL_CMD, struct dm_ioctl)
276607ca46eSDavid Howells 
277607ca46eSDavid Howells #define DM_TABLE_LOAD    _IOWR(DM_IOCTL, DM_TABLE_LOAD_CMD, struct dm_ioctl)
278607ca46eSDavid Howells #define DM_TABLE_CLEAR   _IOWR(DM_IOCTL, DM_TABLE_CLEAR_CMD, struct dm_ioctl)
279607ca46eSDavid Howells #define DM_TABLE_DEPS    _IOWR(DM_IOCTL, DM_TABLE_DEPS_CMD, struct dm_ioctl)
280607ca46eSDavid Howells #define DM_TABLE_STATUS  _IOWR(DM_IOCTL, DM_TABLE_STATUS_CMD, struct dm_ioctl)
281607ca46eSDavid Howells 
282607ca46eSDavid Howells #define DM_LIST_VERSIONS _IOWR(DM_IOCTL, DM_LIST_VERSIONS_CMD, struct dm_ioctl)
283afa179ebSMikulas Patocka #define DM_GET_TARGET_VERSION _IOWR(DM_IOCTL, DM_GET_TARGET_VERSION_CMD, struct dm_ioctl)
284607ca46eSDavid Howells 
285607ca46eSDavid Howells #define DM_TARGET_MSG	 _IOWR(DM_IOCTL, DM_TARGET_MSG_CMD, struct dm_ioctl)
286607ca46eSDavid Howells #define DM_DEV_SET_GEOMETRY	_IOWR(DM_IOCTL, DM_DEV_SET_GEOMETRY_CMD, struct dm_ioctl)
287607ca46eSDavid Howells 
288607ca46eSDavid Howells #define DM_VERSION_MAJOR	4
289*06961c48SMike Snitzer #define DM_VERSION_MINOR	48
29002cde50bSMikulas Patocka #define DM_VERSION_PATCHLEVEL	0
291*06961c48SMike Snitzer #define DM_VERSION_EXTRA	"-ioctl (2023-03-01)"
292607ca46eSDavid Howells 
293607ca46eSDavid Howells /* Status bits */
294607ca46eSDavid Howells #define DM_READONLY_FLAG	(1 << 0) /* In/Out */
295607ca46eSDavid Howells #define DM_SUSPEND_FLAG		(1 << 1) /* In/Out */
296607ca46eSDavid Howells #define DM_PERSISTENT_DEV_FLAG	(1 << 3) /* In */
297607ca46eSDavid Howells 
298607ca46eSDavid Howells /*
299607ca46eSDavid Howells  * Flag passed into ioctl STATUS command to get table information
300607ca46eSDavid Howells  * rather than current status.
301607ca46eSDavid Howells  */
302607ca46eSDavid Howells #define DM_STATUS_TABLE_FLAG	(1 << 4) /* In */
303607ca46eSDavid Howells 
304607ca46eSDavid Howells /*
305607ca46eSDavid Howells  * Flags that indicate whether a table is present in either of
306607ca46eSDavid Howells  * the two table slots that a device has.
307607ca46eSDavid Howells  */
308607ca46eSDavid Howells #define DM_ACTIVE_PRESENT_FLAG   (1 << 5) /* Out */
309607ca46eSDavid Howells #define DM_INACTIVE_PRESENT_FLAG (1 << 6) /* Out */
310607ca46eSDavid Howells 
311607ca46eSDavid Howells /*
312607ca46eSDavid Howells  * Indicates that the buffer passed in wasn't big enough for the
313607ca46eSDavid Howells  * results.
314607ca46eSDavid Howells  */
315607ca46eSDavid Howells #define DM_BUFFER_FULL_FLAG	(1 << 8) /* Out */
316607ca46eSDavid Howells 
317607ca46eSDavid Howells /*
318607ca46eSDavid Howells  * This flag is now ignored.
319607ca46eSDavid Howells  */
320607ca46eSDavid Howells #define DM_SKIP_BDGET_FLAG	(1 << 9) /* In */
321607ca46eSDavid Howells 
322607ca46eSDavid Howells /*
323607ca46eSDavid Howells  * Set this to avoid attempting to freeze any filesystem when suspending.
324607ca46eSDavid Howells  */
325607ca46eSDavid Howells #define DM_SKIP_LOCKFS_FLAG	(1 << 10) /* In */
326607ca46eSDavid Howells 
327607ca46eSDavid Howells /*
328607ca46eSDavid Howells  * Set this to suspend without flushing queued ios.
329607ca46eSDavid Howells  * Also disables flushing uncommitted changes in the thin target before
330607ca46eSDavid Howells  * generating statistics for DM_TABLE_STATUS and DM_DEV_WAIT.
331607ca46eSDavid Howells  */
332607ca46eSDavid Howells #define DM_NOFLUSH_FLAG		(1 << 11) /* In */
333607ca46eSDavid Howells 
334607ca46eSDavid Howells /*
335607ca46eSDavid Howells  * If set, any table information returned will relate to the inactive
336607ca46eSDavid Howells  * table instead of the live one.  Always check DM_INACTIVE_PRESENT_FLAG
337607ca46eSDavid Howells  * is set before using the data returned.
338607ca46eSDavid Howells  */
339607ca46eSDavid Howells #define DM_QUERY_INACTIVE_TABLE_FLAG	(1 << 12) /* In */
340607ca46eSDavid Howells 
341607ca46eSDavid Howells /*
342607ca46eSDavid Howells  * If set, a uevent was generated for which the caller may need to wait.
343607ca46eSDavid Howells  */
344607ca46eSDavid Howells #define DM_UEVENT_GENERATED_FLAG	(1 << 13) /* Out */
345607ca46eSDavid Howells 
346607ca46eSDavid Howells /*
347607ca46eSDavid Howells  * If set, rename changes the uuid not the name.  Only permitted
348607ca46eSDavid Howells  * if no uuid was previously supplied: an existing uuid cannot be changed.
349607ca46eSDavid Howells  */
350607ca46eSDavid Howells #define DM_UUID_FLAG			(1 << 14) /* In */
351607ca46eSDavid Howells 
352607ca46eSDavid Howells /*
353607ca46eSDavid Howells  * If set, all buffers are wiped after use. Use when sending
354607ca46eSDavid Howells  * or requesting sensitive data such as an encryption key.
355607ca46eSDavid Howells  */
356607ca46eSDavid Howells #define DM_SECURE_DATA_FLAG		(1 << 15) /* In */
357607ca46eSDavid Howells 
358a2606241SMikulas Patocka /*
359a2606241SMikulas Patocka  * If set, a message generated output data.
360a2606241SMikulas Patocka  */
361a2606241SMikulas Patocka #define DM_DATA_OUT_FLAG		(1 << 16) /* Out */
362a2606241SMikulas Patocka 
3632c140a24SMikulas Patocka /*
3642c140a24SMikulas Patocka  * If set with DM_DEV_REMOVE or DM_REMOVE_ALL this indicates that if
3652c140a24SMikulas Patocka  * the device cannot be removed immediately because it is still in use
3662c140a24SMikulas Patocka  * it should instead be scheduled for removal when it gets closed.
3672c140a24SMikulas Patocka  *
3682c140a24SMikulas Patocka  * On return from DM_DEV_REMOVE, DM_DEV_STATUS or other ioctls, this
3692c140a24SMikulas Patocka  * flag indicates that the device is scheduled to be removed when it
3702c140a24SMikulas Patocka  * gets closed.
3712c140a24SMikulas Patocka  */
3722c140a24SMikulas Patocka #define DM_DEFERRED_REMOVE		(1 << 17) /* In/Out */
3732c140a24SMikulas Patocka 
374ffcc3936SMike Snitzer /*
375ffcc3936SMike Snitzer  * If set, the device is suspended internally.
376ffcc3936SMike Snitzer  */
377ffcc3936SMike Snitzer #define DM_INTERNAL_SUSPEND_FLAG	(1 << 18) /* Out */
378ffcc3936SMike Snitzer 
37991ccbbacSTushar Sugandhi /*
38091ccbbacSTushar Sugandhi  * If set, returns in the in buffer passed by UM, the raw table information
38191ccbbacSTushar Sugandhi  * that would be measured by IMA subsystem on device state change.
38291ccbbacSTushar Sugandhi  */
38391ccbbacSTushar Sugandhi #define DM_IMA_MEASUREMENT_FLAG	(1 << 19) /* In */
38491ccbbacSTushar Sugandhi 
385607ca46eSDavid Howells #endif				/* _LINUX_DM_IOCTL_H */
386