[ewg] [PATCH] NFS-RDMA: Fix Lustre compile issue

Jon Mason jon at opengridcomputing.com
Tue Mar 31 15:21:32 PDT 2009


This patch fixes a build break in Lustre when compiling in RHEL5.
This is caused by a circular #include dependency caused when including
mpage.h and writeback.h.  Since there may be other pieces of code that
will choose to include both of those header files, it is best to remove
the circular dependency by moving the write_cache_pages code to the
mpage.h kernel_addon header file.

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

diff --git a/kernel_addons/backport/2.6.18-EL5.1/include/linux/mpage.h b/kernel_addons/backport/2.6.18-EL5.1/include/linux/mpage.h
new file mode 100644
index 0000000..1c5ed55
--- /dev/null
+++ b/kernel_addons/backport/2.6.18-EL5.1/include/linux/mpage.h
@@ -0,0 +1,15 @@
+#ifndef BACKPORT_LINUX_MPAGE_H
+#define BACKPORT_LINUX_MPAGE_H
+
+#include_next <linux/mpage.h>
+#include <linux/pagevec.h>
+
+typedef int (*backport_writepage_t)(struct page *page, struct writeback_control *wbc,
+                                void *data);
+
+extern int backport_write_cache_pages(struct address_space *mapping,
+                      struct writeback_control *wbc, backport_writepage_t writepage,
+                      void *data);
+
+#define write_cache_pages backport_write_cache_pages
+#endif
diff --git a/kernel_addons/backport/2.6.18-EL5.1/include/linux/writeback.h b/kernel_addons/backport/2.6.18-EL5.1/include/linux/writeback.h
deleted file mode 100644
index 0ecfd2f..0000000
--- a/kernel_addons/backport/2.6.18-EL5.1/include/linux/writeback.h
+++ /dev/null
@@ -1,13 +0,0 @@
-#ifndef BACKPORT_LINUX_WRITEBACK_H
-#define BACKPORT_LINUX_WRITEBACK_H
-
-#include_next <linux/writeback.h>
-#include <linux/pagevec.h>
-
-typedef int (*backport_writepage_t)(struct page *page, struct writeback_control *wbc,
-                                void *data);
-
-extern int write_cache_pages(struct address_space *mapping,
-                      struct writeback_control *wbc, backport_writepage_t writepage,
-                      void *data);
-#endif
diff --git a/kernel_addons/backport/2.6.18-EL5.1/include/src/writeback.c b/kernel_addons/backport/2.6.18-EL5.1/include/src/writeback.c
index e8bf5ac..0e34f32 100644
--- a/kernel_addons/backport/2.6.18-EL5.1/include/src/writeback.c
+++ b/kernel_addons/backport/2.6.18-EL5.1/include/src/writeback.c
@@ -2,6 +2,7 @@
 #include <linux/pagemap.h>
 #include <linux/pagevec.h>
 #include <linux/writeback.h>
