[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <YNCnbIpKeprhPfRO@zeniv-ca.linux.org.uk>
Date: Mon, 21 Jun 2021 14:51:24 +0000
From: Al Viro <viro@...iv.linux.org.uk>
To: Christoph Hellwig <hch@....de>
Cc: Vivek Goyal <vgoyal@...hat.com>, linux-fsdevel@...r.kernel.org,
linux-kernel@...r.kernel.org, virtio-fs@...hat.com
Subject: Re: [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...
Powered by blists - more mailing lists