Received: by 2002:a6b:500f:0:0:0:0:0 with SMTP id e15csp4297533iob; Sun, 8 May 2022 08:34:20 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwlXAGR5Em2JEA6rVg/edjhHGsFG4NqOd0mVMDUqsz99hi4A+QLKDkInd2O74Z//NgJktdk X-Received: by 2002:a05:6402:296:b0:427:e497:29ef with SMTP id l22-20020a056402029600b00427e49729efmr13499831edv.399.1652024060720; Sun, 08 May 2022 08:34:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1652024060; cv=none; d=google.com; s=arc-20160816; b=nGc4Emc2i2qJE+s4Q400uqE1RfcF0/Vpkh5v7Rf/iN7WruX4AUZb2pAygMCSc0ET2L TblrSObPv4r6E6mcTR1YbnDlGj9kvBCJ9nz1hoo1DKhlrPxxf/FhTGWtmHrOnXXi4jYl +a1Es/XJPO1pC8N3pGW8JNQSZ/Uo9Vldf4+YBAApWWW5GUwAgHaJ/FNUdNvk1SJ5DLl8 ZlCXlRTiLRYaqeGARrt5XyvLW+OC6myfOONGHCyjYusWjar4zwV4M9CTu+U7J3LLl1m0 6lCkq1H7pNqQFPy+84TGOURSNfoFbHaWNWe0gPDRdKGLB1G68zdU0VHyucU/vv6KoSIA 2aIg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=JOJe8EFexHCJl/2Bc6RO8FsgtVtMHIZENqTmuqDEE2I=; b=HsWKB5Z/+C0+bFp+HexEXsuwgBpmo5okx+NIIHW0VAZ3ZV5Uv+WgP+Ii8AL9vTUq5x unHB/Y8wI1C2pD0qNc+Uby+UrK5v9bbS70yaxe07A99CsGq8HrjfsaFkNwurTyjbj4Gc AvIIRBQZPszPBnE5k+dC9su3XnvDfaVbKLbqyTX6ndxLcR8lBsGiBLHpxR5TlA8kl525 zUhWPZyLpLJT0UGGQHVfXsvBCpvVmQEcnklFrcjF1TQwOFJIkP5+UL4c/NUBm8qyQkVw lOu3fa7Ucv2scgSMMKulo5NNigLIzHMJ/ZNfYhIbaWrocSNWUREWXMToWBs93tJjzyIL PETw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=R+I1KpWn; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id g4-20020a50ec04000000b00428679d26b1si5463252edr.331.2022.05.08.08.33.56; Sun, 08 May 2022 08:34:20 -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; dkim=pass header.i=@gmail.com header.s=20210112 header.b=R+I1KpWn; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1351259AbiEDO02 (ORCPT + 99 others); Wed, 4 May 2022 10:26:28 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41260 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238025AbiEDO0Z (ORCPT ); Wed, 4 May 2022 10:26:25 -0400 Received: from mail-qv1-xf2b.google.com (mail-qv1-xf2b.google.com [IPv6:2607:f8b0:4864:20::f2b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9999A2019D; Wed, 4 May 2022 07:22:49 -0700 (PDT) Received: by mail-qv1-xf2b.google.com with SMTP id jt15so930600qvb.8; Wed, 04 May 2022 07:22:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=JOJe8EFexHCJl/2Bc6RO8FsgtVtMHIZENqTmuqDEE2I=; b=R+I1KpWncwM37jcDvaWaBIuoT9NF2QuLZPr3IjIF3/+9wYNZpMUCmWM4I8X+wd0R+j 4jCa+JKhojklqTV34Vg8ws3Oj4dt2uZ3xeqEHypoOH7pgSfZiWXKgAtZrCNR8OV5iOr9 N7Z9D3bLQTIAL14ZgAhrx9teDv5uV/2WjOwbkygKqUE6TcMQeMUXn1WQtyfO4RP0psnV pTyNZ8JD/FOYiPBRQW9RN9KF0Q7I6RcCX8WLgk5BMVpfM/StWJDN+IIJXZKLDNqbHRJx 9mj1bVojs2UukUKW8UG5Xm5x0UKWCBJUxqN2XI2jMIuU0oaHoqazZWigbqbZ6h2kF7HO u8CA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=JOJe8EFexHCJl/2Bc6RO8FsgtVtMHIZENqTmuqDEE2I=; b=TrHsyD4Ex1gOrU53MOICf+G9y9zhcO0bChKTomw5a+cNtgNZTkzfMmaleA754KI8CU W+7HTW92QUzltdD9SztzV6K0LDD34MYF2v6CgD0jw5oah3eRfJyZSATGuEKCczY3X6ak SlfAzsJhW/HIngoWbatqeYD/oiVs7P1AcNc/luB+NrxxcSwfeA9fQZ72GjV1SQO4ngIy eMamI+HldtmeTfVlqORWuafRjqbs+EpWiW0QRIbt6pa0QMTyPPbI7VB7oLXdOBQ0jA/g Zvt/z9KhyqsEAIOcgV/ComeWKR0n11jG57praE3qi+EFDHTOuf6PjiMdr/DPIBsUushQ adHQ== X-Gm-Message-State: AOAM531snmsNWPQRxsxwWcVcwOAlef24Qm0xTmPRGH9t2bcWUSUcPeI2 VuNIXi6O2jN618dTJrTaakiT1LrOZKS+SL3fvzs= X-Received: by 2002:a05:6214:1cc4:b0:435:35c3:f0f1 with SMTP id g4-20020a0562141cc400b0043535c3f0f1mr17657763qvd.0.1651674168694; Wed, 04 May 2022 07:22:48 -0700 (PDT) MIME-Version: 1.0 References: <20220503224305.GF1360180@dread.disaster.area> In-Reply-To: From: Amir Goldstein Date: Wed, 4 May 2022 17:22:37 +0300 Message-ID: Subject: Re: [RFC PATCH] getting misc stats/attributes via xattr API To: Miklos Szeredi Cc: Dave Chinner , linux-fsdevel , "Theodore Ts'o" , Karel Zak , Greg KH , Christian Brauner , linux-kernel , Linux API , linux-man , LSM , Ian Kent , David Howells , Linus Torvalds , Al Viro , Christian Brauner , James Bottomley Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,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 Wed, May 4, 2022 at 10:18 AM Miklos Szeredi wrote: > > On Wed, 4 May 2022 at 00:43, Dave Chinner wrote: > > > "values" is a very generic name - probably should end up being > > something more descriptive of the functionality is provides, > > especially if the header file is going to be dumped in > > include/linux/. I don't really have a good suggestion at the moment, > > though. > > The obvious ones are stat and attr, which are taken already. Info is > probably too generic as well. > > Ideas are welcome. I was thinking of "properties". > > > > > .... > > > > > + > > > +enum { > > > + VAL_MNT_INFO, > > > +}; > > > + > > > +static struct val_desc val_mnt_group[] = { > > > + { VD_NAME("info"), .idx = VAL_MNT_INFO }, > > > + { } > > > +}; > > .... > > > + > > > + > > > +static struct val_desc val_toplevel_group[] = { > > > + { VD_NAME("mnt:"), .get = val_mnt_get, }, > > > + { VD_NAME("mntns:"), .get = val_mntns_get, }, > > > + { }, > > > +}; > > > > I know this is an early POC, my main question is how do you > > envisiage this table driven structure being extended down from just > > the mount into the filesystem so we can expose filesystem specific > > information that isn't covered by generic interfaces like statx? > > I was thinking of adding a i_op callback. The details are a bit > fuzzy, since the vfs and the fs would have to work together when > listing the attributes and possibly also when retrieving the attribute > itself (think mount options). > No, please do not think mount options :) Please think of an interface that does not mix vfs and fs properties. Sure, with mount(2) you can mix fs and vfs options, but with the new interface they should be clearly separated for set and get if possible. ":mnt:info" key to get the effective mount options (as in /proc/$$/mountinfo) does not contradict that, because it can be read only. Thanks, Amir.