Skip to content

Commit

Permalink
dm bufio: use list_move
Browse files Browse the repository at this point in the history
Use list_move() instead of list_del() + list_add().

spatch with a semantic match was used to find this.
(http://coccinelle.lip6.fr/)

Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
Signed-off-by: Alasdair G Kergon <agk@redhat.com>
  • Loading branch information
Wei Yongjun authored and Alasdair G Kergon committed Oct 12, 2012
1 parent a71a261 commit 54499af
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions drivers/md/dm-bufio.c
Original file line number Diff line number Diff line change
Expand Up @@ -441,8 +441,7 @@ static void __relink_lru(struct dm_buffer *b, int dirty)
c->n_buffers[b->list_mode]--;
c->n_buffers[dirty]++;
b->list_mode = dirty;
list_del(&b->lru_list);
list_add(&b->lru_list, &c->lru[dirty]);
list_move(&b->lru_list, &c->lru[dirty]);
}

/*----------------------------------------------------------------
Expand Down

0 comments on commit 54499af

Please sign in to comment.