diff options
author | Andreas Gruenbacher <agruen@linbit.com> | 2011-08-08 22:47:13 (GMT) |
---|---|---|
committer | Philipp Reisner <philipp.reisner@linbit.com> | 2014-02-17 15:50:31 (GMT) |
commit | 69a227731a378f34bc5a8192158bd94d1581ae3d (patch) | |
tree | 9834fdd3691f15ea7a3d901b092dd2b2ab7c54ea /drivers/block/drbd/drbd_nl.c | |
parent | 9f4fe9ad206028fb77fe8d1b485f81d186df1645 (diff) | |
download | linux-69a227731a378f34bc5a8192158bd94d1581ae3d.tar.xz |
drbd: Pass a peer device to a number of fuctions
These functions actually operate on a peer device, or
need a peer device.
drbd_prepare_command(), drbd_send_command(), drbd_send_sync_param()
drbd_send_uuids(), drbd_gen_and_send_sync_uuid(), drbd_send_sizes()
drbd_send_state(), drbd_send_current_state(), and drbd_send_state_req()
drbd_send_sr_reply(), drbd_send_ack(), drbd_send_drequest(),
drbd_send_drequest_csum(), drbd_send_ov_request(), drbd_send_dblock()
drbd_send_block(), drbd_send_out_of_sync(), recv_dless_read()
drbd_drain_block(), receive_bitmap_plain(), recv_resync_read()
read_in_block(), read_for_csum(), drbd_alloc_pages(), drbd_alloc_peer_req()
need_peer_seq(), update_peer_seq(), wait_for_and_update_peer_seq()
drbd_sync_handshake(), drbd_asb_recover_{0,1,2}p(), drbd_connected()
drbd_disconnected(), decode_bitmap_c() and recv_bm_rle_bits()
Signed-off-by: Andreas Gruenbacher <agruen@linbit.com>
Signed-off-by: Philipp Reisner <philipp.reisner@linbit.com>
Diffstat (limited to 'drivers/block/drbd/drbd_nl.c')
-rw-r--r-- | drivers/block/drbd/drbd_nl.c | 27 |
1 files changed, 18 insertions, 9 deletions
diff --git a/drivers/block/drbd/drbd_nl.c b/drivers/block/drbd/drbd_nl.c index 63b345d..6b09eb6 100644 --- a/drivers/block/drbd/drbd_nl.c +++ b/drivers/block/drbd/drbd_nl.c @@ -678,8 +678,8 @@ drbd_set_role(struct drbd_device *device, enum drbd_role new_role, int force) if (device->state.conn >= C_WF_REPORT_PARAMS) { /* if this was forced, we should consider sync */ if (forced) - drbd_send_uuids(device); - drbd_send_current_state(device); + drbd_send_uuids(first_peer_device(device)); + drbd_send_current_state(first_peer_device(device)); } drbd_md_sync(device); @@ -1364,8 +1364,12 @@ int drbd_adm_disk_opts(struct sk_buff *skb, struct genl_info *info) drbd_md_sync(device); - if (device->state.conn >= C_CONNECTED) - drbd_send_sync_param(device); + if (device->state.conn >= C_CONNECTED) { + struct drbd_peer_device *peer_device; + + for_each_peer_device(peer_device, device) + drbd_send_sync_param(peer_device); + } synchronize_rcu(); kfree(old_disk_conf); @@ -2145,8 +2149,13 @@ int drbd_adm_net_opts(struct sk_buff *skb, struct genl_info *info) synchronize_rcu(); kfree(old_net_conf); - if (connection->cstate >= C_WF_REPORT_PARAMS) - drbd_send_sync_param(minor_to_device(conn_lowest_minor(connection))); + if (connection->cstate >= C_WF_REPORT_PARAMS) { + struct drbd_peer_device *peer_device; + int vnr; + + idr_for_each_entry(&connection->peer_devices, peer_device, vnr) + drbd_send_sync_param(peer_device); + } goto done; @@ -2514,8 +2523,8 @@ int drbd_adm_resize(struct sk_buff *skb, struct genl_info *info) if (dd == DS_GREW) set_bit(RESIZE_PENDING, &device->flags); - drbd_send_uuids(device); - drbd_send_sizes(device, 1, ddsf); + drbd_send_uuids(first_peer_device(device)); + drbd_send_sizes(first_peer_device(device), 1, ddsf); } fail: @@ -3244,7 +3253,7 @@ int drbd_adm_new_c_uuid(struct sk_buff *skb, struct genl_info *info) retcode = ERR_IO_MD_DISK; } if (skip_initial_sync) { - drbd_send_uuids_skip_initial_sync(device); + drbd_send_uuids_skip_initial_sync(first_peer_device(device)); _drbd_uuid_set(device, UI_BITMAP, 0); drbd_print_uuids(device, "cleared bitmap UUID"); spin_lock_irq(&device->resource->req_lock); |