Skip to content

Commit

Permalink
drbd: Use container_of() instead of casting
Browse files Browse the repository at this point in the history
Signed-off-by: Philipp Reisner <philipp.reisner@linbit.com>
Signed-off-by: Lars Ellenberg <lars.ellenberg@linbit.com>
  • Loading branch information
Andreas Gruenbacher authored and Philipp Reisner committed Oct 14, 2011
1 parent 9676c76 commit 8050e6d
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions drivers/block/drbd/drbd_receiver.c
Original file line number Diff line number Diff line change
Expand Up @@ -1455,7 +1455,8 @@ static int recv_dless_read(struct drbd_conf *mdev, struct drbd_request *req,
* drbd_process_done_ee() by asender only */
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;
sector_t sector = peer_req->i.sector;
int ok;
Expand Down Expand Up @@ -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)
{
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;
sector_t sector = peer_req->i.sector;
int ok = 1, pcmd;
Expand Down Expand Up @@ -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)
{
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;
int ok = 1;

Expand Down

0 comments on commit 8050e6d

Please sign in to comment.