From: Andrew Morton <akpm@linux-foundation.org>
To: Zach Brown <zach.brown@oracle.com>
Cc: Ken Chen <kenchen@google.com>, linux-kernel@vger.kernel.org
Subject: Re: [patch] cache pipe buf page address for non-highmem arch
Date: Wed, 28 Mar 2007 16:34:16 -0700 [thread overview]
Message-ID: <20070328163416.133d109a.akpm@linux-foundation.org> (raw)
In-Reply-To: <3F0B1567-B32C-44F4-9B90-0737ADDACC56@oracle.com>
On Wed, 28 Mar 2007 16:21:04 -0700
Zach Brown <zach.brown@oracle.com> 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 <akpm@linux-foundation.org>
Cc: "Ken Chen" <kenchen@google.com>
Cc: Zach Brown <zach.brown@oracle.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
---
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
_
next prev parent reply other threads:[~2007-03-28 23:34 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-03-23 0:51 [patch] cache pipe buf page address for non-highmem arch Ken Chen
2007-03-23 1:01 ` Andrew Morton
2007-03-24 0:48 ` Ken Chen
2007-03-27 4:15 ` Andrew Morton
2007-03-27 17:47 ` Ken Chen
2007-03-27 22:57 ` Zach Brown
2007-03-28 23:14 ` Andrew Morton
2007-03-28 23:21 ` Zach Brown
2007-03-28 23:34 ` Andrew Morton [this message]
2007-03-28 23:48 ` Jeremy Fitzhardinge
2007-03-23 10:14 ` Christoph Hellwig
2007-03-24 1:01 ` Ken Chen
2007-03-24 1:40 ` Benjamin LaHaise
2007-03-27 15:05 ` Andi Kleen
2007-03-27 15:01 ` Andi Kleen
2007-03-27 18:06 ` Ken Chen
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20070328163416.133d109a.akpm@linux-foundation.org \
--to=akpm@linux-foundation.org \
--cc=kenchen@google.com \
--cc=linux-kernel@vger.kernel.org \
--cc=zach.brown@oracle.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox