peer_req 230 drivers/block/drbd/drbd_debugfs.c static void seq_print_peer_request_flags(struct seq_file *m, struct drbd_peer_request *peer_req) peer_req 232 drivers/block/drbd/drbd_debugfs.c unsigned long f = peer_req->flags; peer_req 251 drivers/block/drbd/drbd_debugfs.c struct drbd_peer_request *peer_req; peer_req 252 drivers/block/drbd/drbd_debugfs.c list_for_each_entry(peer_req, lh, w.list) { peer_req 253 drivers/block/drbd/drbd_debugfs.c if (reported_preparing && !(peer_req->flags & EE_SUBMITTED)) peer_req 260 drivers/block/drbd/drbd_debugfs.c (unsigned long long)peer_req->i.sector, peer_req->i.size >> 9, peer_req 261 drivers/block/drbd/drbd_debugfs.c (peer_req->flags & EE_WRITE) ? 'W' : 'R', peer_req 262 drivers/block/drbd/drbd_debugfs.c jiffies_to_msecs(now - peer_req->submit_jif)); peer_req 263 drivers/block/drbd/drbd_debugfs.c seq_print_peer_request_flags(m, peer_req); peer_req 264 drivers/block/drbd/drbd_debugfs.c if (peer_req->flags & EE_SUBMITTED) peer_req 1544 drivers/block/drbd/drbd_int.h extern void drbd_endio_write_sec_final(struct drbd_peer_request *peer_req); peer_req 1715 drivers/block/drbd/drbd_int.h static inline int drbd_peer_req_has_active_page(struct drbd_peer_request *peer_req) peer_req 1717 drivers/block/drbd/drbd_int.h struct page *page = peer_req->pages; peer_req 1387 drivers/block/drbd/drbd_main.c struct drbd_peer_request *peer_req) peer_req 1390 drivers/block/drbd/drbd_main.c cpu_to_be64(peer_req->i.sector), peer_req 1391 drivers/block/drbd/drbd_main.c cpu_to_be32(peer_req->i.size), peer_req 1392 drivers/block/drbd/drbd_main.c peer_req->block_id); peer_req 1407 drivers/block/drbd/drbd_main.c struct drbd_peer_request *peer_req) peer_req 1416 drivers/block/drbd/drbd_main.c p->sector = cpu_to_be64(peer_req->i.sector); peer_req 1417 drivers/block/drbd/drbd_main.c p->blksize = cpu_to_be32(peer_req->i.size); peer_req 1632 drivers/block/drbd/drbd_main.c struct drbd_peer_request *peer_req) peer_req 1634 drivers/block/drbd/drbd_main.c struct page *page = peer_req->pages; peer_req 1635 drivers/block/drbd/drbd_main.c unsigned len = peer_req->i.size; peer_req 1781 drivers/block/drbd/drbd_main.c struct drbd_peer_request *peer_req) peer_req 1797 drivers/block/drbd/drbd_main.c p->sector = cpu_to_be64(peer_req->i.sector); peer_req 1798 drivers/block/drbd/drbd_main.c p->block_id = peer_req->block_id; peer_req 1802 drivers/block/drbd/drbd_main.c drbd_csum_ee(peer_device->connection->integrity_tfm, peer_req, p + 1); peer_req 1803 drivers/block/drbd/drbd_main.c err = __send_command(peer_device->connection, device->vnr, sock, cmd, sizeof(*p) + digest_size, NULL, peer_req->i.size); peer_req 1805 drivers/block/drbd/drbd_main.c err = _drbd_send_zc_ee(peer_device, peer_req); peer_req 194 drivers/block/drbd/drbd_receiver.c struct drbd_peer_request *peer_req, *tmp; peer_req 201 drivers/block/drbd/drbd_receiver.c list_for_each_entry_safe(peer_req, tmp, &device->net_ee, w.list) { peer_req 202 drivers/block/drbd/drbd_receiver.c if (drbd_peer_req_has_active_page(peer_req)) peer_req 204 drivers/block/drbd/drbd_receiver.c list_move(&peer_req->w.list, to_be_freed); peer_req 211 drivers/block/drbd/drbd_receiver.c struct drbd_peer_request *peer_req, *t; peer_req 216 drivers/block/drbd/drbd_receiver.c list_for_each_entry_safe(peer_req, t, &reclaimed, w.list) peer_req 217 drivers/block/drbd/drbd_receiver.c drbd_free_net_peer_req(device, peer_req); peer_req 362 drivers/block/drbd/drbd_receiver.c struct drbd_peer_request *peer_req; peer_req 369 drivers/block/drbd/drbd_receiver.c peer_req = mempool_alloc(&drbd_ee_mempool, gfp_mask & ~__GFP_HIGHMEM); peer_req 370 drivers/block/drbd/drbd_receiver.c if (!peer_req) { peer_req 383 drivers/block/drbd/drbd_receiver.c memset(peer_req, 0, sizeof(*peer_req)); peer_req 384 drivers/block/drbd/drbd_receiver.c INIT_LIST_HEAD(&peer_req->w.list); peer_req 385 drivers/block/drbd/drbd_receiver.c drbd_clear_interval(&peer_req->i); peer_req 386 drivers/block/drbd/drbd_receiver.c peer_req->i.size = request_size; peer_req 387 drivers/block/drbd/drbd_receiver.c peer_req->i.sector = sector; peer_req 388 drivers/block/drbd/drbd_receiver.c peer_req->submit_jif = jiffies; peer_req 389 drivers/block/drbd/drbd_receiver.c peer_req->peer_device = peer_device; peer_req 390 drivers/block/drbd/drbd_receiver.c peer_req->pages = page; peer_req 395 drivers/block/drbd/drbd_receiver.c peer_req->block_id = id; peer_req 397 drivers/block/drbd/drbd_receiver.c return peer_req; peer_req 400 drivers/block/drbd/drbd_receiver.c mempool_free(peer_req, &drbd_ee_mempool); peer_req 404 drivers/block/drbd/drbd_receiver.c void __drbd_free_peer_req(struct drbd_device *device, struct drbd_peer_request *peer_req, peer_req 408 drivers/block/drbd/drbd_receiver.c if (peer_req->flags & EE_HAS_DIGEST) peer_req 409 drivers/block/drbd/drbd_receiver.c kfree(peer_req->digest); peer_req 410 drivers/block/drbd/drbd_receiver.c drbd_free_pages(device, peer_req->pages, is_net); peer_req 411 drivers/block/drbd/drbd_receiver.c D_ASSERT(device, atomic_read(&peer_req->pending_bios) == 0); peer_req 412 drivers/block/drbd/drbd_receiver.c D_ASSERT(device, drbd_interval_empty(&peer_req->i)); peer_req 413 drivers/block/drbd/drbd_receiver.c if (!expect(!(peer_req->flags & EE_CALL_AL_COMPLETE_IO))) { peer_req 414 drivers/block/drbd/drbd_receiver.c peer_req->flags &= ~EE_CALL_AL_COMPLETE_IO; peer_req 415 drivers/block/drbd/drbd_receiver.c drbd_al_complete_io(device, &peer_req->i); peer_req 417 drivers/block/drbd/drbd_receiver.c mempool_free(peer_req, &drbd_ee_mempool); peer_req 423 drivers/block/drbd/drbd_receiver.c struct drbd_peer_request *peer_req, *t; peer_req 431 drivers/block/drbd/drbd_receiver.c list_for_each_entry_safe(peer_req, t, &work_list, w.list) { peer_req 432 drivers/block/drbd/drbd_receiver.c __drbd_free_peer_req(device, peer_req, is_net); peer_req 445 drivers/block/drbd/drbd_receiver.c struct drbd_peer_request *peer_req, *t; peer_req 453 drivers/block/drbd/drbd_receiver.c list_for_each_entry_safe(peer_req, t, &reclaimed, w.list) peer_req 454 drivers/block/drbd/drbd_receiver.c drbd_free_net_peer_req(device, peer_req); peer_req 460 drivers/block/drbd/drbd_receiver.c list_for_each_entry_safe(peer_req, t, &work_list, w.list) { peer_req 464 drivers/block/drbd/drbd_receiver.c err2 = peer_req->w.cb(&peer_req->w, !!err); peer_req 467 drivers/block/drbd/drbd_receiver.c drbd_free_peer_req(device, peer_req); peer_req 1592 drivers/block/drbd/drbd_receiver.c static void drbd_issue_peer_discard_or_zero_out(struct drbd_device *device, struct drbd_peer_request *peer_req) peer_req 1599 drivers/block/drbd/drbd_receiver.c peer_req->flags |= EE_ZEROOUT; peer_req 1601 drivers/block/drbd/drbd_receiver.c if (drbd_issue_discard_or_zero_out(device, peer_req->i.sector, peer_req 1602 drivers/block/drbd/drbd_receiver.c peer_req->i.size >> 9, peer_req->flags & (EE_ZEROOUT|EE_TRIM))) peer_req 1603 drivers/block/drbd/drbd_receiver.c peer_req->flags |= EE_WAS_ERROR; peer_req 1604 drivers/block/drbd/drbd_receiver.c drbd_endio_write_sec_final(peer_req); peer_req 1608 drivers/block/drbd/drbd_receiver.c struct drbd_peer_request *peer_req) peer_req 1611 drivers/block/drbd/drbd_receiver.c sector_t s = peer_req->i.sector; peer_req 1612 drivers/block/drbd/drbd_receiver.c sector_t nr = peer_req->i.size >> 9; peer_req 1613 drivers/block/drbd/drbd_receiver.c if (blkdev_issue_write_same(bdev, s, nr, GFP_NOIO, peer_req->pages)) peer_req 1614 drivers/block/drbd/drbd_receiver.c peer_req->flags |= EE_WAS_ERROR; peer_req 1615 drivers/block/drbd/drbd_receiver.c drbd_endio_write_sec_final(peer_req); peer_req 1637 drivers/block/drbd/drbd_receiver.c struct drbd_peer_request *peer_req, peer_req 1643 drivers/block/drbd/drbd_receiver.c struct page *page = peer_req->pages; peer_req 1644 drivers/block/drbd/drbd_receiver.c sector_t sector = peer_req->i.sector; peer_req 1645 drivers/block/drbd/drbd_receiver.c unsigned data_size = peer_req->i.size; peer_req 1656 drivers/block/drbd/drbd_receiver.c if (peer_req->flags & (EE_TRIM|EE_WRITE_SAME|EE_ZEROOUT)) { peer_req 1659 drivers/block/drbd/drbd_receiver.c conn_wait_active_ee_empty(peer_req->peer_device->connection); peer_req 1662 drivers/block/drbd/drbd_receiver.c peer_req->submit_jif = jiffies; peer_req 1663 drivers/block/drbd/drbd_receiver.c peer_req->flags |= EE_SUBMITTED; peer_req 1667 drivers/block/drbd/drbd_receiver.c if (list_empty(&peer_req->w.list)) { peer_req 1669 drivers/block/drbd/drbd_receiver.c list_add_tail(&peer_req->w.list, &device->active_ee); peer_req 1673 drivers/block/drbd/drbd_receiver.c if (peer_req->flags & (EE_TRIM|EE_ZEROOUT)) peer_req 1674 drivers/block/drbd/drbd_receiver.c drbd_issue_peer_discard_or_zero_out(device, peer_req); peer_req 1676 drivers/block/drbd/drbd_receiver.c drbd_issue_peer_wsame(device, peer_req); peer_req 1698 drivers/block/drbd/drbd_receiver.c bio->bi_private = peer_req; peer_req 1716 drivers/block/drbd/drbd_receiver.c atomic_set(&peer_req->pending_bios, n_bios); peer_req 1718 drivers/block/drbd/drbd_receiver.c peer_req->submit_jif = jiffies; peer_req 1719 drivers/block/drbd/drbd_receiver.c peer_req->flags |= EE_SUBMITTED; peer_req 1739 drivers/block/drbd/drbd_receiver.c struct drbd_peer_request *peer_req) peer_req 1741 drivers/block/drbd/drbd_receiver.c struct drbd_interval *i = &peer_req->i; peer_req 1863 drivers/block/drbd/drbd_receiver.c struct drbd_peer_request *peer_req; peer_req 1932 drivers/block/drbd/drbd_receiver.c peer_req = drbd_alloc_peer_req(peer_device, id, sector, ds, data_size, GFP_NOIO); peer_req 1933 drivers/block/drbd/drbd_receiver.c if (!peer_req) peer_req 1936 drivers/block/drbd/drbd_receiver.c peer_req->flags |= EE_WRITE; peer_req 1938 drivers/block/drbd/drbd_receiver.c peer_req->flags |= EE_TRIM; peer_req 1939 drivers/block/drbd/drbd_receiver.c return peer_req; peer_req 1942 drivers/block/drbd/drbd_receiver.c peer_req->flags |= EE_ZEROOUT; peer_req 1943 drivers/block/drbd/drbd_receiver.c return peer_req; peer_req 1946 drivers/block/drbd/drbd_receiver.c peer_req->flags |= EE_WRITE_SAME; peer_req 1950 drivers/block/drbd/drbd_receiver.c page = peer_req->pages; peer_req 1961 drivers/block/drbd/drbd_receiver.c drbd_free_peer_req(device, peer_req); peer_req 1968 drivers/block/drbd/drbd_receiver.c drbd_csum_ee_size(peer_device->connection->peer_integrity_tfm, peer_req, dig_vv, data_size); peer_req 1972 drivers/block/drbd/drbd_receiver.c drbd_free_peer_req(device, peer_req); peer_req 1977 drivers/block/drbd/drbd_receiver.c return peer_req; peer_req 2062 drivers/block/drbd/drbd_receiver.c struct drbd_peer_request *peer_req = peer_req 2064 drivers/block/drbd/drbd_receiver.c struct drbd_peer_device *peer_device = peer_req->peer_device; peer_req 2066 drivers/block/drbd/drbd_receiver.c sector_t sector = peer_req->i.sector; peer_req 2069 drivers/block/drbd/drbd_receiver.c D_ASSERT(device, drbd_interval_empty(&peer_req->i)); peer_req 2071 drivers/block/drbd/drbd_receiver.c if (likely((peer_req->flags & EE_WAS_ERROR) == 0)) { peer_req 2072 drivers/block/drbd/drbd_receiver.c drbd_set_in_sync(device, sector, peer_req->i.size); peer_req 2073 drivers/block/drbd/drbd_receiver.c err = drbd_send_ack(peer_device, P_RS_WRITE_ACK, peer_req); peer_req 2076 drivers/block/drbd/drbd_receiver.c drbd_rs_failed_io(device, sector, peer_req->i.size); peer_req 2078 drivers/block/drbd/drbd_receiver.c err = drbd_send_ack(peer_device, P_NEG_ACK, peer_req); peer_req 2089 drivers/block/drbd/drbd_receiver.c struct drbd_peer_request *peer_req; peer_req 2091 drivers/block/drbd/drbd_receiver.c peer_req = read_in_block(peer_device, ID_SYNCER, sector, pi); peer_req 2092 drivers/block/drbd/drbd_receiver.c if (!peer_req) peer_req 2101 drivers/block/drbd/drbd_receiver.c peer_req->w.cb = e_end_resync_block; peer_req 2102 drivers/block/drbd/drbd_receiver.c peer_req->submit_jif = jiffies; peer_req 2105 drivers/block/drbd/drbd_receiver.c list_add_tail(&peer_req->w.list, &device->sync_ee); peer_req 2109 drivers/block/drbd/drbd_receiver.c if (drbd_submit_peer_request(device, peer_req, REQ_OP_WRITE, 0, peer_req 2116 drivers/block/drbd/drbd_receiver.c list_del(&peer_req->w.list); peer_req 2119 drivers/block/drbd/drbd_receiver.c drbd_free_peer_req(device, peer_req); peer_req 2236 drivers/block/drbd/drbd_receiver.c struct drbd_peer_request *peer_req = peer_req 2238 drivers/block/drbd/drbd_receiver.c struct drbd_peer_device *peer_device = peer_req->peer_device; peer_req 2240 drivers/block/drbd/drbd_receiver.c sector_t sector = peer_req->i.sector; peer_req 2243 drivers/block/drbd/drbd_receiver.c if (peer_req->flags & EE_SEND_WRITE_ACK) { peer_req 2244 drivers/block/drbd/drbd_receiver.c if (likely((peer_req->flags & EE_WAS_ERROR) == 0)) { peer_req 2247 drivers/block/drbd/drbd_receiver.c peer_req->flags & EE_MAY_SET_IN_SYNC) ? peer_req 2249 drivers/block/drbd/drbd_receiver.c err = drbd_send_ack(peer_device, pcmd, peer_req); peer_req 2251 drivers/block/drbd/drbd_receiver.c drbd_set_in_sync(device, sector, peer_req->i.size); peer_req 2253 drivers/block/drbd/drbd_receiver.c err = drbd_send_ack(peer_device, P_NEG_ACK, peer_req); peer_req 2262 drivers/block/drbd/drbd_receiver.c if (peer_req->flags & EE_IN_INTERVAL_TREE) { peer_req 2264 drivers/block/drbd/drbd_receiver.c D_ASSERT(device, !drbd_interval_empty(&peer_req->i)); peer_req 2265 drivers/block/drbd/drbd_receiver.c drbd_remove_epoch_entry_interval(device, peer_req); peer_req 2266 drivers/block/drbd/drbd_receiver.c if (peer_req->flags & EE_RESTART_REQUESTS) peer_req 2267 drivers/block/drbd/drbd_receiver.c restart_conflicting_writes(device, sector, peer_req->i.size); peer_req 2270 drivers/block/drbd/drbd_receiver.c D_ASSERT(device, drbd_interval_empty(&peer_req->i)); peer_req 2272 drivers/block/drbd/drbd_receiver.c drbd_may_finish_epoch(peer_device->connection, peer_req->epoch, EV_PUT + (cancel ? EV_CLEANUP : 0)); peer_req 2279 drivers/block/drbd/drbd_receiver.c struct drbd_peer_request *peer_req = peer_req 2281 drivers/block/drbd/drbd_receiver.c struct drbd_peer_device *peer_device = peer_req->peer_device; peer_req 2284 drivers/block/drbd/drbd_receiver.c err = drbd_send_ack(peer_device, ack, peer_req); peer_req 2297 drivers/block/drbd/drbd_receiver.c struct drbd_peer_request *peer_req = peer_req 2299 drivers/block/drbd/drbd_receiver.c struct drbd_connection *connection = peer_req->peer_device->connection; peer_req 2342 drivers/block/drbd/drbd_receiver.c static bool overlapping_resync_write(struct drbd_device *device, struct drbd_peer_request *peer_req) peer_req 2349 drivers/block/drbd/drbd_receiver.c if (overlaps(peer_req->i.sector, peer_req->i.size, peer_req 2477 drivers/block/drbd/drbd_receiver.c struct drbd_peer_request *peer_req) peer_req 2479 drivers/block/drbd/drbd_receiver.c struct drbd_connection *connection = peer_req->peer_device->connection; peer_req 2481 drivers/block/drbd/drbd_receiver.c sector_t sector = peer_req->i.sector; peer_req 2482 drivers/block/drbd/drbd_receiver.c const unsigned int size = peer_req->i.size; peer_req 2491 drivers/block/drbd/drbd_receiver.c drbd_insert_interval(&device->write_requests, &peer_req->i); peer_req 2495 drivers/block/drbd/drbd_receiver.c if (i == &peer_req->i) peer_req 2531 drivers/block/drbd/drbd_receiver.c peer_req->w.cb = superseded ? e_send_superseded : peer_req 2533 drivers/block/drbd/drbd_receiver.c list_add_tail(&peer_req->w.list, &device->done_ee); peer_req 2534 drivers/block/drbd/drbd_receiver.c queue_work(connection->ack_sender, &peer_req->peer_device->send_acks_work); peer_req 2573 drivers/block/drbd/drbd_receiver.c peer_req->flags |= EE_RESTART_REQUESTS; peer_req 2580 drivers/block/drbd/drbd_receiver.c drbd_remove_epoch_entry_interval(device, peer_req); peer_req 2591 drivers/block/drbd/drbd_receiver.c struct drbd_peer_request *peer_req; peer_req 2622 drivers/block/drbd/drbd_receiver.c peer_req = read_in_block(peer_device, p->block_id, sector, pi); peer_req 2623 drivers/block/drbd/drbd_receiver.c if (!peer_req) { peer_req 2628 drivers/block/drbd/drbd_receiver.c peer_req->w.cb = e_end_block; peer_req 2629 drivers/block/drbd/drbd_receiver.c peer_req->submit_jif = jiffies; peer_req 2630 drivers/block/drbd/drbd_receiver.c peer_req->flags |= EE_APPLICATION; peer_req 2636 drivers/block/drbd/drbd_receiver.c D_ASSERT(peer_device, peer_req->i.size > 0); peer_req 2638 drivers/block/drbd/drbd_receiver.c D_ASSERT(peer_device, peer_req->pages == NULL); peer_req 2642 drivers/block/drbd/drbd_receiver.c peer_req->flags |= EE_ZEROOUT; peer_req 2644 drivers/block/drbd/drbd_receiver.c D_ASSERT(peer_device, peer_req->i.size > 0); peer_req 2646 drivers/block/drbd/drbd_receiver.c D_ASSERT(peer_device, peer_req->pages == NULL); peer_req 2649 drivers/block/drbd/drbd_receiver.c peer_req->flags |= EE_TRIM; peer_req 2650 drivers/block/drbd/drbd_receiver.c } else if (peer_req->pages == NULL) { peer_req 2651 drivers/block/drbd/drbd_receiver.c D_ASSERT(device, peer_req->i.size == 0); peer_req 2656 drivers/block/drbd/drbd_receiver.c peer_req->flags |= EE_MAY_SET_IN_SYNC; peer_req 2659 drivers/block/drbd/drbd_receiver.c peer_req->epoch = connection->current_epoch; peer_req 2660 drivers/block/drbd/drbd_receiver.c atomic_inc(&peer_req->epoch->epoch_size); peer_req 2661 drivers/block/drbd/drbd_receiver.c atomic_inc(&peer_req->epoch->active); peer_req 2680 drivers/block/drbd/drbd_receiver.c peer_req->flags |= EE_SEND_WRITE_ACK; peer_req 2689 drivers/block/drbd/drbd_receiver.c drbd_send_ack(peer_device, P_RECV_ACK, peer_req); peer_req 2695 drivers/block/drbd/drbd_receiver.c peer_req->flags |= EE_IN_INTERVAL_TREE; peer_req 2700 drivers/block/drbd/drbd_receiver.c err = handle_write_conflicts(device, peer_req); peer_req 2717 drivers/block/drbd/drbd_receiver.c if ((peer_req->flags & (EE_TRIM|EE_WRITE_SAME|EE_ZEROOUT)) == 0) peer_req 2718 drivers/block/drbd/drbd_receiver.c list_add_tail(&peer_req->w.list, &device->active_ee); peer_req 2722 drivers/block/drbd/drbd_receiver.c wait_event(device->ee_wait, !overlapping_resync_write(device, peer_req)); peer_req 2726 drivers/block/drbd/drbd_receiver.c drbd_set_out_of_sync(device, peer_req->i.sector, peer_req->i.size); peer_req 2727 drivers/block/drbd/drbd_receiver.c peer_req->flags &= ~EE_MAY_SET_IN_SYNC; peer_req 2728 drivers/block/drbd/drbd_receiver.c drbd_al_begin_io(device, &peer_req->i); peer_req 2729 drivers/block/drbd/drbd_receiver.c peer_req->flags |= EE_CALL_AL_COMPLETE_IO; peer_req 2732 drivers/block/drbd/drbd_receiver.c err = drbd_submit_peer_request(device, peer_req, op, op_flags, peer_req 2740 drivers/block/drbd/drbd_receiver.c list_del(&peer_req->w.list); peer_req 2741 drivers/block/drbd/drbd_receiver.c drbd_remove_epoch_entry_interval(device, peer_req); peer_req 2743 drivers/block/drbd/drbd_receiver.c if (peer_req->flags & EE_CALL_AL_COMPLETE_IO) { peer_req 2744 drivers/block/drbd/drbd_receiver.c peer_req->flags &= ~EE_CALL_AL_COMPLETE_IO; peer_req 2745 drivers/block/drbd/drbd_receiver.c drbd_al_complete_io(device, &peer_req->i); peer_req 2749 drivers/block/drbd/drbd_receiver.c drbd_may_finish_epoch(connection, peer_req->epoch, EV_PUT | EV_CLEANUP); peer_req 2751 drivers/block/drbd/drbd_receiver.c drbd_free_peer_req(device, peer_req); peer_req 2841 drivers/block/drbd/drbd_receiver.c struct drbd_peer_request *peer_req; peer_req 2898 drivers/block/drbd/drbd_receiver.c peer_req = drbd_alloc_peer_req(peer_device, p->block_id, sector, size, peer_req 2900 drivers/block/drbd/drbd_receiver.c if (!peer_req) { peer_req 2907 drivers/block/drbd/drbd_receiver.c peer_req->w.cb = w_e_end_data_req; peer_req 2910 drivers/block/drbd/drbd_receiver.c peer_req->flags |= EE_APPLICATION; peer_req 2918 drivers/block/drbd/drbd_receiver.c peer_req->flags |= EE_RS_THIN_REQ; peer_req 2921 drivers/block/drbd/drbd_receiver.c peer_req->w.cb = w_e_end_rsdata_req; peer_req 2937 drivers/block/drbd/drbd_receiver.c peer_req->digest = di; peer_req 2938 drivers/block/drbd/drbd_receiver.c peer_req->flags |= EE_HAS_DIGEST; peer_req 2945 drivers/block/drbd/drbd_receiver.c peer_req->w.cb = w_e_end_csum_rs_req; peer_req 2953 drivers/block/drbd/drbd_receiver.c peer_req->w.cb = w_e_end_ov_reply; peer_req 2977 drivers/block/drbd/drbd_receiver.c peer_req->w.cb = w_e_end_ov_req; peer_req 3013 drivers/block/drbd/drbd_receiver.c list_add_tail(&peer_req->w.list, &device->read_ee); peer_req 3030 drivers/block/drbd/drbd_receiver.c if (drbd_submit_peer_request(device, peer_req, REQ_OP_READ, 0, peer_req 3039 drivers/block/drbd/drbd_receiver.c list_del(&peer_req->w.list); peer_req 3044 drivers/block/drbd/drbd_receiver.c drbd_free_peer_req(device, peer_req); peer_req 5011 drivers/block/drbd/drbd_receiver.c struct drbd_peer_request *peer_req; peer_req 5014 drivers/block/drbd/drbd_receiver.c peer_req = drbd_alloc_peer_req(peer_device, ID_SYNCER, sector, peer_req 5016 drivers/block/drbd/drbd_receiver.c if (!peer_req) { peer_req 5021 drivers/block/drbd/drbd_receiver.c peer_req->w.cb = e_end_resync_block; peer_req 5022 drivers/block/drbd/drbd_receiver.c peer_req->submit_jif = jiffies; peer_req 5023 drivers/block/drbd/drbd_receiver.c peer_req->flags |= EE_TRIM; peer_req 5026 drivers/block/drbd/drbd_receiver.c list_add_tail(&peer_req->w.list, &device->sync_ee); peer_req 5030 drivers/block/drbd/drbd_receiver.c err = drbd_submit_peer_request(device, peer_req, op, 0, DRBD_FAULT_RS_WR); peer_req 5034 drivers/block/drbd/drbd_receiver.c list_del(&peer_req->w.list); peer_req 5037 drivers/block/drbd/drbd_receiver.c drbd_free_peer_req(device, peer_req); peer_req 80 drivers/block/drbd/drbd_worker.c static void drbd_endio_read_sec_final(struct drbd_peer_request *peer_req) __releases(local) peer_req 83 drivers/block/drbd/drbd_worker.c struct drbd_peer_device *peer_device = peer_req->peer_device; peer_req 87 drivers/block/drbd/drbd_worker.c device->read_cnt += peer_req->i.size >> 9; peer_req 88 drivers/block/drbd/drbd_worker.c list_del(&peer_req->w.list); peer_req 91 drivers/block/drbd/drbd_worker.c if (test_bit(__EE_WAS_ERROR, &peer_req->flags)) peer_req 95 drivers/block/drbd/drbd_worker.c drbd_queue_work(&peer_device->connection->sender_work, &peer_req->w); peer_req 101 drivers/block/drbd/drbd_worker.c void drbd_endio_write_sec_final(struct drbd_peer_request *peer_req) __releases(local) peer_req 104 drivers/block/drbd/drbd_worker.c struct drbd_peer_device *peer_device = peer_req->peer_device; peer_req 116 drivers/block/drbd/drbd_worker.c i = peer_req->i; peer_req 117 drivers/block/drbd/drbd_worker.c do_al_complete_io = peer_req->flags & EE_CALL_AL_COMPLETE_IO; peer_req 118 drivers/block/drbd/drbd_worker.c block_id = peer_req->block_id; peer_req 119 drivers/block/drbd/drbd_worker.c peer_req->flags &= ~EE_CALL_AL_COMPLETE_IO; peer_req 121 drivers/block/drbd/drbd_worker.c if (peer_req->flags & EE_WAS_ERROR) { peer_req 124 drivers/block/drbd/drbd_worker.c if (!__test_and_set_bit(__EE_SEND_WRITE_ACK, &peer_req->flags)) peer_req 126 drivers/block/drbd/drbd_worker.c drbd_set_out_of_sync(device, peer_req->i.sector, peer_req->i.size); peer_req 130 drivers/block/drbd/drbd_worker.c device->writ_cnt += peer_req->i.size >> 9; peer_req 131 drivers/block/drbd/drbd_worker.c list_move_tail(&peer_req->w.list, &device->done_ee); peer_req 145 drivers/block/drbd/drbd_worker.c if (peer_req->flags & EE_WAS_ERROR) peer_req 172 drivers/block/drbd/drbd_worker.c struct drbd_peer_request *peer_req = bio->bi_private; peer_req 173 drivers/block/drbd/drbd_worker.c struct drbd_device *device = peer_req->peer_device->device; peer_req 182 drivers/block/drbd/drbd_worker.c (unsigned long long)peer_req->i.sector); peer_req 185 drivers/block/drbd/drbd_worker.c set_bit(__EE_WAS_ERROR, &peer_req->flags); peer_req 188 drivers/block/drbd/drbd_worker.c if (atomic_dec_and_test(&peer_req->pending_bios)) { peer_req 190 drivers/block/drbd/drbd_worker.c drbd_endio_write_sec_final(peer_req); peer_req 192 drivers/block/drbd/drbd_worker.c drbd_endio_read_sec_final(peer_req); peer_req 286 drivers/block/drbd/drbd_worker.c void drbd_csum_ee(struct crypto_shash *tfm, struct drbd_peer_request *peer_req, void *digest) peer_req 289 drivers/block/drbd/drbd_worker.c struct page *page = peer_req->pages; peer_req 307 drivers/block/drbd/drbd_worker.c len = peer_req->i.size & (PAGE_SIZE - 1); peer_req 344 drivers/block/drbd/drbd_worker.c struct drbd_peer_request *peer_req = container_of(w, struct drbd_peer_request, w); peer_req 345 drivers/block/drbd/drbd_worker.c struct drbd_peer_device *peer_device = peer_req->peer_device; peer_req 354 drivers/block/drbd/drbd_worker.c if (unlikely((peer_req->flags & EE_WAS_ERROR) != 0)) peer_req 360 drivers/block/drbd/drbd_worker.c sector_t sector = peer_req->i.sector; peer_req 361 drivers/block/drbd/drbd_worker.c unsigned int size = peer_req->i.size; peer_req 362 drivers/block/drbd/drbd_worker.c drbd_csum_ee(peer_device->connection->csums_tfm, peer_req, digest); peer_req 368 drivers/block/drbd/drbd_worker.c drbd_free_peer_req(device, peer_req); peer_req 369 drivers/block/drbd/drbd_worker.c peer_req = NULL; peer_req 381 drivers/block/drbd/drbd_worker.c if (peer_req) peer_req 382 drivers/block/drbd/drbd_worker.c drbd_free_peer_req(device, peer_req); peer_req 394 drivers/block/drbd/drbd_worker.c struct drbd_peer_request *peer_req; peer_req 401 drivers/block/drbd/drbd_worker.c peer_req = drbd_alloc_peer_req(peer_device, ID_SYNCER /* unused */, sector, peer_req 403 drivers/block/drbd/drbd_worker.c if (!peer_req) peer_req 406 drivers/block/drbd/drbd_worker.c peer_req->w.cb = w_e_send_csum; peer_req 408 drivers/block/drbd/drbd_worker.c list_add_tail(&peer_req->w.list, &device->read_ee); peer_req 412 drivers/block/drbd/drbd_worker.c if (drbd_submit_peer_request(device, peer_req, REQ_OP_READ, 0, peer_req 421 drivers/block/drbd/drbd_worker.c list_del(&peer_req->w.list); peer_req 424 drivers/block/drbd/drbd_worker.c drbd_free_peer_req(device, peer_req); peer_req 1033 drivers/block/drbd/drbd_worker.c static void move_to_net_ee_or_free(struct drbd_device *device, struct drbd_peer_request *peer_req) peer_req 1035 drivers/block/drbd/drbd_worker.c if (drbd_peer_req_has_active_page(peer_req)) { peer_req 1037 drivers/block/drbd/drbd_worker.c int i = (peer_req->i.size + PAGE_SIZE -1) >> PAGE_SHIFT; peer_req 1041 drivers/block/drbd/drbd_worker.c list_add_tail(&peer_req->w.list, &device->net_ee); peer_req 1045 drivers/block/drbd/drbd_worker.c drbd_free_peer_req(device, peer_req); peer_req 1055 drivers/block/drbd/drbd_worker.c struct drbd_peer_request *peer_req = container_of(w, struct drbd_peer_request, w); peer_req 1056 drivers/block/drbd/drbd_worker.c struct drbd_peer_device *peer_device = peer_req->peer_device; peer_req 1061 drivers/block/drbd/drbd_worker.c drbd_free_peer_req(device, peer_req); peer_req 1066 drivers/block/drbd/drbd_worker.c if (likely((peer_req->flags & EE_WAS_ERROR) == 0)) { peer_req 1067 drivers/block/drbd/drbd_worker.c err = drbd_send_block(peer_device, P_DATA_REPLY, peer_req); peer_req 1071 drivers/block/drbd/drbd_worker.c (unsigned long long)peer_req->i.sector); peer_req 1073 drivers/block/drbd/drbd_worker.c err = drbd_send_ack(peer_device, P_NEG_DREPLY, peer_req); peer_req 1078 drivers/block/drbd/drbd_worker.c move_to_net_ee_or_free(device, peer_req); peer_req 1085 drivers/block/drbd/drbd_worker.c static bool all_zero(struct drbd_peer_request *peer_req) peer_req 1087 drivers/block/drbd/drbd_worker.c struct page *page = peer_req->pages; peer_req 1088 drivers/block/drbd/drbd_worker.c unsigned int len = peer_req->i.size; peer_req 1116 drivers/block/drbd/drbd_worker.c struct drbd_peer_request *peer_req = container_of(w, struct drbd_peer_request, w); peer_req 1117 drivers/block/drbd/drbd_worker.c struct drbd_peer_device *peer_device = peer_req->peer_device; peer_req 1122 drivers/block/drbd/drbd_worker.c drbd_free_peer_req(device, peer_req); peer_req 1128 drivers/block/drbd/drbd_worker.c drbd_rs_complete_io(device, peer_req->i.sector); peer_req 1133 drivers/block/drbd/drbd_worker.c err = drbd_send_ack(peer_device, P_RS_CANCEL, peer_req); peer_req 1134 drivers/block/drbd/drbd_worker.c } else if (likely((peer_req->flags & EE_WAS_ERROR) == 0)) { peer_req 1137 drivers/block/drbd/drbd_worker.c if (peer_req->flags & EE_RS_THIN_REQ && all_zero(peer_req)) peer_req 1138 drivers/block/drbd/drbd_worker.c err = drbd_send_rs_deallocated(peer_device, peer_req); peer_req 1140 drivers/block/drbd/drbd_worker.c err = drbd_send_block(peer_device, P_RS_DATA_REPLY, peer_req); peer_req 1150 drivers/block/drbd/drbd_worker.c (unsigned long long)peer_req->i.sector); peer_req 1152 drivers/block/drbd/drbd_worker.c err = drbd_send_ack(peer_device, P_NEG_RS_DREPLY, peer_req); peer_req 1155 drivers/block/drbd/drbd_worker.c drbd_rs_failed_io(device, peer_req->i.sector, peer_req->i.size); peer_req 1160 drivers/block/drbd/drbd_worker.c move_to_net_ee_or_free(device, peer_req); peer_req 1169 drivers/block/drbd/drbd_worker.c struct drbd_peer_request *peer_req = container_of(w, struct drbd_peer_request, w); peer_req 1170 drivers/block/drbd/drbd_worker.c struct drbd_peer_device *peer_device = peer_req->peer_device; peer_req 1178 drivers/block/drbd/drbd_worker.c drbd_free_peer_req(device, peer_req); peer_req 1184 drivers/block/drbd/drbd_worker.c drbd_rs_complete_io(device, peer_req->i.sector); peer_req 1188 drivers/block/drbd/drbd_worker.c di = peer_req->digest; peer_req 1190 drivers/block/drbd/drbd_worker.c if (likely((peer_req->flags & EE_WAS_ERROR) == 0)) { peer_req 1200 drivers/block/drbd/drbd_worker.c drbd_csum_ee(peer_device->connection->csums_tfm, peer_req, digest); peer_req 1206 drivers/block/drbd/drbd_worker.c drbd_set_in_sync(device, peer_req->i.sector, peer_req->i.size); peer_req 1208 drivers/block/drbd/drbd_worker.c device->rs_same_csum += peer_req->i.size >> BM_BLOCK_SHIFT; peer_req 1209 drivers/block/drbd/drbd_worker.c err = drbd_send_ack(peer_device, P_RS_IS_IN_SYNC, peer_req); peer_req 1212 drivers/block/drbd/drbd_worker.c peer_req->block_id = ID_SYNCER; /* By setting block_id, digest pointer becomes invalid! */ peer_req 1213 drivers/block/drbd/drbd_worker.c peer_req->flags &= ~EE_HAS_DIGEST; /* This peer request no longer has a digest pointer */ peer_req 1215 drivers/block/drbd/drbd_worker.c err = drbd_send_block(peer_device, P_RS_DATA_REPLY, peer_req); peer_req 1218 drivers/block/drbd/drbd_worker.c err = drbd_send_ack(peer_device, P_NEG_RS_DREPLY, peer_req); peer_req 1224 drivers/block/drbd/drbd_worker.c move_to_net_ee_or_free(device, peer_req); peer_req 1233 drivers/block/drbd/drbd_worker.c struct drbd_peer_request *peer_req = container_of(w, struct drbd_peer_request, w); peer_req 1234 drivers/block/drbd/drbd_worker.c struct drbd_peer_device *peer_device = peer_req->peer_device; peer_req 1236 drivers/block/drbd/drbd_worker.c sector_t sector = peer_req->i.sector; peer_req 1237 drivers/block/drbd/drbd_worker.c unsigned int size = peer_req->i.size; peer_req 1252 drivers/block/drbd/drbd_worker.c if (likely(!(peer_req->flags & EE_WAS_ERROR))) peer_req 1253 drivers/block/drbd/drbd_worker.c drbd_csum_ee(peer_device->connection->verify_tfm, peer_req, digest); peer_req 1262 drivers/block/drbd/drbd_worker.c drbd_free_peer_req(device, peer_req); peer_req 1263 drivers/block/drbd/drbd_worker.c peer_req = NULL; peer_req 1271 drivers/block/drbd/drbd_worker.c if (peer_req) peer_req 1272 drivers/block/drbd/drbd_worker.c drbd_free_peer_req(device, peer_req); peer_req 1290 drivers/block/drbd/drbd_worker.c struct drbd_peer_request *peer_req = container_of(w, struct drbd_peer_request, w); peer_req 1291 drivers/block/drbd/drbd_worker.c struct drbd_peer_device *peer_device = peer_req->peer_device; peer_req 1295 drivers/block/drbd/drbd_worker.c sector_t sector = peer_req->i.sector; peer_req 1296 drivers/block/drbd/drbd_worker.c unsigned int size = peer_req->i.size; peer_req 1302 drivers/block/drbd/drbd_worker.c drbd_free_peer_req(device, peer_req); peer_req 1310 drivers/block/drbd/drbd_worker.c drbd_rs_complete_io(device, peer_req->i.sector); peer_req 1314 drivers/block/drbd/drbd_worker.c di = peer_req->digest; peer_req 1316 drivers/block/drbd/drbd_worker.c if (likely((peer_req->flags & EE_WAS_ERROR) == 0)) { peer_req 1320 drivers/block/drbd/drbd_worker.c drbd_csum_ee(peer_device->connection->verify_tfm, peer_req, digest); peer_req 1333 drivers/block/drbd/drbd_worker.c drbd_free_peer_req(device, peer_req);