]> git.baikalelectronics.ru Git - kernel.git/commit
mm/swap_slots.c: assign|reset cache slot by value directly
authorWei Yang <richard.weiyang@linux.alibaba.com>
Thu, 2 Apr 2020 04:06:16 +0000 (21:06 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Thu, 2 Apr 2020 16:35:27 +0000 (09:35 -0700)
commit30f69b3c55c54deb772da5d2a5a65f35fda98042
tree6b29743a8b0556347e9e188f7dbb4dd6d10359d7
parent832a78361136997fe06657000eae1f01588c6e09
mm/swap_slots.c: assign|reset cache slot by value directly

Currently we use a tmp pointer, pentry, to transfer and reset swap cache
slot, which is a little redundant.  Swap cache slot stores the entry value
directly, assign and reset it by value would be straight forward.

Also this patch merges the else and if, since this is the only case we
refill and repeat swap cache.

Signed-off-by: Wei Yang <richard.weiyang@linux.alibaba.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Acked-by: Tim Chen <tim.c.chen@linux.intel.com>
Link: http://lkml.kernel.org/r/20200311055352.50574-1-richard.weiyang@linux.alibaba.com
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
mm/swap_slots.c