summaryrefslogtreecommitdiff
path: root/mm
diff options
context:
space:
mode:
authorHeesub Shin <heesub.shin@samsung.com>2014-12-13 03:57:21 +0300
committerLinus Torvalds <torvalds@linux-foundation.org>2014-12-13 23:42:51 +0300
commit1dd61aa31cb5a64fe294c32424d9602fdb7317b0 (patch)
treefd252c79e8922a9124cbf0e7ec53eed091c48ff2 /mm
parent442cc432e68b24dc6bd70b1ee1f5d477ee1aa385 (diff)
downloadlinux-1dd61aa31cb5a64fe294c32424d9602fdb7317b0.tar.xz
mm/zbud: init user ops only when it is needed
When zbud is initialized through the zpool wrapper, pool->ops which points to user-defined operations is always set regardless of whether it is specified from the upper layer. This causes zbud_reclaim_page() to iterate its loop for evicting pool pages out without any gain. This patch sets the user-defined ops only when it is needed, so that zbud_reclaim_page() can bail out the reclamation loop earlier if there is no user-defined operations specified. Signed-off-by: Heesub Shin <heesub.shin@samsung.com> Acked-by: Dan Streetman <ddstreet@ieee.org> Cc: Seth Jennings <sjennings@variantweb.net> Cc: Sunae Seo <sunae.seo@samsung.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'mm')
-rw-r--r--mm/zbud.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/mm/zbud.c b/mm/zbud.c
index ec71b37fb06c..4e387bea702e 100644
--- a/mm/zbud.c
+++ b/mm/zbud.c
@@ -132,7 +132,7 @@ static struct zbud_ops zbud_zpool_ops = {
static void *zbud_zpool_create(gfp_t gfp, struct zpool_ops *zpool_ops)
{
- return zbud_create_pool(gfp, &zbud_zpool_ops);
+ return zbud_create_pool(gfp, zpool_ops ? &zbud_zpool_ops : NULL);
}
static void zbud_zpool_destroy(void *pool)