lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <1436776744-3135-8-git-send-email-nwang@suse.com>
Date:	Mon, 13 Jul 2015 16:39:01 +0800
From:	Nick Wang <nwang@...e.com>
To:	nwang@...e.com
Cc:	philipp.reisner@...bit.com,
	Lars Ellenberg <lars.ellenberg@...bit.com>,
	drbd-dev@...ts.linbit.com, linux-kernel@...r.kernel.org
Subject: [Patch v2 07/10] drbd: Flags for background drbd device work

Background drbd device work for zeroing out device.

Signed-off-by: Nick Wang <nwang@...e.com>
CC: Philipp Reisner <philipp.reisner@...bit.com>
CC: Lars Ellenberg <lars.ellenberg@...bit.com>
CC: drbd-dev@...ts.linbit.com
CC: linux-kernel@...r.kernel.org
---
 drbd/drbd_int.h    | 3 +++
 drbd/drbd_worker.c | 6 ++++++
 2 files changed, 9 insertions(+)

diff --git a/drbd/drbd_int.h b/drbd/drbd_int.h
index dd680a9..287ffd7 100644
--- a/drbd/drbd_int.h
+++ b/drbd/drbd_int.h
@@ -622,6 +622,9 @@ enum {
 	RS_START,		/* tell worker to start resync/OV */
 	RS_PROGRESS,		/* tell worker that resync made significant progress */
 	RS_DONE,		/* tell worker that resync is done */
+	P_ZERO_START,		/* tell worker to zero out device */
+	S_ZERO_START,		/* tell worker to zero out device as requested*/
+
 	/* used for zero out device */
 	ZERO_DONE,		/* succeed on zero out a device */
 	ZERO_FAIL,		/* fail to zero out a device */
diff --git a/drbd/drbd_worker.c b/drbd/drbd_worker.c
index 293aa27..23e82c1 100644
--- a/drbd/drbd_worker.c
+++ b/drbd/drbd_worker.c
@@ -2070,6 +2070,10 @@ static void do_device_work(struct drbd_device *device, const unsigned long todo)
 		drbd_ldev_destroy(device);
 	if (test_bit(RS_START, &todo))
 		do_start_resync(device);
+	if (test_bit(P_ZERO_START, &todo))
+		require_zero_out_local_device(device);
+	if (test_bit(S_ZERO_START, &todo))
+		receive_zero_out_local_device(device);
 }
 
 #define DRBD_DEVICE_WORK_MASK	\
@@ -2079,6 +2083,8 @@ static void do_device_work(struct drbd_device *device, const unsigned long todo)
 	|(1UL << RS_START)	\
 	|(1UL << RS_PROGRESS)	\
 	|(1UL << RS_DONE)	\
+	|(1UL << P_ZERO_START)	\
+	|(1UL << S_ZERO_START)	\
 	)
 
 static unsigned long get_work_bits(unsigned long *flags)
-- 
1.8.4.5

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