Commit 8050e6d0 authored by Andreas Gruenbacher's avatar Andreas Gruenbacher Committed by Philipp Reisner

drbd: Use container_of() instead of casting

Signed-off-by: default avatarPhilipp Reisner <philipp.reisner@linbit.com>
Signed-off-by: default avatarLars Ellenberg <lars.ellenberg@linbit.com>
parent 9676c760
...@@ -1455,7 +1455,8 @@ static int recv_dless_read(struct drbd_conf *mdev, struct drbd_request *req, ...@@ -1455,7 +1455,8 @@ static int recv_dless_read(struct drbd_conf *mdev, struct drbd_request *req,
* drbd_process_done_ee() by asender only */ * drbd_process_done_ee() by asender only */
static int e_end_resync_block(struct drbd_work *w, int unused) static int e_end_resync_block(struct drbd_work *w, int unused)
{ {
struct drbd_peer_request *peer_req = (struct drbd_peer_request *)w; struct drbd_peer_request *peer_req =
container_of(w, struct drbd_peer_request, w);
struct drbd_conf *mdev = w->mdev; struct drbd_conf *mdev = w->mdev;
sector_t sector = peer_req->i.sector; sector_t sector = peer_req->i.sector;
int ok; int ok;
...@@ -1593,7 +1594,8 @@ static int receive_RSDataReply(struct drbd_conf *mdev, enum drbd_packet cmd, ...@@ -1593,7 +1594,8 @@ static int receive_RSDataReply(struct drbd_conf *mdev, enum drbd_packet cmd,
*/ */
static int e_end_block(struct drbd_work *w, int cancel) static int e_end_block(struct drbd_work *w, int cancel)
{ {
struct drbd_peer_request *peer_req = (struct drbd_peer_request *)w; struct drbd_peer_request *peer_req =
container_of(w, struct drbd_peer_request, w);
struct drbd_conf *mdev = w->mdev; struct drbd_conf *mdev = w->mdev;
sector_t sector = peer_req->i.sector; sector_t sector = peer_req->i.sector;
int ok = 1, pcmd; int ok = 1, pcmd;
...@@ -1631,7 +1633,8 @@ static int e_end_block(struct drbd_work *w, int cancel) ...@@ -1631,7 +1633,8 @@ static int e_end_block(struct drbd_work *w, int cancel)
static int e_send_discard_ack(struct drbd_work *w, int unused) static int e_send_discard_ack(struct drbd_work *w, int unused)
{ {
struct drbd_peer_request *peer_req = (struct drbd_peer_request *)w; struct drbd_peer_request *peer_req =
container_of(w, struct drbd_peer_request, w);
struct drbd_conf *mdev = w->mdev; struct drbd_conf *mdev = w->mdev;
int ok = 1; int ok = 1;
......
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