Re: [PATCH][RFC] splice support

From: Jan Engelhardt
Date: Thu Mar 30 2006 - 03:06:30 EST


>>
>> - splice() take a size_t length. Should it be taking a 64-bit length?
>
>No. You can't splice more than the kernel buffers anyway (ie currently
>PIPE_BUFFERS pages, ie ~64kB, although in theory somebody could use large
>pages for it), so 64-bit would be total overkill.
>
So unsigned int would be enough, would not it?


>> - why is the `flags' arg to sys_splice() unsigned long? Can it be `int'?
>
>flags are always unsigned long, haven't you noticed? [...]

On x86, an unsigned long holds 32 bit, so we can at most put 32 flags in a
'flags' argument, even on x64 -- to stay compatible/deterministic/you know.
So it sounds like a good thing to make it 'unsigned int' rather than
'unsigned long'. Saves stack space.


>> - All the operations do foo(in, out, ...). It's a bit more conventional
>> to do foo(out, in, ...).

man bzero(3)
man swab(3)
man bcopy(3)

It's not (out,in) everywhere. But there are also other extremes, like
outb() where (val,port) is rather confusing compared to the rest of the
world (port,val).



Jan Engelhardt
--
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/