diff options
author | Paul Clements <paul.clements@steeleye.com> | 2012-10-04 17:16:15 -0700 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2012-10-06 03:05:23 +0900 |
commit | 2f012508880f8037590372c24ca6e8b6af8fffb6 (patch) | |
tree | 3921d2b8d00cf47503d30455e2b4df180cc13d11 /include/linux/nbd.h | |
parent | de74e00a965177e8a0d44af0ba31971b80f2bf3f (diff) | |
download | linux-2f012508880f8037590372c24ca6e8b6af8fffb6.tar.gz linux-2f012508880f8037590372c24ca6e8b6af8fffb6.tar.bz2 linux-2f012508880f8037590372c24ca6e8b6af8fffb6.zip |
nbd: add set flags ioctl
Add a set-flags ioctl, allowing various option flags to be set on an nbd
device. This allows the nbd-client to set the device flags (to enable
read-only mode, or enable discard support, etc.).
Flags are typically specified by the nbd-server. During the negotiation
phase of the nbd connection, the server sends its flags to the client.
The client then uses NBD_SET_FLAGS to inform the kernel of the options.
Also included is a one-line fix to debug output for the set-timeout ioctl.
Signed-off-by: Paul Clements <paul.clements@steeleye.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'include/linux/nbd.h')
-rw-r--r-- | include/linux/nbd.h | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/include/linux/nbd.h b/include/linux/nbd.h index d146ca10c0f5..4b8ed5a1cfb0 100644 --- a/include/linux/nbd.h +++ b/include/linux/nbd.h @@ -27,6 +27,7 @@ #define NBD_SET_SIZE_BLOCKS _IO( 0xab, 7 ) #define NBD_DISCONNECT _IO( 0xab, 8 ) #define NBD_SET_TIMEOUT _IO( 0xab, 9 ) +#define NBD_SET_FLAGS _IO( 0xab, 10) enum { NBD_CMD_READ = 0, @@ -34,6 +35,10 @@ enum { NBD_CMD_DISC = 2 }; +/* values for flags field */ +#define NBD_FLAG_HAS_FLAGS (1 << 0) /* nbd-server supports flags */ +#define NBD_FLAG_READ_ONLY (1 << 1) /* device is read-only */ + #define nbd_cmd(req) ((req)->cmd[0]) /* userspace doesn't need the nbd_device structure */ @@ -42,10 +47,6 @@ enum { #include <linux/wait.h> #include <linux/mutex.h> -/* values for flags field */ -#define NBD_READ_ONLY 0x0001 -#define NBD_WRITE_NOCHK 0x0002 - struct request; struct nbd_device { |