]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - include/linux/pagemap.h
Pull ec into release branch
[linux-2.6-omap-h63xx.git] / include / linux / pagemap.h
index 64f95092515120a517ba53c97a606c600a66e40c..8a83537d69785117201334798bd02cc077cac06b 100644 (file)
@@ -11,6 +11,7 @@
 #include <linux/compiler.h>
 #include <asm/uaccess.h>
 #include <linux/gfp.h>
+#include <linux/bitops.h>
 
 /*
  * Bits in mapping->flags.  The lower __GFP_BITS_SHIFT bits are the page
 #define        AS_EIO          (__GFP_BITS_SHIFT + 0)  /* IO error on async write */
 #define AS_ENOSPC      (__GFP_BITS_SHIFT + 1)  /* ENOSPC on async write */
 
+static inline void mapping_set_error(struct address_space *mapping, int error)
+{
+       if (error) {
+               if (error == -ENOSPC)
+                       set_bit(AS_ENOSPC, &mapping->flags);
+               else
+                       set_bit(AS_EIO, &mapping->flags);
+       }
+}
+
 static inline gfp_t mapping_gfp_mask(struct address_space * mapping)
 {
        return (__force gfp_t)mapping->flags & __GFP_BITS_MASK;
@@ -52,19 +63,23 @@ static inline void mapping_set_gfp_mask(struct address_space *m, gfp_t mask)
 void release_pages(struct page **pages, int nr, int cold);
 
 #ifdef CONFIG_NUMA
-extern struct page *page_cache_alloc(struct address_space *x);
-extern struct page *page_cache_alloc_cold(struct address_space *x);
+extern struct page *__page_cache_alloc(gfp_t gfp);
 #else
+static inline struct page *__page_cache_alloc(gfp_t gfp)
+{
+       return alloc_pages(gfp, 0);
+}
+#endif
+
 static inline struct page *page_cache_alloc(struct address_space *x)
 {
-       return alloc_pages(mapping_gfp_mask(x), 0);
+       return __page_cache_alloc(mapping_gfp_mask(x));
 }
 
 static inline struct page *page_cache_alloc_cold(struct address_space *x)
 {
-       return alloc_pages(mapping_gfp_mask(x)|__GFP_COLD, 0);
+       return __page_cache_alloc(mapping_gfp_mask(x)|__GFP_COLD);
 }
-#endif
 
 typedef int filler_t(void *, struct page *);
 
@@ -72,8 +87,6 @@ extern struct page * find_get_page(struct address_space *mapping,
                                unsigned long index);
 extern struct page * find_lock_page(struct address_space *mapping,
                                unsigned long index);
-extern __deprecated_for_modules struct page * find_trylock_page(
-                       struct address_space *mapping, unsigned long index);
 extern struct page * find_or_create_page(struct address_space *mapping,
                                unsigned long index, gfp_t gfp_mask);
 unsigned find_get_pages(struct address_space *mapping, pgoff_t start,
@@ -93,12 +106,23 @@ static inline struct page *grab_cache_page(struct address_space *mapping, unsign
 
 extern struct page * grab_cache_page_nowait(struct address_space *mapping,
                                unsigned long index);
+extern struct page * read_cache_page_async(struct address_space *mapping,
+                               unsigned long index, filler_t *filler,
+                               void *data);
 extern struct page * read_cache_page(struct address_space *mapping,
                                unsigned long index, filler_t *filler,
                                void *data);
 extern int read_cache_pages(struct address_space *mapping,
                struct list_head *pages, filler_t *filler, void *data);
 
+static inline struct page *read_mapping_page_async(
+                                               struct address_space *mapping,
+                                            unsigned long index, void *data)
+{
+       filler_t *filler = (filler_t *)mapping->a_ops->readpage;
+       return read_cache_page_async(mapping, index, filler, data);
+}
+
 static inline struct page *read_mapping_page(struct address_space *mapping,
                                             unsigned long index, void *data)
 {