From: Weijie Yang Date: Tue, 12 Nov 2013 23:08:27 +0000 (-0800) Subject: mm/zswap: refactor the get/put routines X-Git-Tag: v3.13-rc1~106^2~186 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=0ab0abcf511545d1fddbe72a36b3ca73388ac937;p=pandora-kernel.git mm/zswap: refactor the get/put routines The refcount routine was not fit the kernel get/put semantic exactly, There were too many judgement statements on refcount and it could be minus. This patch does the following: - move refcount judgement to zswap_entry_put() to hide resource free function. - add a new function zswap_entry_find_get(), so that callers can use easily in the following pattern: zswap_entry_find_get .../* do something */ zswap_entry_put - to eliminate compile error, move some functions declaration This patch is based on Minchan Kim 's idea and suggestion. Signed-off-by: Weijie Yang Cc: Seth Jennings Acked-by: Minchan Kim Cc: Bob Liu Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- Reading git-diff-tree failed