forked from luck/tmp_suning_uos_patched
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>
This commit is contained in:
parent
23d70c5e52
commit
6e333d0be3
|
@ -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);
|
||||
|
||||
|
|
|
@ -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);
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user