Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

dm bio prison: use rb_entry() rather than container_of()

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>

authored by

Geliang Tang and committed by
Mike Snitzer
6e333d0b 23d70c5e

+2 -2
+1 -1
drivers/md/dm-bio-prison-v1.c
··· 116 116 117 117 while (*new) { 118 118 struct dm_bio_prison_cell *cell = 119 - container_of(*new, struct dm_bio_prison_cell, node); 119 + rb_entry(*new, struct dm_bio_prison_cell, node); 120 120 121 121 r = cmp_keys(key, &cell->key); 122 122
+1 -1
drivers/md/dm-bio-prison-v2.c
··· 120 120 121 121 while (*new) { 122 122 struct dm_bio_prison_cell_v2 *cell = 123 - container_of(*new, struct dm_bio_prison_cell_v2, node); 123 + rb_entry(*new, struct dm_bio_prison_cell_v2, node); 124 124 125 125 r = cmp_keys(key, &cell->key); 126 126