Thread (59 messages) 59 messages, 9 authors, 2016-09-15

Re: [PATCH 3/5] nbd: use flags instead of bool

flat view

From: Joe Perches <joe@perches.com>
Date: 2016-09-09 01:20:45
Also in: lkml

On Thu, 2016-09-08 at 17:12 -0400, Josef Bacik wrote:
In preparation for some future changes, change a few of the state bools over to
normal bits to set/clear properly.
[]
quoted hunk ↗ jump to hunk
diff --git a/drivers/block/nbd.c b/drivers/block/nbd.c
[]
quoted hunk ↗ jump to hunk
@@ -41,8 +41,12 @@
 
 #include <linux/nbd.h>
 
+#define NBD_TIMEDOUT			0
+#define NBD_DISCONNECT_REQUESTED	1
+
 struct nbd_device {
 	u32 flags;
+	unsigned long runtime_flags;
Better to use DECLARE_BITMAP
quoted hunk ↗ jump to hunk
@@ -626,7 +627,7 @@ static int __nbd_ioctl(struct block_device *bdev, struct nbd_device *nbd,
 			return -EINVAL;
 		}
 
-		nbd->disconnect = true;
+		set_bit(NBD_DISCONNECT_REQUESTED, &nbd->runtime_flags);
And remove the & from runtime_flags here
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help