From patchwork Fri May 25 12:48:20 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christian Brauner X-Patchwork-Id: 10427353 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 33966602D6 for ; Fri, 25 May 2018 12:52:40 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 210BC293DF for ; Fri, 25 May 2018 12:52:40 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 15C8D2940D; Fri, 25 May 2018 12:52:40 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.9 required=2.0 tests=BAYES_00, MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI autolearn=unavailable version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 8DE59293F8 for ; Fri, 25 May 2018 12:52:39 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S935268AbeEYMwN (ORCPT ); Fri, 25 May 2018 08:52:13 -0400 Received: from mail-wm0-f66.google.com ([74.125.82.66]:55570 "EHLO mail-wm0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752217AbeEYMto (ORCPT ); Fri, 25 May 2018 08:49:44 -0400 Received: by mail-wm0-f66.google.com with SMTP id a8-v6so14070349wmg.5; Fri, 25 May 2018 05:49:43 -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:to:cc:subject:date:message-id:in-reply-to :references; bh=SZ01z1m7IJs03hHTvKX4kYQ1Sp76aYbMx9gEnrPPZ1I=; b=NhTbH7iCN/GpWqKsTsc06FmlsIVBCXvZaGNZZ61sQlu84sJyYCT1t0VgMl7a4vRD0E OiH51z8df/tlV77IMpYMjI9bpp8qfNnA3bkWWsnKuIgtTHWVhDAUREYIRKZTWTJM1dD0 2bNDrislSHSZlERiT1X/ksjaojOHJUMftkiNgbIqCJ6GF6+3tM3mDuNKn0CFktFKx1Ua 1s7bWfi2nYiMWaxoeaCk5oqW+RIdqRZJLxDDbHpdxDnJujuSZZ0nxlzTM+C9ifTDuzRu oRWEGiseThOcFNYjdKRMj3CLaHbqQd1768174X5rf3l2hLpjg5J/wbcm/x+r774LaZj6 12sg== X-Gm-Message-State: ALKqPwehpZ3/6J2N4NRk7CTp4kG7924UlELzq7ioeav8LeyAfEsP5XMv NOd/XHw4k6jQB6FnukVzCILZ5Gf2HKQ= X-Google-Smtp-Source: ADUXVKLnmi/pQ8wRviKnDZryRuEkkjGKJLuYrv6ND0bcja/yPxn4k6xU8HPeJR75d8SbVFceioZDJQ== X-Received: by 2002:a1c:7204:: with SMTP id n4-v6mr1584288wmc.138.1527252582133; Fri, 25 May 2018 05:49:42 -0700 (PDT) Received: from localhost.localdomain ([2a02:8070:8895:9700:c80a:973d:8254:7f55]) by smtp.gmail.com with ESMTPSA id u8-v6sm6053292wmc.40.2018.05.25.05.49.40 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 25 May 2018 05:49:41 -0700 (PDT) From: Christian Brauner To: linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org Cc: torvalds@linux-foundation.org, tglx@linutronix.de, kstewart@linuxfoundation.org, gregkh@linuxfoundation.org, pombredanne@nexb.com, linux-api@vger.kernel.org, ebiederm@xmission.com, seth.forshee@canonical.com, viro@zeniv.linux.org.uk, Christian Brauner Subject: [PATCH 1/6 v1 resend] fs: use << for MS_* flags Date: Fri, 25 May 2018 14:48:20 +0200 Message-Id: <20180525124825.23875-2-christian@brauner.io> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180525124825.23875-1-christian@brauner.io> References: <20180525124825.23875-1-christian@brauner.io> Sender: linux-fsdevel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fsdevel@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP The definitions for MS_* flags are currently a mixture between hex values and bit-shifts. All higher values are already initialized with bit-shifts for MS_* constants starting with (1<<16). This patch switches the definitions for MS_* constants over to uniformly use bit-shifts. Note that the BIT() macro cannot be used as it is not exported to uapi files as was pointed out by gregkh. Signed-off-by: Christian Brauner --- v0->v1: * non-functional changes: extend commit message --- include/uapi/linux/fs.h | 33 +++++++++++++++++---------------- 1 file changed, 17 insertions(+), 16 deletions(-) diff --git a/include/uapi/linux/fs.h b/include/uapi/linux/fs.h index d2a8313fabd7..9662790a657c 100644 --- a/include/uapi/linux/fs.h +++ b/include/uapi/linux/fs.h @@ -105,22 +105,23 @@ struct inodes_stat_t { /* * These are the fs-independent mount-flags: up to 32 flags are supported */ -#define MS_RDONLY 1 /* Mount read-only */ -#define MS_NOSUID 2 /* Ignore suid and sgid bits */ -#define MS_NODEV 4 /* Disallow access to device special files */ -#define MS_NOEXEC 8 /* Disallow program execution */ -#define MS_SYNCHRONOUS 16 /* Writes are synced at once */ -#define MS_REMOUNT 32 /* Alter flags of a mounted FS */ -#define MS_MANDLOCK 64 /* Allow mandatory locks on an FS */ -#define MS_DIRSYNC 128 /* Directory modifications are synchronous */ -#define MS_NOATIME 1024 /* Do not update access times. */ -#define MS_NODIRATIME 2048 /* Do not update directory access times */ -#define MS_BIND 4096 -#define MS_MOVE 8192 -#define MS_REC 16384 -#define MS_VERBOSE 32768 /* War is peace. Verbosity is silence. - MS_VERBOSE is deprecated. */ -#define MS_SILENT 32768 +#define MS_RDONLY (1<<0) /* Mount read-only */ +#define MS_NOSUID (1<<1) /* Ignore suid and sgid bits */ +#define MS_NODEV (1<<2) /* Disallow access to device special files */ +#define MS_NOEXEC (1<<3) /* Disallow program execution */ +#define MS_SYNCHRONOUS (1<<4) /* Writes are synced at once */ +#define MS_REMOUNT (1<<5) /* Alter flags of a mounted FS */ +#define MS_MANDLOCK (1<<6) /* Allow mandatory locks on an FS */ +#define MS_DIRSYNC (1<<7) /* Directory modifications are synchronous */ +#define MS_NOATIME (1<<10) /* Do not update access times. */ +#define MS_NODIRATIME (1<<11) /* Do not update directory access times */ +#define MS_BIND (1<<12) +#define MS_MOVE (1<<13) +#define MS_REC (1<<14) +#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 */