Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 317778
b: refs/heads/master
c: 1031233
h: refs/heads/master
v: v3
  • Loading branch information
Seth Jennings authored and Greg Kroah-Hartman committed Jul 9, 2012
1 parent faada96 commit ee08646
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 6 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 5f601902c61e6cda627ec71c10609021067ed0fa
refs/heads/master: 103123305c4f695cbb11555d51a32ea14d6bed05
15 changes: 10 additions & 5 deletions trunk/drivers/staging/zsmalloc/zsmalloc-main.c
Original file line number Diff line number Diff line change
Expand Up @@ -774,6 +774,7 @@ void *zs_map_object(struct zs_pool *pool, unsigned long handle)
}

zs_copy_map_object(area->vm_buf, page, off, class->size);
area->vm_addr = NULL;
return area->vm_buf;
}
EXPORT_SYMBOL_GPL(zs_map_object);
Expand All @@ -788,18 +789,22 @@ void zs_unmap_object(struct zs_pool *pool, unsigned long handle)
struct size_class *class;
struct mapping_area *area;

area = &__get_cpu_var(zs_map_area);
if (area->vm_addr) {
/* single-page object fastpath */
kunmap_atomic(area->vm_addr);
put_cpu_var(zs_map_area);
return;
}

BUG_ON(!handle);

obj_handle_to_location(handle, &page, &obj_idx);
get_zspage_mapping(get_first_page(page), &class_idx, &fg);
class = &pool->size_class[class_idx];
off = obj_idx_to_offset(page, obj_idx, class->size);

area = &__get_cpu_var(zs_map_area);
if (off + class->size <= PAGE_SIZE)
kunmap_atomic(area->vm_addr);
else
zs_copy_unmap_object(area->vm_buf, page, off, class->size);
zs_copy_unmap_object(area->vm_buf, page, off, class->size);
put_cpu_var(zs_map_area);
}
EXPORT_SYMBOL_GPL(zs_unmap_object);
Expand Down

0 comments on commit ee08646

Please sign in to comment.