X-Git-Url: http://git.monstr.eu/?a=blobdiff_plain;f=include%2Flinux%2Fpagemap.h;h=62db6b0176b95782666e5e1a7369dea10715ed6d;hb=c3e46874dfb9a2ef08085bb147dc371e72738673;hp=5dcf446f42e5ad6c83c2c2eb3c93bdc61392f026;hpb=ac08b1c68d1b1ed3cebb218fc3ea2c07484eb07d;p=linux-2.6-microblaze.git diff --git a/include/linux/pagemap.h b/include/linux/pagemap.h index 5dcf446f42e5..62db6b0176b9 100644 --- a/include/linux/pagemap.h +++ b/include/linux/pagemap.h @@ -521,18 +521,17 @@ static inline struct page *read_mapping_page(struct address_space *mapping, */ static inline pgoff_t page_to_index(struct page *page) { - pgoff_t pgoff; + struct page *head; if (likely(!PageTransTail(page))) return page->index; + head = compound_head(page); /* * We don't initialize ->index for tail pages: calculate based on * head page */ - pgoff = compound_head(page)->index; - pgoff += page - compound_head(page); - return pgoff; + return head->index + page - head; } extern pgoff_t hugetlb_basepage_index(struct page *page);