[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20220327210319.GM1609613@dread.disaster.area>
Date: Mon, 28 Mar 2022 08:03:19 +1100
From: Dave Chinner <david@...morbit.com>
To: Trond Myklebust <trondmy@...merspace.com>
Cc: "miklos@...redi.hu" <miklos@...redi.hu>,
"raven@...maw.net" <raven@...maw.net>,
"kzak@...hat.com" <kzak@...hat.com>,
"dhowells@...hat.com" <dhowells@...hat.com>,
"linux-fsdevel@...r.kernel.org" <linux-fsdevel@...r.kernel.org>,
"linux-api@...r.kernel.org" <linux-api@...r.kernel.org>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
"linux-security-module@...r.kernel.org"
<linux-security-module@...r.kernel.org>,
"mszeredi@...hat.com" <mszeredi@...hat.com>,
"torvalds@...ux-foundation.org" <torvalds@...ux-foundation.org>,
"viro@...iv.linux.org.uk" <viro@...iv.linux.org.uk>,
"linux-man@...r.kernel.org" <linux-man@...r.kernel.org>,
"amir73il@...il.com" <amir73il@...il.com>,
"christian@...uner.io" <christian@...uner.io>,
"James.Bottomley@...senpartnership.com"
<James.Bottomley@...senpartnership.com>
Subject: Re: [RFC PATCH] getvalues(2) prototype
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@...morbit.com
Powered by blists - more mailing lists