lkml.org 
[lkml]   [2022]   [May]   [20]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
SubjectRe: [PATCH v4 1/3] random: convert to using fops->read_iter()
From
On 5/20/22 7:37 AM, Jason A. Donenfeld wrote:
> On Fri, May 20, 2022 at 11:44:57AM +0200, Jason A. Donenfeld wrote:
>> const struct file_operations urandom_fops = {
>> - .read = urandom_read,
>> + .read_iter = urandom_read_iter,
>
> One thing I noticed is that drivers/char/mem.c has both the .read and
> the .read_iter functions for /dev/zero and /dev/null and such. I wonder
> if the .read ones can be removed?

I'm not sure if we have a clear "always use this if available" set of
rules for this. Ideally we'd want it to be:

1) Use ->read_iter() if available
2) If not, use ->read()

Might require a bit of auditing to ensure that's the case, and if we
can say that it is, then we could clean that up too.

--
Jens Axboe

\
 
 \ /
  Last update: 2022-05-20 16:36    [W:1.958 / U:0.016 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site