Skip to content

DRBD code reorganization

Philipp Reisner drbd-dev lkml 1 version New

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest26 patches 0 repliesNew

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/26drbd: Add missing error gotodrivers/block/drbd/drbd_nl.c+1 -00 replies
2/26idr: Add new function idr_is_empty()include/linux/idr.h lib/idr.c+11 -00 replies
3/26drbd: Describe the future high-level structure of DRBDDocumentation/blockdev/drbd/data-structure-v9.txt+38 -00 replies
4/26drbd: Split off on-the-wire protocol definitionsdrivers/block/drbd/drbd_int.h drivers/block/drbd/drbd_main.c drivers/block/drbd/drbd_nl.c +4 more+301 -2920 replies
5/26drbd: Rename struct drbd_conf -> struct drbd_devicedrivers/block/drbd/drbd_actlog.c drivers/block/drbd/drbd_bitmap.c drivers/block/drbd/drbd_int.h +10 more+562 -5620 replies
6/26drbd: Rename "mdev" to "device"drivers/block/drbd/drbd_actlog.c drivers/block/drbd/drbd_bitmap.c drivers/block/drbd/drbd_int.h +10 more+3404 -34030 replies
7/26drbd: Rename drbd_tconn -> drbd_connectiondrivers/block/drbd/drbd_actlog.c drivers/block/drbd/drbd_bitmap.c drivers/block/drbd/drbd_int.h +9 more+1447 -14470 replies
8/26drbd: Introduce "peer_device" object between "device" and "connection"drivers/block/drbd/drbd_actlog.c drivers/block/drbd/drbd_bitmap.c drivers/block/drbd/drbd_int.h +8 more+416 -3770 replies
9/26drbd: Improve some function and variable namingdrivers/block/drbd/drbd_int.h drivers/block/drbd/drbd_main.c drivers/block/drbd/drbd_nl.c +5 more+49 -490 replies
10/26drbd: Add struct drbd_resourcedrivers/block/drbd/drbd_int.h drivers/block/drbd/drbd_main.c drivers/block/drbd/drbd_nl.c+180 -790 replies
11/26drbd: drbd_adm_down(): Move valid resource name check to drbd_adm_prepare()drivers/block/drbd/drbd_nl.c+3 -60 replies
12/26drbd: Add struct drbd_device->resourcedrivers/block/drbd/drbd_int.h drivers/block/drbd/drbd_main.c drivers/block/drbd/drbd_nl.c+4 -20 replies
13/26drbd: Minor cleanup in conn_new_minor()drivers/block/drbd/drbd_main.c+9 -100 replies
14/26drbd: Add struct drbd_resource->devicesdrivers/block/drbd/drbd_int.h drivers/block/drbd/drbd_main.c drivers/block/drbd/drbd_nl.c+51 -200 replies
15/26drbd: Replace conn_get_by_name() with drbd_find_resource()drivers/block/drbd/drbd_int.h drivers/block/drbd/drbd_main.c drivers/block/drbd/drbd_nl.c+30 -200 replies
16/26drbd: conn_try_disconnect(): Use parameter instead of the global variabledrivers/block/drbd/drbd_nl.c+1 -10 replies
17/26drbd: Move resource options from connection to resourcedrivers/block/drbd/drbd_int.h drivers/block/drbd/drbd_main.c drivers/block/drbd/drbd_nl.c +1 more+25 -220 replies
18/26drbd: Turn connection->volumes into connection->peer_devicesdrivers/block/drbd/drbd_int.h drivers/block/drbd/drbd_main.c drivers/block/drbd/drbd_nl.c +3 more+136 -920 replies
19/26drbd: Remove the terrible DEV hackdrivers/block/drbd/drbd_actlog.c drivers/block/drbd/drbd_bitmap.c drivers/block/drbd/drbd_int.h +6 more+298 -2830 replies
20/26drbd: Turn drbd_printk() into a polymorphic macrodrivers/block/drbd/drbd_int.h+43 -150 replies
21/26drbd: Replace and remove the obsolete conn_() macrosdrivers/block/drbd/drbd_int.h drivers/block/drbd/drbd_main.c drivers/block/drbd/drbd_nl.c +3 more+99 -1090 replies
22/26drbd: Add explicit device parameter to D_ASSERTdrivers/block/drbd/drbd_actlog.c drivers/block/drbd/drbd_bitmap.c drivers/block/drbd/drbd_int.h +6 more+109 -1070 replies
23/26drbd: Rename drbd_{create,delete}_minor -> drbd_{create,delete}_devicedrivers/block/drbd/drbd_int.h drivers/block/drbd/drbd_main.c drivers/block/drbd/drbd_nl.c+7 -70 replies
24/26drbd: get_one_status(): Iterate over resource->devices instead of connection->peer_devicesdrivers/block/drbd/drbd_nl.c+45 -250 replies
25/26drbd: drbd_adm_new_resource(): Check if resource exists, not if it has any connectionsdrivers/block/drbd/drbd_nl.c+1 -10 replies
26/26drbd: drbd_create_device(): Take a resource instead of a connection argumentdrivers/block/drbd/drbd_int.h drivers/block/drbd/drbd_main.c drivers/block/drbd/drbd_nl.c+4 -40 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [PATCH 00/26] DRBD code reorganization

