aboutsummaryrefslogtreecommitdiffstats
path: root/mm/swap_state.c
diff options
context:
space:
mode:
Diffstat (limited to 'mm/swap_state.c')
-rw-r--r--mm/swap_state.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/mm/swap_state.c b/mm/swap_state.c
index 3e3381d6c7ee..2c217e33d497 100644
--- a/mm/swap_state.c
+++ b/mm/swap_state.c
@@ -39,7 +39,7 @@ static struct backing_dev_info swap_backing_dev_info = {
39 39
40struct address_space swapper_space = { 40struct address_space swapper_space = {
41 .page_tree = RADIX_TREE_INIT(GFP_ATOMIC|__GFP_NOWARN), 41 .page_tree = RADIX_TREE_INIT(GFP_ATOMIC|__GFP_NOWARN),
42 .tree_lock = __RW_LOCK_UNLOCKED(swapper_space.tree_lock), 42 .tree_lock = __SPIN_LOCK_UNLOCKED(swapper_space.tree_lock),
43 .a_ops = &swap_aops, 43 .a_ops = &swap_aops,
44 .i_mmap_nonlinear = LIST_HEAD_INIT(swapper_space.i_mmap_nonlinear), 44 .i_mmap_nonlinear = LIST_HEAD_INIT(swapper_space.i_mmap_nonlinear),
45 .backing_dev_info = &swap_backing_dev_info, 45 .backing_dev_info = &swap_backing_dev_info,
@@ -80,7 +80,7 @@ int add_to_swap_cache(struct page *page, swp_entry_t entry, gfp_t gfp_mask)
80 SetPageSwapCache(page); 80 SetPageSwapCache(page);
81 set_page_private(page, entry.val); 81 set_page_private(page, entry.val);
82 82
83 write_lock_irq(&swapper_space.tree_lock); 83 spin_lock_irq(&swapper_space.tree_lock);
84 error = radix_tree_insert(&swapper_space.page_tree, 84 error = radix_tree_insert(&swapper_space.page_tree,
85 entry.val, page); 85 entry.val, page);
86 if (likely(!error)) { 86 if (likely(!error)) {
@@ -88,7 +88,7 @@ int add_to_swap_cache(struct page *page, swp_entry_t entry, gfp_t gfp_mask)
88 __inc_zone_page_state(page, NR_FILE_PAGES); 88 __inc_zone_page_state(page, NR_FILE_PAGES);
89 INC_CACHE_INFO(add_total); 89 INC_CACHE_INFO(add_total);
90 } 90 }
91 write_unlock_irq(&swapper_space.tree_lock); 91 spin_unlock_irq(&swapper_space.tree_lock);
92 radix_tree_preload_end(); 92 radix_tree_preload_end();
93 93
94 if (unlikely(error)) { 94 if (unlikely(error)) {
@@ -182,9 +182,9 @@ void delete_from_swap_cache(struct page *page)
182 182
183 entry.val = page_private(page); 183 entry.val = page_private(page);
184 184
185 write_lock_irq(&swapper_space.tree_lock); 185 spin_lock_irq(&swapper_space.tree_lock);
186 __delete_from_swap_cache(page); 186 __delete_from_swap_cache(page);
187 write_unlock_irq(&swapper_space.tree_lock); 187 spin_unlock_irq(&swapper_space.tree_lock);
188 188
189 swap_free(entry); 189 swap_free(entry);
190 page_cache_release(page); 190 page_cache_release(page);