summaryrefslogtreecommitdiff
path: root/drivers/md/dm-ebs-target.c
diff options
context:
space:
mode:
authorMikulas Patocka <mpatocka@redhat.com>2020-06-02 16:34:41 +0300
committerMike Snitzer <snitzer@redhat.com>2020-06-05 21:59:42 +0300
commit334b4fc17275667b38ebfd719714dab0edb83c6a (patch)
treedd6366b202e6c05c3c770014e6e73fe8cd69f77a /drivers/md/dm-ebs-target.c
parent33a180623b6c35f2727daecb63763955af3af1df (diff)
downloadlinux-334b4fc17275667b38ebfd719714dab0edb83c6a.tar.xz
dm ebs: use dm_bufio_forget_buffers
Use dm_bufio_forget_buffers instead of a block-by-block loop that calls dm_bufio_forget. dm_bufio_forget_buffers is faster than the loop because it searches for used buffers using rb-tree. Signed-off-by: Mikulas Patocka <mpatocka@redhat.com> Signed-off-by: Mike Snitzer <snitzer@redhat.com>
Diffstat (limited to 'drivers/md/dm-ebs-target.c')
-rw-r--r--drivers/md/dm-ebs-target.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/md/dm-ebs-target.c b/drivers/md/dm-ebs-target.c
index ae3f5fad3b39..44451276f128 100644
--- a/drivers/md/dm-ebs-target.c
+++ b/drivers/md/dm-ebs-target.c
@@ -167,8 +167,8 @@ static void __ebs_forget_bio(struct ebs_c *ec, struct bio *bio)
sector_t blocks, sector = bio->bi_iter.bi_sector;
blocks = __nr_blocks(ec, bio);
- for (; blocks--; sector += ec->u_bs)
- dm_bufio_forget(ec->bufio, __sector_to_block(ec, sector));
+
+ dm_bufio_forget_buffers(ec->bufio, __sector_to_block(ec, sector), blocks);
}
/* Worker funtion to process incoming bios. */