Received: by 2002:a05:6a10:2726:0:0:0:0 with SMTP id ib38csp4707197pxb; Mon, 28 Mar 2022 01:43:54 -0700 (PDT) X-Google-Smtp-Source: ABdhPJza59YY3dGbtx/XxcRpPnuafqYVvNfONRaowXccob60sryQ5sKD+qG3HIVFf1e9WR358bI1 X-Received: by 2002:a17:907:da6:b0:6e0:c59:f3ad with SMTP id go38-20020a1709070da600b006e00c59f3admr26550870ejc.85.1648457034390; Mon, 28 Mar 2022 01:43:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1648457034; cv=none; d=google.com; s=arc-20160816; b=wdaQ6zx/4S+a2K4BsmSluoBNl0nS3vsGW+FgxVtaaiVoi8Z4rwNKIT//GGe+Q2Rvg9 Lxrnyl05Fua80/i1475YRteRcoL77k2QDQtwSHMzpCK0kUm+HyVqwgPmdGXG+QTUA3fS xnvvfRn3lBB9lCT2HMvz60Mt2asz4Sf4NmFOgmo7T/WBoCZ6yym5vIj3B7fr27jsMNYS vKVV+x+8eaU6LtebHgXJ1o4dn5L7Zp67G2LrophraEoYQONtUY5k2kv66S26SyFGPBuW Kgls+4hI0GbjSldu7baez17cPhOLxp0eTGNmCu++oDSA634hSVukcal6qduTpor0MtHM afHA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=FWHogJl2DBq3MgRSlKqaEz8ki23qL1op/yQtJuvuBSY=; b=X0t9yAZtq9QSxxenyUovRpTAK4n8uYle9mJUOGanUb2r1Vk67T3RF5X80R8Q3PZDI9 oQnK7knMXxZou2+3phoH3wK1p3JPCMp70jkIZJtJ1Ql97FXgmrp1z44hNiR2NHPubnG+ qwCzyCFnWyKCZbT8tvjjrn1M7Gngoi8NmCvikEDqqfwG6/RWBDahszJ8qRFLh24ScWuu L9j3OEhkEZyLFR4MRfTwGfj2JmjTKPMtm3bY085qV+b3JULEBDo46SwhZXbi0lnhy8zO X6CjNTVgtcyOsDROQY6+mwmX2IvUr4rOmx39J6suXqLsowk6KgIyagE0GN9sWKPFgs25 /HAQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id v27-20020a50f09b000000b00418c2b5be3asi13860228edl.284.2022.03.28.01.43.28; Mon, 28 Mar 2022 01:43:54 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234876AbiC0VFL (ORCPT + 99 others); Sun, 27 Mar 2022 17:05:11 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60420 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229878AbiC0VFH (ORCPT ); Sun, 27 Mar 2022 17:05:07 -0400 Received: from mail105.syd.optusnet.com.au (mail105.syd.optusnet.com.au [211.29.132.249]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 7A94D496BA; Sun, 27 Mar 2022 14:03:27 -0700 (PDT) Received: from dread.disaster.area (pa49-186-150-27.pa.vic.optusnet.com.au [49.186.150.27]) by mail105.syd.optusnet.com.au (Postfix) with ESMTPS id B445B10E6855; Mon, 28 Mar 2022 08:03:20 +1100 (AEDT) Received: from dave by dread.disaster.area with local (Exim 4.92.3) (envelope-from ) id 1nYa2h-00AeCQ-BD; Mon, 28 Mar 2022 08:03:19 +1100 Date: Mon, 28 Mar 2022 08:03:19 +1100 From: Dave Chinner To: Trond Myklebust Cc: "miklos@szeredi.hu" , "raven@themaw.net" , "kzak@redhat.com" , "dhowells@redhat.com" , "linux-fsdevel@vger.kernel.org" , "linux-api@vger.kernel.org" , "linux-kernel@vger.kernel.org" , "linux-security-module@vger.kernel.org" , "mszeredi@redhat.com" , "torvalds@linux-foundation.org" , "viro@zeniv.linux.org.uk" , "linux-man@vger.kernel.org" , "amir73il@gmail.com" , "christian@brauner.io" , "James.Bottomley@hansenpartnership.com" Subject: Re: [RFC PATCH] getvalues(2) prototype Message-ID: <20220327210319.GM1609613@dread.disaster.area> References: <20220322192712.709170-1-mszeredi@redhat.com> <20220323225843.GI1609613@dread.disaster.area> <20220324203116.GJ1609613@dread.disaster.area> <5d5c170949a5c4e2e4b8ef8949e5cdc5110eeabf.camel@hammerspace.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <5d5c170949a5c4e2e4b8ef8949e5cdc5110eeabf.camel@hammerspace.com> X-Optus-CM-Score: 0 X-Optus-CM-Analysis: v=2.4 cv=deDjYVbe c=1 sm=1 tr=0 ts=6240d11d a=sPqof0Mm7fxWrhYUF33ZaQ==:117 a=sPqof0Mm7fxWrhYUF33ZaQ==:17 a=8nJEP1OIZ-IA:10 a=o8Y5sQTvuykA:10 a=7-415B0cAAAA:8 a=SMe7BH-ruLLs_FX_YN0A:9 a=wPNLvfGTeEIA:10 a=biEYGPWJfzWAr4FL6Ov7:22 X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_NONE, SPF_HELO_PASS,SPF_NONE,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Mar 25, 2022 at 04:42:27PM +0000, Trond Myklebust wrote: > On Fri, 2022-03-25 at 07:31 +1100, Dave Chinner wrote: > > > and anyway the point of a > > > hierarchical namespace is to be able to list nodes on each level.? > > > We > > > can use getxattr() for this purpose, just like getvalues() does in > > > the > > > above example. > > > > Yup, and like Casey suggests, you could implement a generic > > getvalues()-like user library on top of it so users don't even need > > to know where and how the values are located or retrieved. > > > > The other advantage of an xattr interface is that is also provides a > > symmetrical API for -changing- values. No need for some special > > configfs or configfd thingy for setting parameters - just change the > > value of the parameter or mount option with a simple setxattr call. > > That retains the simplicity of proc and sysfs attributes in that you > > can change them just by writing a new value to the file.... > > The downsides are, however, that the current interface provides little > in the way of atomicity if you want to read or write to multiple > attributes at the same time. Something like a backup program might want > to be able to atomically retrieve the ctime when it is backing up the > attributes. I assumed that batched updates were implied and understood after my earlier comments about XFS_IOC_ATTRMULTI_BY_HANDLE as used by xfsdump/restore for the past 20+ years. > Also, when setting attributes, I'd like to avoid multiple syscalls when > I'm changing multiple related attributes. > > IOW: Adding a batching interface that is akin to what Miklos was > proposing would be a helpful change if we want to go down this path. Yup, that's exactly what XFS_IOC_ATTRMULTI_BY_HANDLE provides and I'm assuming that would also be provided by whatever formalised generic syscall API we come up with here... Cheers, Dave. -- Dave Chinner david@fromorbit.com