md/raid1: introduce wait_for_serialization
authorGuoqing Jiang <guoqing.jiang@cloud.ionos.com>
Mon, 23 Dec 2019 09:49:02 +0000 (10:49 +0100)
committerSong Liu <songliubraving@fb.com>
Mon, 13 Jan 2020 19:44:10 +0000 (11:44 -0800)
commitd0d2d8ba0494655a01b97542c083e51b29cf8637
tree685b048c60c1bb7d88873645ebe3a46f0207eed7
parent025471f9f50fede6527c70336484becbcb2aff28
md/raid1: introduce wait_for_serialization

Previously, we call check_and_add_serial when serialization is
enabled for write IO, but it could allocate and free memory
back and forth.

Now, let's just get an element from memory pool with the new
function, then insert node to rb tree if no collision happens.

Signed-off-by: Guoqing Jiang <guoqing.jiang@cloud.ionos.com>
Signed-off-by: Song Liu <songliubraving@fb.com>
drivers/md/raid1.c