From: Ralf Baechle <ralf@linux-mips.org>
To: Gerd Hoffmann <kraxel@redhat.com>
Cc: linux-kernel@vger.kernel.org, linux-arch@vger.kernel.org
Subject: Re: [PATCH v2] Add preadv and pwritev system calls.
Date: Fri, 12 Dec 2008 15:40:24 +0000 [thread overview]
Message-ID: <20081212154024.GA31555@linux-mips.org> (raw)
In-Reply-To: <1229090440-32120-1-git-send-email-kraxel@redhat.com>
On Fri, Dec 12, 2008 at 03:00:40PM +0100, Gerd Hoffmann wrote:
> This patch adds preadv and pwritev system calls. These syscalls are a
> pretty straightforward combination of pread and readv (same for write).
> They are quite useful for doing vectored I/O in threaded applications.
> Using lseek+readv instead opens race windows you'll have to plug with
> locking.
>
> Other systems have such system calls too, for example NetBSD, check
> here: http://www.daemon-systems.org/man/preadv.2.html
>
> The patch sports the actual system call implementation and the windup in
> the x86 system call tables. Other archs are TBD.
> +asmlinkage ssize_t sys_preadv(unsigned long fd, const struct iovec __user *vec,
> + unsigned long vlen, loff_t pos)
> +asmlinkage ssize_t sys_pwritev(unsigned long fd, const struct iovec __user *vec,
> + unsigned long vlen, loff_t pos)
As so often before the devil is in the function prototype. On some
architectures - 32-bit MIPS and PARISC, maybe others - 64-bit arguments
such as loff_t need to be passed in an _aligned_ pair of 32-bit
arguments which effectivly requires another wrapper like this around
your compat wrapper:
asmlinkage int sys32_preadv(unsigned long fd,
const struct compat_iovec __user *vec,
unsigned long vlen, int dummy, unsigned a5, unsigned a6)
{
return compat_sys_preadv(fd, vec, vlen, merge_64(a5, a6));
}
merge_64() takes two 32-bit halves of a 64-bit argument and combines them
into a 64-bit argument again.
I wonder, does that merging happen magically on x86 or?
Ralf
next prev parent reply other threads:[~2008-12-12 15:42 UTC|newest]
Thread overview: 32+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-12-12 14:00 [PATCH v2] Add preadv and pwritev system calls Gerd Hoffmann
2008-12-12 15:29 ` Matthew Wilcox
2008-12-12 15:48 ` Gerd Hoffmann
2008-12-12 15:51 ` Matthew Wilcox
2008-12-12 16:02 ` Gerd Hoffmann
2008-12-12 17:03 ` Matthew Wilcox
2008-12-12 17:03 ` Matthew Wilcox
2008-12-12 18:21 ` Alan Cox
2008-12-12 19:02 ` Russell King
2008-12-12 18:29 ` Scott Lurndal
2008-12-12 19:07 ` Russell King
2008-12-12 19:56 ` Gerd Hoffmann
2008-12-12 19:56 ` Gerd Hoffmann
2008-12-12 20:12 ` Russell King
2008-12-12 20:12 ` Russell King
2008-12-12 20:39 ` Gerd Hoffmann
2008-12-12 20:39 ` Gerd Hoffmann
2008-12-14 18:19 ` Pavel Machek
2008-12-14 18:19 ` Pavel Machek
2008-12-15 16:37 ` Jennifer Pioch
2008-12-15 20:43 ` Gerd Hoffmann
2008-12-16 9:57 ` Arnd Bergmann
[not found] ` <200812161057.03025.arnd-r2nGTMty4D4@public.gmane.org>
2008-12-17 1:45 ` Dan Mick
2008-12-17 1:45 ` [osol-code] " Dan Mick
2008-12-12 19:47 ` Arnd Bergmann
2008-12-12 20:02 ` Gerd Hoffmann
2008-12-14 11:49 ` Heiko Carstens
2008-12-15 4:14 ` Paul Mackerras
2008-12-15 6:20 ` David Miller
2008-12-12 15:40 ` Ralf Baechle [this message]
2008-12-12 16:59 ` Russell King
2008-12-13 1:18 ` Michael Kerrisk
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=20081212154024.GA31555@linux-mips.org \
--to=ralf@linux-mips.org \
--cc=kraxel@redhat.com \
--cc=linux-arch@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
/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