Re: [PATCH] char/mem: only use {read,write}_iter, not the old {read,write} functions

From: Jens Axboe
Date: Fri May 20 2022 - 10:38:46 EST


On 5/20/22 7:50 AM, Jason A. Donenfeld wrote:
> Currently mem.c implements both the {read,write}_iter functions and the
> {read,write} functions. But with {read,write} going away at some point
> in the future, and most kernel code made to prefer {read,write}_iter,
> there's no point in keeping around the old code. Actually, this comment
> in __kernel_read() indicates that having both might be plain wrong:
>
> /*
> * Also fail if ->read_iter and ->read are both wired up as that
> * implies very convoluted semantics.
> */
> if (unlikely(!file->f_op->read_iter || file->f_op->read))
> return warn_unsupported(file, "read");

Nice, just another bit of wasted space due to not having clearly
defined iter vs non-iter.

Reviewed-by: Jens Axboe <axboe@xxxxxxxxx>

--
Jens Axboe