diff options
author | Weijie Yang <weijie.yang@samsung.com> | 2013-11-12 15:08:27 -0800 |
---|---|---|
committer | Chanho Park <chanho61.park@samsung.com> | 2014-03-20 17:44:42 +0900 |
commit | bb72940f92345d33ae610fc6c007eed2bde27616 (patch) | |
tree | 5233f7f05552f0b09c2f2384bf71f237688ecb7b /net | |
parent | 14c1113b43bcb942babcf0cf3f99ba91e44cd80c (diff) | |
download | linux-3.10-bb72940f92345d33ae610fc6c007eed2bde27616.tar.gz linux-3.10-bb72940f92345d33ae610fc6c007eed2bde27616.tar.bz2 linux-3.10-bb72940f92345d33ae610fc6c007eed2bde27616.zip |
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 <minchan@kernel.org> 's idea and suggestion.
Change-Id: I8510ffe4f49a1a5f00b53be89b2ee33854464db8
Signed-off-by: Weijie Yang <weijie.yang@samsung.com>
Cc: Seth Jennings <sjennings@variantweb.net>
Acked-by: Minchan Kim <minchan@kernel.org>
Cc: Bob Liu <bob.liu@oracle.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'net')
0 files changed, 0 insertions, 0 deletions