Skip to contentSkip to conversation

inline grab_cache_page

PATCH New Christoph Hellwig 1 participant 1 message Aug 29, 2002

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 inline grab_cache_page

It's nothing but a wrapper for slightly different parameters around find_or_create pages. Also some external code (e.g. XFS) want the latter exported to control the gfp_mask.

include/linux/pagemap.h +9 -1
@@ -97,7 +97,15 @@ static inline void wait_on_page(struct p
 		___wait_on_page(page);
 }
 
-extern struct page * grab_cache_page (struct address_space *, unsigned long);
+/*
+ * Returns locked page at given index in given cache, creating it if needed.
+ */
+static inline struct page *grab_cache_page(struct address_space *mapping, unsigned long index)
+{
+	return find_or_create_page(mapping, index, mapping->gfp_mask);
+}
+
+
 extern struct page * grab_cache_page_nowait (struct address_space *, unsigned long);
 
 typedef int filler_t(void *, struct page*);
kernel/ksyms.c +1 -1
@@ -261,7 +262,7 @@ EXPORT_SYMBOL(poll_freewait);
 EXPORT_SYMBOL(ROOT_DEV);
 EXPORT_SYMBOL(__find_get_page);
 EXPORT_SYMBOL(__find_lock_page);
-EXPORT_SYMBOL(grab_cache_page);
+EXPORT_SYMBOL(find_or_create_page);
 EXPORT_SYMBOL(grab_cache_page_nowait);
 EXPORT_SYMBOL(read_cache_page);
 EXPORT_SYMBOL(set_page_dirty);
mm/filemap.c +0 -9
@@ -1029,15 +1029,6 @@ struct page * find_or_create_page(struct
 }
 
 /*
- * Returns locked page at given index in given cache, creating it if needed.
- */
-struct page *grab_cache_page(struct address_space *mapping, unsigned long index)
-{
-	return find_or_create_page(mapping, index, mapping->gfp_mask);
-}
-
-
-/*
  * Same as grab_cache_page, but do not wait if the page is unavailable.
  * This is intended for speculative data generators, where the data can
  * be regenerated if the page couldn't be grabbed.  This routine should