Skip to content

Commit

Permalink
null_blk: use kmap_local_page() and kunmap_local()
Browse files Browse the repository at this point in the history
Replace the deprecated API kmap_atomic() and kunmap_atomic() with
kmap_local_page() and kunmap_local() in null_flush_cache_page().

Signed-off-by: Chaitanya Kulkarni <kch@nvidia.com>
Link: https://lore.kernel.org/r/20230330184926.64209-2-kch@nvidia.com
Signed-off-by: Jens Axboe <axboe@kernel.dk>
  • Loading branch information
Chaitanya Kulkarni authored and Jens Axboe committed Apr 2, 2023
1 parent fbb5615 commit acc3c87
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions drivers/block/null_blk/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -1030,8 +1030,8 @@ static int null_flush_cache_page(struct nullb *nullb, struct nullb_page *c_page)
if (!t_page)
return -ENOMEM;

src = kmap_atomic(c_page->page);
dst = kmap_atomic(t_page->page);
src = kmap_local_page(c_page->page);
dst = kmap_local_page(t_page->page);

for (i = 0; i < PAGE_SECTORS;
i += (nullb->dev->blocksize >> SECTOR_SHIFT)) {
Expand All @@ -1043,8 +1043,8 @@ static int null_flush_cache_page(struct nullb *nullb, struct nullb_page *c_page)
}
}

kunmap_atomic(dst);
kunmap_atomic(src);
kunmap_local(dst);
kunmap_local(src);

ret = radix_tree_delete_item(&nullb->dev->cache, idx, c_page);
null_free_page(ret);
Expand Down

0 comments on commit acc3c87

Please sign in to comment.