Lines Matching refs:epoch
1352 * drbd_may_finish_epoch() - Applies an epoch_event to the epoch's state, eventually finishes it.
1354 * @epoch: Epoch object.
1358 struct drbd_epoch *epoch,
1369 epoch_size = atomic_read(&epoch->epoch_size);
1373 atomic_dec(&epoch->active);
1376 set_bit(DE_HAVE_BARRIER_NUMBER, &epoch->flags);
1384 atomic_read(&epoch->active) == 0 &&
1385 (test_bit(DE_HAVE_BARRIER_NUMBER, &epoch->flags) || ev & EV_CLEANUP)) {
1388 drbd_send_b_ack(epoch->connection, epoch->barrier_nr, epoch_size);
1394 if (test_bit(DE_HAVE_BARRIER_NUMBER, &epoch->flags))
1395 dec_unacked(epoch->connection);
1398 if (connection->current_epoch != epoch) {
1399 next_epoch = list_entry(epoch->list.next, struct drbd_epoch, list);
1400 list_del(&epoch->list);
1403 kfree(epoch);
1408 epoch->flags = 0;
1409 atomic_set(&epoch->epoch_size, 0);
1410 /* atomic_set(&epoch->active, 0); is already zero */
1419 epoch = next_epoch;
1774 struct drbd_epoch *epoch;
1795 epoch = kmalloc(sizeof(struct drbd_epoch), GFP_NOIO);
1796 if (epoch)
1799 drbd_warn(connection, "Allocation of an epoch failed, slowing down\n");
1808 epoch = kmalloc(sizeof(struct drbd_epoch), GFP_NOIO);
1809 if (epoch)
1820 epoch->flags = 0;
1821 atomic_set(&epoch->epoch_size, 0);
1822 atomic_set(&epoch->active, 0);
1826 list_add(&epoch->list, &connection->current_epoch->list);
1827 connection->current_epoch = epoch;
1831 kfree(epoch);
2273 drbd_may_finish_epoch(peer_device->connection, peer_req->epoch, EV_PUT + (cancel ? EV_CLEANUP : 0));
2660 peer_req->epoch = connection->current_epoch;
2661 atomic_inc(&peer_req->epoch->epoch_size);
2662 atomic_inc(&peer_req->epoch->active);
2750 drbd_may_finish_epoch(connection, peer_req->epoch, EV_PUT | EV_CLEANUP);