struct delay_probe {
struct list_head list;
- int seq_num;
+ unsigned int seq_num;
struct timeval time;
};
char congestion_reason; /* Why we where congested... */
struct list_head delay_probes; /* protected by peer_seq_lock */
int data_delay; /* Delay of packets on the data-sock behind meta-sock */
- atomic_t delay_seq; /* To generate sequence numbers of delay probes */
+ unsigned int delay_seq; /* To generate sequence numbers of delay probes */
struct timeval dps_time; /* delay-probes-start-time */
- int dp_volume_last; /* send_cnt of last delay probe */
+ unsigned int dp_volume_last; /* send_cnt of last delay probe */
int c_sync_rate; /* current resync rate after delay_probe magic */
};
do_gettimeofday(&now);
offset = now.tv_usec - mdev->dps_time.tv_usec +
(now.tv_sec - mdev->dps_time.tv_sec) * 1000000;
- dp.seq_num = cpu_to_be32(atomic_read(&mdev->delay_seq));
+ dp.seq_num = cpu_to_be32(mdev->delay_seq);
dp.offset = cpu_to_be32(offset);
ok = _drbd_send_cmd(mdev, ds->socket, P_DELAY_PROBE,
static int drbd_send_delay_probes(struct drbd_conf *mdev)
{
int ok;
- atomic_inc(&mdev->delay_seq);
+
+ mdev->delay_seq++;
do_gettimeofday(&mdev->dps_time);
ok = drbd_send_delay_probe(mdev, &mdev->meta);
ok = ok && drbd_send_delay_probe(mdev, &mdev->data);
static void consider_delay_probes(struct drbd_conf *mdev)
{
- if (mdev->state.conn != C_SYNC_SOURCE)
+ if (mdev->state.conn != C_SYNC_SOURCE || mdev->agreed_pro_version < 93)
return;
if (mdev->dp_volume_last + mdev->sync_conf.dp_volume * 2 < mdev->send_cnt)
atomic_set(&mdev->net_cnt, 0);
atomic_set(&mdev->packet_seq, 0);
atomic_set(&mdev->pp_in_use, 0);
- atomic_set(&mdev->delay_seq, 0);
mutex_init(&mdev->md_io_mutex);
mutex_init(&mdev->data.mutex);
mdev->data_delay / 1000,
(mdev->data_delay % 1000) / 100);
else if (mdev->state.conn == C_SYNC_SOURCE)
- seq_printf(seq, " delay_probe: %d\n\t",
- atomic_read(&mdev->delay_seq));
+ seq_printf(seq, " delay_probe: %u\n\t", mdev->delay_seq);
/* see drivers/md/md.c
* We do not want to overflow, so the order of operands and