Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp5988072ybi; Wed, 29 May 2019 00:44:26 -0700 (PDT) X-Google-Smtp-Source: APXvYqyMH9xJHkyJdyU7chTfiquFSUDvcTuc2J8JfebhqQgP3xe2XafY9f6IlrjK4iK6ENm3RWlh X-Received: by 2002:a17:90a:2e87:: with SMTP id r7mr9964330pjd.112.1559115866057; Wed, 29 May 2019 00:44:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1559115866; cv=none; d=google.com; s=arc-20160816; b=NbwZVIKb6nqiNSVljwW7NxcZRuugI/IiL8S2yYdsjCyIGJwPeWtxP5mGV/w9MYe4PD 0T8FLp6/LGsI1ymNeylYuWnjgi7FgoP4VA7NtwfuzjQGUvR3VlmHiLQD/EY1AM8BPfqb 06vibJNcYoxiG+KyVXUMzeZ6A1MCNH/crq1qLJFDYQz9LwVduCFhbddU4oOqYixgqGBc 3mq3JvMVPYk78tL4QklIIDH5ButnsWrDvzeoDW1bVbsp/4/zyMMjefhbmQfZhAKa+iYT kX7lcrO1lvUKJo925WE8dZ8JGzzTDCHTbBqF9HYpdvdKW/Ar3ZbnlqPTvNA1CiE3yBDw 2qmw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=hqFyk47sSJVRHLsfxDt9uxstj8u1M1gZeotStw/KYzw=; b=dcLg3NYFFgDMF5mknLm5TzJJZcnk5Ci0sq8hvizhHkIEYfHPUmTDssevibL2q9cgxt 7jy+PFFkSWeUv+OrHxHQ7Mlet0mKcr+djbNjzNX5J1VCmHuQZqc/Zh2isfIIuTbQ7GKB cI8j4KrCwplTxKYx3bGU/8i6X0cfM1At6kKIDV+5wM96zB5qFZaUfKYJfFCdSeWBUaSN Z3jHrzKvBS/BiGGQOm95ksQybc0oAAJ4AtVMcQZp/GHKiTGLyABncXHRe8IPoB97wI7B USBohFcNRz4BdjgVsmElOvYY0qtBWbvqg2wZ3XligIwMA8nxQEyULwX05T+Yt/O08Fvt OqNg== ARC-Authentication-Results: i=1; mx.google.com; dkim=temperror (no key for signature) header.i=@szeredi.hu header.s=google header.b=id5wu9Bv; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id w61si1993695plb.330.2019.05.29.00.44.10; Wed, 29 May 2019 00:44:26 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=temperror (no key for signature) header.i=@szeredi.hu header.s=google header.b=id5wu9Bv; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726808AbfE2HnB (ORCPT + 99 others); Wed, 29 May 2019 03:43:01 -0400 Received: from mail-it1-f194.google.com ([209.85.166.194]:34722 "EHLO mail-it1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726101AbfE2HnB (ORCPT ); Wed, 29 May 2019 03:43:01 -0400 Received: by mail-it1-f194.google.com with SMTP id g23so4770924iti.1 for ; Wed, 29 May 2019 00:43:00 -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=hqFyk47sSJVRHLsfxDt9uxstj8u1M1gZeotStw/KYzw=; b=id5wu9BvoNG48+Ck6s8h94PZq86QUHxdJHUYxEOU8jSAxFsa+1A4HOIk2KNNGCHNYc OwBytSNRzvO8aYb8lITay3X7zkUGradhD9vfX1R53KWAnrSkr37AzcJ0yZUZVC+Trdhy bprSeX3NyZpk8vHx5k5/l7d+PI9MlT+Ld0xEg= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=hqFyk47sSJVRHLsfxDt9uxstj8u1M1gZeotStw/KYzw=; b=CPCPMgfqjlyIioaYCX0Ay5JGwxccJTuiHzsILRCW4AA64uXYxY6yZbkaGqr8+X20LU MnGNT2Dn0lyGh1igDjLAkUrKha2fsJHsud9gs2wuFM8aX0PhXDpbDND++S0Sp89gRp1m avG7S8PPNL7VyWilKUt0A4lOLeMo8DIRV0foEjzFE3RGEEAqIjpUKwX9qUq7jT39H02j yrWG5lGMgvw9kKllOxxe/LNwhYDas7OBk1GXe3BBqZD8hnfwYB2QZfvfGlP/loaeSS1o V+Hz2O3EPYMcMUOo9Or1pmI+d/q94ZEfXCZ1PzbY+hR3tnff/y57j6i+kWwSzcEUSNNM jAaQ== X-Gm-Message-State: APjAAAV0+awxxb/c546uS/ZAR4YSpBh/QD24SYW2A0rCQle1rmrWb5J1 HvuwfBeL9up04wG4rjEUSZMTUnOczB5Iii/WW3+GHQ== X-Received: by 2002:a24:2846:: with SMTP id h67mr6510467ith.94.1559115780417; Wed, 29 May 2019 00:43:00 -0700 (PDT) MIME-Version: 1.0 References: <155905626142.1662.18430571708534506785.stgit@warthog.procyon.org.uk> <155905627049.1662.17033721577309385838.stgit@warthog.procyon.org.uk> In-Reply-To: <155905627049.1662.17033721577309385838.stgit@warthog.procyon.org.uk> From: Miklos Szeredi Date: Wed, 29 May 2019 09:42:49 +0200 Message-ID: Subject: Re: [PATCH 01/25] vfs: syscall: Add fsinfo() to query filesystem information [ver #13] To: David Howells Cc: Al Viro , Ian Kent , Linux API , linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, Miklos Szeredi Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, May 28, 2019 at 5:11 PM David Howells wrote: > > Add a system call to allow filesystem information to be queried. A request > value can be given to indicate the desired attribute. Support is provided > for enumerating multi-value attributes. > [...] > +static u32 calc_sb_flags(u32 s_flags) > +{ > + u32 flags = 0; > + > + if (s_flags & SB_RDONLY) flags |= MS_RDONLY; > + if (s_flags & SB_SYNCHRONOUS) flags |= MS_SYNCHRONOUS; > + if (s_flags & SB_MANDLOCK) flags |= MS_MANDLOCK; > + if (s_flags & SB_DIRSYNC) flags |= MS_DIRSYNC; > + if (s_flags & SB_SILENT) flags |= MS_SILENT; > + if (s_flags & SB_POSIXACL) flags |= MS_POSIXACL; > + if (s_flags & SB_LAZYTIME) flags |= MS_LAZYTIME; > + if (s_flags & SB_I_VERSION) flags |= MS_I_VERSION; Please don't resurrect MS_ flags. They are from the old API and shouldn't be used in the new one. Some of them (e.g. MS_POSIXACL, MS_I_VERSION) are actually internal flags despite being exported on the old API. And there's SB_SILENT which is simply not a superblock flag and we might be better getting rid of it entirely. The proper way to query mount options should be analogous to the way they are set on the new API: list of {key, type, value, aux} tuples. Thanks, Miklos