Proposal for kernel change

Alexander Viro viro en math.psu.edu
Dom Ene 23 11:37:55 CST 2000



On Sat, 22 Jan 2000, Abramo Bagnara wrote:

> 
> After a preliminary discussion with Alan and his green light, I send you
> our proposal for writev/readv callback insertion to file_operation
> struct.

Awwww...

> Currently the stream mode is not usable with non interleaved data
> because:
> - we'd have to specify bytes per voice (or deduce it using count / V)
> - we'd have to recompose the stream after a partial transfer
> - the transferred bytes are not contiguous
> etc.
> 
> We can for sure affirm that to use that with standard write interface is
> a mess and not efficient.
> -----------
> 
> Proposal:
> 
> To extend struct file_operation for readv and writev functions.
> 
> If the pointer is NULL the current behaviour is retained.
> 
> This permit also to not treat the sock case as an exception (exceptions
> may be thought as bad design symptoms ;-)

Correct, but adding more and more methods... If anything, we might be
better off with callback _passed_ _to_ ->read() and ->write(). _That_
would make a lot of sense, simply because we could (a) do read/write from
kernel space without set_fs() trickery; (b) do analogs of sendfile() right
way; (c) yes, kill special case for sockets; (d) hopefully solve your
problem. Normal sys_read() and sys_write() would pass copy_to_user() /
copy_from_user() here. For sys_readv() and sys_writev() - well,
corresponding function that would copy to/from iovector. IIRC we have
something like that either in net/core/* or in net/socket.c...

Linus, remember the patch splitting write_one_page() in two parts? That
would make the thing very natural for regular files too - we would just
call that callback from generic_file_write(). And reading side already has
such callback...
							Cheers,
								Al


-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo en vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/



Más información sobre la lista de distribución Ayuda