perf tools: Enable libtraceevent dynamic linking
[linux-2.6-microblaze.git] / mm / swapfile.c
index 96799a2..084a5b9 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.
@@ -1157,13 +1170,13 @@ static struct swap_info_struct *__swap_info_get(swp_entry_t entry)
        return p;
 
 bad_offset:
-       pr_err("swap_info_get: %s%08lx\n", Bad_offset, entry.val);
+       pr_err("%s: %s%08lx\n", __func__, Bad_offset, entry.val);
        goto out;
 bad_device:
-       pr_err("swap_info_get: %s%08lx\n", Unused_file, entry.val);
+       pr_err("%s: %s%08lx\n", __func__, Unused_file, entry.val);
        goto out;
 bad_nofile:
-       pr_err("swap_info_get: %s%08lx\n", Bad_file, entry.val);
+       pr_err("%s: %s%08lx\n", __func__, Bad_file, entry.val);
 out:
        return NULL;
 }
@@ -1180,7 +1193,7 @@ static struct swap_info_struct *_swap_info_get(swp_entry_t entry)
        return p;
 
 bad_free:
-       pr_err("swap_info_get: %s%08lx\n", Unused_offset, entry.val);
+       pr_err("%s: %s%08lx\n", __func__, Unused_offset, entry.val);
 out:
        return NULL;
 }