mm/vmalloc: remove vwrite()
[linux-2.6-microblaze.git] / mm / swapfile.c
index f039745..149e774 100644 (file)
@@ -219,6 +219,19 @@ offset_to_swap_extent(struct swap_info_struct *sis, unsigned long offset)
        BUG();
 }
 
+sector_t swap_page_sector(struct page *page)
+{
+       struct swap_info_struct *sis = page_swap_info(page);
+       struct swap_extent *se;
+       sector_t sector;
+       pgoff_t offset;
+
+       offset = __page_file_index(page);
+       se = offset_to_swap_extent(sis, offset);
+       sector = se->start_block + (offset - se->start_page);
+       return sector << (PAGE_SHIFT - 9);
+}
+
 /*
  * swap allocation tell device that a cluster of swap can now be discarded,
  * to allow the swap device to optimize its wear-levelling.
@@ -2767,7 +2780,7 @@ static int swap_show(struct seq_file *swap, void *v)
        unsigned int bytes, inuse;
 
        if (si == SEQ_START_TOKEN) {
-               seq_puts(swap,"Filename\t\t\t\tType\t\tSize\t\tUsed\t\tPriority\n");
+               seq_puts(swap, "Filename\t\t\t\tType\t\tSize\t\tUsed\t\tPriority\n");
                return 0;
        }
 
@@ -3271,7 +3284,7 @@ SYSCALL_DEFINE2(swapon, const char __user *, specialfile, int, swap_flags)
                                         sizeof(long),
                                         GFP_KERNEL);
 
-       if (p->bdev &&(swap_flags & SWAP_FLAG_DISCARD) && swap_discardable(p)) {
+       if (p->bdev && (swap_flags & SWAP_FLAG_DISCARD) && swap_discardable(p)) {
                /*
                 * When discard is enabled for swap with no particular
                 * policy flagged, we set all swap discard flags here in