Commit 97d5dd12 authored by Cong Wang's avatar Cong Wang Committed by Cong Wang

zcache: remove the second argument of k[un]map_atomic()

Acked-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
Signed-off-by: default avatarCong Wang <amwang@redhat.com>
parent f0c5b592
...@@ -421,13 +421,13 @@ static int zbud_decompress(struct page *page, struct zbud_hdr *zh) ...@@ -421,13 +421,13 @@ static int zbud_decompress(struct page *page, struct zbud_hdr *zh)
} }
ASSERT_SENTINEL(zh, ZBH); ASSERT_SENTINEL(zh, ZBH);
BUG_ON(zh->size == 0 || zh->size > zbud_max_buddy_size()); BUG_ON(zh->size == 0 || zh->size > zbud_max_buddy_size());
to_va = kmap_atomic(page, KM_USER0); to_va = kmap_atomic(page);
size = zh->size; size = zh->size;
from_va = zbud_data(zh, size); from_va = zbud_data(zh, size);
ret = lzo1x_decompress_safe(from_va, size, to_va, &out_len); ret = lzo1x_decompress_safe(from_va, size, to_va, &out_len);
BUG_ON(ret != LZO_E_OK); BUG_ON(ret != LZO_E_OK);
BUG_ON(out_len != PAGE_SIZE); BUG_ON(out_len != PAGE_SIZE);
kunmap_atomic(to_va, KM_USER0); kunmap_atomic(to_va);
out: out:
spin_unlock(&zbpg->lock); spin_unlock(&zbpg->lock);
return ret; return ret;
...@@ -676,13 +676,13 @@ static struct zv_hdr *zv_create(struct xv_pool *xvpool, uint32_t pool_id, ...@@ -676,13 +676,13 @@ static struct zv_hdr *zv_create(struct xv_pool *xvpool, uint32_t pool_id,
goto out; goto out;
atomic_inc(&zv_curr_dist_counts[chunks]); atomic_inc(&zv_curr_dist_counts[chunks]);
atomic_inc(&zv_cumul_dist_counts[chunks]); atomic_inc(&zv_cumul_dist_counts[chunks]);
zv = kmap_atomic(page, KM_USER0) + offset; zv = kmap_atomic(page) + offset;
zv->index = index; zv->index = index;
zv->oid = *oid; zv->oid = *oid;
zv->pool_id = pool_id; zv->pool_id = pool_id;
SET_SENTINEL(zv, ZVH); SET_SENTINEL(zv, ZVH);
memcpy((char *)zv + sizeof(struct zv_hdr), cdata, clen); memcpy((char *)zv + sizeof(struct zv_hdr), cdata, clen);
kunmap_atomic(zv, KM_USER0); kunmap_atomic(zv);
out: out:
return zv; return zv;
} }
...@@ -718,10 +718,10 @@ static void zv_decompress(struct page *page, struct zv_hdr *zv) ...@@ -718,10 +718,10 @@ static void zv_decompress(struct page *page, struct zv_hdr *zv)
ASSERT_SENTINEL(zv, ZVH); ASSERT_SENTINEL(zv, ZVH);
size = xv_get_object_size(zv) - sizeof(*zv); size = xv_get_object_size(zv) - sizeof(*zv);
BUG_ON(size == 0); BUG_ON(size == 0);
to_va = kmap_atomic(page, KM_USER0); to_va = kmap_atomic(page);
ret = lzo1x_decompress_safe((char *)zv + sizeof(*zv), ret = lzo1x_decompress_safe((char *)zv + sizeof(*zv),
size, to_va, &clen); size, to_va, &clen);
kunmap_atomic(to_va, KM_USER0); kunmap_atomic(to_va);
BUG_ON(ret != LZO_E_OK); BUG_ON(ret != LZO_E_OK);
BUG_ON(clen != PAGE_SIZE); BUG_ON(clen != PAGE_SIZE);
} }
...@@ -1300,12 +1300,12 @@ static int zcache_compress(struct page *from, void **out_va, size_t *out_len) ...@@ -1300,12 +1300,12 @@ static int zcache_compress(struct page *from, void **out_va, size_t *out_len)
BUG_ON(!irqs_disabled()); BUG_ON(!irqs_disabled());
if (unlikely(dmem == NULL || wmem == NULL)) if (unlikely(dmem == NULL || wmem == NULL))
goto out; /* no buffer, so can't compress */ goto out; /* no buffer, so can't compress */
from_va = kmap_atomic(from, KM_USER0); from_va = kmap_atomic(from);
mb(); mb();
ret = lzo1x_1_compress(from_va, PAGE_SIZE, dmem, out_len, wmem); ret = lzo1x_1_compress(from_va, PAGE_SIZE, dmem, out_len, wmem);
BUG_ON(ret != LZO_E_OK); BUG_ON(ret != LZO_E_OK);
*out_va = dmem; *out_va = dmem;
kunmap_atomic(from_va, KM_USER0); kunmap_atomic(from_va);
ret = 1; ret = 1;
out: out:
return ret; return ret;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment