Received: by 10.192.165.156 with SMTP id m28csp1007775imm; Fri, 13 Apr 2018 11:34:21 -0700 (PDT) X-Google-Smtp-Source: AIpwx4/1F8kI0ThPxCALJWUP3RSvUlV5RSvUz+X8WQ+d21Qwei+uKXdpNweGyGv6x2DILmHf0c6q X-Received: by 10.98.214.152 with SMTP id a24mr12404951pfl.159.1523644461564; Fri, 13 Apr 2018 11:34:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1523644461; cv=none; d=google.com; s=arc-20160816; b=gKz+5/ylwU5MQE7ThWAqtBEopKOE5wWAs74t3zjmtIQdz0dDzsmuy8oC/lF1lRoyDC 3CTz3ydsArIRzjjs/1moWOHBPyqC+DYSHF1Vrq1voCDap3rzqRlPurOBZ5hFerowvg3m 7EN2pnngaGX/6dAKJ/+UgLGK0m6FklSZ/+TIU2510IdYFeHJcPo6evXM1cBJZJVqRjtc nYfHq1hc4eynW/oq4s5sD2569mM+lGvC5bCj1CFBTrn0JbLs4pr/CFKDpNGgkKFmieyr eKYwDCqSwfsd1kAVTeYRoIkybVNhU1qwAvbLuKmt2mpdGD6vmqMo2+4sC7g9l/Kf9Whk mkkQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:date:from:arc-authentication-results; bh=6FECpZzvMl52wY1S2tpj7G5o/MvANsbt7RzY3VaSyO0=; b=iOKTcP0wNSYvwFKot72N6JIY8qIIgr3j23X/L8EBBq9i2gy5ttK918k1VQaSkFeNry DVGAGDlmp6sNDxj8jmNJgY8ma3LlIqMXn8EZEpTxB4M6XQsLDzdzp9pZgY/WsKak4D2m CVUUKo/btg8PUSVCgHiSSOW/JhHvEuV1rEveQpJP80tyG72qaEkccuCyg3Ojp9rn4PaO PNXWRrssumShNd4de80Jo18gHOFSZOw10x9drVhpOwZuMDVdiQ5TsSW0S0J2aZ4qZgiy DlXxxgYGU9NoG5QQN8sRsH0H44sRPY+TUU/rJlsfSzJHZXVPx/wUhs3VP8oOoIODqCLM 4duQ== ARC-Authentication-Results: i=1; mx.google.com; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=canonical.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id n4si4591080pgt.450.2018.04.13.11.34.07; Fri, 13 Apr 2018 11:34:21 -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; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=canonical.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751676AbeDMScz (ORCPT + 99 others); Fri, 13 Apr 2018 14:32:55 -0400 Received: from youngberry.canonical.com ([91.189.89.112]:37923 "EHLO youngberry.canonical.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751421AbeDMScx (ORCPT ); Fri, 13 Apr 2018 14:32:53 -0400 Received: from mail-wr0-f199.google.com ([209.85.128.199]) by youngberry.canonical.com with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.76) (envelope-from ) id 1f73VE-0003lx-Nz for linux-kernel@vger.kernel.org; Fri, 13 Apr 2018 18:32:52 +0000 Received: by mail-wr0-f199.google.com with SMTP id o8so5616615wra.12 for ; Fri, 13 Apr 2018 11:32:52 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:date:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=6FECpZzvMl52wY1S2tpj7G5o/MvANsbt7RzY3VaSyO0=; b=jK9ev871Fk7741Nl9p2cUF7AdknHDe4yI2BNnU1mLmp/o7aq4SjkhUUpQQwQn5rpTb AXEkqa+ispM5oNtjNtB9KMzGX6SLLLB5DPYn4ZqIDoQqRpGapDUDEse2HOBJF2BKoKTq 4eTBrkCAKkN4tsovRtp1qjTS/ZB2K+0hEILJg0LMgEsz3AGSRgn+I2lh6cHXU0BGCaC8 sfBeR2slta4P9k1Z9jUYoAnnkPpFnbVYc5II38uojuUa5zGcUbX8TUIPeH+sNHH65MWq jz3TDcUIid6m1NrgL0ZVRXKLjq/T06b5gfp+t10+lekYoWOznm59FFSzQ0umLpfpA+72 t6jw== X-Gm-Message-State: ALQs6tBvBbtOAwb94e/O2QJrjt9Q6/xE4Mn6UE7kP9UoisMNmtdUTHIn J+sXayrcBF9Yk0Yzayf3jprqsrgdtJR69GzUf7Ugh9e7tD+Scc9hfTsLW7eAHMEmQ1e/HB8Z21E UFqmH1BOWbX3FdDrgS1jiCeO7EPCcjc5KqxZL7Hbopg== X-Received: by 10.223.152.83 with SMTP id v77mr4537242wrb.225.1523644372406; Fri, 13 Apr 2018 11:32:52 -0700 (PDT) X-Received: by 10.223.152.83 with SMTP id v77mr4537229wrb.225.1523644372109; Fri, 13 Apr 2018 11:32:52 -0700 (PDT) Received: from gmail.com ([2a02:8070:8895:9700:29d3:13fa:afa8:ff34]) by smtp.gmail.com with ESMTPSA id 19sm2253802wmv.18.2018.04.13.11.32.51 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 13 Apr 2018 11:32:51 -0700 (PDT) From: Christian Brauner X-Google-Original-From: Christian Brauner Date: Fri, 13 Apr 2018 20:32:50 +0200 To: Randy Dunlap Cc: Andreas Dilger , Alexander Viro , Thomas Gleixner , Kate Stewart , Greg Kroah-Hartman , Philippe Ombredanne , Linux FS Devel , linux-kernel@vger.kernel.org, serge@hallyn.com Subject: Re: [PATCH 2/6] statfs: use << to align with fs header Message-ID: <20180413183250.GA8277@gmail.com> References: <20180413161126.31313-1-christian.brauner@ubuntu.com> <20180413161126.31313-3-christian.brauner@ubuntu.com> <833FF27F-CFAD-4011-A21C-86B3947BB7D5@dilger.ca> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.9.4 (2018-02-28) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Apr 13, 2018 at 10:55:23AM -0700, Randy Dunlap wrote: > On 04/13/2018 10:35 AM, Andreas Dilger wrote: > > On Apr 13, 2018, at 10:11 AM, Christian Brauner wrote: > >> > >> Consistenly use << to define ST_* constants. This also aligns them with > >> their MS_* counterparts in fs.h > > > > IMHO, using (1 << 10) makes the code harder to debug. If you see a field > > in a structure like 0x8354, it is non-trivial to map this to the ST_* > > flags if they are declared in the form (1 << 10) or BIT(10). If they are > > declared in the form 0x100 (as they are now) then it is trivial that the > > ST_APPEND flag is set in 0x8354, and easy to understand the other flags. > > > > So, my preference would be to NOT land this or the previous patch. All higher values are already initialized with bit-shifts for MS_* constants starting with (1<<16) as you can see from the patch and in fs.h: > +#define MS_VERBOSE (1<<15) /* War is peace. Verbosity is silence. > + * MS_VERBOSE is deprecated. > + */ > +#define MS_SILENT (1<<15) > #define MS_POSIXACL (1<<16) /* VFS does not apply the umask */ > #define MS_UNBINDABLE (1<<17) /* change to unbindable */ > #define MS_PRIVATE (1<<18) /* change to private */ This just makes it uniform which imho has merit on its own. If using shifts is considered a valid counter argument because for lack of ease to analyze struct fields then the values for MS_* flags in fs.h should probably all be hex values. In any case, I'm not going to bikeshed over this. The two patches can simply be left out when applying or I can change it all over to hex values. Christian