Received: by 2002:a6b:500f:0:0:0:0:0 with SMTP id e15csp1526144iob; Thu, 5 May 2022 03:23:03 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwBrHqO0KM0jfvtDXNO3iVftEAtZ5/qw9FbbGXmfQ8Y8zSOnOfyDg/fOZpgFn/D2xTsTMU9 X-Received: by 2002:a17:907:7f8a:b0:6f4:d25a:7fb6 with SMTP id qk10-20020a1709077f8a00b006f4d25a7fb6mr6623344ejc.586.1651746183081; Thu, 05 May 2022 03:23:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1651746183; cv=none; d=google.com; s=arc-20160816; b=lcYinXWHlTAZx9USarQ6zhwhSgKeMBULVv9OWkIWHEdeJqWkDckPueoHuCd3lffoZE dUboVUrmtMCdGj6yFmPlUPXhPddNMaxEEiiwgxKTUpQoOa41DhChVgZF072lcEpMvtlT 4WTm9JUL04+2z8msWk43K7tm3EbE2USZDV5hItJneTVOtqu7vchdrQObma8c5qC8juQe n4qap+7lUlvscx3ASzZDY/JFnLxmPo6xRfT2sKZ8c1qjoXnVp2W3Akcw4k+vlhH659eY jVBVa5KjpaTMOwIVmljZm6EdfTsQvN3cVAsltRK3y9qD4ttILynVkpH0bbC2+LZ6Xw/q OwLQ== 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=HeDEBC07UgqxsnebnTXHGSAnBgMOF2dSI/K4/ycdir4=; b=koh17gqFDTYe00S9zddyAIrlbTxtKLFBfEeV0mtXQskq8rj8MgBfSLdIMpt5nNn7JE gIpTSkjVdgnTmF5MIQ3a9g9N/uukSiiqGxGCPR7TIUEmeQvvjq8MI+EAYgFL01bU/PpP 3gQxTghY5E3SxPPRLTBu/qOYktytQG30orClzPO8YNfNzMV3AJdeiZ8Js32R6jFB2fe7 8ZGOinyCC0Ruf/t5DHjXSw1XUTCoZRn/jhVR44vDgAb5JzDj6uUXmlebEDsM552FWF2R F+1PQKfgTLpMBtceUgTu8d4804lCxTJGn3Sqtex7JlvsR8Pq0iHF3rlQyjHlJ6wZX/63 gnhg== ARC-Authentication-Results: i=1; mx.google.com; dkim=temperror (no key for signature) header.i=@szeredi.hu header.s=google header.b=YU5OMd73; 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 ho18-20020a1709070e9200b006f38fefd886si2272466ejc.245.2022.05.05.03.22.38; Thu, 05 May 2022 03:23:03 -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=temperror (no key for signature) header.i=@szeredi.hu header.s=google header.b=YU5OMd73; 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 S1345270AbiEDHWB (ORCPT + 99 others); Wed, 4 May 2022 03:22:01 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43494 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1345271AbiEDHV4 (ORCPT ); Wed, 4 May 2022 03:21:56 -0400 Received: from mail-ed1-x52e.google.com (mail-ed1-x52e.google.com [IPv6:2a00:1450:4864:20::52e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 28BB71ADAD for ; Wed, 4 May 2022 00:18:16 -0700 (PDT) Received: by mail-ed1-x52e.google.com with SMTP id p18so688505edr.7 for ; Wed, 04 May 2022 00:18:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=szeredi.hu; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=HeDEBC07UgqxsnebnTXHGSAnBgMOF2dSI/K4/ycdir4=; b=YU5OMd73Si+5Q7eezRvTwdPDhF0jXaVTuwFWRU724SKGGloQXdlPG0YIbvGIPIvCEh dbB6OBn/F3ingQg0jfPVD96Mzywvz5BjjGP6iFXZu+DCNmDCBkwsDrGygbU0vRiTBlSB lz1a0yhiew8HtumOPuAlYiBHyLzRep6vC6wrk= 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=HeDEBC07UgqxsnebnTXHGSAnBgMOF2dSI/K4/ycdir4=; b=zveGTHxeVDw3EdiQ4iylv83DTdimodSnuiPbpUszyzejdOrnfS5xK8aDETPLADI7sc bLhQglSM5RbZO0SluD6LYsgyXSHeNG9AjA+k6YuS2cMIuuByecyQ3A390UjSXuOtdqFd vKVpRA6YsFziJavhWpqDG8bWmiK9sAsQOwJ9wsUyFbL+y331dA4eOALHf675qtv4/Yi4 G006x7v6tIlkwwxNx4qkpYEfwngQbNFsCVMe5aPAu/2oYp2vmnP5pz8HPnz25lf3ryn8 nva52RZKOVk8+zaFqVYj4FLKMxffcbBxQG0ZGAlcLlhpFPXa99x94LPWrfrSaJYALJhf jF6A== X-Gm-Message-State: AOAM532W5/2pYJB+Hw3bOqESNplHAbtdVhK8BRZwmsbTpaFwjp/lO8Wt jOJsoRyq4fc2UuafMUBqlxoT/CDzcbeGb1q01l4YDQ== X-Received: by 2002:a50:9346:0:b0:425:e4c0:ab4b with SMTP id n6-20020a509346000000b00425e4c0ab4bmr21853531eda.154.1651648694663; Wed, 04 May 2022 00:18:14 -0700 (PDT) MIME-Version: 1.0 References: <20220503224305.GF1360180@dread.disaster.area> In-Reply-To: <20220503224305.GF1360180@dread.disaster.area> From: Miklos Szeredi Date: Wed, 4 May 2022 09:18:03 +0200 Message-ID: Subject: Re: [RFC PATCH] getting misc stats/attributes via xattr API To: Dave Chinner Cc: linux-fsdevel@vger.kernel.org, "Theodore Ts'o" , Karel Zak , Greg KH , Christian Brauner , linux-kernel@vger.kernel.org, Linux API , linux-man , LSM , Ian Kent , David Howells , Linus Torvalds , Al Viro , Christian Brauner , Amir Goldstein , James Bottomley Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-1.7 required=5.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE autolearn=no 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, 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. > > .... > > > + > > +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). Thanks, Miklos