aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGanesh Mahendran <opensource.ganesh@gmail.com>2016-07-28 18:47:43 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2016-07-28 19:07:41 -0400
commit41b88e14c1612be7d4eba18fff1e70d168abe356 (patch)
tree9365660008f52fb941a044125fe4246535801a60
parent91dcade47a3d0e7c31464ef05f56c08e92a0e9c2 (diff)
mm/zsmalloc: use obj_index to keep consistent with others
This is a cleanup patch. Change "index" to "obj_index" to keep consistent with others in zsmalloc. Link: http://lkml.kernel.org/r/1467882338-4300-1-git-send-email-opensource.ganesh@gmail.com Signed-off-by: Ganesh Mahendran <opensource.ganesh@gmail.com> Reviewed-by: Sergey Senozhatsky <sergey.senozhatsky@gmail.com> Acked-by: Minchan Kim <minchan@kernel.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
-rw-r--r--mm/zsmalloc.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/mm/zsmalloc.c b/mm/zsmalloc.c
index 04176de6df70..0b4790e81193 100644
--- a/mm/zsmalloc.c
+++ b/mm/zsmalloc.c
@@ -1776,7 +1776,7 @@ struct zs_compact_control {
1776 struct page *d_page; 1776 struct page *d_page;
1777 /* Starting object index within @s_page which used for live object 1777 /* Starting object index within @s_page which used for live object
1778 * in the subpage. */ 1778 * in the subpage. */
1779 int index; 1779 int obj_idx;
1780}; 1780};
1781 1781
1782static int migrate_zspage(struct zs_pool *pool, struct size_class *class, 1782static int migrate_zspage(struct zs_pool *pool, struct size_class *class,
@@ -1786,16 +1786,16 @@ static int migrate_zspage(struct zs_pool *pool, struct size_class *class,
1786 unsigned long handle; 1786 unsigned long handle;
1787 struct page *s_page = cc->s_page; 1787 struct page *s_page = cc->s_page;
1788 struct page *d_page = cc->d_page; 1788 struct page *d_page = cc->d_page;
1789 unsigned long index = cc->index; 1789 int obj_idx = cc->obj_idx;
1790 int ret = 0; 1790 int ret = 0;
1791 1791
1792 while (1) { 1792 while (1) {
1793 handle = find_alloced_obj(class, s_page, index); 1793 handle = find_alloced_obj(class, s_page, obj_idx);
1794 if (!handle) { 1794 if (!handle) {
1795 s_page = get_next_page(s_page); 1795 s_page = get_next_page(s_page);
1796 if (!s_page) 1796 if (!s_page)
1797 break; 1797 break;
1798 index = 0; 1798 obj_idx = 0;
1799 continue; 1799 continue;
1800 } 1800 }
1801 1801
@@ -1809,7 +1809,7 @@ static int migrate_zspage(struct zs_pool *pool, struct size_class *class,
1809 used_obj = handle_to_obj(handle); 1809 used_obj = handle_to_obj(handle);
1810 free_obj = obj_malloc(class, get_zspage(d_page), handle); 1810 free_obj = obj_malloc(class, get_zspage(d_page), handle);
1811 zs_object_copy(class, free_obj, used_obj); 1811 zs_object_copy(class, free_obj, used_obj);
1812 index++; 1812 obj_idx++;
1813 /* 1813 /*
1814 * record_obj updates handle's value to free_obj and it will 1814 * record_obj updates handle's value to free_obj and it will
1815 * invalidate lock bit(ie, HANDLE_PIN_BIT) of handle, which 1815 * invalidate lock bit(ie, HANDLE_PIN_BIT) of handle, which
@@ -1824,7 +1824,7 @@ static int migrate_zspage(struct zs_pool *pool, struct size_class *class,
1824 1824
1825 /* Remember last position in this iteration */ 1825 /* Remember last position in this iteration */
1826 cc->s_page = s_page; 1826 cc->s_page = s_page;
1827 cc->index = index; 1827 cc->obj_idx = obj_idx;
1828 1828
1829 return ret; 1829 return ret;
1830} 1830}
@@ -2279,7 +2279,7 @@ static void __zs_compact(struct zs_pool *pool, struct size_class *class)
2279 if (!zs_can_compact(class)) 2279 if (!zs_can_compact(class))
2280 break; 2280 break;
2281 2281
2282 cc.index = 0; 2282 cc.obj_idx = 0;
2283 cc.s_page = get_first_page(src_zspage); 2283 cc.s_page = get_first_page(src_zspage);
2284 2284
2285 while ((dst_zspage = isolate_zspage(class, false))) { 2285 while ((dst_zspage = isolate_zspage(class, false))) {