Commit ea1db79
ublk: refactor common helper ublk_shmem_remove_ranges()
Extract the shared walk+erase+unpin+kfree loop into
ublk_shmem_remove_ranges(). When buf_index >= 0, only ranges matching
that index are removed; when buf_index < 0, all ranges are removed.
Also extract ublk_unpin_range_pages() to share the page unpinning
loop.
Convert both __ublk_ctrl_unreg_buf() and ublk_buf_cleanup() to use
the new helper.
Signed-off-by: Ming Lei <tom.leiming@gmail.com>
Link: https://patch.msgid.link/20260423033058.2805135-3-tom.leiming@gmail.com
Signed-off-by: Jens Axboe <axboe@kernel.dk>1 parent 47903fa commit ea1db79
1 file changed
Lines changed: 29 additions & 40 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5421 | 5421 | | |
5422 | 5422 | | |
5423 | 5423 | | |
5424 | | - | |
| 5424 | + | |
| 5425 | + | |
| 5426 | + | |
| 5427 | + | |
| 5428 | + | |
| 5429 | + | |
| 5430 | + | |
| 5431 | + | |
| 5432 | + | |
| 5433 | + | |
| 5434 | + | |
| 5435 | + | |
| 5436 | + | |
| 5437 | + | |
| 5438 | + | |
| 5439 | + | |
| 5440 | + | |
| 5441 | + | |
| 5442 | + | |
| 5443 | + | |
| 5444 | + | |
| 5445 | + | |
| 5446 | + | |
| 5447 | + | |
5425 | 5448 | | |
5426 | 5449 | | |
5427 | 5450 | | |
5428 | | - | |
5429 | 5451 | | |
5430 | 5452 | | |
5431 | 5453 | | |
5432 | 5454 | | |
5433 | | - | |
| 5455 | + | |
5434 | 5456 | | |
5435 | | - | |
| 5457 | + | |
5436 | 5458 | | |
5437 | 5459 | | |
5438 | 5460 | | |
5439 | 5461 | | |
5440 | 5462 | | |
5441 | 5463 | | |
5442 | 5464 | | |
5443 | | - | |
5444 | | - | |
5445 | | - | |
5446 | | - | |
5447 | | - | |
5448 | | - | |
5449 | | - | |
5450 | | - | |
5451 | | - | |
5452 | | - | |
| 5465 | + | |
5453 | 5466 | | |
5454 | 5467 | | |
5455 | 5468 | | |
| |||
5472 | 5485 | | |
5473 | 5486 | | |
5474 | 5487 | | |
5475 | | - | |
| 5488 | + | |
5476 | 5489 | | |
5477 | 5490 | | |
5478 | 5491 | | |
| |||
5482 | 5495 | | |
5483 | 5496 | | |
5484 | 5497 | | |
5485 | | - | |
5486 | | - | |
5487 | | - | |
5488 | | - | |
5489 | | - | |
5490 | | - | |
5491 | | - | |
5492 | | - | |
5493 | | - | |
5494 | | - | |
5495 | | - | |
5496 | | - | |
5497 | | - | |
5498 | | - | |
5499 | | - | |
5500 | | - | |
5501 | | - | |
5502 | | - | |
5503 | | - | |
5504 | | - | |
5505 | | - | |
5506 | | - | |
5507 | | - | |
5508 | | - | |
5509 | | - | |
| 5498 | + | |
5510 | 5499 | | |
5511 | 5500 | | |
5512 | 5501 | | |
| |||
0 commit comments