MM: use ihk_mc_{alloc/free}_pages() everywhere and fix free_pages() on kmalloc()ed object bug

This commit is contained in:
Balazs Gerofi
2016-08-17 18:02:05 +09:00
parent 01d2ea1605
commit f5857cfc9e
6 changed files with 39 additions and 42 deletions

View File

@@ -99,7 +99,7 @@ int devobj_create(int fd, size_t len, off_t off, struct memobj **objp, int *maxp
}
memset(obj, 0, sizeof(*obj));
obj->pfn_table = allocate_pages(pfn_npages, IHK_MC_AP_NOWAIT);
obj->pfn_table = ihk_mc_alloc_pages(pfn_npages, IHK_MC_AP_NOWAIT);
if (!obj->pfn_table) {
error = -ENOMEM;
kprintf("%s: error: fd: %d, len: %lu, off: %lu allocating PFN failed.\n",
@@ -141,7 +141,7 @@ int devobj_create(int fd, size_t len, off_t off, struct memobj **objp, int *maxp
out:
if (obj) {
if (obj->pfn_table) {
free_pages(obj->pfn_table, pfn_npages);
ihk_mc_free_pages(obj->pfn_table, pfn_npages);
}
kfree(obj);
}
@@ -196,7 +196,7 @@ static void devobj_release(struct memobj *memobj)
}
if (obj->pfn_table) {
free_pages(obj->pfn_table, pfn_npages);
ihk_mc_free_pages(obj->pfn_table, pfn_npages);
}
kfree(free_obj);
}