#include <linux/compat.h>
#include <linux/if_ether.h>
+/* This pulls-in a lot of non-exported symbol backports
+ * on kernels older than 2.6.32. There's no harm for not
+ * making this available on kernels < 2.6.32. */
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,32))
+#include <linux/pagemap.h>
+
+/* This backports:
+ *
+ * commit d9d90e5eb70e09903dadff42099b6c948f814050
+ * Author: Hugh Dickins <hughd@google.com>
+ * Date: Mon Jun 27 16:18:04 2011 -0700
+ *
+ * tmpfs: add shmem_read_mapping_page_gfp
+ */
+
+struct page *shmem_read_mapping_page_gfp(struct address_space *mapping,
+ pgoff_t index, gfp_t gfp)
+{
+ return read_cache_page_gfp(mapping, index, gfp);
+}
+EXPORT_SYMBOL_GPL(shmem_read_mapping_page_gfp);
+#endif
+
int mac_pton(const char *s, u8 *mac)
{
int i;
#include <linux/rcupdate.h>
+/* This pulls-in a lot of non-exported symbol backports
+ * on kernels older than 2.6.32. There's no harm for not
+ * making this available on kernels < 2.6.32. */
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,32))
+#include <linux/pagemap.h>
+
+/* This backports the 2nd part of:
+ *
+ * commit d9d90e5eb70e09903dadff42099b6c948f814050
+ * Author: Hugh Dickins <hughd@google.com>
+ * Date: Mon Jun 27 16:18:04 2011 -0700
+ *
+ * tmpfs: add shmem_read_mapping_page_gfp
+ *
+ * First part is in compat-3.0.c.
+ */
+extern struct page *shmem_read_mapping_page_gfp(struct address_space *mapping,
+ pgoff_t index, gfp_t gfp);
+
+
+static inline struct page *shmem_read_mapping_page(
+ struct address_space *mapping, pgoff_t index)
+{
+ return shmem_read_mapping_page_gfp(mapping, index,
+ mapping_gfp_mask(mapping));
+}
+#endif
+
+
/*
* since commit 1c5cae815d19ffe02bdfda1260949ef2b1806171
* "net: call dev_alloc_name from register_netdevice" dev_alloc_name is