Commit 9c282c29 authored by Guobin Huang's avatar Guobin Huang Committed by Jens Axboe

drbd: use DEFINE_SPINLOCK() for spinlock

spinlock can be initialized automatically with DEFINE_SPINLOCK()
rather than explicitly calling spin_lock_init().
Reported-by: default avatarHulk Robot <hulkci@huawei.com>
Signed-off-by: default avatarGuobin Huang <huangguobin4@huawei.com>
Link: https://lore.kernel.org/r/1617710988-49205-1-git-send-email-huangguobin4@huawei.comSigned-off-by: default avatarJens Axboe <axboe@kernel.dk>
parent b60b270b
...@@ -125,7 +125,7 @@ struct bio_set drbd_io_bio_set; ...@@ -125,7 +125,7 @@ struct bio_set drbd_io_bio_set;
member of struct page. member of struct page.
*/ */
struct page *drbd_pp_pool; struct page *drbd_pp_pool;
spinlock_t drbd_pp_lock; DEFINE_SPINLOCK(drbd_pp_lock);
int drbd_pp_vacant; int drbd_pp_vacant;
wait_queue_head_t drbd_pp_wait; wait_queue_head_t drbd_pp_wait;
...@@ -2160,9 +2160,6 @@ static int drbd_create_mempools(void) ...@@ -2160,9 +2160,6 @@ static int drbd_create_mempools(void)
if (ret) if (ret)
goto Enomem; goto Enomem;
/* drbd's page pool */
spin_lock_init(&drbd_pp_lock);
for (i = 0; i < number; i++) { for (i = 0; i < number; i++) {
page = alloc_page(GFP_HIGHUSER); page = alloc_page(GFP_HIGHUSER);
if (!page) if (!page)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment