drbd: Allow to change data-integrity-alg on the fly
authorAndreas Gruenbacher <agruen@linbit.com>
Thu, 28 Apr 2011 19:47:21 +0000 (21:47 +0200)
committerPhilipp Reisner <philipp.reisner@linbit.com>
Thu, 8 Nov 2012 15:52:59 +0000 (16:52 +0100)
commit88104ca458dff8ed7db935936b91b9af4422c9cd
treeeb6844263caa72ddf6406998e9f45d497506019e
parenta7eb7bdf58b5dd98560ee6fa5caf2fcdd1779a47
drbd: Allow to change data-integrity-alg on the fly

The main purpose of this is to allow to turn data integrity checking on
and off on demand without causing interruptions.

Implemented by allocating tconn->peer_integrity_tfm only when receiving
a P_PROTOCOL message.  l accesses to tconn->peer_integrity_tf happen in
worker context, and no further synchronization is necessary.

On the sender side, tconn->integrity_tfm is modified under
tconn->data.mutex, and a P_PROTOCOL message is sent whenever.  All
accesses to tconn->integrity_tfm already happen under this mutex.

Signed-off-by: Philipp Reisner <philipp.reisner@linbit.com>
Signed-off-by: Lars Ellenberg <lars.ellenberg@linbit.com>
drivers/block/drbd/drbd_main.c
drivers/block/drbd/drbd_nl.c
drivers/block/drbd/drbd_receiver.c