diff mbox series

[3/4] null-blk: use memset_page() to fill page pattern

Message ID 20230329204652.52785-4-kch@nvidia.com (mailing list archive)
State New, archived
Headers show
Series [1/4] null_blk: use memcpy_page() in copy_to_nullb() | expand

Commit Message

Chaitanya Kulkarni March 29, 2023, 8:46 p.m. UTC
Use library helper memset_page() to set the buffer to 0xFF instead of
having duplicate code. This also removes deprecated API kmap_atomic()
from :include/linux/highmem.h:
"kmap_atomic - Atomically map a page for temporary usage - Deprecated!"

Signed-off-by: Chaitanya Kulkarni <kch@nvidia.com>
---
 drivers/block/null_blk/main.c | 6 +-----
 1 file changed, 1 insertion(+), 5 deletions(-)
diff mbox series

Patch

diff --git a/drivers/block/null_blk/main.c b/drivers/block/null_blk/main.c
index 2b344dcb4382..41da75a7f75e 100644
--- a/drivers/block/null_blk/main.c
+++ b/drivers/block/null_blk/main.c
@@ -1167,11 +1167,7 @@  static int copy_from_nullb(struct nullb *nullb, struct page *dest,
 static void nullb_fill_pattern(struct nullb *nullb, struct page *page,
 			       unsigned int len, unsigned int off)
 {
-	void *dst;
-
-	dst = kmap_atomic(page);
-	memset(dst + off, 0xFF, len);
-	kunmap_atomic(dst);
+	memset_page(page, off, 0xff, len);
 }
 
 blk_status_t null_handle_discard(struct nullb_device *dev,