[ewg] [PATCH] NFS-RDMA: Fix IA64 build break

Jon Mason jon at opengridcomputing.com
Mon Mar 30 14:52:01 PDT 2009


Hey Vlad,
The OFED build for IA64 is broke due to a circular #include list
resulting in "struct page" not being defined when page-flags.h is
included.  This was only hit on IA64 because of certain ASM files
including the first of the circular list.

This is fixed by defining cancel_dirty_page where "struct page" is
defined (e.g., mm.h), thus removing the possibility of the circular
#include.

I have verified this builds on IA64 (thanks to UNH) and x86_64, and I
have run connectathon on the x86_64 system without issue.

Thanks,
Jon

Signed-Off-By: Jon Mason <jon at opengridcomputing.com>

diff --git a/kernel_addons/backport/2.6.18-EL5.1/include/linux/mm.h b/kernel_addons/backport/2.6.18-EL5.1/include/linux/mm.h
index 31d4849..18fe1e2 100644
--- a/kernel_addons/backport/2.6.18-EL5.1/include/linux/mm.h
+++ b/kernel_addons/backport/2.6.18-EL5.1/include/linux/mm.h
@@ -2,6 +2,7 @@
 #define _BACKPORT_LINUX_MM_H_
 
 #include_next <linux/mm.h>
+#include <linux/vmstat.h>
 
 #if defined(__i386__)
 #include <asm/highmem.h>
@@ -18,4 +19,22 @@ struct shrinker {
 	long			nr;     /* objs pending delete */
 };
 
+static inline void task_io_account_cancelled_write(size_t bytes)
+{
+}
+
+static inline void cancel_dirty_page(struct page *page, unsigned int account_size)
+{
+	if (TestClearPageDirty(page)) {
+		struct address_space *mapping = page->mapping;
+		if (mapping && mapping_cap_account_dirty(mapping)) {
+			dec_zone_page_state(page, NR_FILE_DIRTY);
+			dec_bdi_stat(mapping->backing_dev_info,
+					BDI_RECLAIMABLE);
+			if (account_size)
+				task_io_account_cancelled_write(account_size);
+		}
+	}
+}
+
 #endif
diff --git a/kernel_addons/backport/2.6.18-EL5.1/include/linux/page-flags.h b/kernel_addons/backport/2.6.18-EL5.1/include/linux/page-flags.h
deleted file mode 100644
index bbecbfc..0000000
--- a/kernel_addons/backport/2.6.18-EL5.1/include/linux/page-flags.h
+++ /dev/null
@@ -1,25 +0,0 @@
-#ifndef BACKPORT_LINUX_PAGE_FLAGS_H
-#define BACKPORT_LINUX_PAGE_FLAGS_H
-
-#include_next <linux/page-flags.h>
-#include <linux/vmstat.h>
-
-static inline void task_io_account_cancelled_write(size_t bytes)
-{
-}
-
-static inline void cancel_dirty_page(struct page *page, unsigned int account_size)
-{
-	if (TestClearPageDirty(page)) {
-		struct address_space *mapping = page->mapping;
-		if (mapping && mapping_cap_account_dirty(mapping)) {
-			dec_zone_page_state(page, NR_FILE_DIRTY);
-			dec_bdi_stat(mapping->backing_dev_info,
-					BDI_RECLAIMABLE);
-			if (account_size)
-				task_io_account_cancelled_write(account_size);
-		}
-	}
-}
-
-#endif /* BACKPORT_LINUX_PAGE_FLAGS_H */
diff --git a/kernel_addons/backport/2.6.18-EL5.2/include/linux/mm.h b/kernel_addons/backport/2.6.18-EL5.2/include/linux/mm.h
index 31d4849..18fe1e2 100644
--- a/kernel_addons/backport/2.6.18-EL5.2/include/linux/mm.h
+++ b/kernel_addons/backport/2.6.18-EL5.2/include/linux/mm.h
@@ -2,6 +2,7 @@
 #define _BACKPORT_LINUX_MM_H_
 
 #include_next <linux/mm.h>
+#include <linux/vmstat.h>
 
 #if defined(__i386__)
 #include <asm/highmem.h>
@@ -18,4 +19,22 @@ struct shrinker {
 	long			nr;     /* objs pending delete */
 };
 
