/linux-4.4.14/drivers/block/drbd/ |
H A D | drbd_debugfs.h | 20 void drbd_debugfs_peer_device_add(struct drbd_peer_device *peer_device); 21 void drbd_debugfs_peer_device_cleanup(struct drbd_peer_device *peer_device); 36 static inline void drbd_debugfs_peer_device_add(struct drbd_peer_device *peer_device) { } drbd_debugfs_peer_device_cleanup() argument 37 static inline void drbd_debugfs_peer_device_cleanup(struct drbd_peer_device *peer_device) { } argument
|
H A D | drbd_receiver.c | 251 struct page *drbd_alloc_pages(struct drbd_peer_device *peer_device, unsigned int number, drbd_alloc_pages() argument 254 struct drbd_device *device = peer_device->device; drbd_alloc_pages() 261 nc = rcu_dereference(peer_device->connection->net_conf); drbd_alloc_pages() 341 drbd_alloc_peer_req(struct drbd_peer_device *peer_device, u64 id, sector_t sector, __must_hold() 344 struct drbd_device *device = peer_device->device; __must_hold() 360 page = drbd_alloc_pages(peer_device, nr_pages, __must_hold() 372 peer_req->peer_device = peer_device; __must_hold() 869 int drbd_connected(struct drbd_peer_device *peer_device) drbd_connected() argument 871 struct drbd_device *device = peer_device->device; drbd_connected() 877 device->state_mutex = peer_device->connection->agreed_pro_version < 100 ? drbd_connected() 878 &peer_device->connection->cstate_mutex : drbd_connected() 881 err = drbd_send_sync_param(peer_device); drbd_connected() 883 err = drbd_send_sizes(peer_device, 0, 0); drbd_connected() 885 err = drbd_send_uuids(peer_device); drbd_connected() 887 err = drbd_send_current_state(peer_device); drbd_connected() 906 struct drbd_peer_device *peer_device; conn_connect() local 1071 idr_for_each_entry(&connection->peer_devices, peer_device, vnr) conn_connect() 1072 mutex_lock(peer_device->device->state_mutex); conn_connect() 1076 idr_for_each_entry(&connection->peer_devices, peer_device, vnr) conn_connect() 1077 mutex_unlock(peer_device->device->state_mutex); conn_connect() 1080 idr_for_each_entry(&connection->peer_devices, peer_device, vnr) { conn_connect() 1081 struct drbd_device *device = peer_device->device; conn_connect() 1090 drbd_connected(peer_device); conn_connect() 1178 struct drbd_peer_device *peer_device; drbd_flush() local 1183 idr_for_each_entry(&connection->peer_devices, peer_device, vnr) { drbd_flush() 1184 struct drbd_device *device = peer_device->device; drbd_flush() 1495 struct drbd_peer_device *peer_device; conn_wait_active_ee_empty() local 1499 idr_for_each_entry(&connection->peer_devices, peer_device, vnr) { conn_wait_active_ee_empty() 1500 struct drbd_device *device = peer_device->device; conn_wait_active_ee_empty() 1588 read_in_block(struct drbd_peer_device *peer_device, u64 id, sector_t sector, __must_hold() 1591 struct drbd_device *device = peer_device->device; __must_hold() 1597 void *dig_in = peer_device->connection->int_dig_in; __must_hold() 1598 void *dig_vv = peer_device->connection->int_dig_vv; __must_hold() 1603 if (!trim && peer_device->connection->peer_integrity_tfm) { __must_hold() 1604 digest_size = crypto_hash_digestsize(peer_device->connection->peer_integrity_tfm); __must_hold() 1609 err = drbd_recv_all_warn(peer_device->connection, dig_in, digest_size); __must_hold() 1616 D_ASSERT(peer_device, data_size == 0); __must_hold() 1639 peer_req = drbd_alloc_peer_req(peer_device, id, sector, data_size, trim == NULL, GFP_NOIO); __must_hold() 1652 err = drbd_recv_all_warn(peer_device->connection, data, len); page_chain_for_each() 1666 drbd_csum_ee(peer_device->connection->peer_integrity_tfm, peer_req, dig_vv); 1681 static int drbd_drain_block(struct drbd_peer_device *peer_device, int data_size) drbd_drain_block() argument 1690 page = drbd_alloc_pages(peer_device, 1, 1); drbd_drain_block() 1696 err = drbd_recv_all_warn(peer_device->connection, data, len); drbd_drain_block() 1702 drbd_free_pages(peer_device->device, page, 0); drbd_drain_block() 1706 static int recv_dless_read(struct drbd_peer_device *peer_device, struct drbd_request *req, recv_dless_read() argument 1713 void *dig_in = peer_device->connection->int_dig_in; recv_dless_read() 1714 void *dig_vv = peer_device->connection->int_dig_vv; recv_dless_read() 1717 if (peer_device->connection->peer_integrity_tfm) { recv_dless_read() 1718 digest_size = crypto_hash_digestsize(peer_device->connection->peer_integrity_tfm); recv_dless_read() 1719 err = drbd_recv_all_warn(peer_device->connection, dig_in, digest_size); recv_dless_read() 1727 peer_device->device->recv_cnt += data_size>>9; recv_dless_read() 1730 D_ASSERT(peer_device->device, sector == bio->bi_iter.bi_sector); recv_dless_read() 1735 err = drbd_recv_all_warn(peer_device->connection, mapped, expect); bio_for_each_segment() 1743 drbd_csum_bio(peer_device->connection->peer_integrity_tfm, bio, dig_vv); 1745 drbd_err(peer_device, "Digest integrity check FAILED. Broken NICs?\n"); 1750 D_ASSERT(peer_device->device, data_size == 0); 1762 struct drbd_peer_device *peer_device = peer_req->peer_device; e_end_resync_block() local 1763 struct drbd_device *device = peer_device->device; e_end_resync_block() 1771 err = drbd_send_ack(peer_device, P_RS_WRITE_ACK, peer_req); e_end_resync_block() 1776 err = drbd_send_ack(peer_device, P_NEG_ACK, peer_req); e_end_resync_block() 1783 static int recv_resync_read(struct drbd_peer_device *peer_device, sector_t sector, __releases() 1786 struct drbd_device *device = peer_device->device; __releases() 1789 peer_req = read_in_block(peer_device, ID_SYNCER, sector, pi); __releases() 1841 struct drbd_peer_device *peer_device; receive_DataReply() local 1848 peer_device = conn_peer_device(connection, pi->vnr); receive_DataReply() 1849 if (!peer_device) receive_DataReply() 1851 device = peer_device->device; receive_DataReply() 1864 err = recv_dless_read(peer_device, req, sector, pi->size); receive_DataReply() 1876 struct drbd_peer_device *peer_device; receive_RSDataReply() local 1882 peer_device = conn_peer_device(connection, pi->vnr); receive_RSDataReply() 1883 if (!peer_device) receive_RSDataReply() 1885 device = peer_device->device; receive_RSDataReply() 1894 err = recv_resync_read(peer_device, sector, pi); receive_RSDataReply() 1899 err = drbd_drain_block(peer_device, pi->size); receive_RSDataReply() 1901 drbd_send_ack_dp(peer_device, P_NEG_ACK, p, pi->size); receive_RSDataReply() 1935 struct drbd_peer_device *peer_device = peer_req->peer_device; e_end_block() local 1936 struct drbd_device *device = peer_device->device; e_end_block() 1946 err = drbd_send_ack(peer_device, pcmd, peer_req); e_end_block() 1950 err = drbd_send_ack(peer_device, P_NEG_ACK, peer_req); e_end_block() 1978 struct drbd_peer_device *peer_device = peer_req->peer_device; e_send_ack() local 1981 err = drbd_send_ack(peer_device, ack, peer_req); e_send_ack() 1982 dec_unacked(peer_device->device); e_send_ack() 1996 struct drbd_connection *connection = peer_req->peer_device->connection; e_send_retry_write() 2017 static void update_peer_seq(struct drbd_peer_device *peer_device, unsigned int peer_seq) update_peer_seq() argument 2019 struct drbd_device *device = peer_device->device; update_peer_seq() 2022 if (test_bit(RESOLVE_CONFLICTS, &peer_device->connection->flags)) { update_peer_seq() 2078 static int wait_for_and_update_peer_seq(struct drbd_peer_device *peer_device, const u32 peer_seq) wait_for_and_update_peer_seq() argument 2080 struct drbd_device *device = peer_device->device; wait_for_and_update_peer_seq() 2085 if (!test_bit(RESOLVE_CONFLICTS, &peer_device->connection->flags)) wait_for_and_update_peer_seq() 2111 timeout = rcu_dereference(peer_device->connection->net_conf)->ping_timeo*HZ/10; wait_for_and_update_peer_seq() 2165 struct drbd_connection *connection = peer_req->peer_device->connection; handle_write_conflicts() 2273 struct drbd_peer_device *peer_device; receive_Data() local 2284 peer_device = conn_peer_device(connection, pi->vnr); receive_Data() 2285 if (!peer_device) receive_Data() 2287 device = peer_device->device; receive_Data() 2292 err = wait_for_and_update_peer_seq(peer_device, peer_seq); receive_Data() 2293 drbd_send_ack_dp(peer_device, P_NEG_ACK, p, pi->size); receive_Data() 2295 err2 = drbd_drain_block(peer_device, pi->size); receive_Data() 2308 peer_req = read_in_block(peer_device, p->block_id, sector, pi); receive_Data() 2325 D_ASSERT(peer_device, peer_req->i.size > 0); receive_Data() 2326 D_ASSERT(peer_device, rw & REQ_DISCARD); receive_Data() 2327 D_ASSERT(peer_device, peer_req->pages == NULL); receive_Data() 2343 nc = rcu_dereference(peer_device->connection->net_conf); receive_Data() 2345 if (peer_device->connection->agreed_pro_version < 100) { receive_Data() 2374 err = wait_for_and_update_peer_seq(peer_device, peer_seq); receive_Data() 2388 update_peer_seq(peer_device, peer_seq); receive_Data() 2515 struct drbd_peer_device *peer_device; receive_DataRequest() local 2525 peer_device = conn_peer_device(connection, pi->vnr); receive_DataRequest() 2526 if (!peer_device) receive_DataRequest() 2528 device = peer_device->device; receive_DataRequest() 2549 drbd_send_ack_rp(peer_device, P_NEG_DREPLY, p); receive_DataRequest() 2554 drbd_send_ack_rp(peer_device, P_NEG_RS_DREPLY , p); receive_DataRequest() 2559 drbd_send_ack_ex(peer_device, P_OV_RESULT, sector, size, ID_IN_SYNC); receive_DataRequest() 2569 return drbd_drain_block(peer_device, pi->size); receive_DataRequest() 2575 peer_req = drbd_alloc_peer_req(peer_device, p->block_id, sector, size, receive_DataRequest() 2610 if (drbd_recv_all(peer_device->connection, di->digest, pi->size)) receive_DataRequest() 2614 D_ASSERT(device, peer_device->connection->agreed_pro_version >= 89); receive_DataRequest() 2633 peer_device->connection->agreed_pro_version >= 90) { receive_DataRequest() 2720 static int drbd_asb_recover_0p(struct drbd_peer_device *peer_device) __must_hold(local) __must_hold() 2722 struct drbd_device *device = peer_device->device; __must_hold() 2734 after_sb_0p = rcu_dereference(peer_device->connection->net_conf)->after_sb_0p; __must_hold() 2769 rv = test_bit(RESOLVE_CONFLICTS, &peer_device->connection->flags) __must_hold() 2785 rv = test_bit(RESOLVE_CONFLICTS, &peer_device->connection->flags) __must_hold() 2801 static int drbd_asb_recover_1p(struct drbd_peer_device *peer_device) __must_hold(local) __must_hold() 2803 struct drbd_device *device = peer_device->device; __must_hold() 2808 after_sb_1p = rcu_dereference(peer_device->connection->net_conf)->after_sb_1p; __must_hold() 2822 hg = drbd_asb_recover_0p(peer_device); __must_hold() 2829 rv = drbd_asb_recover_0p(peer_device); __must_hold() 2834 hg = drbd_asb_recover_0p(peer_device); __must_hold() 2858 static int drbd_asb_recover_2p(struct drbd_peer_device *peer_device) __must_hold(local) __must_hold() 2860 struct drbd_device *device = peer_device->device; __must_hold() 2865 after_sb_2p = rcu_dereference(peer_device->connection->net_conf)->after_sb_2p; __must_hold() 2879 rv = drbd_asb_recover_0p(peer_device); __must_hold() 2884 hg = drbd_asb_recover_0p(peer_device); __must_hold() 2936 struct drbd_peer_device *const peer_device = first_peer_device(device); __must_hold() local 2937 struct drbd_connection *const connection = peer_device ? peer_device->connection : NULL; __must_hold() 3121 static enum drbd_conns drbd_sync_handshake(struct drbd_peer_device *peer_device, 3125 struct drbd_device *device = peer_device->device; __must_hold() 3170 nc = rcu_dereference(peer_device->connection->net_conf); __must_hold() 3179 hg = drbd_asb_recover_0p(peer_device); __must_hold() 3182 hg = drbd_asb_recover_1p(peer_device); __must_hold() 3185 hg = drbd_asb_recover_2p(peer_device); __must_hold() 3245 if (tentative || test_bit(CONN_DRY_RUN, &peer_device->connection->flags)) { __must_hold() 3503 struct drbd_peer_device *peer_device; receive_SyncParam() local 3516 peer_device = conn_peer_device(connection, pi->vnr); receive_SyncParam() 3517 if (!peer_device) receive_SyncParam() 3519 device = peer_device->device; receive_SyncParam() 3550 err = drbd_recv_all(peer_device->connection, p, header_size); receive_SyncParam() 3555 old_net_conf = peer_device->connection->net_conf; receive_SyncParam() 3581 err = drbd_recv_all(peer_device->connection, p->verify_alg, data_size); receive_SyncParam() 3655 crypto_free_hash(peer_device->connection->verify_tfm); receive_SyncParam() 3656 peer_device->connection->verify_tfm = verify_tfm; receive_SyncParam() 3662 crypto_free_hash(peer_device->connection->csums_tfm); receive_SyncParam() 3663 peer_device->connection->csums_tfm = csums_tfm; receive_SyncParam() 3709 conn_request_state(peer_device->connection, NS(conn, C_DISCONNECTING), CS_HARD); receive_SyncParam() 3728 struct drbd_peer_device *peer_device; receive_sizes() local 3736 peer_device = conn_peer_device(connection, pi->vnr); receive_sizes() 3737 if (!peer_device) receive_sizes() 3739 device = peer_device->device; receive_sizes() 3771 conn_request_state(peer_device->connection, NS(conn, C_DISCONNECTING), CS_HARD); receive_sizes() 3849 drbd_send_sizes(peer_device, 0, ddsf); receive_sizes() 3869 struct drbd_peer_device *peer_device; receive_uuids() local 3875 peer_device = conn_peer_device(connection, pi->vnr); receive_uuids() 3876 if (!peer_device) receive_uuids() 3878 device = peer_device->device; receive_uuids() 3898 conn_request_state(peer_device->connection, NS(conn, C_DISCONNECTING), CS_HARD); receive_uuids() 3905 peer_device->connection->agreed_pro_version >= 90 && receive_uuids() 3976 struct drbd_peer_device *peer_device; receive_req_state() local 3982 peer_device = conn_peer_device(connection, pi->vnr); receive_req_state() 3983 if (!peer_device) receive_req_state() 3985 device = peer_device->device; receive_req_state() 3990 if (test_bit(RESOLVE_CONFLICTS, &peer_device->connection->flags) && receive_req_state() 3992 drbd_send_sr_reply(peer_device, SS_CONCURRENT_ST_CHG); receive_req_state() 4000 drbd_send_sr_reply(peer_device, rv); receive_req_state() 4033 struct drbd_peer_device *peer_device; receive_state() local 4041 peer_device = conn_peer_device(connection, pi->vnr); receive_state() 4042 if (!peer_device) receive_state() 4044 device = peer_device->device; receive_state() 4139 ns.conn = drbd_sync_handshake(peer_device, peer_state.role, real_peer_disk); receive_state() 4151 if (test_and_clear_bit(CONN_DRY_RUN, &peer_device->connection->flags)) receive_state() 4154 conn_request_state(peer_device->connection, NS(conn, C_DISCONNECTING), CS_HARD); receive_state() 4176 tl_clear(peer_device->connection); receive_state() 4179 conn_request_state(peer_device->connection, NS2(conn, C_PROTOCOL_ERROR, susp, 0), CS_HARD); receive_state() 4187 conn_request_state(peer_device->connection, NS(conn, C_DISCONNECTING), CS_HARD); receive_state() 4197 drbd_send_uuids(peer_device); receive_state() 4198 drbd_send_current_state(peer_device); receive_state() 4211 struct drbd_peer_device *peer_device; receive_sync_uuid() local 4215 peer_device = conn_peer_device(connection, pi->vnr); receive_sync_uuid() 4216 if (!peer_device) receive_sync_uuid() 4218 device = peer_device->device; receive_sync_uuid() 4251 receive_bitmap_plain(struct drbd_peer_device *peer_device, unsigned int size, receive_bitmap_plain() argument 4255 drbd_header_size(peer_device->connection); receive_bitmap_plain() 4262 drbd_err(peer_device, "%s:want (%u) != size (%u)\n", __func__, want, size); receive_bitmap_plain() 4267 err = drbd_recv_all(peer_device->connection, p, want); receive_bitmap_plain() 4271 drbd_bm_merge_lel(peer_device->device, c->word_offset, num_words, p); receive_bitmap_plain() 4303 recv_bm_rle_bits(struct drbd_peer_device *peer_device, recv_bm_rle_bits() argument 4332 drbd_err(peer_device, "bitmap overflow (e:%lu) while decoding bm RLE packet\n", e); recv_bm_rle_bits() 4335 _drbd_bm_set_bits(peer_device->device, s, e); recv_bm_rle_bits() 4339 drbd_err(peer_device, "bitmap decoding error: h:%d b:%d la:0x%08llx l:%u/%u\n", recv_bm_rle_bits() 4372 decode_bitmap_c(struct drbd_peer_device *peer_device, decode_bitmap_c() argument 4378 return recv_bm_rle_bits(peer_device, p, c, len - sizeof(*p)); decode_bitmap_c() 4384 drbd_err(peer_device, "receive_bitmap_c: unknown encoding %u\n", p->encoding); decode_bitmap_c() 4385 conn_request_state(peer_device->connection, NS(conn, C_PROTOCOL_ERROR), CS_HARD); decode_bitmap_c() 4435 struct drbd_peer_device *peer_device; receive_bitmap() local 4440 peer_device = conn_peer_device(connection, pi->vnr); receive_bitmap() 4441 if (!peer_device) receive_bitmap() 4443 device = peer_device->device; receive_bitmap() 4456 err = receive_bitmap_plain(peer_device, pi->size, pi->data, &c); receive_bitmap() 4472 err = drbd_recv_all(peer_device->connection, p, pi->size); receive_bitmap() 4475 err = decode_bitmap_c(peer_device, p, &c, pi->size); receive_bitmap() 4490 err = drbd_recv_header(peer_device->connection, pi); receive_bitmap() 4540 struct drbd_peer_device *peer_device; receive_out_of_sync() local 4544 peer_device = conn_peer_device(connection, pi->vnr); receive_out_of_sync() 4545 if (!peer_device) receive_out_of_sync() 4547 device = peer_device->device; receive_out_of_sync() 4650 struct drbd_peer_device *peer_device; conn_disconnect() local 4669 idr_for_each_entry(&connection->peer_devices, peer_device, vnr) { conn_disconnect() 4670 struct drbd_device *device = peer_device->device; conn_disconnect() 4673 drbd_disconnected(peer_device); conn_disconnect() 4701 static int drbd_disconnected(struct drbd_peer_device *peer_device) drbd_disconnected() argument 4703 struct drbd_device *device = peer_device->device; drbd_disconnected() 4735 drbd_flush_workqueue(&peer_device->connection->sender_work); drbd_disconnected() 4742 drbd_flush_workqueue(&peer_device->connection->sender_work); drbd_disconnected() 4752 tl_clear(peer_device->connection); drbd_disconnected() 5118 struct drbd_peer_device *peer_device; got_RqSReply() local 5123 peer_device = conn_peer_device(connection, pi->vnr); got_RqSReply() 5124 if (!peer_device) got_RqSReply() 5126 device = peer_device->device; got_RqSReply() 5163 struct drbd_peer_device *peer_device; got_IsInSync() local 5169 peer_device = conn_peer_device(connection, pi->vnr); got_IsInSync() 5170 if (!peer_device) got_IsInSync() 5172 device = peer_device->device; got_IsInSync() 5174 D_ASSERT(device, peer_device->connection->agreed_pro_version >= 89); got_IsInSync() 5176 update_peer_seq(peer_device, be32_to_cpu(p->seq_num)); got_IsInSync() 5215 struct drbd_peer_device *peer_device; got_BlockAck() local 5222 peer_device = conn_peer_device(connection, pi->vnr); got_BlockAck() 5223 if (!peer_device) got_BlockAck() 5225 device = peer_device->device; got_BlockAck() 5227 update_peer_seq(peer_device, be32_to_cpu(p->seq_num)); got_BlockAck() 5261 struct drbd_peer_device *peer_device; got_NegAck() local 5268 peer_device = conn_peer_device(connection, pi->vnr); got_NegAck() 5269 if (!peer_device) got_NegAck() 5271 device = peer_device->device; got_NegAck() 5273 update_peer_seq(peer_device, be32_to_cpu(p->seq_num)); got_NegAck() 5297 struct drbd_peer_device *peer_device; got_NegDReply() local 5302 peer_device = conn_peer_device(connection, pi->vnr); got_NegDReply() 5303 if (!peer_device) got_NegDReply() 5305 device = peer_device->device; got_NegDReply() 5307 update_peer_seq(peer_device, be32_to_cpu(p->seq_num)); got_NegDReply() 5319 struct drbd_peer_device *peer_device; got_NegRSDReply() local 5325 peer_device = conn_peer_device(connection, pi->vnr); got_NegRSDReply() 5326 if (!peer_device) got_NegRSDReply() 5328 device = peer_device->device; got_NegRSDReply() 5333 update_peer_seq(peer_device, be32_to_cpu(p->seq_num)); got_NegRSDReply() 5356 struct drbd_peer_device *peer_device; got_BarrierAck() local 5362 idr_for_each_entry(&connection->peer_devices, peer_device, vnr) { got_BarrierAck() 5363 struct drbd_device *device = peer_device->device; got_BarrierAck() 5379 struct drbd_peer_device *peer_device; got_OVResult() local 5386 peer_device = conn_peer_device(connection, pi->vnr); got_OVResult() 5387 if (!peer_device) got_OVResult() 5389 device = peer_device->device; got_OVResult() 5394 update_peer_seq(peer_device, be32_to_cpu(p->seq_num)); got_OVResult() 5418 drbd_queue_work(&peer_device->connection->sender_work, &dw->w); got_OVResult() 5436 struct drbd_peer_device *peer_device; connection_finish_peer_reqs() local 5444 idr_for_each_entry(&connection->peer_devices, peer_device, vnr) { connection_finish_peer_reqs() 5445 struct drbd_device *device = peer_device->device; connection_finish_peer_reqs() 5458 idr_for_each_entry(&connection->peer_devices, peer_device, vnr) { connection_finish_peer_reqs() 5459 struct drbd_device *device = peer_device->device; connection_finish_peer_reqs()
|
H A D | drbd_worker.c | 100 struct drbd_peer_device *peer_device = peer_req->peer_device; __releases() local 101 struct drbd_device *device = peer_device->device; __releases() 112 drbd_queue_work(&peer_device->connection->sender_work, &peer_req->w); __releases() 121 struct drbd_peer_device *peer_device = peer_req->peer_device; __releases() local 122 struct drbd_device *device = peer_device->device; __releases() 166 wake_asender(peer_device->connection); __releases() 176 struct drbd_device *device = peer_req->peer_device->device; drbd_peer_request_endio() 323 struct drbd_peer_device *peer_device = peer_req->peer_device; w_e_send_csum() local 324 struct drbd_device *device = peer_device->device; w_e_send_csum() 335 digest_size = crypto_hash_digestsize(peer_device->connection->csums_tfm); w_e_send_csum() 340 drbd_csum_ee(peer_device->connection->csums_tfm, peer_req, digest); w_e_send_csum() 349 err = drbd_send_drequest_csum(peer_device, sector, size, w_e_send_csum() 369 static int read_for_csum(struct drbd_peer_device *peer_device, sector_t sector, int size) read_for_csum() argument 371 struct drbd_device *device = peer_device->device; read_for_csum() 379 peer_req = drbd_alloc_peer_req(peer_device, ID_SYNCER /* unused */, sector, read_for_csum() 566 struct drbd_peer_device *const peer_device = first_peer_device(device); make_resync_request() local 567 struct drbd_connection *const connection = peer_device ? peer_device->connection : NULL; make_resync_request() 685 switch (read_for_csum(peer_device, sector, size)) { make_resync_request() 704 err = drbd_send_drequest(peer_device, P_RS_DATA_REQUEST, make_resync_request() 999 struct drbd_peer_device *peer_device = peer_req->peer_device; w_e_end_data_req() local 1000 struct drbd_device *device = peer_device->device; w_e_end_data_req() 1010 err = drbd_send_block(peer_device, P_DATA_REPLY, peer_req); w_e_end_data_req() 1016 err = drbd_send_ack(peer_device, P_NEG_DREPLY, peer_req); w_e_end_data_req() 1036 struct drbd_peer_device *peer_device = peer_req->peer_device; w_e_end_rsdata_req() local 1037 struct drbd_device *device = peer_device->device; w_e_end_rsdata_req() 1052 err = drbd_send_ack(peer_device, P_RS_CANCEL, peer_req); w_e_end_rsdata_req() 1056 err = drbd_send_block(peer_device, P_RS_DATA_REPLY, peer_req); w_e_end_rsdata_req() 1068 err = drbd_send_ack(peer_device, P_NEG_RS_DREPLY, peer_req); w_e_end_rsdata_req() 1086 struct drbd_peer_device *peer_device = peer_req->peer_device; w_e_end_csum_rs_req() local 1087 struct drbd_device *device = peer_device->device; w_e_end_csum_rs_req() 1110 if (peer_device->connection->csums_tfm) { w_e_end_csum_rs_req() 1111 digest_size = crypto_hash_digestsize(peer_device->connection->csums_tfm); w_e_end_csum_rs_req() 1116 drbd_csum_ee(peer_device->connection->csums_tfm, peer_req, digest); w_e_end_csum_rs_req() 1125 err = drbd_send_ack(peer_device, P_RS_IS_IN_SYNC, peer_req); w_e_end_csum_rs_req() 1131 err = drbd_send_block(peer_device, P_RS_DATA_REPLY, peer_req); w_e_end_csum_rs_req() 1134 err = drbd_send_ack(peer_device, P_NEG_RS_DREPLY, peer_req); w_e_end_csum_rs_req() 1150 struct drbd_peer_device *peer_device = peer_req->peer_device; w_e_end_ov_req() local 1151 struct drbd_device *device = peer_device->device; w_e_end_ov_req() 1161 digest_size = crypto_hash_digestsize(peer_device->connection->verify_tfm); w_e_end_ov_req() 1169 drbd_csum_ee(peer_device->connection->verify_tfm, peer_req, digest); w_e_end_ov_req() 1181 err = drbd_send_drequest_csum(peer_device, sector, size, digest, digest_size, P_OV_REPLY); w_e_end_ov_req() 1207 struct drbd_peer_device *peer_device = peer_req->peer_device; w_e_end_ov_reply() local 1208 struct drbd_device *device = peer_device->device; w_e_end_ov_reply() 1233 digest_size = crypto_hash_digestsize(peer_device->connection->verify_tfm); w_e_end_ov_reply() 1236 drbd_csum_ee(peer_device->connection->verify_tfm, peer_req, digest); w_e_end_ov_reply() 1255 err = drbd_send_ack_ex(peer_device, P_OV_RESULT, sector, size, w_e_end_ov_reply() 1337 struct drbd_peer_device *const peer_device = first_peer_device(device); w_send_out_of_sync() local 1338 struct drbd_connection *const connection = peer_device->connection; w_send_out_of_sync() 1353 err = drbd_send_out_of_sync(peer_device, req); w_send_out_of_sync() 1368 struct drbd_peer_device *const peer_device = first_peer_device(device); w_send_dblock() local 1369 struct drbd_connection *connection = peer_device->connection; w_send_dblock() 1382 err = drbd_send_dblock(peer_device, req); w_send_dblock() 1397 struct drbd_peer_device *const peer_device = first_peer_device(device); w_send_read_req() local 1398 struct drbd_connection *connection = peer_device->connection; w_send_read_req() 1411 err = drbd_send_drequest(peer_device, P_DATA_REQUEST, req->i.sector, req->i.size, w_send_read_req() 1635 struct drbd_peer_device *peer_device = first_peer_device(device); drbd_start_resync() local 1636 struct drbd_connection *connection = peer_device ? peer_device->connection : NULL; drbd_start_resync() 1773 drbd_gen_and_send_sync_uuid(peer_device); drbd_start_resync() 1951 struct drbd_peer_device *peer_device; do_unqueued_work() local 1955 idr_for_each_entry(&connection->peer_devices, peer_device, vnr) { do_unqueued_work() 1956 struct drbd_device *device = peer_device->device; do_unqueued_work() 2067 struct drbd_peer_device *peer_device; drbd_worker() local 2122 idr_for_each_entry(&connection->peer_devices, peer_device, vnr) { drbd_worker() 2123 struct drbd_device *device = peer_device->device; drbd_worker()
|
H A D | drbd_main.c | 488 struct drbd_peer_device *peer_device; conn_lowest_minor() local 492 peer_device = idr_get_next(&connection->peer_devices, &vnr); conn_lowest_minor() 493 if (peer_device) conn_lowest_minor() 494 minor = device_to_minor(peer_device->device); conn_lowest_minor() 638 void *drbd_prepare_command(struct drbd_peer_device *peer_device, struct drbd_socket *sock) drbd_prepare_command() argument 640 return conn_prepare_command(peer_device->connection, sock); drbd_prepare_command() 692 int drbd_send_command(struct drbd_peer_device *peer_device, struct drbd_socket *sock, drbd_send_command() argument 698 err = __send_command(peer_device->connection, peer_device->device->vnr, drbd_send_command() 724 int drbd_send_sync_param(struct drbd_peer_device *peer_device) drbd_send_sync_param() argument 729 const int apv = peer_device->connection->agreed_pro_version; drbd_send_sync_param() 734 sock = &peer_device->connection->data; drbd_send_sync_param() 735 p = drbd_prepare_command(peer_device, sock); drbd_send_sync_param() 740 nc = rcu_dereference(peer_device->connection->net_conf); drbd_send_sync_param() 753 if (get_ldev(peer_device->device)) { drbd_send_sync_param() 754 dc = rcu_dereference(peer_device->device->ldev->disk_conf); drbd_send_sync_param() 760 put_ldev(peer_device->device); drbd_send_sync_param() 775 return drbd_send_command(peer_device, sock, cmd, size, NULL, 0); drbd_send_sync_param() 834 static int _drbd_send_uuids(struct drbd_peer_device *peer_device, u64 uuid_flags) _drbd_send_uuids() argument 836 struct drbd_device *device = peer_device->device; _drbd_send_uuids() 844 sock = &peer_device->connection->data; _drbd_send_uuids() 845 p = drbd_prepare_command(peer_device, sock); _drbd_send_uuids() 858 uuid_flags |= rcu_dereference(peer_device->connection->net_conf)->discard_my_data ? 1 : 0; _drbd_send_uuids() 865 return drbd_send_command(peer_device, sock, P_UUIDS, sizeof(*p), NULL, 0); _drbd_send_uuids() 868 int drbd_send_uuids(struct drbd_peer_device *peer_device) drbd_send_uuids() argument 870 return _drbd_send_uuids(peer_device, 0); drbd_send_uuids() 873 int drbd_send_uuids_skip_initial_sync(struct drbd_peer_device *peer_device) drbd_send_uuids_skip_initial_sync() argument 875 return _drbd_send_uuids(peer_device, 8); drbd_send_uuids_skip_initial_sync() 896 void drbd_gen_and_send_sync_uuid(struct drbd_peer_device *peer_device) drbd_gen_and_send_sync_uuid() argument 898 struct drbd_device *device = peer_device->device; drbd_gen_and_send_sync_uuid() 914 sock = &peer_device->connection->data; drbd_gen_and_send_sync_uuid() 915 p = drbd_prepare_command(peer_device, sock); drbd_gen_and_send_sync_uuid() 918 drbd_send_command(peer_device, sock, P_SYNC_UUID, sizeof(*p), NULL, 0); drbd_gen_and_send_sync_uuid() 922 int drbd_send_sizes(struct drbd_peer_device *peer_device, int trigger_reply, enum dds_flags flags) drbd_send_sizes() argument 924 struct drbd_device *device = peer_device->device; drbd_send_sizes() 948 sock = &peer_device->connection->data; drbd_send_sizes() 949 p = drbd_prepare_command(peer_device, sock); drbd_send_sizes() 953 if (peer_device->connection->agreed_pro_version <= 94) drbd_send_sizes() 955 else if (peer_device->connection->agreed_pro_version < 100) drbd_send_sizes() 964 return drbd_send_command(peer_device, sock, P_SIZES, sizeof(*p), NULL, 0); drbd_send_sizes() 969 * @peer_device: DRBD peer device. 971 int drbd_send_current_state(struct drbd_peer_device *peer_device) drbd_send_current_state() argument 976 sock = &peer_device->connection->data; drbd_send_current_state() 977 p = drbd_prepare_command(peer_device, sock); drbd_send_current_state() 980 p->state = cpu_to_be32(peer_device->device->state.i); /* Within the send mutex */ drbd_send_current_state() 981 return drbd_send_command(peer_device, sock, P_STATE, sizeof(*p), NULL, 0); drbd_send_current_state() 986 * @peer_device: DRBD peer device. 994 int drbd_send_state(struct drbd_peer_device *peer_device, union drbd_state state) drbd_send_state() argument 999 sock = &peer_device->connection->data; drbd_send_state() 1000 p = drbd_prepare_command(peer_device, sock); drbd_send_state() 1004 return drbd_send_command(peer_device, sock, P_STATE, sizeof(*p), NULL, 0); drbd_send_state() 1007 int drbd_send_state_req(struct drbd_peer_device *peer_device, union drbd_state mask, union drbd_state val) drbd_send_state_req() argument 1012 sock = &peer_device->connection->data; drbd_send_state_req() 1013 p = drbd_prepare_command(peer_device, sock); drbd_send_state_req() 1018 return drbd_send_command(peer_device, sock, P_STATE_CHG_REQ, sizeof(*p), NULL, 0); drbd_send_state_req() 1037 void drbd_send_sr_reply(struct drbd_peer_device *peer_device, enum drbd_state_rv retcode) drbd_send_sr_reply() argument 1042 sock = &peer_device->connection->meta; drbd_send_sr_reply() 1043 p = drbd_prepare_command(peer_device, sock); drbd_send_sr_reply() 1046 drbd_send_command(peer_device, sock, P_STATE_CHG_REPLY, sizeof(*p), NULL, 0); drbd_send_sr_reply() 1315 static int _drbd_send_ack(struct drbd_peer_device *peer_device, enum drbd_packet cmd, _drbd_send_ack() argument 1321 if (peer_device->device->state.conn < C_CONNECTED) _drbd_send_ack() 1324 sock = &peer_device->connection->meta; _drbd_send_ack() 1325 p = drbd_prepare_command(peer_device, sock); _drbd_send_ack() 1331 p->seq_num = cpu_to_be32(atomic_inc_return(&peer_device->device->packet_seq)); _drbd_send_ack() 1332 return drbd_send_command(peer_device, sock, cmd, sizeof(*p), NULL, 0); _drbd_send_ack() 1338 void drbd_send_ack_dp(struct drbd_peer_device *peer_device, enum drbd_packet cmd, drbd_send_ack_dp() argument 1341 if (peer_device->connection->peer_integrity_tfm) drbd_send_ack_dp() 1342 data_size -= crypto_hash_digestsize(peer_device->connection->peer_integrity_tfm); drbd_send_ack_dp() 1343 _drbd_send_ack(peer_device, cmd, dp->sector, cpu_to_be32(data_size), drbd_send_ack_dp() 1347 void drbd_send_ack_rp(struct drbd_peer_device *peer_device, enum drbd_packet cmd, drbd_send_ack_rp() argument 1350 _drbd_send_ack(peer_device, cmd, rp->sector, rp->blksize, rp->block_id); drbd_send_ack_rp() 1359 int drbd_send_ack(struct drbd_peer_device *peer_device, enum drbd_packet cmd, drbd_send_ack() argument 1362 return _drbd_send_ack(peer_device, cmd, drbd_send_ack() 1370 int drbd_send_ack_ex(struct drbd_peer_device *peer_device, enum drbd_packet cmd, drbd_send_ack_ex() argument 1373 return _drbd_send_ack(peer_device, cmd, drbd_send_ack_ex() 1379 int drbd_send_drequest(struct drbd_peer_device *peer_device, int cmd, drbd_send_drequest() argument 1385 sock = &peer_device->connection->data; drbd_send_drequest() 1386 p = drbd_prepare_command(peer_device, sock); drbd_send_drequest() 1392 return drbd_send_command(peer_device, sock, cmd, sizeof(*p), NULL, 0); drbd_send_drequest() 1395 int drbd_send_drequest_csum(struct drbd_peer_device *peer_device, sector_t sector, int size, drbd_send_drequest_csum() argument 1403 sock = &peer_device->connection->data; drbd_send_drequest_csum() 1404 p = drbd_prepare_command(peer_device, sock); drbd_send_drequest_csum() 1410 return drbd_send_command(peer_device, sock, cmd, sizeof(*p), digest, digest_size); drbd_send_drequest_csum() 1413 int drbd_send_ov_request(struct drbd_peer_device *peer_device, sector_t sector, int size) drbd_send_ov_request() argument 1418 sock = &peer_device->connection->data; drbd_send_ov_request() 1419 p = drbd_prepare_command(peer_device, sock); drbd_send_ov_request() 1425 return drbd_send_command(peer_device, sock, P_OV_REQUEST, sizeof(*p), NULL, 0); drbd_send_ov_request() 1483 static int _drbd_no_send_page(struct drbd_peer_device *peer_device, struct page *page, _drbd_no_send_page() argument 1490 socket = peer_device->connection->data.socket; _drbd_no_send_page() 1492 err = drbd_send_all(peer_device->connection, socket, addr, size, msg_flags); _drbd_no_send_page() 1495 peer_device->device->send_cnt += size >> 9; _drbd_no_send_page() 1499 static int _drbd_send_page(struct drbd_peer_device *peer_device, struct page *page, _drbd_send_page() argument 1502 struct socket *socket = peer_device->connection->data.socket; _drbd_send_page() 1514 return _drbd_no_send_page(peer_device, page, offset, size, msg_flags); _drbd_send_page() 1517 drbd_update_congested(peer_device->connection); _drbd_send_page() 1525 if (we_should_drop_the_connection(peer_device->connection, socket)) _drbd_send_page() 1529 drbd_warn(peer_device->device, "%s: size=%d len=%d sent=%d\n", _drbd_send_page() 1539 clear_bit(NET_CONGESTED, &peer_device->connection->flags); _drbd_send_page() 1543 peer_device->device->send_cnt += size >> 9; _drbd_send_page() 1548 static int _drbd_send_bio(struct drbd_peer_device *peer_device, struct bio *bio) _drbd_send_bio() argument 1557 err = _drbd_no_send_page(peer_device, bvec.bv_page, bio_for_each_segment() 1567 static int _drbd_send_zc_bio(struct drbd_peer_device *peer_device, struct bio *bio) _drbd_send_zc_bio() argument 1576 err = _drbd_send_page(peer_device, bvec.bv_page, bio_for_each_segment() 1585 static int _drbd_send_zc_ee(struct drbd_peer_device *peer_device, _drbd_send_zc_ee() argument 1596 err = _drbd_send_page(peer_device, page, 0, l, page_chain_for_each() 1619 int drbd_send_dblock(struct drbd_peer_device *peer_device, struct drbd_request *req) drbd_send_dblock() argument 1621 struct drbd_device *device = peer_device->device; drbd_send_dblock() 1628 sock = &peer_device->connection->data; drbd_send_dblock() 1629 p = drbd_prepare_command(peer_device, sock); drbd_send_dblock() 1630 digest_size = peer_device->connection->integrity_tfm ? drbd_send_dblock() 1631 crypto_hash_digestsize(peer_device->connection->integrity_tfm) : 0; drbd_send_dblock() 1638 dp_flags = bio_flags_to_wire(peer_device->connection, req->master_bio->bi_rw); drbd_send_dblock() 1642 if (peer_device->connection->agreed_pro_version >= 100) { drbd_send_dblock() 1656 err = __send_command(peer_device->connection, device->vnr, sock, P_TRIM, sizeof(*t), NULL, 0); drbd_send_dblock() 1663 drbd_csum_bio(peer_device->connection->integrity_tfm, req->master_bio, p + 1); drbd_send_dblock() 1664 err = __send_command(peer_device->connection, device->vnr, sock, P_DATA, sizeof(*p) + digest_size, NULL, req->i.size); drbd_send_dblock() 1678 err = _drbd_send_bio(peer_device, req->master_bio); drbd_send_dblock() 1680 err = _drbd_send_zc_bio(peer_device, req->master_bio); drbd_send_dblock() 1687 drbd_csum_bio(peer_device->connection->integrity_tfm, req->master_bio, digest); drbd_send_dblock() 1707 int drbd_send_block(struct drbd_peer_device *peer_device, enum drbd_packet cmd, drbd_send_block() argument 1710 struct drbd_device *device = peer_device->device; drbd_send_block() 1716 sock = &peer_device->connection->data; drbd_send_block() 1717 p = drbd_prepare_command(peer_device, sock); drbd_send_block() 1719 digest_size = peer_device->connection->integrity_tfm ? drbd_send_block() 1720 crypto_hash_digestsize(peer_device->connection->integrity_tfm) : 0; drbd_send_block() 1729 drbd_csum_ee(peer_device->connection->integrity_tfm, peer_req, p + 1); drbd_send_block() 1730 err = __send_command(peer_device->connection, device->vnr, sock, cmd, sizeof(*p) + digest_size, NULL, peer_req->i.size); drbd_send_block() 1732 err = _drbd_send_zc_ee(peer_device, peer_req); drbd_send_block() 1738 int drbd_send_out_of_sync(struct drbd_peer_device *peer_device, struct drbd_request *req) drbd_send_out_of_sync() argument 1743 sock = &peer_device->connection->data; drbd_send_out_of_sync() 1744 p = drbd_prepare_command(peer_device, sock); drbd_send_out_of_sync() 1749 return drbd_send_command(peer_device, sock, P_OUT_OF_SYNC, sizeof(*p), NULL, 0); drbd_send_out_of_sync() 2168 struct drbd_peer_device *peer_device, *tmp_peer_device; drbd_destroy_device() local 2203 for_each_peer_device_safe(peer_device, tmp_peer_device, device) { for_each_peer_device_safe() 2204 kref_put(&peer_device->connection->kref, drbd_destroy_connection); for_each_peer_device_safe() 2205 kfree(peer_device); for_each_peer_device_safe() 2720 struct drbd_peer_device *peer_device, *tmp_peer_device; drbd_create_device() local 2807 peer_device = kzalloc(sizeof(struct drbd_peer_device), GFP_KERNEL); for_each_connection() 2808 if (!peer_device) for_each_connection() 2810 peer_device->connection = connection; for_each_connection() 2811 peer_device->device = device; for_each_connection() 2813 list_add(&peer_device->peer_devices, &device->peer_devices); for_each_connection() 2816 id = idr_alloc(&connection->peer_devices, peer_device, vnr, vnr + 1, GFP_KERNEL); for_each_connection() 2835 for_each_peer_device(peer_device, device) 2836 drbd_connected(peer_device); 2839 for_each_peer_device(peer_device, device) 2840 drbd_debugfs_peer_device_add(peer_device); 2848 peer_device = idr_find(&connection->peer_devices, vnr); for_each_connection() 2849 if (peer_device) { for_each_connection() 2854 for_each_peer_device_safe(peer_device, tmp_peer_device, device) { for_each_peer_device_safe() 2855 list_del(&peer_device->peer_devices); for_each_peer_device_safe() 2856 kfree(peer_device); for_each_peer_device_safe() 2880 struct drbd_peer_device *peer_device; drbd_delete_device() local 2884 for_each_peer_device(peer_device, device) drbd_delete_device() 2885 drbd_debugfs_peer_device_cleanup(peer_device); drbd_delete_device() 3013 struct drbd_peer_device *peer_device; conn_md_sync() local 3017 idr_for_each_entry(&connection->peer_devices, peer_device, vnr) { conn_md_sync() 3018 struct drbd_device *device = peer_device->device; conn_md_sync()
|
H A D | drbd_state.c | 67 struct drbd_peer_device *peer_device; conn_all_vols_unconf() local 72 idr_for_each_entry(&connection->peer_devices, peer_device, vnr) { conn_all_vols_unconf() 73 struct drbd_device *device = peer_device->device; conn_all_vols_unconf() 108 struct drbd_peer_device *peer_device; conn_highest_role() local 112 idr_for_each_entry(&connection->peer_devices, peer_device, vnr) { conn_highest_role() 113 struct drbd_device *device = peer_device->device; conn_highest_role() 124 struct drbd_peer_device *peer_device; conn_highest_peer() local 128 idr_for_each_entry(&connection->peer_devices, peer_device, vnr) { conn_highest_peer() 129 struct drbd_device *device = peer_device->device; conn_highest_peer() 140 struct drbd_peer_device *peer_device; conn_highest_disk() local 144 idr_for_each_entry(&connection->peer_devices, peer_device, vnr) { conn_highest_disk() 145 struct drbd_device *device = peer_device->device; conn_highest_disk() 156 struct drbd_peer_device *peer_device; conn_lowest_disk() local 160 idr_for_each_entry(&connection->peer_devices, peer_device, vnr) { conn_lowest_disk() 161 struct drbd_device *device = peer_device->device; conn_lowest_disk() 172 struct drbd_peer_device *peer_device; conn_highest_pdsk() local 176 idr_for_each_entry(&connection->peer_devices, peer_device, vnr) { conn_highest_pdsk() 177 struct drbd_device *device = peer_device->device; conn_highest_pdsk() 188 struct drbd_peer_device *peer_device; conn_lowest_conn() local 192 idr_for_each_entry(&connection->peer_devices, peer_device, vnr) { conn_lowest_conn() 193 struct drbd_device *device = peer_device->device; conn_lowest_conn() 203 struct drbd_peer_device *peer_device; no_peer_wf_report_params() local 208 idr_for_each_entry(&connection->peer_devices, peer_device, vnr) no_peer_wf_report_params() 209 if (peer_device->device->state.conn == C_WF_REPORT_PARAMS) { no_peer_wf_report_params() 220 struct drbd_peer_device *peer_device; wake_up_all_devices() local 224 idr_for_each_entry(&connection->peer_devices, peer_device, vnr) wake_up_all_devices() 225 wake_up(&peer_device->device->state_wait); wake_up_all_devices() 980 struct drbd_peer_device *peer_device = first_peer_device(device); __drbd_set_state() local 981 struct drbd_connection *connection = peer_device ? peer_device->connection : NULL; __drbd_set_state() 1259 struct drbd_peer_device *peer_device = first_peer_device(device); after_state_ch() local 1260 struct drbd_connection *connection = peer_device ? peer_device->connection : NULL; after_state_ch() 1309 struct drbd_peer_device *peer_device; local 1313 idr_for_each_entry(&connection->peer_devices, peer_device, vnr) 1314 clear_bit(NEW_CUR_UUID, &peer_device->device->flags); 1332 drbd_gen_and_send_sync_uuid(peer_device); 1346 drbd_send_uuids(peer_device); 1347 drbd_send_state(peer_device, ns); 1372 drbd_send_uuids(peer_device); 1383 drbd_send_uuids(peer_device); 1410 drbd_send_sizes(peer_device, 0, 0); /* to start sync... */ 1411 drbd_send_uuids(peer_device); 1412 drbd_send_state(peer_device, ns); 1419 drbd_send_state(peer_device, ns); 1429 drbd_send_state(peer_device, ns); 1432 drbd_send_state(peer_device, ns); 1486 drbd_send_state(peer_device, ns); 1510 drbd_send_state(peer_device, ns); 1518 drbd_send_state(peer_device, ns); 1536 drbd_send_state(peer_device, ns); 1543 drbd_send_state(peer_device, ns); 1584 struct drbd_peer_device *peer_device; w_after_conn_state_ch() local 1612 idr_for_each_entry(&connection->peer_devices, peer_device, vnr) { w_after_conn_state_ch() 1613 struct drbd_device *device = peer_device->device; w_after_conn_state_ch() 1639 struct drbd_peer_device *peer_device; conn_old_common_state() local 1650 idr_for_each_entry(&connection->peer_devices, peer_device, vnr) { conn_old_common_state() 1651 struct drbd_device *device = peer_device->device; conn_old_common_state() 1688 struct drbd_peer_device *peer_device; conn_is_valid_transition() local 1692 idr_for_each_entry(&connection->peer_devices, peer_device, vnr) { conn_is_valid_transition() 1693 struct drbd_device *device = peer_device->device; conn_is_valid_transition() 1737 struct drbd_peer_device *peer_device; conn_set_state() local 1752 idr_for_each_entry(&connection->peer_devices, peer_device, vnr) { conn_set_state() 1753 struct drbd_device *device = peer_device->device; conn_set_state()
|
H A D | drbd_req.c | 336 static void set_if_null_req_next(struct drbd_peer_device *peer_device, struct drbd_request *req) set_if_null_req_next() argument 338 struct drbd_connection *connection = peer_device ? peer_device->connection : NULL; set_if_null_req_next() 345 static void advance_conn_req_next(struct drbd_peer_device *peer_device, struct drbd_request *req) advance_conn_req_next() argument 347 struct drbd_connection *connection = peer_device ? peer_device->connection : NULL; advance_conn_req_next() 362 static void set_if_null_req_ack_pending(struct drbd_peer_device *peer_device, struct drbd_request *req) set_if_null_req_ack_pending() argument 364 struct drbd_connection *connection = peer_device ? peer_device->connection : NULL; set_if_null_req_ack_pending() 371 static void advance_conn_req_ack_pending(struct drbd_peer_device *peer_device, struct drbd_request *req) advance_conn_req_ack_pending() argument 373 struct drbd_connection *connection = peer_device ? peer_device->connection : NULL; advance_conn_req_ack_pending() 388 static void set_if_null_req_not_net_done(struct drbd_peer_device *peer_device, struct drbd_request *req) set_if_null_req_not_net_done() argument 390 struct drbd_connection *connection = peer_device ? peer_device->connection : NULL; set_if_null_req_not_net_done() 397 static void advance_conn_req_not_net_done(struct drbd_peer_device *peer_device, struct drbd_request *req) advance_conn_req_not_net_done() argument 399 struct drbd_connection *connection = peer_device ? peer_device->connection : NULL; advance_conn_req_not_net_done() 420 struct drbd_peer_device *peer_device = first_peer_device(device); mod_rq_state() local 449 set_if_null_req_next(peer_device, req); mod_rq_state() 459 set_if_null_req_not_net_done(peer_device, req); mod_rq_state() 462 set_if_null_req_ack_pending(peer_device, req); mod_rq_state() 493 advance_conn_req_ack_pending(peer_device, req); mod_rq_state() 498 advance_conn_req_next(peer_device, req); mod_rq_state() 511 advance_conn_req_next(peer_device, req); mod_rq_state() 512 advance_conn_req_ack_pending(peer_device, req); mod_rq_state() 513 advance_conn_req_not_net_done(peer_device, req); mod_rq_state() 582 struct drbd_peer_device *const peer_device = first_peer_device(device); __req_mod() local 583 struct drbd_connection *const connection = peer_device ? peer_device->connection : NULL; __req_mod()
|
H A D | drbd_debugfs.c | 860 void drbd_debugfs_peer_device_add(struct drbd_peer_device *peer_device) drbd_debugfs_peer_device_add() argument 862 struct dentry *conn_dir = peer_device->connection->debugfs_conn; drbd_debugfs_peer_device_add() 869 snprintf(vnr_buf, sizeof(vnr_buf), "%u", peer_device->device->vnr); drbd_debugfs_peer_device_add() 873 peer_device->debugfs_peer_dev = dentry; drbd_debugfs_peer_device_add() 877 drbd_debugfs_peer_device_cleanup(peer_device); drbd_debugfs_peer_device_add() 878 drbd_err(peer_device, "failed to create debugfs entries\n"); drbd_debugfs_peer_device_add() 881 void drbd_debugfs_peer_device_cleanup(struct drbd_peer_device *peer_device) drbd_debugfs_peer_device_cleanup() argument 883 drbd_debugfs_remove(&peer_device->debugfs_peer_dev); drbd_debugfs_peer_device_cleanup()
|
H A D | drbd_nl.c | 412 struct drbd_peer_device *peer_device; highest_fencing_policy() local 416 idr_for_each_entry(&connection->peer_devices, peer_device, vnr) { highest_fencing_policy() 417 struct drbd_device *device = peer_device->device; highest_fencing_policy() 420 rcu_dereference(peer_device->device->ldev->disk_conf); highest_fencing_policy() 431 peer_device = idr_get_next(&connection->peer_devices, &vnr); highest_fencing_policy() 432 drbd_change_state(peer_device->device, CS_VERBOSE | CS_HARD, NS(susp_fen, 0)); highest_fencing_policy() 565 struct drbd_peer_device *const peer_device = first_peer_device(device); drbd_set_role() local 566 struct drbd_connection *const connection = peer_device ? peer_device->connection : NULL; drbd_set_role() 694 drbd_send_uuids(peer_device); drbd_set_role() 695 drbd_send_current_state(peer_device); drbd_set_role() 1426 struct drbd_peer_device *peer_device; drbd_adm_disk_opts() local 1428 for_each_peer_device(peer_device, device) drbd_adm_disk_opts() 1429 drbd_send_sync_param(peer_device); drbd_adm_disk_opts() 1456 struct drbd_peer_device *peer_device; drbd_adm_attach() local 1480 peer_device = first_peer_device(device); drbd_adm_attach() 1481 connection = peer_device ? peer_device->connection : NULL; drbd_adm_attach() 1960 struct drbd_peer_device *peer_device; conn_resync_running() local 1965 idr_for_each_entry(&connection->peer_devices, peer_device, vnr) { conn_resync_running() 1966 struct drbd_device *device = peer_device->device; conn_resync_running() 1982 struct drbd_peer_device *peer_device; conn_ov_running() local 1987 idr_for_each_entry(&connection->peer_devices, peer_device, vnr) { conn_ov_running() 1988 struct drbd_device *device = peer_device->device; conn_ov_running() 2003 struct drbd_peer_device *peer_device; _check_net_options() local 2026 idr_for_each_entry(&connection->peer_devices, peer_device, i) { _check_net_options() 2027 struct drbd_device *device = peer_device->device; _check_net_options() 2048 struct drbd_peer_device *peer_device; check_net_options() local 2056 idr_for_each_entry(&connection->peer_devices, peer_device, i) { check_net_options() 2057 struct drbd_device *device = peer_device->device; check_net_options() 2225 struct drbd_peer_device *peer_device; drbd_adm_net_opts() local 2228 idr_for_each_entry(&connection->peer_devices, peer_device, vnr) drbd_adm_net_opts() 2229 drbd_send_sync_param(peer_device); drbd_adm_net_opts() 2251 struct drbd_peer_device *peer_device; drbd_adm_connect() local 2353 idr_for_each_entry(&connection->peer_devices, peer_device, i) { 2354 struct drbd_device *device = peer_device->device; 3573 struct drbd_peer_device *peer_device; for_each_connection() local 3575 idr_for_each_entry(&connection->peer_devices, peer_device, i) { for_each_connection() 3576 retcode = drbd_set_role(peer_device->device, R_SECONDARY, 0); for_each_connection()
|
H A D | drbd_int.h | 105 #define __drbd_printk_peer_device(level, peer_device, fmt, args...) \ 106 dev_printk(level, disk_to_dev((peer_device)->device->vdisk), fmt, ## args) 417 struct drbd_peer_device *peer_device; member in struct:drbd_peer_request 1041 #define for_each_peer_device(peer_device, device) \ 1042 list_for_each_entry(peer_device, &device->peer_devices, peer_devices) 1044 #define for_each_peer_device_rcu(peer_device, device) \ 1045 list_for_each_entry_rcu(peer_device, &device->peer_devices, peer_devices) 1047 #define for_each_peer_device_safe(peer_device, tmp, device) \ 1048 list_for_each_entry_safe(peer_device, tmp, &device->peer_devices, peer_devices)
|