From owner-svn-src-head@freebsd.org Wed Aug 19 17:09:59 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 566F13C4D11; Wed, 19 Aug 2020 17:09:59 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BWvRC1dWpz4Hbm; Wed, 19 Aug 2020 17:09:59 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1B39C261C7; Wed, 19 Aug 2020 17:09:59 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 07JH9wH4008672; Wed, 19 Aug 2020 17:09:58 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 07JH9w1V008671; Wed, 19 Aug 2020 17:09:58 GMT (envelope-from imp@FreeBSD.org) Message-Id: <202008191709.07JH9w1V008671@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Wed, 19 Aug 2020 17:09:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r364401 - in head: sbin/mount sys/sys X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: in head: sbin/mount sys/sys X-SVN-Commit-Revision: 364401 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 19 Aug 2020 17:09:59 -0000 Author: imp Date: Wed Aug 19 17:09:58 2020 New Revision: 364401 URL: https://svnweb.freebsd.org/changeset/base/364401 Log: Move the mount name to bit mapping into sys/mount.h so it can be shared with the kernel. Discussed with: kib@ Reviewed by: kirk@ (prior version) Sponsored by: Netflix Diffential Revision: https://reviews.freebsd.org/D25969 Modified: head/sbin/mount/mount.c head/sys/sys/mount.h Modified: head/sbin/mount/mount.c ============================================================================== --- head/sbin/mount/mount.c Wed Aug 19 17:05:30 2020 (r364400) +++ head/sbin/mount/mount.c Wed Aug 19 17:09:58 2020 (r364401) @@ -42,6 +42,7 @@ static char sccsid[] = "@(#)mount.c 8.25 (Berkeley) 5/ __FBSDID("$FreeBSD$"); #include +#define _WANT_MNTOPTNAMES #include #include #include @@ -92,36 +93,8 @@ void usage(void); char *flags2opts(int); /* Map from mount options to printable formats. */ -static struct opt { - uint64_t o_opt; - const char *o_name; -} optnames[] = { - { MNT_ASYNC, "asynchronous" }, - { MNT_EXPORTED, "NFS exported" }, - { MNT_LOCAL, "local" }, - { MNT_NOATIME, "noatime" }, - { MNT_NOEXEC, "noexec" }, - { MNT_NOSUID, "nosuid" }, - { MNT_NOSYMFOLLOW, "nosymfollow" }, - { MNT_QUOTA, "with quotas" }, - { MNT_RDONLY, "read-only" }, - { MNT_SYNCHRONOUS, "synchronous" }, - { MNT_UNION, "union" }, - { MNT_NOCLUSTERR, "noclusterr" }, - { MNT_NOCLUSTERW, "noclusterw" }, - { MNT_SUIDDIR, "suiddir" }, - { MNT_SOFTDEP, "soft-updates" }, - { MNT_SUJ, "journaled soft-updates" }, - { MNT_MULTILABEL, "multilabel" }, - { MNT_ACLS, "acls" }, - { MNT_NFS4ACLS, "nfsv4acls" }, - { MNT_GJOURNAL, "gjournal" }, - { MNT_AUTOMOUNTED, "automounted" }, - { MNT_VERIFIED, "verified" }, - { MNT_UNTRUSTED, "untrusted" }, - { MNT_NOCOVER, "nocover" }, - { MNT_EMPTYDIR, "emptydir" }, - { 0, NULL } +static struct mntoptnames optnames[] = { + MNTOPT_NAMES }; /* @@ -664,7 +637,7 @@ prmount(struct statfs *sfp) { uint64_t flags; unsigned int i; - struct opt *o; + struct mntoptnames *o; struct passwd *pw; (void)printf("%s on %s (%s", sfp->f_mntfromname, sfp->f_mntonname, Modified: head/sys/sys/mount.h ============================================================================== --- head/sys/sys/mount.h Wed Aug 19 17:05:30 2020 (r364400) +++ head/sys/sys/mount.h Wed Aug 19 17:09:58 2020 (r364401) @@ -294,6 +294,45 @@ void __mnt_vnode_markerfree_lazy(struct vnode #endif /* _KERNEL */ +#if defined(_WANT_MNTOPTNAMES) || defined(_KERNEL) +struct mntoptnames { + uint64_t o_opt; + const char *o_name; +}; +#define MNTOPT_NAMES \ + { MNT_ASYNC, "asynchronous" }, \ + { MNT_EXPORTED, "NFS exported" }, \ + { MNT_LOCAL, "local" }, \ + { MNT_NOATIME, "noatime" }, \ + { MNT_NOEXEC, "noexec" }, \ + { MNT_NOSUID, "nosuid" }, \ + { MNT_NOSYMFOLLOW, "nosymfollow" }, \ + { MNT_QUOTA, "with quotas" }, \ + { MNT_RDONLY, "read-only" }, \ + { MNT_SYNCHRONOUS, "synchronous" }, \ + { MNT_UNION, "union" }, \ + { MNT_NOCLUSTERR, "noclusterr" }, \ + { MNT_NOCLUSTERW, "noclusterw" }, \ + { MNT_SUIDDIR, "suiddir" }, \ + { MNT_SOFTDEP, "soft-updates" }, \ + { MNT_SUJ, "journaled soft-updates" }, \ + { MNT_MULTILABEL, "multilabel" }, \ + { MNT_ACLS, "acls" }, \ + { MNT_NFS4ACLS, "nfsv4acls" }, \ + { MNT_GJOURNAL, "gjournal" }, \ + { MNT_AUTOMOUNTED, "automounted" }, \ + { MNT_VERIFIED, "verified" }, \ + { MNT_UNTRUSTED, "untrusted" }, \ + { MNT_NOCOVER, "nocover" }, \ + { MNT_EMPTYDIR, "emptydir" }, \ + { MNT_UPDATE, "update" }, \ + { MNT_DELEXPORT, "delexport" }, \ + { MNT_RELOAD, "reload" }, \ + { MNT_FORCE, "force" }, \ + { MNT_SNAPSHOT, "snapshot" }, \ + { 0, NULL } +#endif + /* * User specifiable flags, stored in mnt_flag. */