diff options
author | Huang Ying <ying.huang@intel.com> | 2017-05-03 23:54:36 +0200 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2017-05-04 00:52:10 +0200 |
commit | 0ef017d117d79eb765cb490a8d7e323752a13f4a (patch) | |
tree | 368d0236ded4e4798abdc8d9b98fe1dc922069a9 /mm/swapfile.c | |
parent | mm, swap: fix comment in __read_swap_cache_async (diff) | |
download | linux-0ef017d117d79eb765cb490a8d7e323752a13f4a.tar.xz linux-0ef017d117d79eb765cb490a8d7e323752a13f4a.zip |
mm, swap: improve readability via make spin_lock/unlock balanced
This is just a cleanup patch, no functionality change.
In cluster_list_add_tail(), spin_lock_nested() is used to lock the
cluster, while unlock_cluster() is used to unlock the cluster. To
improve the code readability, use spin_unlock() directly to unlock the
cluster.
Link: http://lkml.kernel.org/r/20170317064635.12792-2-ying.huang@intel.com
Signed-off-by: "Huang, Ying" <ying.huang@intel.com>
Acked-by: Tim Chen <tim.c.chen@intel.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'mm/swapfile.c')
-rw-r--r-- | mm/swapfile.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/mm/swapfile.c b/mm/swapfile.c index 6b6bb1bb6209..42fd620dcf4c 100644 --- a/mm/swapfile.c +++ b/mm/swapfile.c @@ -335,7 +335,7 @@ static void cluster_list_add_tail(struct swap_cluster_list *list, ci_tail = ci + tail; spin_lock_nested(&ci_tail->lock, SINGLE_DEPTH_NESTING); cluster_set_next(ci_tail, idx); - unlock_cluster(ci_tail); + spin_unlock(&ci_tail->lock); cluster_set_next_flag(&list->tail, idx, 0); } } |