+#include <linux/mpage.h>
 #include <linux/module.h>
 
 int write_cache_pages(struct address_space *mapping,
diff --git a/kernel_addons/backport/2.6.18-EL5.2/include/linux/mpage.h b/kernel_addons/backport/2.6.18-EL5.2/include/linux/mpage.h
new file mode 100644
index 0000000..1c5ed55
--- /dev/null
+++ b/kernel_addons/backport/2.6.18-EL5.2/include/linux/mpage.h
@@ -0,0 +1,15 @@
+#ifndef BACKPORT_LINUX_MPAGE_H
+#define BACKPORT_LINUX_MPAGE_H
+
+#include_next <linux/mpage.h>
+#include <linux/pagevec.h>
+
+typedef int (*backport_writepage_t)(struct page *page, struct writeback_control *wbc,
+                                void *data);
+
+extern int backport_write_cache_pages(struct address_space *mapping,
+                      struct writeback_control *wbc, backport_writepage_t writepage,
+                      void *data);
+
+#define write_cache_pages backport_write_cache_pages
+#endif
diff --git a/kernel_addons/backport/2.6.18-EL5.2/include/linux/writeback.h b/kernel_addons/backport/2.6.18-EL5.2/include/linux/writeback.h
deleted file mode 100644
index 0ecfd2f..0000000
--- a/kernel_addons/backport/2.6.18-EL5.2/include/linux/writeback.h
+++ /dev/null
@@ -1,13 +0,0 @@
-#ifndef BACKPORT_LINUX_WRITEBACK_H
-#define BACKPORT_LINUX_WRITEBACK_H
-
-#include_next <linux/writeback.h>
-#include <linux/pagevec.h>
-
-typedef int (*backport_writepage_t)(struct page *page, struct writeback_control *wbc,
-                                void *data);
-
-extern int write_cache_pages(struct address_space *mapping,
-                      struct writeback_control *wbc, backport_writepage_t writepage,
-                      void *data);
-#endif
diff --git a/kernel_addons/backport/2.6.18-EL5.2/include/src/writeback.c b/kernel_addons/backport/2.6.18-EL5.2/include/src/writeback.c
index e8bf5ac..0e34f32 100644
--- a/kernel_addons/backport/2.6.18-EL5.2/include/src/writeback.c
+++ b/kernel_addons/backport/2.6.18-EL5.2/include/src/writeback.c
@@ -2,6 +2,7 @@
 #include <linux/pagemap.h>
 #include <linux/pagevec.h>
 #include <linux/writeback.h>
+#include <linux/mpage.h>
 #include <linux/module.h>
 
 int write_cache_pages(struct address_space *mapping,
diff --git a/kernel_addons/backport/2.6.18-EL5.3/include/linux/mpage.h b/kernel_addons/backport/2.6.18-EL5.3/include/linux/mpage.h
new file mode 100644
index 0000000..1c5ed55
--- /dev/null
+++ b/kernel_addons/backport/2.6.18-EL5.3/include/linux/mpage.h
@@ -0,0 +1,15 @@
+#ifndef BACKPORT_LINUX_MPAGE_H
+#define BACKPORT_LINUX_MPAGE_H
+
+#include_next <linux/mpage.h>
+#include <linux/pagevec.h>
+
+typedef int (*backport_writepage_t)(struct page *page, struct writeback_control *wbc,
+                                void *data);
+
+extern int backport_write_cache_pages(struct address_space *mapping,
+                      struct writeback_control *wbc, backport_writepage_t writepage,
+                      void *data);
+
+#define write_cache_pages backport_write_cache_pages
+#endif
diff --git a/kernel_addons/backport/2.6.18-EL5.3/include/linux/writeback.h b/kernel_addons/backport/2.6.18-EL5.3/include/linux/writeback.h
deleted file mode 100644
index ed3fd56..0000000
--- a/kernel_addons/backport/2.6.18-EL5.3/include/linux/writeback.h
+++ /dev/null
@@ -1,15 +0,0 @@
-#ifndef BACKPORT_LINUX_WRITEBACK_H
-#define BACKPORT_LINUX_WRITEBACK_H
-
-#include_next <linux/writeback.h>
-#include <linux/pagevec.h>
-
-typedef int (*backport_writepage_t)(struct page *page, struct writeback_control *wbc,
-                                void *data);
-
-extern int backport_write_cache_pages(struct address_space *mapping,
-                      struct writeback_control *wbc, backport_writepage_t writepage,
-                      void *data);
-
-#define write_cache_pages backport_write_cache_pages
-#endif
diff --git a/kernel_addons/backport/2.6.18-EL5.3/include/src/writeback.c b/kernel_addons/backport/2.6.18-EL5.3/include/src/writeback.c
index fbd4055..7f8ebbe 100644
--- a/kernel_addons/backport/2.6.18-EL5.3/include/src/writeback.c
+++ b/kernel_addons/backport/2.6.18-EL5.3/include/src/writeback.c
@@ -2,6 +2,7 @@
 #include <linux/pagemap.h>
 #include <linux/pagevec.h>
 #include <linux/writeback.h>
+#include <linux/mpage.h>
 #include <linux/module.h>
 
 int backport_write_cache_pages(struct address_space *mapping,
diff --git a/kernel_patches/backport/2.6.18-EL5.3/rnfs_fs.patch b/kernel_patches/backport/2.6.18-EL5.3/rnfs_fs.patch
index 09ef4d1..f91e162 100644
--- a/kernel_patches/backport/2.6.18-EL5.3/rnfs_fs.patch
+++ b/kernel_patches/backport/2.6.18-EL5.3/rnfs_fs.patch
@@ -1120,6 +1120,14 @@ diff --git a/fs/nfs/write.c b/fs/nfs/write.c
 index 3229e21..08df526 100644
 --- a/fs/nfs/write.c
 +++ b/fs/nfs/write.c
+@@ -12,6 +12,7 @@
+ #include <linux/pagemap.h>
+ #include <linux/file.h>
+ #include <linux/writeback.h>
++#include <linux/mpage.h>
+ #include <linux/swap.h>
+ 
+ #include <linux/sunrpc/clnt.h>
 @@ -726,8 +726,8 @@ int nfs_updatepage(struct file *file, struct page *page,
  	nfs_inc_stats(inode, NFSIOS_VFSUPDATEPAGE);
  



More information about the ewg mailing list