aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/block/drbd/drbd_actlog.c
diff options
context:
space:
mode:
authorAndreas Gruenbacher <agruen@linbit.com>2011-05-31 14:33:49 +0200
committerPhilipp Reisner <philipp.reisner@linbit.com>2014-02-17 16:44:51 +0100
commita6b32bc3cebd3fb6848c526763733b9dbc389c02 (patch)
tree91435ad006bf2eaada891ae26e01bb51fcc790d9 /drivers/block/drbd/drbd_actlog.c
parentdrbd: Rename drbd_tconn -> drbd_connection (diff)
downloadlinux-dev-a6b32bc3cebd3fb6848c526763733b9dbc389c02.tar.xz
linux-dev-a6b32bc3cebd3fb6848c526763733b9dbc389c02.zip
drbd: Introduce "peer_device" object between "device" and "connection"
In a setup where a device (aka volume) can replicate to multiple peers and one connection can be shared between multiple devices, we need separate objects to represent devices on peer nodes and network connections. As a first step to introduce multiple connections per device, give each drbd_device object a single drbd_peer_device object which connects it to a drbd_connection object. Signed-off-by: Andreas Gruenbacher <agruen@linbit.com> Signed-off-by: Philipp Reisner <philipp.reisner@linbit.com>
Diffstat (limited to 'drivers/block/drbd/drbd_actlog.c')
-rw-r--r--drivers/block/drbd/drbd_actlog.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/drivers/block/drbd/drbd_actlog.c b/drivers/block/drbd/drbd_actlog.c
index 8b507455f71e..4af4dc166373 100644
--- a/drivers/block/drbd/drbd_actlog.c
+++ b/drivers/block/drbd/drbd_actlog.c
@@ -315,7 +315,7 @@ void drbd_al_begin_io_commit(struct drbd_device *device, bool delegate)
{
bool locked = false;
- BUG_ON(delegate && current == device->connection->worker.task);
+ BUG_ON(delegate && current == first_peer_device(device)->connection->worker.task);
/* Serialize multiple transactions.
* This uses test_and_set_bit, memory barrier is implicit.
@@ -354,7 +354,7 @@ void drbd_al_begin_io_commit(struct drbd_device *device, bool delegate)
*/
void drbd_al_begin_io(struct drbd_device *device, struct drbd_interval *i, bool delegate)
{
- BUG_ON(delegate && current == device->connection->worker.task);
+ BUG_ON(delegate && current == first_peer_device(device)->connection->worker.task);
if (drbd_al_begin_io_prepare(device, i))
drbd_al_begin_io_commit(device, delegate);
@@ -614,7 +614,7 @@ static int al_write_transaction(struct drbd_device *device, bool delegate)
init_completion(&al_work.event);
al_work.w.cb = w_al_write_transaction;
al_work.w.device = device;
- drbd_queue_work_front(&device->connection->sender_work, &al_work.w);
+ drbd_queue_work_front(&first_peer_device(device)->connection->sender_work, &al_work.w);
wait_for_completion(&al_work.event);
return al_work.err;
} else
@@ -796,7 +796,7 @@ static void drbd_try_clear_on_disk_bm(struct drbd_device *device, sector_t secto
udw->enr = ext->lce.lc_number;
udw->w.cb = w_update_odbm;
udw->w.device = device;
- drbd_queue_work_front(&device->connection->sender_work, &udw->w);
+ drbd_queue_work_front(&first_peer_device(device)->connection->sender_work, &udw->w);
} else {
dev_warn(DEV, "Could not kmalloc an udw\n");
}