• Home
  • Raw
  • Download

Lines Matching refs:peer_device

224 	struct drbd_peer_device *peer_device;  in conn_reclaim_net_peer_reqs()  local
228 idr_for_each_entry(&connection->peer_devices, peer_device, vnr) { in conn_reclaim_net_peer_reqs()
229 struct drbd_device *device = peer_device->device; in conn_reclaim_net_peer_reqs()
262 struct page *drbd_alloc_pages(struct drbd_peer_device *peer_device, unsigned int number, in drbd_alloc_pages() argument
265 struct drbd_device *device = peer_device->device; in drbd_alloc_pages()
272 nc = rcu_dereference(peer_device->connection->net_conf); in drbd_alloc_pages()
360 drbd_alloc_peer_req(struct drbd_peer_device *peer_device, u64 id, sector_t sector, in drbd_alloc_peer_req() argument
363 struct drbd_device *device = peer_device->device; in drbd_alloc_peer_req()
379 page = drbd_alloc_pages(peer_device, nr_pages, in drbd_alloc_peer_req()
391 peer_req->peer_device = peer_device; in drbd_alloc_peer_req()
889 int drbd_connected(struct drbd_peer_device *peer_device) in drbd_connected() argument
891 struct drbd_device *device = peer_device->device; in drbd_connected()
897 device->state_mutex = peer_device->connection->agreed_pro_version < 100 ? in drbd_connected()
898 &peer_device->connection->cstate_mutex : in drbd_connected()
901 err = drbd_send_sync_param(peer_device); in drbd_connected()
903 err = drbd_send_sizes(peer_device, 0, 0); in drbd_connected()
905 err = drbd_send_uuids(peer_device); in drbd_connected()
907 err = drbd_send_current_state(peer_device); in drbd_connected()
926 struct drbd_peer_device *peer_device; in conn_connect() local
1094 idr_for_each_entry(&connection->peer_devices, peer_device, vnr) in conn_connect()
1095 mutex_lock(peer_device->device->state_mutex); in conn_connect()
1102 idr_for_each_entry(&connection->peer_devices, peer_device, vnr) in conn_connect()
1103 mutex_unlock(peer_device->device->state_mutex); in conn_connect()
1106 idr_for_each_entry(&connection->peer_devices, peer_device, vnr) { in conn_connect()
1107 struct drbd_device *device = peer_device->device; in conn_connect()
1116 drbd_connected(peer_device); in conn_connect()
1315 struct drbd_peer_device *peer_device; in drbd_flush() local
1324 idr_for_each_entry(&connection->peer_devices, peer_device, vnr) { in drbd_flush()
1325 struct drbd_device *device = peer_device->device; in drbd_flush()
1636 struct drbd_device *device = peer_req->peer_device->device; in drbd_submit_peer_request()
1654 conn_wait_active_ee_empty(peer_req->peer_device->connection); in drbd_submit_peer_request()
1742 struct drbd_peer_device *peer_device; in conn_wait_active_ee_empty() local
1746 idr_for_each_entry(&connection->peer_devices, peer_device, vnr) { in conn_wait_active_ee_empty()
1747 struct drbd_device *device = peer_device->device; in conn_wait_active_ee_empty()
1847 read_in_block(struct drbd_peer_device *peer_device, u64 id, sector_t sector, in read_in_block() argument
1850 struct drbd_device *device = peer_device->device; in read_in_block()
1856 void *dig_in = peer_device->connection->int_dig_in; in read_in_block()
1857 void *dig_vv = peer_device->connection->int_dig_vv; in read_in_block()
1863 if (!trim && peer_device->connection->peer_integrity_tfm) { in read_in_block()
1864 digest_size = crypto_shash_digestsize(peer_device->connection->peer_integrity_tfm); in read_in_block()
1869 err = drbd_recv_all_warn(peer_device->connection, dig_in, digest_size); in read_in_block()
1878 if (!expect(peer_device, data_size == 0)) in read_in_block()
1882 if (!expect(peer_device, data_size == 0)) in read_in_block()
1887 if (!expect(peer_device, IS_ALIGNED(ds, 512))) in read_in_block()
1890 if (!expect(peer_device, ds <= (DRBD_MAX_BBIO_SECTORS << 9))) in read_in_block()
1892 } else if (!expect(peer_device, ds <= DRBD_MAX_BIO_SIZE)) in read_in_block()
1908 peer_req = drbd_alloc_peer_req(peer_device, id, sector, ds, data_size, GFP_NOIO); in read_in_block()
1928 err = drbd_recv_all_warn(peer_device->connection, data, len); in read_in_block()
1942 drbd_csum_ee_size(peer_device->connection->peer_integrity_tfm, peer_req, dig_vv, data_size); in read_in_block()
1957 static int drbd_drain_block(struct drbd_peer_device *peer_device, int data_size) in drbd_drain_block() argument
1966 page = drbd_alloc_pages(peer_device, 1, 1); in drbd_drain_block()
1972 err = drbd_recv_all_warn(peer_device->connection, data, len); in drbd_drain_block()
1978 drbd_free_pages(peer_device->device, page, 0); in drbd_drain_block()
1982 static int recv_dless_read(struct drbd_peer_device *peer_device, struct drbd_request *req, in recv_dless_read() argument
1989 void *dig_in = peer_device->connection->int_dig_in; in recv_dless_read()
1990 void *dig_vv = peer_device->connection->int_dig_vv; in recv_dless_read()
1993 if (peer_device->connection->peer_integrity_tfm) { in recv_dless_read()
1994 digest_size = crypto_shash_digestsize(peer_device->connection->peer_integrity_tfm); in recv_dless_read()
1995 err = drbd_recv_all_warn(peer_device->connection, dig_in, digest_size); in recv_dless_read()
2003 peer_device->device->recv_cnt += data_size>>9; in recv_dless_read()
2006 D_ASSERT(peer_device->device, sector == bio->bi_iter.bi_sector); in recv_dless_read()
2011 err = drbd_recv_all_warn(peer_device->connection, mapped, expect); in recv_dless_read()
2019 drbd_csum_bio(peer_device->connection->peer_integrity_tfm, bio, dig_vv); in recv_dless_read()
2021 drbd_err(peer_device, "Digest integrity check FAILED. Broken NICs?\n"); in recv_dless_read()
2026 D_ASSERT(peer_device->device, data_size == 0); in recv_dless_read()
2038 struct drbd_peer_device *peer_device = peer_req->peer_device; in e_end_resync_block() local
2039 struct drbd_device *device = peer_device->device; in e_end_resync_block()
2046 drbd_set_in_sync(peer_device, sector, peer_req->i.size); in e_end_resync_block()
2047 err = drbd_send_ack(peer_device, P_RS_WRITE_ACK, peer_req); in e_end_resync_block()
2050 drbd_rs_failed_io(peer_device, sector, peer_req->i.size); in e_end_resync_block()
2052 err = drbd_send_ack(peer_device, P_NEG_ACK, peer_req); in e_end_resync_block()
2059 static int recv_resync_read(struct drbd_peer_device *peer_device, sector_t sector, in recv_resync_read() argument
2062 struct drbd_device *device = peer_device->device; in recv_resync_read()
2065 peer_req = read_in_block(peer_device, ID_SYNCER, sector, pi); in recv_resync_read()
2069 dec_rs_pending(peer_device); in recv_resync_read()
2118 struct drbd_peer_device *peer_device; in receive_DataReply() local
2125 peer_device = conn_peer_device(connection, pi->vnr); in receive_DataReply()
2126 if (!peer_device) in receive_DataReply()
2128 device = peer_device->device; in receive_DataReply()
2138 err = recv_dless_read(peer_device, req, sector, pi->size); in receive_DataReply()
2140 req_mod(req, DATA_RECEIVED, peer_device); in receive_DataReply()
2150 struct drbd_peer_device *peer_device; in receive_RSDataReply() local
2156 peer_device = conn_peer_device(connection, pi->vnr); in receive_RSDataReply()
2157 if (!peer_device) in receive_RSDataReply()
2159 device = peer_device->device; in receive_RSDataReply()
2168 err = recv_resync_read(peer_device, sector, pi); in receive_RSDataReply()
2173 err = drbd_drain_block(peer_device, pi->size); in receive_RSDataReply()
2175 drbd_send_ack_dp(peer_device, P_NEG_ACK, p, pi->size); in receive_RSDataReply()
2209 struct drbd_peer_device *peer_device = peer_req->peer_device; in e_end_block() local
2210 struct drbd_device *device = peer_device->device; in e_end_block()
2220 err = drbd_send_ack(peer_device, pcmd, peer_req); in e_end_block()
2222 drbd_set_in_sync(peer_device, sector, peer_req->i.size); in e_end_block()
2224 err = drbd_send_ack(peer_device, P_NEG_ACK, peer_req); in e_end_block()
2243 …drbd_may_finish_epoch(peer_device->connection, peer_req->epoch, EV_PUT + (cancel ? EV_CLEANUP : 0)… in e_end_block()
2252 struct drbd_peer_device *peer_device = peer_req->peer_device; in e_send_ack() local
2255 err = drbd_send_ack(peer_device, ack, peer_req); in e_send_ack()
2256 dec_unacked(peer_device->device); in e_send_ack()
2270 struct drbd_connection *connection = peer_req->peer_device->connection; in e_send_retry_write()
2291 static void update_peer_seq(struct drbd_peer_device *peer_device, unsigned int peer_seq) in update_peer_seq() argument
2293 struct drbd_device *device = peer_device->device; in update_peer_seq()
2296 if (test_bit(RESOLVE_CONFLICTS, &peer_device->connection->flags)) { in update_peer_seq()
2352 static int wait_for_and_update_peer_seq(struct drbd_peer_device *peer_device, const u32 peer_seq) in wait_for_and_update_peer_seq() argument
2354 struct drbd_device *device = peer_device->device; in wait_for_and_update_peer_seq()
2359 if (!test_bit(RESOLVE_CONFLICTS, &peer_device->connection->flags)) in wait_for_and_update_peer_seq()
2375 tp = rcu_dereference(peer_device->connection->net_conf)->two_primaries; in wait_for_and_update_peer_seq()
2385 timeout = rcu_dereference(peer_device->connection->net_conf)->ping_timeo*HZ/10; in wait_for_and_update_peer_seq()
2422 struct drbd_peer_device *peer_device = first_peer_device(device); in fail_postponed_requests() local
2436 __req_mod(req, NEG_ACKED, peer_device, &m); in fail_postponed_requests()
2448 struct drbd_connection *connection = peer_req->peer_device->connection; in handle_write_conflicts()
2503 queue_work(connection->ack_sender, &peer_req->peer_device->send_acks_work); in handle_write_conflicts()
2556 struct drbd_peer_device *peer_device; in receive_Data() local
2566 peer_device = conn_peer_device(connection, pi->vnr); in receive_Data()
2567 if (!peer_device) in receive_Data()
2569 device = peer_device->device; in receive_Data()
2574 err = wait_for_and_update_peer_seq(peer_device, peer_seq); in receive_Data()
2575 drbd_send_ack_dp(peer_device, P_NEG_ACK, p, pi->size); in receive_Data()
2577 err2 = drbd_drain_block(peer_device, pi->size); in receive_Data()
2590 peer_req = read_in_block(peer_device, p->block_id, sector, pi); in receive_Data()
2603 D_ASSERT(peer_device, peer_req->i.size > 0); in receive_Data()
2604 D_ASSERT(peer_device, peer_req_op(peer_req) == REQ_OP_DISCARD); in receive_Data()
2605 D_ASSERT(peer_device, peer_req->pages == NULL); in receive_Data()
2611 D_ASSERT(peer_device, peer_req->i.size > 0); in receive_Data()
2612 D_ASSERT(peer_device, peer_req_op(peer_req) == REQ_OP_WRITE_ZEROES); in receive_Data()
2613 D_ASSERT(peer_device, peer_req->pages == NULL); in receive_Data()
2632 nc = rcu_dereference(peer_device->connection->net_conf); in receive_Data()
2634 if (peer_device->connection->agreed_pro_version < 100) { in receive_Data()
2656 drbd_send_ack(peer_device, P_RECV_ACK, peer_req); in receive_Data()
2663 err = wait_for_and_update_peer_seq(peer_device, peer_seq); in receive_Data()
2677 update_peer_seq(peer_device, peer_seq); in receive_Data()
2693 drbd_set_out_of_sync(peer_device, peer_req->i.sector, peer_req->i.size); in receive_Data()
2732 bool drbd_rs_should_slow_down(struct drbd_peer_device *peer_device, sector_t sector, in drbd_rs_should_slow_down() argument
2735 struct drbd_device *device = peer_device->device; in drbd_rs_should_slow_down()
2804 struct drbd_peer_device *peer_device; in receive_DataRequest() local
2813 peer_device = conn_peer_device(connection, pi->vnr); in receive_DataRequest()
2814 if (!peer_device) in receive_DataRequest()
2816 device = peer_device->device; in receive_DataRequest()
2837 drbd_send_ack_rp(peer_device, P_NEG_DREPLY, p); in receive_DataRequest()
2843 drbd_send_ack_rp(peer_device, P_NEG_RS_DREPLY , p); in receive_DataRequest()
2847 dec_rs_pending(peer_device); in receive_DataRequest()
2848 drbd_send_ack_ex(peer_device, P_OV_RESULT, sector, size, ID_IN_SYNC); in receive_DataRequest()
2858 return drbd_drain_block(peer_device, pi->size); in receive_DataRequest()
2864 peer_req = drbd_alloc_peer_req(peer_device, p->block_id, sector, size, in receive_DataRequest()
2904 if (drbd_recv_all(peer_device->connection, di->digest, pi->size)) in receive_DataRequest()
2908 D_ASSERT(device, peer_device->connection->agreed_pro_version >= 89); in receive_DataRequest()
2918 dec_rs_pending(peer_device); in receive_DataRequest()
2927 peer_device->connection->agreed_pro_version >= 90) { in receive_DataRequest()
2981 && drbd_rs_should_slow_down(peer_device, sector, false)) in receive_DataRequest()
3013 static int drbd_asb_recover_0p(struct drbd_peer_device *peer_device) __must_hold(local) in drbd_asb_recover_0p() argument
3015 struct drbd_device *device = peer_device->device; in drbd_asb_recover_0p()
3027 after_sb_0p = rcu_dereference(peer_device->connection->net_conf)->after_sb_0p; in drbd_asb_recover_0p()
3063 rv = test_bit(RESOLVE_CONFLICTS, &peer_device->connection->flags) in drbd_asb_recover_0p()
3080 rv = test_bit(RESOLVE_CONFLICTS, &peer_device->connection->flags) in drbd_asb_recover_0p()
3096 static int drbd_asb_recover_1p(struct drbd_peer_device *peer_device) __must_hold(local) in drbd_asb_recover_1p() argument
3098 struct drbd_device *device = peer_device->device; in drbd_asb_recover_1p()
3103 after_sb_1p = rcu_dereference(peer_device->connection->net_conf)->after_sb_1p; in drbd_asb_recover_1p()
3117 hg = drbd_asb_recover_0p(peer_device); in drbd_asb_recover_1p()
3124 rv = drbd_asb_recover_0p(peer_device); in drbd_asb_recover_1p()
3129 hg = drbd_asb_recover_0p(peer_device); in drbd_asb_recover_1p()
3153 static int drbd_asb_recover_2p(struct drbd_peer_device *peer_device) __must_hold(local) in drbd_asb_recover_2p() argument
3155 struct drbd_device *device = peer_device->device; in drbd_asb_recover_2p()
3160 after_sb_2p = rcu_dereference(peer_device->connection->net_conf)->after_sb_2p; in drbd_asb_recover_2p()
3174 rv = drbd_asb_recover_0p(peer_device); in drbd_asb_recover_2p()
3179 hg = drbd_asb_recover_0p(peer_device); in drbd_asb_recover_2p()
3230 static int drbd_uuid_compare(struct drbd_peer_device *const peer_device, in drbd_uuid_compare() argument
3233 struct drbd_connection *const connection = peer_device->connection; in drbd_uuid_compare()
3234 struct drbd_device *device = peer_device->device; in drbd_uuid_compare()
3324 drbd_warn(peer_device, "Equivalent unrotated UUIDs, but current primary present.\n"); in drbd_uuid_compare()
3331 …drbd_err(peer_device, "Equivalent unrotated UUIDs, but both are primary. Can not resolve this.\n"); in drbd_uuid_compare()
3449 static enum drbd_conns drbd_sync_handshake(struct drbd_peer_device *peer_device, in drbd_sync_handshake() argument
3453 struct drbd_device *device = peer_device->device; in drbd_sync_handshake()
3470 hg = drbd_uuid_compare(peer_device, peer_role, &rule_nr); in drbd_sync_handshake()
3507 nc = rcu_dereference(peer_device->connection->net_conf); in drbd_sync_handshake()
3520 hg = drbd_asb_recover_0p(peer_device); in drbd_sync_handshake()
3523 hg = drbd_asb_recover_1p(peer_device); in drbd_sync_handshake()
3526 hg = drbd_asb_recover_2p(peer_device); in drbd_sync_handshake()
3583 if (tentative || test_bit(CONN_DRY_RUN, &peer_device->connection->flags)) { in drbd_sync_handshake()
3840 struct drbd_peer_device *peer_device; in receive_SyncParam() local
3853 peer_device = conn_peer_device(connection, pi->vnr); in receive_SyncParam()
3854 if (!peer_device) in receive_SyncParam()
3856 device = peer_device->device; in receive_SyncParam()
3888 err = drbd_recv_all(peer_device->connection, p, header_size); in receive_SyncParam()
3893 old_net_conf = peer_device->connection->net_conf; in receive_SyncParam()
3918 err = drbd_recv_all(peer_device->connection, p->verify_alg, data_size); in receive_SyncParam()
3990 crypto_free_shash(peer_device->connection->verify_tfm); in receive_SyncParam()
3991 peer_device->connection->verify_tfm = verify_tfm; in receive_SyncParam()
3997 crypto_free_shash(peer_device->connection->csums_tfm); in receive_SyncParam()
3998 peer_device->connection->csums_tfm = csums_tfm; in receive_SyncParam()
4044 conn_request_state(peer_device->connection, NS(conn, C_DISCONNECTING), CS_HARD); in receive_SyncParam()
4063 struct drbd_peer_device *peer_device; in receive_sizes() local
4073 peer_device = conn_peer_device(connection, pi->vnr); in receive_sizes()
4074 if (!peer_device) in receive_sizes()
4076 device = peer_device->device; in receive_sizes()
4111 conn_request_state(peer_device->connection, NS(conn, C_DISCONNECTING), CS_HARD); in receive_sizes()
4184 conn_request_state(peer_device->connection, NS(conn, C_DISCONNECTING), CS_HARD); in receive_sizes()
4214 drbd_send_sizes(peer_device, 0, ddsf); in receive_sizes()
4234 struct drbd_peer_device *peer_device; in receive_uuids() local
4240 peer_device = conn_peer_device(connection, pi->vnr); in receive_uuids()
4241 if (!peer_device) in receive_uuids()
4243 device = peer_device->device; in receive_uuids()
4261 conn_request_state(peer_device->connection, NS(conn, C_DISCONNECTING), CS_HARD); in receive_uuids()
4268 peer_device->connection->agreed_pro_version >= 90 && in receive_uuids()
4339 struct drbd_peer_device *peer_device; in receive_req_state() local
4345 peer_device = conn_peer_device(connection, pi->vnr); in receive_req_state()
4346 if (!peer_device) in receive_req_state()
4348 device = peer_device->device; in receive_req_state()
4353 if (test_bit(RESOLVE_CONFLICTS, &peer_device->connection->flags) && in receive_req_state()
4355 drbd_send_sr_reply(peer_device, SS_CONCURRENT_ST_CHG); in receive_req_state()
4363 drbd_send_sr_reply(peer_device, rv); in receive_req_state()
4396 struct drbd_peer_device *peer_device; in receive_state() local
4404 peer_device = conn_peer_device(connection, pi->vnr); in receive_state()
4405 if (!peer_device) in receive_state()
4407 device = peer_device->device; in receive_state()
4453 drbd_resync_finished(peer_device); in receive_state()
4461 ov_out_of_sync_print(peer_device); in receive_state()
4462 drbd_resync_finished(peer_device); in receive_state()
4521 ns.conn = drbd_sync_handshake(peer_device, peer_state.role, real_peer_disk); in receive_state()
4533 if (test_and_clear_bit(CONN_DRY_RUN, &peer_device->connection->flags)) in receive_state()
4536 conn_request_state(peer_device->connection, NS(conn, C_DISCONNECTING), CS_HARD); in receive_state()
4558 tl_clear(peer_device->connection); in receive_state()
4561 conn_request_state(peer_device->connection, NS2(conn, C_PROTOCOL_ERROR, susp, 0), CS_HARD); in receive_state()
4569 conn_request_state(peer_device->connection, NS(conn, C_DISCONNECTING), CS_HARD); in receive_state()
4579 drbd_send_uuids(peer_device); in receive_state()
4580 drbd_send_current_state(peer_device); in receive_state()
4593 struct drbd_peer_device *peer_device; in receive_sync_uuid() local
4597 peer_device = conn_peer_device(connection, pi->vnr); in receive_sync_uuid()
4598 if (!peer_device) in receive_sync_uuid()
4600 device = peer_device->device; in receive_sync_uuid()
4633 receive_bitmap_plain(struct drbd_peer_device *peer_device, unsigned int size, in receive_bitmap_plain() argument
4637 drbd_header_size(peer_device->connection); in receive_bitmap_plain()
4644 drbd_err(peer_device, "%s:want (%u) != size (%u)\n", __func__, want, size); in receive_bitmap_plain()
4649 err = drbd_recv_all(peer_device->connection, p, want); in receive_bitmap_plain()
4653 drbd_bm_merge_lel(peer_device->device, c->word_offset, num_words, p); in receive_bitmap_plain()
4685 recv_bm_rle_bits(struct drbd_peer_device *peer_device, in recv_bm_rle_bits() argument
4714 drbd_err(peer_device, "bitmap overflow (e:%lu) while decoding bm RLE packet\n", e); in recv_bm_rle_bits()
4717 _drbd_bm_set_bits(peer_device->device, s, e); in recv_bm_rle_bits()
4721 drbd_err(peer_device, "bitmap decoding error: h:%d b:%d la:0x%08llx l:%u/%u\n", in recv_bm_rle_bits()
4754 decode_bitmap_c(struct drbd_peer_device *peer_device, in decode_bitmap_c() argument
4760 return recv_bm_rle_bits(peer_device, p, c, len - sizeof(*p)); in decode_bitmap_c()
4766 drbd_err(peer_device, "receive_bitmap_c: unknown encoding %u\n", p->encoding); in decode_bitmap_c()
4767 conn_request_state(peer_device->connection, NS(conn, C_PROTOCOL_ERROR), CS_HARD); in decode_bitmap_c()
4771 void INFO_bm_xfer_stats(struct drbd_peer_device *peer_device, in INFO_bm_xfer_stats() argument
4775 unsigned int header_size = drbd_header_size(peer_device->connection); in INFO_bm_xfer_stats()
4799 drbd_info(peer_device, "%s bitmap stats [Bytes(packets)]: plain %u(%u), RLE %u(%u), " in INFO_bm_xfer_stats()
4817 struct drbd_peer_device *peer_device; in receive_bitmap() local
4822 peer_device = conn_peer_device(connection, pi->vnr); in receive_bitmap()
4823 if (!peer_device) in receive_bitmap()
4825 device = peer_device->device; in receive_bitmap()
4838 err = receive_bitmap_plain(peer_device, pi->size, pi->data, &c); in receive_bitmap()
4854 err = drbd_recv_all(peer_device->connection, p, pi->size); in receive_bitmap()
4857 err = decode_bitmap_c(peer_device, p, &c, pi->size); in receive_bitmap()
4872 err = drbd_recv_header(peer_device->connection, pi); in receive_bitmap()
4877 INFO_bm_xfer_stats(peer_device, "receive", &c); in receive_bitmap()
4882 err = drbd_send_bitmap(device, peer_device); in receive_bitmap()
4921 struct drbd_peer_device *peer_device; in receive_out_of_sync() local
4925 peer_device = conn_peer_device(connection, pi->vnr); in receive_out_of_sync()
4926 if (!peer_device) in receive_out_of_sync()
4928 device = peer_device->device; in receive_out_of_sync()
4940 drbd_set_out_of_sync(peer_device, be64_to_cpu(p->sector), be32_to_cpu(p->blksize)); in receive_out_of_sync()
4947 struct drbd_peer_device *peer_device; in receive_rs_deallocated() local
4953 peer_device = conn_peer_device(connection, pi->vnr); in receive_rs_deallocated()
4954 if (!peer_device) in receive_rs_deallocated()
4956 device = peer_device->device; in receive_rs_deallocated()
4961 dec_rs_pending(peer_device); in receive_rs_deallocated()
4966 peer_req = drbd_alloc_peer_req(peer_device, ID_SYNCER, sector, in receive_rs_deallocated()
5003 drbd_send_ack_ex(peer_device, P_NEG_ACK, sector, size, ID_SYNCER); in receive_rs_deallocated()
5107 struct drbd_peer_device *peer_device; in conn_disconnect() local
5130 idr_for_each_entry(&connection->peer_devices, peer_device, vnr) { in conn_disconnect()
5131 struct drbd_device *device = peer_device->device; in conn_disconnect()
5134 drbd_disconnected(peer_device); in conn_disconnect()
5162 static int drbd_disconnected(struct drbd_peer_device *peer_device) in drbd_disconnected() argument
5164 struct drbd_device *device = peer_device->device; in drbd_disconnected()
5196 drbd_flush_workqueue(&peer_device->connection->sender_work); in drbd_disconnected()
5203 drbd_flush_workqueue(&peer_device->connection->sender_work); in drbd_disconnected()
5213 tl_clear(peer_device->connection); in drbd_disconnected()
5591 struct drbd_peer_device *peer_device; in got_RqSReply() local
5596 peer_device = conn_peer_device(connection, pi->vnr); in got_RqSReply()
5597 if (!peer_device) in got_RqSReply()
5599 device = peer_device->device; in got_RqSReply()
5636 struct drbd_peer_device *peer_device; in got_IsInSync() local
5642 peer_device = conn_peer_device(connection, pi->vnr); in got_IsInSync()
5643 if (!peer_device) in got_IsInSync()
5645 device = peer_device->device; in got_IsInSync()
5647 D_ASSERT(device, peer_device->connection->agreed_pro_version >= 89); in got_IsInSync()
5649 update_peer_seq(peer_device, be32_to_cpu(p->seq_num)); in got_IsInSync()
5653 drbd_set_in_sync(peer_device, sector, blksize); in got_IsInSync()
5658 dec_rs_pending(peer_device); in got_IsInSync()
5665 validate_req_change_req_state(struct drbd_peer_device *peer_device, u64 id, sector_t sector, in validate_req_change_req_state() argument
5669 struct drbd_device *device = peer_device->device; in validate_req_change_req_state()
5679 __req_mod(req, what, peer_device, &m); in validate_req_change_req_state()
5689 struct drbd_peer_device *peer_device; in got_BlockAck() local
5696 peer_device = conn_peer_device(connection, pi->vnr); in got_BlockAck()
5697 if (!peer_device) in got_BlockAck()
5699 device = peer_device->device; in got_BlockAck()
5701 update_peer_seq(peer_device, be32_to_cpu(p->seq_num)); in got_BlockAck()
5704 drbd_set_in_sync(peer_device, sector, blksize); in got_BlockAck()
5705 dec_rs_pending(peer_device); in got_BlockAck()
5728 return validate_req_change_req_state(peer_device, p->block_id, sector, in got_BlockAck()
5735 struct drbd_peer_device *peer_device; in got_NegAck() local
5742 peer_device = conn_peer_device(connection, pi->vnr); in got_NegAck()
5743 if (!peer_device) in got_NegAck()
5745 device = peer_device->device; in got_NegAck()
5747 update_peer_seq(peer_device, be32_to_cpu(p->seq_num)); in got_NegAck()
5750 dec_rs_pending(peer_device); in got_NegAck()
5751 drbd_rs_failed_io(peer_device, sector, size); in got_NegAck()
5755 err = validate_req_change_req_state(peer_device, p->block_id, sector, in got_NegAck()
5764 drbd_set_out_of_sync(peer_device, sector, size); in got_NegAck()
5771 struct drbd_peer_device *peer_device; in got_NegDReply() local
5776 peer_device = conn_peer_device(connection, pi->vnr); in got_NegDReply()
5777 if (!peer_device) in got_NegDReply()
5779 device = peer_device->device; in got_NegDReply()
5781 update_peer_seq(peer_device, be32_to_cpu(p->seq_num)); in got_NegDReply()
5786 return validate_req_change_req_state(peer_device, p->block_id, sector, in got_NegDReply()
5793 struct drbd_peer_device *peer_device; in got_NegRSDReply() local
5799 peer_device = conn_peer_device(connection, pi->vnr); in got_NegRSDReply()
5800 if (!peer_device) in got_NegRSDReply()
5802 device = peer_device->device; in got_NegRSDReply()
5807 update_peer_seq(peer_device, be32_to_cpu(p->seq_num)); in got_NegRSDReply()
5809 dec_rs_pending(peer_device); in got_NegRSDReply()
5815 drbd_rs_failed_io(peer_device, sector, size); in got_NegRSDReply()
5831 struct drbd_peer_device *peer_device; in got_BarrierAck() local
5837 idr_for_each_entry(&connection->peer_devices, peer_device, vnr) { in got_BarrierAck()
5838 struct drbd_device *device = peer_device->device; in got_BarrierAck()
5854 struct drbd_peer_device *peer_device; in got_OVResult() local
5861 peer_device = conn_peer_device(connection, pi->vnr); in got_OVResult()
5862 if (!peer_device) in got_OVResult()
5864 device = peer_device->device; in got_OVResult()
5869 update_peer_seq(peer_device, be32_to_cpu(p->seq_num)); in got_OVResult()
5872 drbd_ov_out_of_sync_found(peer_device, sector, size); in got_OVResult()
5874 ov_out_of_sync_print(peer_device); in got_OVResult()
5880 dec_rs_pending(peer_device); in got_OVResult()
5886 drbd_advance_rs_marks(peer_device, device->ov_left); in got_OVResult()
5893 drbd_queue_work(&peer_device->connection->sender_work, &dw->w); in got_OVResult()
5896 ov_out_of_sync_print(peer_device); in got_OVResult()
5897 drbd_resync_finished(peer_device); in got_OVResult()
6099 struct drbd_peer_device *peer_device = in drbd_send_acks_wf() local
6101 struct drbd_connection *connection = peer_device->connection; in drbd_send_acks_wf()
6102 struct drbd_device *device = peer_device->device; in drbd_send_acks_wf()