Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 363557
b: refs/heads/master
c: dcb4e2d
h: refs/heads/master
i:
  363555: 57558b0
v: v3
  • Loading branch information
Wanpeng Li authored and Greg Kroah-Hartman committed Mar 19, 2013
1 parent dc18da3 commit 1582938
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: ad3c025b35832f9634523651d27dbf1233570976
refs/heads/master: dcb4e2d9bb4e3b6ad05bc513a237a87e46952341
26 changes: 26 additions & 0 deletions trunk/drivers/staging/zcache/zcache-main.c
Original file line number Diff line number Diff line change
Expand Up @@ -277,6 +277,32 @@ static void zcache_obj_free(struct tmem_obj *obj, struct tmem_pool *pool)
kmem_cache_free(zcache_obj_cache, obj);
}

static bool page_is_zero_filled(void *ptr)
{
unsigned int pos;
unsigned long *page;

page = (unsigned long *)ptr;

for (pos = 0; pos < PAGE_SIZE / sizeof(*page); pos++) {
if (page[pos])
return false;
}

return true;
}

static void handle_zero_filled_page(void *page)
{
void *user_mem;

user_mem = kmap_atomic(page);
memset(user_mem, 0, PAGE_SIZE);
kunmap_atomic(user_mem);

flush_dcache_page(page);
}

static struct tmem_hostops zcache_hostops = {
.obj_alloc = zcache_obj_alloc,
.obj_free = zcache_obj_free,
Expand Down

0 comments on commit 1582938

Please sign in to comment.