drbd: change the semantics of Attach vs. Assemble
authorIustin Pop <iustin@google.com>
Tue, 13 Jan 2009 15:20:12 +0000 (15:20 +0000)
committerIustin Pop <iustin@google.com>
Tue, 13 Jan 2009 15:20:12 +0000 (15:20 +0000)
commit2d0c83196ab477b300b383500b74d25a425bb268
tree4248b25c26c38e21a700e3c0ec5f30f92dfda2ca
parentf87548b5b229d6b856da5f979e35f285eb3284e9
drbd: change the semantics of Attach vs. Assemble

Currently, both the Attach and Assemble methods for DRBD8 devices will use and
alter the device state. This is suboptimal, and it has been worked
around in 1.2 via a special cache in the node daemon so that we don't
need to call Attach() again in migration, for example.

Since in 2.0 we have static minors, we can change these functions so
that:
  - Attach() does not affect the device in any way, and only checks if
    the minor is already in use or not
  - Assemble() has two logic paths, one for startup from unused minor
    (the old Assemble, now renamed _FastAssemble) and one for
    re-checking/fixing an in-use minor (the old Attach, now renamed
    _SlowAttach)

Basically Attach was renamed to _SlowAttach, Assemble to _FastAssemble,
and we have a new, simple Assemble that calls one or the other based on
the result of the new Attach.

The LUReplaceDisks (with new secondary) is relying on the special
semantics of Attach modifying the device and is broken until the end of
the patch series.

Reviewed-by: ultrotter
lib/bdev.py