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 Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 7848DC433FE for ; Thu, 24 Mar 2022 06:56:39 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1348243AbiCXG6I (ORCPT ); Thu, 24 Mar 2022 02:58:08 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48814 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230331AbiCXG6H (ORCPT ); Thu, 24 Mar 2022 02:58:07 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CD74797284; Wed, 23 Mar 2022 23:56:36 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 68C91B81DDE; Thu, 24 Mar 2022 06:56:35 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 57068C340F0; Thu, 24 Mar 2022 06:56:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1648104993; bh=t7ZJC+nb03OJhruyjJMshPqBsDPc27EJQOvu6/pKRwY=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=p+2mxlDm/Y1xr/p0OUWJrcZ66gIMW04Vgb7md5J0s7MAJoIPQB+VZsH+halolMzp/ hnhPaJffyBkZusGuTOcc0JXhpOCDyIJaQlwNDwN7Vl5iTULbpmBqY0GMwdb4iZKEXA fNXyI8STxgYWAMryldGFDv9mv/5p8eJasA19T3IM= Date: Thu, 24 Mar 2022 07:56:30 +0100 From: Greg KH To: Miklos Szeredi Cc: Christian Brauner , Miklos Szeredi , linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, Linux API , linux-man , LSM , Karel Zak , Ian Kent , David Howells , Linus Torvalds , Al Viro , Christian Brauner , Amir Goldstein , James Bottomley Subject: Re: [RFC PATCH] getvalues(2) prototype Message-ID: References: <20220322192712.709170-1-mszeredi@redhat.com> <20220323114215.pfrxy2b6vsvqig6a@wittgenstein> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: On Wed, Mar 23, 2022 at 04:23:34PM +0100, Miklos Szeredi wrote: > On Wed, 23 Mar 2022 at 14:38, Greg KH wrote: > > > This has been proposed in the past a few times. Most recently by the > > KVM developers, which tried to create a "generic" api, but ended up just > > making something to work for KVM as they got tired of people ignoring > > their more intrusive patch sets. See virt/kvm/binary_stats.c for what > > they ended up with, and perhaps you can just use that same type of > > interface here as well? > > So this looks like a fixed set of statistics where each one has a > descriptor (a name, size, offset, flags, ...) that tells about the > piece of data to be exported. The stats are kept up to date in kernel > memory and copied to userspace on read. The copy can be selective, > since the read can specify the offset and size of data it would like > to retrieve. > > The interface is self descriptive and selective, but its structure is > fixed for a specific object type, there's no way this could be > extended to look up things like extended attributes. Maybe that's not > a problem, but the lack of a hierarchical namespace could turn out to > be a major drawback. > > I think people underestimate the usefulness of hierarchical > namespaces, even though we use them extensively in lots of well > established interfaces. I like the namespaces, they work well. If you want self-describing interfaces (which I think your patch does), then why not just use the varlink protocol? It's been implemented for the kernel already many years ago: https://github.com/varlink and specifically: https://github.com/varlink/linux-varlink It doesn't need a new syscall. thanks, greg k-h