Commit 8ccf218e authored by Andreas Gruenbacher's avatar Andreas Gruenbacher Committed by Philipp Reisner

drbd: Replace atomic_add_return with atomic_inc_return

Signed-off-by: default avatarPhilipp Reisner <philipp.reisner@linbit.com>
Signed-off-by: default avatarLars Ellenberg <lars.ellenberg@linbit.com>
parent 206d3589
...@@ -1242,7 +1242,7 @@ static int _drbd_send_ack(struct drbd_conf *mdev, enum drbd_packet cmd, ...@@ -1242,7 +1242,7 @@ static int _drbd_send_ack(struct drbd_conf *mdev, enum drbd_packet cmd,
p.sector = sector; p.sector = sector;
p.block_id = block_id; p.block_id = block_id;
p.blksize = blksize; p.blksize = blksize;
p.seq_num = cpu_to_be32(atomic_add_return(1, &mdev->packet_seq)); p.seq_num = cpu_to_be32(atomic_inc_return(&mdev->packet_seq));
if (!mdev->tconn->meta.socket || mdev->state.conn < C_CONNECTED) if (!mdev->tconn->meta.socket || mdev->state.conn < C_CONNECTED)
return false; return false;
...@@ -1530,7 +1530,7 @@ int drbd_send_dblock(struct drbd_conf *mdev, struct drbd_request *req) ...@@ -1530,7 +1530,7 @@ int drbd_send_dblock(struct drbd_conf *mdev, struct drbd_request *req)
prepare_header(mdev, &p.head, P_DATA, sizeof(p) - sizeof(struct p_header) + dgs + req->i.size); prepare_header(mdev, &p.head, P_DATA, sizeof(p) - sizeof(struct p_header) + dgs + req->i.size);
p.sector = cpu_to_be64(req->i.sector); p.sector = cpu_to_be64(req->i.sector);
p.block_id = (unsigned long)req; p.block_id = (unsigned long)req;
p.seq_num = cpu_to_be32(req->seq_num = atomic_add_return(1, &mdev->packet_seq)); p.seq_num = cpu_to_be32(req->seq_num = atomic_inc_return(&mdev->packet_seq));
dp_flags = bio_flags_to_wire(mdev, req->master_bio->bi_rw); dp_flags = bio_flags_to_wire(mdev, req->master_bio->bi_rw);
......
...@@ -2374,7 +2374,7 @@ void drbd_bcast_state(struct drbd_conf *mdev, union drbd_state state) ...@@ -2374,7 +2374,7 @@ void drbd_bcast_state(struct drbd_conf *mdev, union drbd_state state)
cn_reply->id.idx = CN_IDX_DRBD; cn_reply->id.idx = CN_IDX_DRBD;
cn_reply->id.val = CN_VAL_DRBD; cn_reply->id.val = CN_VAL_DRBD;
cn_reply->seq = atomic_add_return(1, &drbd_nl_seq); cn_reply->seq = atomic_inc_return(&drbd_nl_seq);
cn_reply->ack = 0; /* not used here. */ cn_reply->ack = 0; /* not used here. */
cn_reply->len = sizeof(struct drbd_nl_cfg_reply) + cn_reply->len = sizeof(struct drbd_nl_cfg_reply) +
(int)((char *)tl - (char *)reply->tag_list); (int)((char *)tl - (char *)reply->tag_list);
...@@ -2406,7 +2406,7 @@ void drbd_bcast_ev_helper(struct drbd_conf *mdev, char *helper_name) ...@@ -2406,7 +2406,7 @@ void drbd_bcast_ev_helper(struct drbd_conf *mdev, char *helper_name)
cn_reply->id.idx = CN_IDX_DRBD; cn_reply->id.idx = CN_IDX_DRBD;
cn_reply->id.val = CN_VAL_DRBD; cn_reply->id.val = CN_VAL_DRBD;
cn_reply->seq = atomic_add_return(1, &drbd_nl_seq); cn_reply->seq = atomic_inc_return(&drbd_nl_seq);
cn_reply->ack = 0; /* not used here. */ cn_reply->ack = 0; /* not used here. */
cn_reply->len = sizeof(struct drbd_nl_cfg_reply) + cn_reply->len = sizeof(struct drbd_nl_cfg_reply) +
(int)((char *)tl - (char *)reply->tag_list); (int)((char *)tl - (char *)reply->tag_list);
...@@ -2485,7 +2485,7 @@ void drbd_bcast_ee(struct drbd_conf *mdev, const char *reason, const int dgs, ...@@ -2485,7 +2485,7 @@ void drbd_bcast_ee(struct drbd_conf *mdev, const char *reason, const int dgs,
cn_reply->id.idx = CN_IDX_DRBD; cn_reply->id.idx = CN_IDX_DRBD;
cn_reply->id.val = CN_VAL_DRBD; cn_reply->id.val = CN_VAL_DRBD;
cn_reply->seq = atomic_add_return(1,&drbd_nl_seq); cn_reply->seq = atomic_inc_return(&drbd_nl_seq);
cn_reply->ack = 0; // not used here. cn_reply->ack = 0; // not used here.
cn_reply->len = sizeof(struct drbd_nl_cfg_reply) + cn_reply->len = sizeof(struct drbd_nl_cfg_reply) +
(int)((char*)tl - (char*)reply->tag_list); (int)((char*)tl - (char*)reply->tag_list);
...@@ -2524,7 +2524,7 @@ void drbd_bcast_sync_progress(struct drbd_conf *mdev) ...@@ -2524,7 +2524,7 @@ void drbd_bcast_sync_progress(struct drbd_conf *mdev)
cn_reply->id.idx = CN_IDX_DRBD; cn_reply->id.idx = CN_IDX_DRBD;
cn_reply->id.val = CN_VAL_DRBD; cn_reply->id.val = CN_VAL_DRBD;
cn_reply->seq = atomic_add_return(1, &drbd_nl_seq); cn_reply->seq = atomic_inc_return(&drbd_nl_seq);
cn_reply->ack = 0; /* not used here. */ cn_reply->ack = 0; /* not used here. */
cn_reply->len = sizeof(struct drbd_nl_cfg_reply) + cn_reply->len = sizeof(struct drbd_nl_cfg_reply) +
(int)((char *)tl - (char *)reply->tag_list); (int)((char *)tl - (char *)reply->tag_list);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment