static void queue_barrier(struct drbd_conf *mdev) { struct drbd_tl_epoch *b; if (test_bit(CREATE_BARRIER, &mdev->flags)) return; b = mdev->newest_tle; b->w.cb = w_send_barrier; inc_ap_pending(mdev); drbd_queue_work(&mdev->data.work, &b->w); set_bit(CREATE_BARRIER, &mdev->flags); }
static void queue_barrier(struct drbd_conf *mdev) { struct drbd_tl_epoch *b; /* We are within the req_lock. Once we queued the barrier for sending, * we set the CREATE_BARRIER bit. It is cleared as soon as a new * barrier/epoch object is added. This is the only place this bit is * set. It indicates that the barrier for this epoch is already queued, * and no new epoch has been created yet. */ if (test_bit(CREATE_BARRIER, &mdev->flags)) return; b = mdev->newest_tle; b->w.cb = w_send_barrier; /* inc_ap_pending done here, so we won't * get imbalanced on connection loss. * dec_ap_pending will be done in got_BarrierAck * or (on connection loss) in tl_clear. */ inc_ap_pending(mdev); drbd_queue_work(&mdev->data.work, &b->w); set_bit(CREATE_BARRIER, &mdev->flags); }