diff options
Diffstat (limited to 'mm/swap_state.c')
-rw-r--r-- | mm/swap_state.c | 19 |
1 files changed, 9 insertions, 10 deletions
diff --git a/mm/swap_state.c b/mm/swap_state.c index 3353c9029cef..e793fdea275d 100644 --- a/mm/swap_state.c +++ b/mm/swap_state.c | |||
@@ -72,10 +72,10 @@ int add_to_swap_cache(struct page *page, swp_entry_t entry, gfp_t gfp_mask) | |||
72 | { | 72 | { |
73 | int error; | 73 | int error; |
74 | 74 | ||
75 | BUG_ON(!PageLocked(page)); | 75 | VM_BUG_ON(!PageLocked(page)); |
76 | BUG_ON(PageSwapCache(page)); | 76 | VM_BUG_ON(PageSwapCache(page)); |
77 | BUG_ON(PagePrivate(page)); | 77 | VM_BUG_ON(!PageSwapBacked(page)); |
78 | BUG_ON(!PageSwapBacked(page)); | 78 | |
79 | error = radix_tree_preload(gfp_mask); | 79 | error = radix_tree_preload(gfp_mask); |
80 | if (!error) { | 80 | if (!error) { |
81 | page_cache_get(page); | 81 | page_cache_get(page); |
@@ -108,10 +108,9 @@ int add_to_swap_cache(struct page *page, swp_entry_t entry, gfp_t gfp_mask) | |||
108 | */ | 108 | */ |
109 | void __delete_from_swap_cache(struct page *page) | 109 | void __delete_from_swap_cache(struct page *page) |
110 | { | 110 | { |
111 | BUG_ON(!PageLocked(page)); | 111 | VM_BUG_ON(!PageLocked(page)); |
112 | BUG_ON(!PageSwapCache(page)); | 112 | VM_BUG_ON(!PageSwapCache(page)); |
113 | BUG_ON(PageWriteback(page)); | 113 | VM_BUG_ON(PageWriteback(page)); |
114 | BUG_ON(PagePrivate(page)); | ||
115 | 114 | ||
116 | radix_tree_delete(&swapper_space.page_tree, page_private(page)); | 115 | radix_tree_delete(&swapper_space.page_tree, page_private(page)); |
117 | set_page_private(page, 0); | 116 | set_page_private(page, 0); |
@@ -134,8 +133,8 @@ int add_to_swap(struct page * page, gfp_t gfp_mask) | |||
134 | swp_entry_t entry; | 133 | swp_entry_t entry; |
135 | int err; | 134 | int err; |
136 | 135 | ||
137 | BUG_ON(!PageLocked(page)); | 136 | VM_BUG_ON(!PageLocked(page)); |
138 | BUG_ON(!PageUptodate(page)); | 137 | VM_BUG_ON(!PageUptodate(page)); |
139 | 138 | ||
140 | for (;;) { | 139 | for (;;) { |
141 | entry = get_swap_page(); | 140 | entry = get_swap_page(); |