Skip to content

Commit

Permalink
dm bio prison: use rb_entry() rather than container_of()
Browse files Browse the repository at this point in the history
To make the code clearer, use rb_entry() instead of container_of() to
deal with rbtree.

Signed-off-by: Geliang Tang <geliangtang@gmail.com>
Acked-by: Coly Li <colyli@suse.de>
Signed-off-by: Mike Snitzer <snitzer@redhat.com>
  • Loading branch information
Geliang Tang authored and Mike Snitzer committed Jun 19, 2017
1 parent 23d70c5 commit 6e333d0
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion drivers/md/dm-bio-prison-v1.c
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ static int __bio_detain(struct dm_bio_prison *prison,

while (*new) {
struct dm_bio_prison_cell *cell =
container_of(*new, struct dm_bio_prison_cell, node);
rb_entry(*new, struct dm_bio_prison_cell, node);

r = cmp_keys(key, &cell->key);

Expand Down
2 changes: 1 addition & 1 deletion drivers/md/dm-bio-prison-v2.c
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ static bool __find_or_insert(struct dm_bio_prison_v2 *prison,

while (*new) {
struct dm_bio_prison_cell_v2 *cell =
container_of(*new, struct dm_bio_prison_cell_v2, node);
rb_entry(*new, struct dm_bio_prison_cell_v2, node);

r = cmp_keys(key, &cell->key);

Expand Down

0 comments on commit 6e333d0

Please sign in to comment.