This patch exports the zcache interface to be used from the outside world. Signed-off-by: Sasha Levin <levinsasha928@xxxxxxxxx> --- drivers/staging/zcache/zcache-main.c | 13 +++++++------ drivers/staging/zcache/zcache.h | 17 +++++++++++++++++ 2 files changed, 24 insertions(+), 6 deletions(-) create mode 100644 drivers/staging/zcache/zcache.h diff --git a/drivers/staging/zcache/zcache-main.c b/drivers/staging/zcache/zcache-main.c index 784c796..a196aff 100644 --- a/drivers/staging/zcache/zcache-main.c +++ b/drivers/staging/zcache/zcache-main.c @@ -32,6 +32,7 @@ #include <linux/crypto.h> #include <linux/string.h> #include "tmem.h" +#include "zcache.h" #include "../zsmalloc/zsmalloc.h" @@ -1563,7 +1564,7 @@ static struct shrinker zcache_shrinker = { * zcache shims between cleancache/frontswap ops and tmem */ -static int zcache_put_page(int cli_id, int pool_id, struct tmem_oid *oidp, +int zcache_put_page(int cli_id, int pool_id, struct tmem_oid *oidp, uint32_t index, struct page *page) { struct tmem_pool *pool; @@ -1596,7 +1597,7 @@ out: return ret; } -static int zcache_get_page(int cli_id, int pool_id, struct tmem_oid *oidp, +int zcache_get_page(int cli_id, int pool_id, struct tmem_oid *oidp, uint32_t index, struct page *page) { struct tmem_pool *pool; @@ -1616,7 +1617,7 @@ static int zcache_get_page(int cli_id, int pool_id, struct tmem_oid *oidp, return ret; } -static int zcache_flush_page(int cli_id, int pool_id, +int zcache_flush_page(int cli_id, int pool_id, struct tmem_oid *oidp, uint32_t index) { struct tmem_pool *pool; @@ -1637,7 +1638,7 @@ static int zcache_flush_page(int cli_id, int pool_id, return ret; } -static int zcache_flush_object(int cli_id, int pool_id, +int zcache_flush_object(int cli_id, int pool_id, struct tmem_oid *oidp) { struct tmem_pool *pool; @@ -1658,7 +1659,7 @@ static int zcache_flush_object(int cli_id, int pool_id, return ret; } -static int zcache_destroy_pool(int cli_id, int pool_id) +int zcache_destroy_pool(int cli_id, int pool_id) { struct tmem_pool *pool = NULL; struct zcache_client *cli = NULL; @@ -1941,7 +1942,7 @@ struct frontswap_ops zcache_frontswap_register_ops(void) * NOTHING HAPPENS! */ -static int zcache_enabled; +int zcache_enabled; static int __init enable_zcache(char *s) { diff --git a/drivers/staging/zcache/zcache.h b/drivers/staging/zcache/zcache.h new file mode 100644 index 0000000..ec06ea2 --- /dev/null +++ b/drivers/staging/zcache/zcache.h @@ -0,0 +1,17 @@ +#ifndef _ZCACHE_H_ +#define _ZCACHE_H_ + +extern int zcache_enabled; + +extern int zcache_new_pool(uint16_t cli_id, uint32_t flags); +extern int zcache_destroy_pool(int cli_id, int pool_id); +extern int zcache_put_page(int cli_id, int pool_id, struct tmem_oid *oidp, + uint32_t index, struct page *page); +extern int zcache_get_page(int cli_id, int pool_id, struct tmem_oid *oidp, + uint32_t index, struct page *page); +extern int zcache_flush_page(int cli_id, int pool_id, + struct tmem_oid *oidp, uint32_t index); +extern int zcache_flush_object(int cli_id, int pool_id, + struct tmem_oid *oidp); + +#endif -- 1.7.8.6 -- To unsubscribe from this list: send the line "unsubscribe kvm" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html