These are the same thing since mr always comes from odp->private. It is confusing to reference the same memory via two names.
Unified · Split
| @@ -601,7 +601,7 @@ next_mr: · 600 unmodified lines | |||
| 601 | start_idx = (io_virt - (mr->mmkey.iova & page_mask)) >> page_shift; | 601 | start_idx = (io_virt - (mr->mmkey.iova & page_mask)) >> page_shift; |
| 602 | access_mask = ODP_READ_ALLOWED_BIT; | 602 | access_mask = ODP_READ_ALLOWED_BIT; |
| 603 | 603 | ||
| 604 | if (prefetch && !downgrade && !mr->umem->writable) { | 604 | if (prefetch && !downgrade && !odp->umem.writable) { |
| 605 | /* prefetch with write-access must | 605 | /* prefetch with write-access must |
| 606 | * be supported by the MR | 606 | * be supported by the MR |
| 607 | */ | 607 | */ |
| @@ -609,7 +609,7 @@ next_mr: · 1 unmodified line | |||
| 609 | goto out; | 609 | goto out; |
| 610 | } | 610 | } |
| 611 | 611 | ||
| 612 | if (mr->umem->writable && !downgrade) | 612 | if (odp->umem.writable && !downgrade) |
| 613 | access_mask |= ODP_WRITE_ALLOWED_BIT; | 613 | access_mask |= ODP_WRITE_ALLOWED_BIT; |
| 614 | 614 | ||
| 615 | current_seq = READ_ONCE(odp->notifiers_seq); | 615 | current_seq = READ_ONCE(odp->notifiers_seq); |
| @@ -619,8 +619,8 @@ next_mr: · 3 unmodified lines | |||
| 619 | */ | 619 | */ |
| 620 | smp_rmb(); | 620 | smp_rmb(); |
| 621 | 621 | ||
| 622 | ret = ib_umem_odp_map_dma_pages(to_ib_umem_odp(mr->umem), io_virt, size, | 622 | ret = ib_umem_odp_map_dma_pages(odp, io_virt, size, access_mask, |
| 623 | access_mask, current_seq); | 623 | current_seq); |
| 624 | 624 | ||
| 625 | if (ret < 0) | 625 | if (ret < 0) |
| 626 | goto out; | 626 | goto out; |
| @@ -628,8 +628,7 @@ next_mr: · 1 unmodified line | |||
| 628 | np = ret; | 628 | np = ret; |
| 629 | 629 | ||
| 630 | mutex_lock(&odp->umem_mutex); | 630 | mutex_lock(&odp->umem_mutex); |
| 631 | if (!ib_umem_mmu_notifier_retry(to_ib_umem_odp(mr->umem), | 631 | if (!ib_umem_mmu_notifier_retry(odp, current_seq)) { |
| 632 | current_seq)) { | ||
| 633 | /* | 632 | /* |
| 634 | * No need to check whether the MTTs really belong to | 633 | * No need to check whether the MTTs really belong to |
| 635 | * this MR, since ib_umem_odp_map_dma_pages already | 634 | * this MR, since ib_umem_odp_map_dma_pages already |