* Fix compiling UML
@ 2007-07-23 5:52 Ulrich Drepper
2007-07-23 7:43 ` Al Viro
0 siblings, 1 reply; 2+ messages in thread
From: Ulrich Drepper @ 2007-07-23 5:52 UTC (permalink / raw)
To: Linux Kernel, Andrew Morton, Linus Torvalds, jdike
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
The following patch is needed to get 2.6.23-rc1 to compile for UML
on x86-64.
Signed-off-by: Ulrich Drepper <drepper@redhat.com>
diff --git a/arch/um/os-Linux/aio.c b/arch/um/os-Linux/aio.c
index b126df4..9c70cb0 100644
- --- a/arch/um/os-Linux/aio.c
+++ b/arch/um/os-Linux/aio.c
@@ -75,9 +75,10 @@ static int do_aio(aio_context_t ctx, enum aio_type type, int fd, char *buf,
.aio_buf = (unsigned long) buf,
.aio_nbytes = len,
.aio_offset = offset,
+ .aio_flags = 0,
+ .aio_resfd = 0,
.aio_reserved1 = 0,
- - .aio_reserved2 = 0,
- - .aio_reserved3 = 0 });
+ .aio_reserved2 = 0 });
switch(type){
case AIO_READ:
- --
➧ Ulrich Drepper ➧ Red Hat, Inc. ➧ 444 Castro St ➧ Mountain View, CA ❖
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.7 (GNU/Linux)
iD8DBQFGpEIN2ijCOnn/RHQRAsTjAJ9Rs6wJFPxQ/ivqK3yaC5pymtcGhACgzWID
l2vwUwABAk8mAiw/g+7y3U0=
=bPu6
-----END PGP SIGNATURE-----
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: Fix compiling UML
2007-07-23 5:52 Fix compiling UML Ulrich Drepper
@ 2007-07-23 7:43 ` Al Viro
0 siblings, 0 replies; 2+ messages in thread
From: Al Viro @ 2007-07-23 7:43 UTC (permalink / raw)
To: Ulrich Drepper; +Cc: Linux Kernel, Andrew Morton, Linus Torvalds, jdike
On Sun, Jul 22, 2007 at 10:52:13PM -0700, Ulrich Drepper wrote:
> .aio_buf = (unsigned long) buf,
> .aio_nbytes = len,
> .aio_offset = offset,
> + .aio_flags = 0,
> + .aio_resfd = 0,
> .aio_reserved1 = 0,
> - - .aio_reserved2 = 0,
> - - .aio_reserved3 = 0 });
> + .aio_reserved2 = 0 });
Huh? First of all, you have a corrupted tree. No lines that would
start with " -" in that area... As for the rest, I would argue that
leaving *any* of these fields in that compound literal is no wise, since
that's just asking for future trouble of the same kind.
FWIW, why do we need that iocb at all? That compound literal already
gives us a modifiable object of the right type, with exactly the same
lifetime...
IOW, how about the following?
static int do_aio(aio_context_t ctx, enum aio_type type, int fd, char *buf,
int len, unsigned long long offset, struct aio_context *aio)
{
struct iocb *p = & (struct iocb) {
.aio_data = (unsigned long) aio,
.aio_fildes = fd,
.aio_buf = (unsigned long) buf,
.aio_nbytes = len,
.aio_offset = offset
};
char c;
switch (type) {
case AIO_READ:
p->aio_lio_opcode = IOCB_CMD_PREAD;
break;
case AIO_WRITE:
p->aio_lio_opcode = IOCB_CMD_PWRITE;
break;
case AIO_MMAP:
p->aio_lio_opcode = IOCB_CMD_PREAD;
p->aio_buf = (unsigned long) &c;
p->aio_nbytes = sizeof(c);
break;
default:
printk("Bogus op in do_aio - %d\n", type);
return -EINVAL;
}
return (io_submit(ctx, 1, &p) > 0) ? 0 : -errno;
}
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2007-07-23 7:43 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-07-23 5:52 Fix compiling UML Ulrich Drepper
2007-07-23 7:43 ` Al Viro
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox