]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - include/linux/mm.h
[PATCH] mark f_ops const in the inode
[linux-2.6-omap-h63xx.git] / include / linux / mm.h
index e67980654c4989426b3079dd00e4072a656a0933..6aa016f1d3ae05d4b29e2076431219283b4c689a 100644 (file)
@@ -307,14 +307,11 @@ static inline int get_page_unless_zero(struct page *page)
        return atomic_inc_not_zero(&page->_count);
 }
 
-#define set_page_count(p,v)    atomic_set(&(p)->_count, (v))
-#define __put_page(p)          atomic_dec(&(p)->_count)
-
 extern void FASTCALL(__page_cache_release(struct page *));
 
 static inline int page_count(struct page *page)
 {
-       if (PageCompound(page))
+       if (unlikely(PageCompound(page)))
                page = (struct page *)page_private(page);
        return atomic_read(&page->_count);
 }
@@ -326,13 +323,18 @@ static inline void get_page(struct page *page)
        atomic_inc(&page->_count);
 }
 
+/*
+ * Setup the page count before being freed into the page allocator for
+ * the first time (boot or memory hotplug)
+ */
+static inline void init_page_count(struct page *page)
+{
+       atomic_set(&page->_count, 1);
+}
+
 void put_page(struct page *page);
 
-#ifdef CONFIG_MMU
 void split_page(struct page *page, unsigned int order);
-#else
-static inline void split_page(struct page *page, unsigned int order) {}
-#endif
 
 /*
  * Multiple processes may "see" the same page. E.g. for untouched
@@ -1046,7 +1048,7 @@ int in_gate_area_no_task(unsigned long addr);
 
 int drop_caches_sysctl_handler(struct ctl_table *, int, struct file *,
                                        void __user *, size_t *, loff_t *);
-int shrink_slab(unsigned long scanned, gfp_t gfp_mask,
+unsigned long shrink_slab(unsigned long scanned, gfp_t gfp_mask,
                        unsigned long lru_pages);
 void drop_pagecache(void);
 void drop_slab(void);