RPC: add wrapper for svc_reserve to account for checksum
[safe/jmp/linux-2.6] / include / linux / mm.h
index 8c149fa..4670ebd 100644 (file)
@@ -269,14 +269,7 @@ static inline int get_page_unless_zero(struct page *page)
 
 static inline struct page *compound_head(struct page *page)
 {
-       /*
-        * We could avoid the PageCompound(page) check if
-        * we would not overload PageTail().
-        *
-        * This check has to be done in several performance critical
-        * paths of the slab etc. IMHO PageTail deserves its own flag.
-        */
-       if (unlikely(PageCompound(page) && PageTail(page)))
+       if (unlikely(PageTail(page)))
                return page->first_page;
        return page;
 }
@@ -293,6 +286,12 @@ static inline void get_page(struct page *page)
        atomic_inc(&page->_count);
 }
 
+static inline struct page *virt_to_head_page(const void *x)
+{
+       struct page *page = virt_to_page(x);
+       return compound_head(page);
+}
+
 /*
  * Setup the page count before being freed into the page allocator for
  * the first time (boot or memory hotplug)
@@ -327,7 +326,7 @@ static inline compound_page_dtor *get_compound_page_dtor(struct page *page)
 
 static inline int compound_order(struct page *page)
 {
-       if (!PageCompound(page) || PageTail(page))
+       if (!PageHead(page))
                return 0;
        return (unsigned long)page[1].lru.prev;
 }