On Wed, 28 Mar 2007 16:21:04 -0700
Zach Brown <[EMAIL PROTECTED]> wrote:

> > Does this look OK?
> 
> Almost...
> 
> > #ifdef CONFIG_HIGHMEM
> > static inline void pipe_kunmap_atomic(void *addr, enum km_type type)
> > #else       /* CONFIG_HIGHMEM */
> > static inline void pipe_kunmap_atomic(struct page *page, enum  
> > km_type type)
> 

OK, I give up.  What are you telling me here?

<compiles it>

argh, enum km_type isn't defined if !CONFIG_HIGHMEM, which is extravagantly
dumb.


From: Andrew Morton <[EMAIL PROTECTED]>

Cc: "Ken Chen" <[EMAIL PROTECTED]>
Cc: Zach Brown <[EMAIL PROTECTED]>
Signed-off-by: Andrew Morton <[EMAIL PROTECTED]>
---

 fs/pipe.c |   31 +++++++++++++++++++++++++------
 1 files changed, 25 insertions(+), 6 deletions(-)

diff -puN fs/pipe.c~cache-pipe-buf-page-address-for-non-highmem-arch-fix-tidy 
fs/pipe.c
--- a/fs/pipe.c~cache-pipe-buf-page-address-for-non-highmem-arch-fix-tidy
+++ a/fs/pipe.c
@@ -22,17 +22,36 @@
 #include <asm/ioctls.h>
 
 #ifdef CONFIG_HIGHMEM
-#define pipe_kmap              kmap
-#define pipe_kmap_atomic       kmap_atomic
-#define pipe_kunmap            kunmap
-#define pipe_kunmap_atomic     kunmap_atomic
+static inline void *pipe_kmap(struct page *page)
+{
+       return kmap(page);
+}
+
+static inline void pipe_kunmap(struct page *page)
+{
+       kunmap(page);
+}
+
+static inline void *pipe_kmap_atomic(struct page *page, enum km_type type)
+{
+       return kmap_atomic(page, type);
+}
+
+static inline void pipe_kunmap_atomic(void *addr, enum km_type type)
+{
+       kunmap_atomic(addr, type);
+}
 #else  /* CONFIG_HIGHMEM */
 static inline void *pipe_kmap(struct page *page)
 {
-       return (void *) page->private;
+       return (void *)page->private;
 }
+
+static inline void pipe_kunmap(struct page *page)
+{
+}
+
 #define pipe_kmap_atomic(page, type)   pipe_kmap(page)
-#define pipe_kunmap(page)              do { } while (0)
 #define pipe_kunmap_atomic(page, type) do { } while (0)
 #endif
 
_

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Reply via email to