summaryrefslogtreecommitdiffstats
path: root/drivers/staging/zsmalloc
diff options
context:
space:
mode:
authorMinchan Kim2012-05-03 08:40:40 +0200
committerGreg Kroah-Hartman2012-05-09 22:20:22 +0200
commit00a61d8618bb7314113eb3ba27c12631cd85c298 (patch)
tree7d26a7c2acdbe2b85fbd12d4ab9cfc70e17864e7 /drivers/staging/zsmalloc
parentstaging: zsmalloc: rename zspage_order with zspage_pages (diff)
downloadkernel-qcow2-linux-00a61d8618bb7314113eb3ba27c12631cd85c298.tar.gz
kernel-qcow2-linux-00a61d8618bb7314113eb3ba27c12631cd85c298.tar.xz
kernel-qcow2-linux-00a61d8618bb7314113eb3ba27c12631cd85c298.zip
staging: zsmalloc: add/fix function comment
Add/fix the comment. Signed-off-by: Minchan Kim <minchan@kernel.org> Acked-by: Nitin Gupta <ngupta@vflare.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging/zsmalloc')
-rw-r--r--drivers/staging/zsmalloc/zsmalloc-main.c17
1 files changed, 11 insertions, 6 deletions
diff --git a/drivers/staging/zsmalloc/zsmalloc-main.c b/drivers/staging/zsmalloc/zsmalloc-main.c
index 86428000f88a..449673773286 100644
--- a/drivers/staging/zsmalloc/zsmalloc-main.c
+++ b/drivers/staging/zsmalloc/zsmalloc-main.c
@@ -566,13 +566,9 @@ EXPORT_SYMBOL_GPL(zs_destroy_pool);
* zs_malloc - Allocate block of given size from pool.
* @pool: pool to allocate from
* @size: size of block to allocate
- * @page: page no. that holds the object
- * @offset: location of object within page
- *
- * On success, <page, offset> identifies block allocated
- * and 0 is returned. On failure, <page, offset> is set to
- * 0 and -ENOMEM is returned.
*
+ * On success, handle to the allocated object is returned,
+ * otherwise NULL.
* Allocation requests with size > ZS_MAX_ALLOC_SIZE will fail.
*/
void *zs_malloc(struct zs_pool *pool, size_t size)
@@ -667,6 +663,15 @@ void zs_free(struct zs_pool *pool, void *obj)
}
EXPORT_SYMBOL_GPL(zs_free);
+/**
+ * zs_map_object - get address of allocated object from handle.
+ * @pool: pool from which the object was allocated
+ * @handle: handle returned from zs_malloc
+ *
+ * Before using an object allocated from zs_malloc, it must be mapped using
+ * this function. When done with the object, it must be unmapped using
+ * zs_unmap_object
+*/
void *zs_map_object(struct zs_pool *pool, void *handle)
{
struct page *page;