mntopts.h revision 92882
175584Sru/*- 275584Sru * Copyright (c) 1994 375584Sru * The Regents of the University of California. All rights reserved. 475584Sru * 575584Sru * Redistribution and use in source and binary forms, with or without 675584Sru * modification, are permitted provided that the following conditions 775584Sru * are met: 875584Sru * 1. Redistributions of source code must retain the above copyright 975584Sru * notice, this list of conditions and the following disclaimer. 1075584Sru * 2. Redistributions in binary form must reproduce the above copyright 1175584Sru * notice, this list of conditions and the following disclaimer in the 1275584Sru * documentation and/or other materials provided with the distribution. 1375584Sru * 3. All advertising materials mentioning features or use of this software 1475584Sru * must display the following acknowledgement: 1575584Sru * This product includes software developed by the University of 1675584Sru * California, Berkeley and its contributors. 1775584Sru * 4. Neither the name of the University nor the names of its contributors 1875584Sru * may be used to endorse or promote products derived from this software 1975584Sru * without specific prior written permission. 2075584Sru * 2175584Sru * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND 2275584Sru * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 2375584Sru * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 2475584Sru * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE 2575584Sru * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 2675584Sru * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 2775584Sru * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 2875584Sru * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 2975584Sru * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 3075584Sru * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 3175584Sru * SUCH DAMAGE. 3275584Sru * 3375584Sru * @(#)mntopts.h 8.7 (Berkeley) 3/29/95 3475584Sru * $FreeBSD: head/sbin/mount/mntopts.h 92882 2002-03-21 13:14:21Z imp $ 3575584Sru */ 3675584Sru 3775584Srustruct mntopt { 3875584Sru const char *m_option; /* option name */ 3975584Sru int m_inverse; /* if a negative option, e.g. "dev" */ 4075584Sru int m_flag; /* bit to set, e.g. MNT_RDONLY */ 4175584Sru int m_altloc; /* 1 => set bit in altflags */ 4275584Sru}; 4375584Sru 4475584Sru/* User-visible MNT_ flags. */ 4575584Sru#define MOPT_ASYNC { "async", 0, MNT_ASYNC, 0 } 4675584Sru#define MOPT_NOATIME { "atime", 1, MNT_NOATIME, 0 } 4775584Sru#define MOPT_NODEV { "dev", 1, MNT_NODEV, 0 } 4875584Sru#define MOPT_NOEXEC { "exec", 1, MNT_NOEXEC, 0 } 4975584Sru#define MOPT_NOSUID { "suid", 1, MNT_NOSUID, 0 } 5075584Sru#define MOPT_NOSYMFOLLOW { "symfollow", 1, MNT_NOSYMFOLLOW, 0 } 5175584Sru#define MOPT_RDONLY { "rdonly", 0, MNT_RDONLY, 0 } 5275584Sru#define MOPT_SYNC { "sync", 0, MNT_SYNCHRONOUS, 0 } 5375584Sru#define MOPT_UNION { "union", 0, MNT_UNION, 0 } 5475584Sru#define MOPT_USERQUOTA { "userquota", 0, 0, 0 } 5575584Sru#define MOPT_GROUPQUOTA { "groupquota", 0, 0, 0 } 5675584Sru#define MOPT_NOCLUSTERR { "clusterr", 1, MNT_NOCLUSTERR, 0 } 5775584Sru#define MOPT_NOCLUSTERW { "clusterw", 1, MNT_NOCLUSTERW, 0 } 58151497Sru#define MOPT_SUIDDIR { "suiddir", 0, MNT_SUIDDIR, 0 } 5975584Sru#define MOPT_SNAPSHOT { "snapshot", 0, MNT_SNAPSHOT, 0 } 6075584Sru 6175584Sru/* Control flags. */ 6275584Sru#define MOPT_FORCE { "force", 0, MNT_FORCE, 0 } 6375584Sru#define MOPT_UPDATE { "update", 0, MNT_UPDATE, 0 } 6475584Sru#define MOPT_RO { "ro", 0, MNT_RDONLY, 0 } 65151497Sru#define MOPT_RW { "rw", 1, MNT_RDONLY, 0 } 6675584Sru 6775584Sru/* This is parsed by mount(8), but is ignored by specific mount_*(8)s. */ 6875584Sru#define MOPT_AUTO { "auto", 0, 0, 0 } 6975584Sru 7075584Sru#define MOPT_FSTAB_COMPAT \ 7175584Sru MOPT_RO, \ 7275584Sru MOPT_RW, \ 7375584Sru MOPT_AUTO 74151497Sru 7575584Sru/* Standard options which all mounts can understand. */ 7675584Sru#define MOPT_STDOPTS \ 7775584Sru MOPT_USERQUOTA, \ 7875584Sru MOPT_GROUPQUOTA, \ 7975584Sru MOPT_FSTAB_COMPAT, \ 8075584Sru MOPT_NOATIME, \ 8175584Sru MOPT_NODEV, \ 8275584Sru MOPT_NOEXEC, \ 8375584Sru MOPT_SUIDDIR, /* must be before MOPT_NOSUID */ \ 8475584Sru MOPT_NOSUID, \ 8575584Sru MOPT_NOSYMFOLLOW, \ 8675584Sru MOPT_RDONLY, \ 8775584Sru MOPT_UNION, \ 8875584Sru MOPT_NOCLUSTERR, \ 8975584Sru MOPT_NOCLUSTERW 9075584Sru 9175584Sruvoid getmntopts(const char *, const struct mntopt *, int *, int *); 9275584Sruvoid rmslashes(char *, char *); 9375584Sruvoid checkpath(const char *, char resolved_path[]); 9475584Sruextern int getmnt_silent; 9575584Sru