From mboxrd@z Thu Jan 1 00:00:00 1970 From: Linus Torvalds Subject: Re: [patch 143/166] preadv/pwritev: Add preadv and pwritev system calls. Date: Thu, 2 Apr 2009 18:43:08 -0700 (PDT) Message-ID: References: <200904022359.n32NxNYu022834@imap1.linux-foundation.org> Mime-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Return-path: In-Reply-To: <200904022359.n32NxNYu022834-AB4EexQrvXRQetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org> Sender: linux-api-owner-u79uwXL29TY76Z2rM5mHXA@public.gmane.org To: Andrew Morton Cc: kraxel-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org, arnd-r2nGTMty4D4@public.gmane.org, "H. Peter Anvin" , linux-api-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, linux-arch-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, Ingo Molnar , ralf-6z/3iImG2C8G8FEW9MqTrA@public.gmane.org, tglx-hfZtesqFncYOwBW4kG4KsQ@public.gmane.org, Al Viro List-Id: linux-arch.vger.kernel.org On Thu, 2 Apr 2009, akpm-de/tnXTf+JLsfHDXvbKv3WD2FQJk+8+b@public.gmane.org wrote: > > glibc entriely and use a syscall prototype which works without > arch-specific wrappers inside the kernel: The offset argument is > explicitly split into two 32bit values. Grr. That may make sense on 32-bit architectures, but makes no sense what-so-ever on 64-bit ones. Why not just say that it's two "unsigned long" arguments, and split it by "sizeof unsigned long". And then, on 64-bit architectures, the high bits can be ignored. You can even get gcc to optimize it all away by doing something like #define HALF_LONG (BITS_IN_LONG / 2) offset = (((loff_t)high << HALF_LONG) << HALF_LONG) | low; and then gcc should automaticaly notice that shifting up that way is just a fancy way of saying "0", and ignore the high bits. How married are people to this crazy 2x "32 bits" model? Linus -- To unsubscribe from this list: send the line "unsubscribe linux-api" in the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org More majordomo info at http://vger.kernel.org/majordomo-info.html From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp1.linux-foundation.org ([140.211.169.13]:56563 "EHLO smtp1.linux-foundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751861AbZDCBtO (ORCPT ); Thu, 2 Apr 2009 21:49:14 -0400 Date: Thu, 2 Apr 2009 18:43:08 -0700 (PDT) From: Linus Torvalds Subject: Re: [patch 143/166] preadv/pwritev: Add preadv and pwritev system calls. In-Reply-To: <200904022359.n32NxNYu022834@imap1.linux-foundation.org> Message-ID: References: <200904022359.n32NxNYu022834@imap1.linux-foundation.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: linux-arch-owner@vger.kernel.org List-ID: To: Andrew Morton Cc: kraxel@redhat.com, arnd@arndb.de, "H. Peter Anvin" , linux-api@vger.kernel.org, linux-arch@vger.kernel.org, Ingo Molnar , ralf@linux-mips.org, tglx@linutronix.de, Al Viro Message-ID: <20090403014308.wCDDzE9tCmTRsOPIGXUvkd7ZpXBqtn35-o28J1tid_s@z> On Thu, 2 Apr 2009, akpm@linux-foundation.org wrote: > > glibc entriely and use a syscall prototype which works without > arch-specific wrappers inside the kernel: The offset argument is > explicitly split into two 32bit values. Grr. That may make sense on 32-bit architectures, but makes no sense what-so-ever on 64-bit ones. Why not just say that it's two "unsigned long" arguments, and split it by "sizeof unsigned long". And then, on 64-bit architectures, the high bits can be ignored. You can even get gcc to optimize it all away by doing something like #define HALF_LONG (BITS_IN_LONG / 2) offset = (((loff_t)high << HALF_LONG) << HALF_LONG) | low; and then gcc should automaticaly notice that shifting up that way is just a fancy way of saying "0", and ignore the high bits. How married are people to this crazy 2x "32 bits" model? Linus