Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752497AbbGMIlG (ORCPT ); Mon, 13 Jul 2015 04:41:06 -0400 Received: from victor.provo.novell.com ([137.65.250.26]:40125 "EHLO prv3-mh.provo.novell.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751929AbbGMIjj (ORCPT ); Mon, 13 Jul 2015 04:39:39 -0400 From: Nick Wang To: nwang@suse.com Cc: philipp.reisner@linbit.com, Lars Ellenberg , drbd-dev@lists.linbit.com, linux-kernel@vger.kernel.org Subject: [Patch v2 05/10] drbd: Functions to notify peer node to zero out Date: Mon, 13 Jul 2015 16:38:59 +0800 Message-Id: <1436776744-3135-6-git-send-email-nwang@suse.com> X-Mailer: git-send-email 1.8.4.5 In-Reply-To: <1436776744-3135-1-git-send-email-nwang@suse.com> References: <1436776744-3135-1-git-send-email-nwang@suse.com> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2280 Lines: 65 Notify peer node to start zeroing out device. Update state of peer node when both nodes are finished zeroing. Signed-off-by: Nick Wang CC: Philipp Reisner CC: Lars Ellenberg CC: drbd-dev@lists.linbit.com CC: linux-kernel@vger.kernel.org --- drbd/drbd_int.h | 2 ++ drbd/drbd_main.c | 19 +++++++++++++++++++ 2 files changed, 21 insertions(+) diff --git a/drbd/drbd_int.h b/drbd/drbd_int.h index 014b65e..f43f957 100644 --- a/drbd/drbd_int.h +++ b/drbd/drbd_int.h @@ -1208,6 +1208,8 @@ extern int __drbd_send_protocol(struct drbd_connection *connection, enum drbd_pa extern int drbd_send_protocol(struct drbd_connection *connection); extern int drbd_send_uuids(struct drbd_peer_device *); extern int drbd_send_uuids_skip_initial_sync(struct drbd_peer_device *); +extern int drbd_send_zero_out_start(struct drbd_peer_device *); +extern int drbd_send_zero_out_finish(struct drbd_peer_device *); extern int drbd_send_zero_out_ok(struct drbd_peer_device *); extern int drbd_send_zero_out_fail(struct drbd_peer_device *); extern void drbd_gen_and_send_sync_uuid(struct drbd_peer_device *); diff --git a/drbd/drbd_main.c b/drbd/drbd_main.c index 740015e..2b821cd 100644 --- a/drbd/drbd_main.c +++ b/drbd/drbd_main.c @@ -908,6 +908,25 @@ int drbd_send_uuids_skip_initial_sync(struct drbd_peer_device *peer_device) return _drbd_send_uuids(peer_device, 8); } + +/** + * drbd_send_zero_out_start() - Notify peer node to start zero out + * @peer_device: DRBD peer device. + */ +int drbd_send_zero_out_start(struct drbd_peer_device *peer_device) +{ + return _drbd_send_uuids(peer_device, 16); +} + +/** + * drbd_send_zero_out_finish() - Notify both node finished zeroing out + * @peer_device: DRBD peer device. + */ +int drbd_send_zero_out_finish(struct drbd_peer_device *peer_device) +{ + return _drbd_send_uuids(peer_device, 32); +} + /** * _drbd_send_zero_out_state() - Sends the drbd state to the peer * @peer_device: DRBD peer device. -- 1.8.4.5 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/