Received: by 10.192.165.156 with SMTP id m28csp953137imm; Fri, 13 Apr 2018 10:38:26 -0700 (PDT) X-Google-Smtp-Source: AIpwx486i8yy6JFNoRP4qEaBHUBCgA9iBPV+PAGoLmiBEmWunuiF8FiX7PTFIPwkB6WmNBHGjyZy X-Received: by 2002:a17:902:8a82:: with SMTP id p2-v6mr5952465plo.91.1523641106428; Fri, 13 Apr 2018 10:38:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1523641106; cv=none; d=google.com; s=arc-20160816; b=Z3PkDMRp/sCRZCSoLqBolRVtUQQXcqfJxvF1rgE7dGT/F3QlqRVmsE/V/T2E0ybPFw JugqbyuT2E0jbBxsH4O86JzRq8BSOcxXAV9irinMEzngfAAvY3uCqzpt/MWl+Vp/XjJq KLnPk9bJXe8gXteud4GS6gWAYhHyoopF/EFvCw7TyQffmwGAlRlv7Q57uQm4D1rXoUmk LYqtVx/Bk5VOQUE3qhcsCxK/v54nPD67MOANzGfF97LA3YvgXPxQ1I5S74fZhtx+YLPR vSarATNM3A4+rUfnsWMKwB3qwwx/GxZW/IZwxiAnJ7Zsx4ZQj0Gu5aBbNfHnDh836KJ2 8TVw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:to:cc:in-reply-to:date:subject :mime-version:message-id:from:dkim-signature :arc-authentication-results; bh=A22juUA9iDP3ZDLxQH5cux0EJsl08n7FRblQ2YnCb7Y=; b=0uCrpwOoiwpzWTlVhrJ5rIHDXQCpsv83m2mFsLltdoYqKr4jHGqpDmNMmynNYQPKa4 bIeItCWoDFJkSBy4JTU1oVzIstLjgfwL7Nm0qfS8WB+cImhffyNtfMHt1tatHpRGgoH2 mjNsX6dfoN2PlfOrT0CWmOZFb6ZseP4S46XaKU7JWflEU8LAsufP/CnMKmsUB2NQSf3G BL+ve3t+aP53wzoz7hqfIthoXGWb7ugbP6gM5ofbrGsJDvUCHO19k3sgJUVnwtLF3cGS ItxATGsQRl5u5uX3Q/KzygdFlWjIEBKIzzt4zl3DfOYpHw9dRci4ChO5TPMDQD/2VFIF vs6A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@dilger-ca.20150623.gappssmtp.com header.s=20150623 header.b=T02tRN2s; 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 9si4993875pfh.242.2018.04.13.10.38.11; Fri, 13 Apr 2018 10:38: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=pass header.i=@dilger-ca.20150623.gappssmtp.com header.s=20150623 header.b=T02tRN2s; 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 S1751087AbeDMRfh (ORCPT + 99 others); Fri, 13 Apr 2018 13:35:37 -0400 Received: from mail-pf0-f195.google.com ([209.85.192.195]:44546 "EHLO mail-pf0-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750849AbeDMRfg (ORCPT ); Fri, 13 Apr 2018 13:35:36 -0400 Received: by mail-pf0-f195.google.com with SMTP id p15so6417980pff.11 for ; Fri, 13 Apr 2018 10:35:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=dilger-ca.20150623.gappssmtp.com; s=20150623; h=from:message-id:mime-version:subject:date:in-reply-to:cc:to :references; bh=A22juUA9iDP3ZDLxQH5cux0EJsl08n7FRblQ2YnCb7Y=; b=T02tRN2skUKiuRHe6aRhEZ5GAe4CmDl2noBskfWuJNvMoub2yjCRRZJB2aOxdUR93K HbcwxKKLK4iNdfYx6dgf32QdxB9mQY1Psbip7rRUHKi0Zg/nB6uuR/dgcWkS2OG8FGdG R9UmEsDcWk1c4vBuhxInqTNKisLeIwY/FYymfJdTMn90EEaEPTwwudnNJZQxvYxUA1RC V0zV/3ODiilq4G3YcUOPPnel0Lr2HBJsmA3puT9S1sQxIJIswcACWyWKftsWrlFBoUkY i5C55nNXmi1V1rUUFgOOf6bemPTIH2bY+ZGyB+qHQcVRqenehEEP097h2hqhJ9sblf/1 5cCw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:message-id:mime-version:subject:date :in-reply-to:cc:to:references; bh=A22juUA9iDP3ZDLxQH5cux0EJsl08n7FRblQ2YnCb7Y=; b=luNKxIgZVEITXPniUoLDNgVbpOzQx8uRrnu4CW1X3cJhUdnGMXYx7pGOxHzwcyMZ+I n23w9ma+OumDpAR4zBUv9N1Y2VC+zBwXhEI1jCMQp7ZAmuIvYD/ZsDf9Ux0Ycltg7tGj QFtPtu55An5G2W8LgZjLg5lqD5T+zAYp7xhjU3/fXbX8sVtvoOA6ro2vL2VpjjjKWvlo yHP4bgO/3CH9glrzeOO6Fs0AhI/L9CTqqmcSw2jixLDUUAQbeb4oMwFcMeckj8TBNsds TM1fPxWvPLwVYjAkh4yCsmQfcJoW3E55eCQXpfJAHB6OwKPYy1zzg3agX+woSzqBckTE 8esQ== X-Gm-Message-State: ALQs6tBfgWZMVYmShcYLMtU9ajEMs+2pn27I++rq65el4y5n1VoKXu2P ZviLrLRO4VGISBAj70ZW7ac2ww== X-Received: by 10.99.109.136 with SMTP id i130mr4834439pgc.380.1523640935563; Fri, 13 Apr 2018 10:35:35 -0700 (PDT) Received: from cabot-wlan.adilger.int (S0106a84e3fe4b223.cg.shawcable.net. [70.77.216.213]) by smtp.gmail.com with ESMTPSA id f64sm12721924pfa.154.2018.04.13.10.35.13 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 13 Apr 2018 10:35:30 -0700 (PDT) From: Andreas Dilger Message-Id: <833FF27F-CFAD-4011-A21C-86B3947BB7D5@dilger.ca> Content-Type: multipart/signed; boundary="Apple-Mail=_D7F47ADB-50BF-47CD-AAC9-EA4086E41970"; protocol="application/pgp-signature"; micalg=pgp-sha256 Mime-Version: 1.0 (Mac OS X Mail 10.3 \(3273\)) Subject: Re: [PATCH 2/6] statfs: use << to align with fs header Date: Fri, 13 Apr 2018 11:35:11 -0600 In-Reply-To: <20180413161126.31313-3-christian.brauner@ubuntu.com> Cc: Alexander Viro , Thomas Gleixner , Kate Stewart , Greg Kroah-Hartman , Philippe Ombredanne , Linux FS Devel , linux-kernel@vger.kernel.org, serge@hallyn.com To: Christian Brauner References: <20180413161126.31313-1-christian.brauner@ubuntu.com> <20180413161126.31313-3-christian.brauner@ubuntu.com> X-Mailer: Apple Mail (2.3273) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --Apple-Mail=_D7F47ADB-50BF-47CD-AAC9-EA4086E41970 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=us-ascii On Apr 13, 2018, at 10:11 AM, Christian Brauner = wrote: >=20 > 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. Cheers, Andreas > Signed-off-by: Christian Brauner > --- > include/linux/statfs.h | 26 +++++++++++++------------- > 1 file changed, 13 insertions(+), 13 deletions(-) >=20 > diff --git a/include/linux/statfs.h b/include/linux/statfs.h > index 3142e98546ac..b336c04e793c 100644 > --- a/include/linux/statfs.h > +++ b/include/linux/statfs.h > @@ -27,18 +27,18 @@ struct kstatfs { > * ABI. The exception is ST_VALID which has the same value as = MS_REMOUNT > * which doesn't make any sense for statfs. > */ > -#define ST_RDONLY 0x0001 /* mount read-only */ > -#define ST_NOSUID 0x0002 /* ignore suid and sgid bits */ > -#define ST_NODEV 0x0004 /* disallow access to device special = files */ > -#define ST_NOEXEC 0x0008 /* disallow program execution */ > -#define ST_SYNCHRONOUS 0x0010 /* writes are synced at once */ > -#define ST_VALID 0x0020 /* f_flags support is implemented */ > -#define ST_MANDLOCK 0x0040 /* allow mandatory locks on an FS */ > -/* 0x0080 used for ST_WRITE in glibc */ > -/* 0x0100 used for ST_APPEND in glibc */ > -/* 0x0200 used for ST_IMMUTABLE in glibc */ > -#define ST_NOATIME 0x0400 /* do not update access times */ > -#define ST_NODIRATIME 0x0800 /* do not update directory = access times */ > -#define ST_RELATIME 0x1000 /* update atime relative to mtime/ctime = */ > +#define ST_RDONLY (1<<0) /* mount read-only */ > +#define ST_NOSUID (1<<1) /* ignore suid and sgid bits */ > +#define ST_NODEV (1<<2) /* disallow access to device special = files */ > +#define ST_NOEXEC (1<<3) /* disallow program execution */ > +#define ST_SYNCHRONOUS (1<<4) /* writes are synced at once */ > +#define ST_VALID (1<<5) /* f_flags support is implemented */ > +#define ST_MANDLOCK (1<<6) /* allow mandatory locks on an FS */ > +/* (1<<7) used for ST_WRITE in glibc */ > +/* (1<<8) used for ST_APPEND in glibc */ > +/* (1<<9) used for ST_IMMUTABLE in glibc */ > +#define ST_NOATIME (1<<10) /* do not update access times */ > +#define ST_NODIRATIME (1<<11) /* do not update directory = access times */ > +#define ST_RELATIME (1<<12) /* update atime relative to mtime/ctime = */ >=20 > #endif > -- > 2.17.0 >=20 Cheers, Andreas --Apple-Mail=_D7F47ADB-50BF-47CD-AAC9-EA4086E41970 Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=signature.asc Content-Type: application/pgp-signature; name=signature.asc Content-Description: Message signed with OpenPGP -----BEGIN PGP SIGNATURE----- Comment: GPGTools - http://gpgtools.org iQIzBAEBCAAdFiEEDb73u6ZejP5ZMprvcqXauRfMH+AFAlrQ6k8ACgkQcqXauRfM H+BY5A//dcXNbzUvpY084Y1ap19FYY9GUGnuN3CIrR/zKSUVO1ihVJfLSwTG40Wn usG1NBwhpuhKiPJ6rL+Z+m8+ag8n13yAR54nxRCtsAqsDMdeC3WWVad78EoBOdcU bEb0Kw3GtTRPY7eSW7M/hnHGuDIWVhYfpv8F/H/q9YqwjHnH92eQABrvCZq/KvKS hRjzKY0mUb0SehSDTcu5/BGn/z0uEA55w9WZm5i1zR5fk09dli5u2cnMrE/W10FQ 8W4G9w+jOtJHWmDutvK6xiHSDL4ZyZ2M4mym3rIBybO+TFzqcAV84cbXx7aRP+jV Y1dNY59elAQyZ5vuuxF0pch3qC9NWN78GrFBOkC6ExEBZaQVYQw8KWHuzG+j3wB0 f7Dxns1FFnm14nprxbRkbw+CtS1Fz9nihFp7xMhcX/ISyMSr4D7crw7NXny0rF6X LfMN0jF+HU2Xodvtc5E42ZSnwbpa0MnJqFQZilBu2bEFh7cu8DmAAyHdhi7ucm5/ Qutzgz+vVkXQn353auIVBoCjUQc7mjpX2zqP8xVmO9TIhdT78Q2o+Uoaa8tJ4Czd hQXdWwL05AEW1urKAAQywVQE2TFUPRoBMAHOV1ahdeP32BVDicaguyqkduEmMp9b ntRukS/Cvs6wmtzm5k724cvXuSYRHn6PtYoayQdFJ8Ncd6IIpHw= =JHIA -----END PGP SIGNATURE----- --Apple-Mail=_D7F47ADB-50BF-47CD-AAC9-EA4086E41970--