From c80e2258d59d264d56bbea212ec98a114a1de32a Mon Sep 17 00:00:00 2001 From: Nick Wang Date: Tue, 21 Jul 2015 10:32:41 +0800 Subject: [PATCH 1/1] drbdsetup: Support zeroout/discard devices instead of initial full sync. --- documentation/v84/drbdsetup.xml | 18 ++++++++++++++++++ user/v84/config_flags.c | 2 ++ user/v84/linux/drbd_genl.h | 2 ++ 3 files changed, 22 insertions(+) diff --git a/documentation/v84/drbdsetup.xml b/documentation/v84/drbdsetup.xml index d4c4e87..039c6d8 100644 --- a/documentation/v84/drbdsetup.xml +++ b/documentation/v84/drbdsetup.xml @@ -1705,6 +1705,24 @@ Clears the sync bitmap in addition to generating a new current UUID. + + + + + + Start to zeroing out the device on both side in addition to generating + a new current UUID . + + + + + + + + Start to allocate a thinly provided backing device on both side in + addition to generating a new current UUID . + + This can be used to skip the initial sync, if you want to start from scratch. This diff --git a/user/v84/config_flags.c b/user/v84/config_flags.c index 3b0303f..b9870fa 100644 --- a/user/v84/config_flags.c +++ b/user/v84/config_flags.c @@ -1019,6 +1019,8 @@ struct context_def new_current_uuid_cmd_ctx = { NLA_POLICY(new_c_uuid_parms), .fields = { { "clear-bitmap", FLAG(clear_bm) }, + { "zeroout-devices", FLAG(zeroout_devices) }, + { "discard-devices", FLAG(discard_devices) }, { } }, }; diff --git a/user/v84/linux/drbd_genl.h b/user/v84/linux/drbd_genl.h index 8ddedd1..2aabe4c 100644 --- a/user/v84/linux/drbd_genl.h +++ b/user/v84/linux/drbd_genl.h @@ -238,6 +238,8 @@ GENL_struct(DRBD_NLA_START_OV_PARMS, 9, start_ov_parms, GENL_struct(DRBD_NLA_NEW_C_UUID_PARMS, 10, new_c_uuid_parms, __flg_field(1, DRBD_GENLA_F_MANDATORY, clear_bm) + __flg_field(2, 0, zeroout_devices) + __flg_field(3, 0, discard_devices) ) GENL_struct(DRBD_NLA_TIMEOUT_PARMS, 11, timeout_parms, -- 2.1.4