Back to home page

OSCL-LXR

 
 

    


0001 ================================
0002 kernel data structure for DRBD-9
0003 ================================
0004 
0005 This describes the in kernel data structure for DRBD-9. Starting with
0006 Linux v3.14 we are reorganizing DRBD to use this data structure.
0007 
0008 Basic Data Structure
0009 ====================
0010 
0011 A node has a number of DRBD resources.  Each such resource has a number of
0012 devices (aka volumes) and connections to other nodes ("peer nodes"). Each DRBD
0013 device is represented by a block device locally.
0014 
0015 The DRBD objects are interconnected to form a matrix as depicted below; a
0016 drbd_peer_device object sits at each intersection between a drbd_device and a
0017 drbd_connection::
0018 
0019   /--------------+---------------+.....+---------------\
0020   |   resource   |    device     |     |    device     |
0021   +--------------+---------------+.....+---------------+
0022   |  connection  |  peer_device  |     |  peer_device  |
0023   +--------------+---------------+.....+---------------+
0024   :              :               :     :               :
0025   :              :               :     :               :
0026   +--------------+---------------+.....+---------------+
0027   |  connection  |  peer_device  |     |  peer_device  |
0028   \--------------+---------------+.....+---------------/
0029 
0030 In this table, horizontally, devices can be accessed from resources by their
0031 volume number.  Likewise, peer_devices can be accessed from connections by
0032 their volume number.  Objects in the vertical direction are connected by double
0033 linked lists.  There are back pointers from peer_devices to their connections a
0034 devices, and from connections and devices to their resource.
0035 
0036 All resources are in the drbd_resources double-linked list.  In addition, all
0037 devices can be accessed by their minor device number via the drbd_devices idr.
0038 
0039 The drbd_resource, drbd_connection, and drbd_device objects are reference
0040 counted.  The peer_device objects only serve to establish the links between
0041 devices and connections; their lifetime is determined by the lifetime of the
0042 device and connection which they reference.