summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorJosef Bacik <josef@toxicpanda.com>2017-04-07 00:02:07 +0300
committerJens Axboe <axboe@fb.com>2017-04-17 18:58:42 +0300
commita2c97909f97ef32b76e856572fba4f77e1885fe6 (patch)
tree93693ce1eb0141806a19c307b92b6d5e11bbab0e /include
parentc6a4759ea0c9a7e7661f34f6943dafb1c6ae1b1c (diff)
downloadlinux-a2c97909f97ef32b76e856572fba4f77e1885fe6.tar.xz
nbd: add a flag to destroy an nbd device on disconnect
For ease of management it would be nice for users to specify that the device node for a nbd device is destroyed once it is disconnected and there are no more users. Add a client flag and enable this operation to happen. Signed-off-by: Josef Bacik <jbacik@fb.com> Signed-off-by: Jens Axboe <axboe@fb.com>
Diffstat (limited to 'include')
-rw-r--r--include/uapi/linux/nbd.h6
1 files changed, 5 insertions, 1 deletions
diff --git a/include/uapi/linux/nbd.h b/include/uapi/linux/nbd.h
index c91c642ea900..155e33f81913 100644
--- a/include/uapi/linux/nbd.h
+++ b/include/uapi/linux/nbd.h
@@ -37,7 +37,7 @@ enum {
NBD_CMD_TRIM = 4
};
-/* values for flags field */
+/* values for flags field, these are server interaction specific. */
#define NBD_FLAG_HAS_FLAGS (1 << 0) /* nbd-server supports flags */
#define NBD_FLAG_READ_ONLY (1 << 1) /* device is read-only */
#define NBD_FLAG_SEND_FLUSH (1 << 2) /* can flush writeback cache */
@@ -45,6 +45,10 @@ enum {
#define NBD_FLAG_SEND_TRIM (1 << 5) /* send trim/discard */
#define NBD_FLAG_CAN_MULTI_CONN (1 << 8) /* Server supports multiple connections per export. */
+/* These are client behavior specific flags. */
+#define NBD_CFLAG_DESTROY_ON_DISCONNECT (1 << 0) /* delete the nbd device on
+ disconnect. */
+
/* userspace doesn't need the nbd_device structure */
/* These are sent over the network in the request/reply magic fields */