Basic Data Structure
====================

A node has a number of DRBD resources.  Each such resource has a number of
devices (aka volumes) and connections to other nodes ("peer nodes"). Each
device has a unique minor device number.

This relationship is represented by the global variable drbd_resources, the
drbd_resource, drbd_connection, drbd_device, and drbd_peer_device objects, and
their interconnections.

The objects form a matrix; a drbd_peer_device object sits at each intersection
between a drbd_device and a drbd_connection:

  /--------------+---------------+.....+---------------\
  |   resource   |    device     |     |    device     |
  +--------------+---------------+.....+---------------+
  |  connection  |  peer_device  |     |  peer_device  |
  +--------------+---------------+.....+---------------+
  :              :               :     :               :
  :              :               :     :               :
  +--------------+---------------+.....+---------------+
  |  connection  |  peer_device  |     |  peer_device  |
  \--------------+---------------+.....+---------------/


In the table above, horizontally, devices can be accessed from resources by
their volume number.  Likewise, peer_devices can be accessed from connections
by their volume number.  There is no useful order between connections, and so
objects in the vertical direction are in double linked lists.  There are back
pointers from peer_devices to their connections a devices, and from connections
and devices to their resource.

In addition, devices can be accessed by major / minor number from the global
variable drbd_devices.

The drbd_resource, drbd_connection, and drbd_device objects are reference
counted.  The peer_device objects only serve to establish the links between
devices and connections; their lifetime is determined by the lifetime of the
device and connection which they reference.

The objects below a resource (devices, connections, peer devices) are modified
in a lru-safe way.  They are modified under the resource->conf_update mutex.
