From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-3.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 1FC04C48BC2 for ; Mon, 21 Jun 2021 14:51:29 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id F0A6460FDA for ; Mon, 21 Jun 2021 14:51:28 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230136AbhFUOxm (ORCPT ); Mon, 21 Jun 2021 10:53:42 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35538 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229807AbhFUOxl (ORCPT ); Mon, 21 Jun 2021 10:53:41 -0400 Received: from zeniv-ca.linux.org.uk (zeniv-ca.linux.org.uk [IPv6:2607:5300:60:148a::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id F2E57C061574; Mon, 21 Jun 2021 07:51:26 -0700 (PDT) Received: from viro by zeniv-ca.linux.org.uk with local (Exim 4.94.2 #2 (Red Hat Linux)) id 1lvLGm-00ArVj-Ba; Mon, 21 Jun 2021 14:51:24 +0000 Date: Mon, 21 Jun 2021 14:51:24 +0000 From: Al Viro To: Christoph Hellwig Cc: Vivek Goyal , linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, virtio-fs@redhat.com Subject: Re: [PATCH 1/2] init: split get_fs_names Message-ID: References: <20210621062657.3641879-1-hch@lst.de> <20210621062657.3641879-2-hch@lst.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Sender: Al Viro Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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...