From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1750917AbXC1XOb (ORCPT ); Wed, 28 Mar 2007 19:14:31 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S933813AbXC1XOb (ORCPT ); Wed, 28 Mar 2007 19:14:31 -0400 Received: from smtp.osdl.org ([65.172.181.24]:35199 "EHLO smtp.osdl.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750917AbXC1XOa (ORCPT ); Wed, 28 Mar 2007 19:14:30 -0400 Date: Wed, 28 Mar 2007 16:14:20 -0700 From: Andrew Morton To: Zach Brown Cc: Ken Chen , linux-kernel@vger.kernel.org Subject: Re: [patch] cache pipe buf page address for non-highmem arch Message-Id: <20070328161420.3c8f9688.akpm@linux-foundation.org> In-Reply-To: <3D4D126C-0B26-4B00-A2E4-68BD84555B51@oracle.com> References: <20070322170122.ee2589a1.akpm@linux-foundation.org> <20070326201552.b8ad7dda.akpm@linux-foundation.org> <3D4D126C-0B26-4B00-A2E4-68BD84555B51@oracle.com> X-Mailer: Sylpheed version 2.2.7 (GTK+ 2.8.6; i686-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org On Tue, 27 Mar 2007 15:57:53 -0700 Zach Brown wrote: > > +#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) > > Please don't drop arguments in stubs. It can let completely broken > code compile, like: > > pipe_kunmap(SOME_COMPLETE_NONSENSE); > > Static inlines with empty bodies are the gold standard. > yup. Does this look OK? #ifdef CONFIG_HIGHMEM 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; } static inline void pipe_kunmap(struct page *page) { } static inline void *pipe_kmap_atomic(struct page *page, enum km_type type) { return (void *)page->private; } static inline void pipe_kunmap_atomic(struct page *page, enum km_type type) { } #endif