History

nbd: Add the nbd NBD_DISCONNECT_ON_CLOSE config flag.

If NBD_DISCONNECT_ON_CLOSE is set on a device, then the driver will issue a disconnect from nbd_release if the device has no remaining bdev->bd_openers. Fix ret val so reconfigure with only setting the flag succeeds.

Doron Roberts-Kedes committed 8 years ago

Commit 08ba91e1 parent ce042c12 files · +37 −8Browse files

Showing the changes to include/uapi/linux (1 of 2 files). Show all

Unified · Split

include/uapi/linux/nbd.h+3−0
@@ -53,6 +53,9 @@ enum { · 52 unmodified lines
5353 /* These are client behavior specific flags. */
5454 #define NBD_CFLAG_DESTROY_ON_DISCONNECT (1 << 0) /* delete the nbd device on
5555 disconnect. */
56+#define NBD_CFLAG_DISCONNECT_ON_CLOSE (1 << 1) /* disconnect the nbd device on
57+ * close by last opener.
58+ */
5659
5760 /* userspace doesn't need the nbd_device structure */
5861