Hi,

we are preparing DRBD for the ability to have multiple connections, in other words the ability to mirror a single block device to multiple peers concurrently.

This patch set is the first half of a preparation step. With part 2 it introduces a new in memory object (struct drbd_resource), and renames the current in memory objects for clarity.

This patch set does not introduce any new functionality. The first patch of the set is one minor bugfix. The second patch introduces a new function for IDRs, outside of the drbd tree.

I will post the second part on Monday.

The following paragraphs describe the data structures that are set in place by this patch set.

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 DRBD device is represented by a block device locally.

The DRBD objects are interconnected to form a matrix as depicted below; 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 this table, horizontally, devices can be accessed from resources by their volume number. Likewise, peer_devices can be accessed from connections by their volume number. Objects in the vertical direction are connected by double linked lists. There are back pointers from peer_devices to their connections a devices, and from connections and devices to their resource.

All resources are in the drbd_resources double-linked list. In addition, all devices can be accessed by their minor device number via the drbd_devices idr.

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.

Andreas Gruenbacher (25):
idr: Add new function idr_is_empty()
drbd: Describe the future high-level structure of DRBD
drbd: Split off on-the-wire protocol definitions
drbd: Rename struct drbd_conf -> struct drbd_device
drbd: Rename "mdev" to "device"
drbd: Rename drbd_tconn -> drbd_connection
drbd: Introduce "peer_device" object between "device" and
"connection"
drbd: Improve some function and variable naming
drbd: Add struct drbd_resource
drbd: drbd_adm_down(): Move valid resource name check to
drbd_adm_prepare()
drbd: Add struct drbd_device->resource
drbd: Minor cleanup in conn_new_minor()
drbd: Add struct drbd_resource->devices
drbd: Replace conn_get_by_name() with drbd_find_resource()
drbd: conn_try_disconnect(): Use parameter instead of the global
variable
drbd: Move resource options from connection to resource
drbd: Turn connection->volumes into connection->peer_devices
drbd: Remove the terrible DEV hack
drbd: Turn drbd_printk() into a polymorphic macro
drbd: Replace and remove the obsolete conn_() macros
drbd: Add explicit device parameter to D_ASSERT
drbd: Rename drbd_{create,delete}_minor ->
drbd_{create,delete}_device
drbd: get_one_status(): Iterate over resource->devices instead of

    connection->peer_devices

drbd: drbd_adm_new_resource(): Check if resource exists, not if it
has any connections
drbd: drbd_create_device(): Take a resource instead of a connection
argument

Philipp Reisner (1):
drbd: Add missing error goto

 Documentation/blockdev/drbd/data-structure-v9.txt |   38 +
 drivers/block/drbd/drbd_actlog.c                  |  624 +++---
 drivers/block/drbd/drbd_bitmap.c                  |  360 +--
 drivers/block/drbd/drbd_int.h                     | 1087 ++++-----
 drivers/block/drbd/drbd_main.c                    | 1897 ++++++++--------
 drivers/block/drbd/drbd_nl.c                      | 1539 ++++++-------
 drivers/block/drbd/drbd_proc.c                    |  138 +-
 drivers/block/drbd/drbd_protocol.h                |  295 +++
 drivers/block/drbd/drbd_receiver.c                | 2435 +++++++++++----------
 drivers/block/drbd/drbd_req.c                     |  455 ++--
 drivers/block/drbd/drbd_req.h                     |   20 +-
 drivers/block/drbd/drbd_state.c                   |  852 +++----
 drivers/block/drbd/drbd_state.h                   |   40 +-
 drivers/block/drbd/drbd_worker.c                  |  878 ++++----
 drivers/block/drbd/drbd_wrappers.h                |   14 +-
 include/linux/drbd_genl.h                         |    4 +-
 include/linux/idr.h                               |    1 +
 lib/idr.c                                         |   10 +
 18 files changed, 5514 insertions(+), 5173 deletions(-)
 create mode 100644 Documentation/blockdev/drbd/data-structure-v9.txt
 create mode 100644 drivers/block/drbd/drbd_protocol.h
Signature · 1 line
1.7.9.5