diff options
| author | Mikulas Patocka <mpatocka@redhat.com> | 2013-11-01 18:27:41 -0400 |
|---|---|---|
| committer | Mike Snitzer <snitzer@redhat.com> | 2013-11-09 18:20:22 -0500 |
| commit | 2c140a246dc0bc085b98eddde978060fcec1080c (patch) | |
| tree | 73d747f4422fe202868495d08ea5d189bc16bd79 /include/uapi/linux | |
| parent | 7833b08e18241a1c35c09ef38be840cbf6c58acf (diff) | |
dm: allow remove to be deferred
This patch allows the removal of an open device to be deferred until
it is closed. (Previously such a removal attempt would fail.)
The deferred remove functionality is enabled by setting the flag
DM_DEFERRED_REMOVE in the ioctl structure on DM_DEV_REMOVE or
DM_REMOVE_ALL ioctl.
On return from DM_DEV_REMOVE, the flag DM_DEFERRED_REMOVE indicates if
the device was removed immediately or flagged to be removed on close -
if the flag is clear, the device was removed.
On return from DM_DEV_STATUS and other ioctls, the flag
DM_DEFERRED_REMOVE is set if the device is scheduled to be removed on
closure.
A device that is scheduled to be deleted can be revived using the
message "@cancel_deferred_remove". This message clears the
DMF_DEFERRED_REMOVE flag so that the device won't be deleted on close.
Signed-off-by: Mikulas Patocka <mpatocka@redhat.com>
Signed-off-by: Alasdair G Kergon <agk@redhat.com>
Signed-off-by: Mike Snitzer <snitzer@redhat.com>
Diffstat (limited to 'include/uapi/linux')
| -rw-r--r-- | include/uapi/linux/dm-ioctl.h | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/include/uapi/linux/dm-ioctl.h b/include/uapi/linux/dm-ioctl.h index f1e12bd40b3b..c8a4302093a3 100644 --- a/include/uapi/linux/dm-ioctl.h +++ b/include/uapi/linux/dm-ioctl.h | |||
| @@ -267,9 +267,9 @@ enum { | |||
| 267 | #define DM_DEV_SET_GEOMETRY _IOWR(DM_IOCTL, DM_DEV_SET_GEOMETRY_CMD, struct dm_ioctl) | 267 | #define DM_DEV_SET_GEOMETRY _IOWR(DM_IOCTL, DM_DEV_SET_GEOMETRY_CMD, struct dm_ioctl) |
| 268 | 268 | ||
| 269 | #define DM_VERSION_MAJOR 4 | 269 | #define DM_VERSION_MAJOR 4 |
| 270 | #define DM_VERSION_MINOR 26 | 270 | #define DM_VERSION_MINOR 27 |
| 271 | #define DM_VERSION_PATCHLEVEL 0 | 271 | #define DM_VERSION_PATCHLEVEL 0 |
| 272 | #define DM_VERSION_EXTRA "-ioctl (2013-08-15)" | 272 | #define DM_VERSION_EXTRA "-ioctl (2013-10-30)" |
| 273 | 273 | ||
| 274 | /* Status bits */ | 274 | /* Status bits */ |
| 275 | #define DM_READONLY_FLAG (1 << 0) /* In/Out */ | 275 | #define DM_READONLY_FLAG (1 << 0) /* In/Out */ |
| @@ -341,4 +341,15 @@ enum { | |||
| 341 | */ | 341 | */ |
| 342 | #define DM_DATA_OUT_FLAG (1 << 16) /* Out */ | 342 | #define DM_DATA_OUT_FLAG (1 << 16) /* Out */ |
| 343 | 343 | ||
| 344 | /* | ||
| 345 | * If set with DM_DEV_REMOVE or DM_REMOVE_ALL this indicates that if | ||
| 346 | * the device cannot be removed immediately because it is still in use | ||
| 347 | * it should instead be scheduled for removal when it gets closed. | ||
| 348 | * | ||
| 349 | * On return from DM_DEV_REMOVE, DM_DEV_STATUS or other ioctls, this | ||
| 350 | * flag indicates that the device is scheduled to be removed when it | ||
| 351 | * gets closed. | ||
| 352 | */ | ||
| 353 | #define DM_DEFERRED_REMOVE (1 << 17) /* In/Out */ | ||
| 354 | |||
| 344 | #endif /* _LINUX_DM_IOCTL_H */ | 355 | #endif /* _LINUX_DM_IOCTL_H */ |
