diff options
-rw-r--r-- | lib/dma.c | 2 | ||||
-rw-r--r-- | lib/dma.h | 3 | ||||
-rw-r--r-- | test/unit-tests.c | 1 |
3 files changed, 0 insertions, 6 deletions
@@ -172,8 +172,6 @@ MOCK_DEFINE(dma_controller_remove_region)(dma_controller_t *dma, dma->vfu_ctx->in_cb = CB_NONE; } - assert(region->refcnt == 0); - if (region->info.vaddr != NULL) { dma_controller_unmap_region(dma, region); } else { @@ -96,7 +96,6 @@ typedef struct { vfu_dma_info_t info; int fd; // File descriptor to mmap off_t offset; // File offset - int refcnt; // Number of users of this region char *dirty_bitmap; // Dirty page bitmap } dma_memory_region_t; @@ -255,7 +254,6 @@ dma_map_sg(dma_controller_t *dma, dma_sg_t *sg, struct iovec *iov, sg->dma_addr + sg->offset + sg->length); iov->iov_base = region->info.vaddr + sg->offset; iov->iov_len = sg->length; - region->refcnt++; sg++; iov++; @@ -326,7 +324,6 @@ dma_unmap_sg(dma_controller_t *dma, dma_sg_t *sg, int cnt) vfu_log(dma->vfu_ctx, LOG_DEBUG, "unmap %p-%p", sg->dma_addr + sg->offset, sg->dma_addr + sg->offset + sg->length); - r->refcnt--; sg++; } while (--cnt > 0); } diff --git a/test/unit-tests.c b/test/unit-tests.c index 6b16fe6..97b06f1 100644 --- a/test/unit-tests.c +++ b/test/unit-tests.c @@ -267,7 +267,6 @@ test_dma_controller_add_region_no_fd(void **state UNUSED) assert_int_equal(0x1000, r->info.page_size); assert_int_equal(offset, r->offset); assert_int_equal(fd, r->fd); - assert_int_equal(0, r->refcnt); assert_int_equal(PROT_NONE, r->info.prot); } |