lkml.org 
[lkml]   [2021]   [Jun]   [21]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 1/2] init: split get_fs_names
On Mon, Jun 21, 2021 at 02:46:37PM +0000, Al Viro wrote:

> int __init get_filesystem_list(char *buf, bool is_dev)
> {
> int f = is_dev ? FS_REQUIRES_DEV : 0;
> int left = PAGE_SIZE, count = 0;
> struct file_system_type *p;
>
> read_lock(&file_systems_lock);
> for (p = file_systems; p; p = p->next) {
> if ((p->fs_flags & FS_REQUIRES_DEV) == f) {
> size_t len = strlen(p->name) + 1;
> if (len > left)
> break;
> memcpy(buf, p->name, len);
> buf += len;
> left -= len;
> count++;
> }
> }
> read_unlock(&file_systems_lock);
> return count;
> }
>
> Generates NUL-separated list, returns the number of list elements,
> the second argument is "what kind do you want"...

Actually, looking at the rest of the queue, that's only used for
!nodev ones, so might as well drop the flag here...

\
 
 \ /
  Last update: 2021-06-21 16:52    [W:0.235 / U:0.176 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site