+static inline void task_io_account_cancelled_write(size_t bytes)
+{
+}
+
+static inline void cancel_dirty_page(struct page *page, unsigned int account_size)
+{
+	if (TestClearPageDirty(page)) {
+		struct address_space *mapping = page->mapping;
+		if (mapping && mapping_cap_account_dirty(mapping)) {
+			dec_zone_page_state(page, NR_FILE_DIRTY);
+			dec_bdi_stat(mapping->backing_dev_info,
+					BDI_RECLAIMABLE);
+			if (account_size)
+				task_io_account_cancelled_write(account_size);
+		}
+	}
+}
+
 #endif
diff --git a/kernel_addons/backport/2.6.18-EL5.2/include/linux/page-flags.h b/kernel_addons/backport/2.6.18-EL5.2/include/linux/page-flags.h
deleted file mode 100644
index bbecbfc..0000000
--- a/kernel_addons/backport/2.6.18-EL5.2/include/linux/page-flags.h
+++ /dev/null
@@ -1,25 +0,0 @@
-#ifndef BACKPORT_LINUX_PAGE_FLAGS_H
-#define BACKPORT_LINUX_PAGE_FLAGS_H
-
-#include_next <linux/page-flags.h>
-#include <linux/vmstat.h>
-
-static inline void task_io_account_cancelled_write(size_t bytes)
-{
-}
-
-static inline void cancel_dirty_page(struct page *page, unsigned int account_size)
-{
-	if (TestClearPageDirty(page)) {
-		struct address_space *mapping = page->mapping;
-		if (mapping && mapping_cap_account_dirty(mapping)) {
-			dec_zone_page_state(page, NR_FILE_DIRTY);
-			dec_bdi_stat(mapping->backing_dev_info,
-					BDI_RECLAIMABLE);
-			if (account_size)
-				task_io_account_cancelled_write(account_size);
-		}
-	}
-}
-
-#endif /* BACKPORT_LINUX_PAGE_FLAGS_H */
diff --git a/kernel_addons/backport/2.6.18-EL5.3/include/linux/mm.h b/kernel_addons/backport/2.6.18-EL5.3/include/linux/mm.h
index 31d4849..18fe1e2 100644
--- a/kernel_addons/backport/2.6.18-EL5.3/include/linux/mm.h
+++ b/kernel_addons/backport/2.6.18-EL5.3/include/linux/mm.h
@@ -2,6 +2,7 @@
 #define _BACKPORT_LINUX_MM_H_
 
 #include_next <linux/mm.h>
+#include <linux/vmstat.h>
 
 #if defined(__i386__)
 #include <asm/highmem.h>
@@ -18,4 +19,22 @@ struct shrinker {
 	long			nr;     /* objs pending delete */
 };
 
+static inline void task_io_account_cancelled_write(size_t bytes)
+{
+}
+
+static inline void cancel_dirty_page(struct page *page, unsigned int account_size)
+{
+	if (TestClearPageDirty(page)) {
+		struct address_space *mapping = page->mapping;
+		if (mapping && mapping_cap_account_dirty(mapping)) {
+			dec_zone_page_state(page, NR_FILE_DIRTY);
+			dec_bdi_stat(mapping->backing_dev_info,
+					BDI_RECLAIMABLE);
+			if (account_size)
+				task_io_account_cancelled_write(account_size);
+		}
+	}
+}
+
 #endif
diff --git a/kernel_addons/backport/2.6.18-EL5.3/include/linux/page-flags.h b/kernel_addons/backport/2.6.18-EL5.3/include/linux/page-flags.h
deleted file mode 100644
index c7ae693..0000000
--- a/kernel_addons/backport/2.6.18-EL5.3/include/linux/page-flags.h
+++ /dev/null
@@ -1,27 +0,0 @@
-#ifndef BACKPORT_LINUX_PAGE_FLAGS_H
-#define BACKPORT_LINUX_PAGE_FLAGS_H
-
-#include_next <linux/page-flags.h>
-#ifndef CONFIG_IA64
-#include <linux/vmstat.h>
-#include <linux/mm.h>
-
-static inline void task_io_account_cancelled_write(size_t bytes)
-{
-}
-
-static inline void cancel_dirty_page(struct page *page, unsigned int account_size)
-{
-	if (TestClearPageDirty(page)) {
-		struct address_space *mapping = page->mapping;
-		if (mapping && mapping_cap_account_dirty(mapping)) {
-			dec_zone_page_state(page, NR_FILE_DIRTY);
-			dec_bdi_stat(mapping->backing_dev_info,
-					BDI_RECLAIMABLE);
-			if (account_size)
-				task_io_account_cancelled_write(account_size);
-		}
-	}
-}
-#endif
-#endif /* BACKPORT_LINUX_PAGE_FLAGS_H */



More information about the ewg mailing list