diff options
| author | Mikulas Patocka <mpatocka@redhat.com> | 2025-09-17 17:49:59 +0200 |
|---|---|---|
| committer | Mikulas Patocka <mpatocka@redhat.com> | 2025-09-23 14:50:56 +0200 |
| commit | e7151e225c043106c745b7eeb1370255ac8eb048 (patch) | |
| tree | 217fb3ce2e279a6db51ceaef3c59e68146b0b5cb | |
| parent | 4b9197ed60bb3929d39833075b4108b366453018 (diff) | |
dm-integrity: allocate the recalculate buffer with kmalloc
Allocate the recalculate buffer with kmalloc rather than vmalloc. This
will be needed later, for the simplification of the asynchronous hash
interface.
Signed-off-by: Mikulas Patocka <mpatocka@redhat.com>
| -rw-r--r-- | drivers/md/dm-integrity.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/drivers/md/dm-integrity.c b/drivers/md/dm-integrity.c index b7bfcb79b19a..ed119e3f574e 100644 --- a/drivers/md/dm-integrity.c +++ b/drivers/md/dm-integrity.c @@ -2998,7 +2998,7 @@ static void integrity_recalc(struct work_struct *w) unsigned recalc_sectors = RECALC_SECTORS; retry: - recalc_buffer = __vmalloc(recalc_sectors << SECTOR_SHIFT, GFP_NOIO); + recalc_buffer = kmalloc(recalc_sectors << SECTOR_SHIFT, GFP_NOIO | __GFP_NOWARN); if (!recalc_buffer) { oom: recalc_sectors >>= 1; @@ -3012,7 +3012,7 @@ oom: recalc_tags_size += ic->internal_hash_digestsize - ic->tag_size; recalc_tags = kvmalloc(recalc_tags_size, GFP_NOIO); if (!recalc_tags) { - vfree(recalc_buffer); + kfree(recalc_buffer); recalc_buffer = NULL; goto oom; } @@ -3078,7 +3078,7 @@ next_chunk: goto err; io_req.bi_opf = REQ_OP_READ; - io_req.mem.type = DM_IO_VMA; + io_req.mem.type = DM_IO_KMEM; io_req.mem.ptr.addr = recalc_buffer; io_req.notify.fn = NULL; io_req.client = ic->io; @@ -3136,7 +3136,7 @@ unlock_ret: recalc_write_super(ic); free_ret: - vfree(recalc_buffer); + kfree(recalc_buffer); kvfree(recalc_tags); } |
