Btrfs: don't commit instead of overcommitting
[pandora-kernel.git] / mm / page_io.c
index 4a37962..78eee32 100644 (file)
@@ -205,7 +205,7 @@ int swap_writepage(struct page *page, struct writeback_control *wbc)
                struct file *swap_file = sis->swap_file;
                struct address_space *mapping = swap_file->f_mapping;
                struct iovec iov = {
-                       .iov_base = page_address(page),
+                       .iov_base = kmap(page),
                        .iov_len  = PAGE_SIZE,
                };
 
@@ -218,6 +218,7 @@ int swap_writepage(struct page *page, struct writeback_control *wbc)
                ret = mapping->a_ops->direct_IO(KERNEL_WRITE,
                                                &kiocb, &iov,
                                                kiocb.ki_pos, 1);
+               kunmap(page);
                if (ret == PAGE_SIZE) {
                        count_vm_event(PSWPOUT);
                        ret = 0;