diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2012-03-21 09:40:26 -0700 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2012-03-21 09:40:26 -0700 |
commit | 9f3938346a5c1fa504647670edb5fea5756cfb00 (patch) | |
tree | 7cf6d24d6b076c8db8571494984924cac03703a2 /drivers/staging/ramster/xvmalloc.c | |
parent | 69a7aebcf019ab3ff5764525ad6858fbe23bb86d (diff) | |
parent | 317b6e128247f75976b0fc2b9fd8d2c20ef13b3a (diff) | |
download | op-kernel-dev-9f3938346a5c1fa504647670edb5fea5756cfb00.zip op-kernel-dev-9f3938346a5c1fa504647670edb5fea5756cfb00.tar.gz |
Merge branch 'kmap_atomic' of git://github.com/congwang/linux
Pull kmap_atomic cleanup from Cong Wang.
It's been in -next for a long time, and it gets rid of the (no longer
used) second argument to k[un]map_atomic().
Fix up a few trivial conflicts in various drivers, and do an "evil
merge" to catch some new uses that have come in since Cong's tree.
* 'kmap_atomic' of git://github.com/congwang/linux: (59 commits)
feature-removal-schedule.txt: schedule the deprecated form of kmap_atomic() for removal
highmem: kill all __kmap_atomic() [swarren@nvidia.com: highmem: Fix ARM build break due to __kmap_atomic rename]
drbd: remove the second argument of k[un]map_atomic()
zcache: remove the second argument of k[un]map_atomic()
gma500: remove the second argument of k[un]map_atomic()
dm: remove the second argument of k[un]map_atomic()
tomoyo: remove the second argument of k[un]map_atomic()
sunrpc: remove the second argument of k[un]map_atomic()
rds: remove the second argument of k[un]map_atomic()
net: remove the second argument of k[un]map_atomic()
mm: remove the second argument of k[un]map_atomic()
lib: remove the second argument of k[un]map_atomic()
power: remove the second argument of k[un]map_atomic()
kdb: remove the second argument of k[un]map_atomic()
udf: remove the second argument of k[un]map_atomic()
ubifs: remove the second argument of k[un]map_atomic()
squashfs: remove the second argument of k[un]map_atomic()
reiserfs: remove the second argument of k[un]map_atomic()
ocfs2: remove the second argument of k[un]map_atomic()
ntfs: remove the second argument of k[un]map_atomic()
...
Diffstat (limited to 'drivers/staging/ramster/xvmalloc.c')
-rw-r--r-- | drivers/staging/ramster/xvmalloc.c | 39 |
1 files changed, 19 insertions, 20 deletions
diff --git a/drivers/staging/ramster/xvmalloc.c b/drivers/staging/ramster/xvmalloc.c index 1f9c508..93ba8e9 100644 --- a/drivers/staging/ramster/xvmalloc.c +++ b/drivers/staging/ramster/xvmalloc.c @@ -56,17 +56,17 @@ static void clear_flag(struct block_header *block, enum blockflags flag) * This is called from xv_malloc/xv_free path, so it * needs to be fast. */ -static void *get_ptr_atomic(struct page *page, u16 offset, enum km_type type) +static void *get_ptr_atomic(struct page *page, u16 offset) { unsigned char *base; - base = kmap_atomic(page, type); + base = kmap_atomic(page); return base + offset; } -static void put_ptr_atomic(void *ptr, enum km_type type) +static void put_ptr_atomic(void *ptr) { - kunmap_atomic(ptr, type); + kunmap_atomic(ptr); } static u32 get_blockprev(struct block_header *block) @@ -202,10 +202,10 @@ static void insert_block(struct xv_pool *pool, struct page *page, u32 offset, if (block->link.next_page) { nextblock = get_ptr_atomic(block->link.next_page, - block->link.next_offset, KM_USER1); + block->link.next_offset); nextblock->link.prev_page = page; nextblock->link.prev_offset = offset; - put_ptr_atomic(nextblock, KM_USER1); + put_ptr_atomic(nextblock); /* If there was a next page then the free bits are set. */ return; } @@ -225,18 +225,18 @@ static void remove_block(struct xv_pool *pool, struct page *page, u32 offset, if (block->link.prev_page) { tmpblock = get_ptr_atomic(block->link.prev_page, - block->link.prev_offset, KM_USER1); + block->link.prev_offset); tmpblock->link.next_page = block->link.next_page; tmpblock->link.next_offset = block->link.next_offset; - put_ptr_atomic(tmpblock, KM_USER1); + put_ptr_atomic(tmpblock); } if (block->link.next_page) { tmpblock = get_ptr_atomic(block->link.next_page, - block->link.next_offset, KM_USER1); + block->link.next_offset); tmpblock->link.prev_page = block->link.prev_page; tmpblock->link.prev_offset = block->link.prev_offset; - put_ptr_atomic(tmpblock, KM_USER1); + put_ptr_atomic(tmpblock); } /* Is this block is at the head of the freelist? */ @@ -249,11 +249,10 @@ static void remove_block(struct xv_pool *pool, struct page *page, u32 offset, if (pool->freelist[slindex].page) { struct block_header *tmpblock; tmpblock = get_ptr_atomic(pool->freelist[slindex].page, - pool->freelist[slindex].offset, - KM_USER1); + pool->freelist[slindex].offset); tmpblock->link.prev_page = NULL; tmpblock->link.prev_offset = 0; - put_ptr_atomic(tmpblock, KM_USER1); + put_ptr_atomic(tmpblock); } else { /* This freelist bucket is empty */ __clear_bit(slindex % BITS_PER_LONG, @@ -284,7 +283,7 @@ static int grow_pool(struct xv_pool *pool, gfp_t flags) stat_inc(&pool->total_pages); spin_lock(&pool->lock); - block = get_ptr_atomic(page, 0, KM_USER0); + block = get_ptr_atomic(page, 0); block->size = PAGE_SIZE - XV_ALIGN; set_flag(block, BLOCK_FREE); @@ -293,7 +292,7 @@ static int grow_pool(struct xv_pool *pool, gfp_t flags) insert_block(pool, page, 0, block); - put_ptr_atomic(block, KM_USER0); + put_ptr_atomic(block); spin_unlock(&pool->lock); return 0; @@ -375,7 +374,7 @@ int xv_malloc(struct xv_pool *pool, u32 size, struct page **page, return -ENOMEM; } - block = get_ptr_atomic(*page, *offset, KM_USER0); + block = get_ptr_atomic(*page, *offset); remove_block(pool, *page, *offset, block, index); @@ -405,7 +404,7 @@ int xv_malloc(struct xv_pool *pool, u32 size, struct page **page, block->size = origsize; clear_flag(block, BLOCK_FREE); - put_ptr_atomic(block, KM_USER0); + put_ptr_atomic(block); spin_unlock(&pool->lock); *offset += XV_ALIGN; @@ -426,7 +425,7 @@ void xv_free(struct xv_pool *pool, struct page *page, u32 offset) spin_lock(&pool->lock); - page_start = get_ptr_atomic(page, 0, KM_USER0); + page_start = get_ptr_atomic(page, 0); block = (struct block_header *)((char *)page_start + offset); /* Catch double free bugs */ @@ -468,7 +467,7 @@ void xv_free(struct xv_pool *pool, struct page *page, u32 offset) /* No used objects in this page. Free it. */ if (block->size == PAGE_SIZE - XV_ALIGN) { - put_ptr_atomic(page_start, KM_USER0); + put_ptr_atomic(page_start); spin_unlock(&pool->lock); __free_page(page); @@ -486,7 +485,7 @@ void xv_free(struct xv_pool *pool, struct page *page, u32 offset) set_blockprev(tmpblock, offset); } - put_ptr_atomic(page_start, KM_USER0); + put_ptr_atomic(page_start); spin_unlock(&pool->lock); } EXPORT_SYMBOL_GPL(xv_free); |