[BACK]Return to fstypes.h CVS log [TXT][DIR] Up to [cvs.NetBSD.org] / src / sys / sys

Annotation of src/sys/sys/fstypes.h, Revision 1.23.2.1

1.23.2.1! wrstuden    1: /*     $NetBSD: fstypes.h,v 1.23 2008/05/06 18:43:45 ad Exp $  */
1.1       christos    2:
                      3: /*
                      4:  * Copyright (c) 1989, 1991, 1993
                      5:  *     The Regents of the University of California.  All rights reserved.
                      6:  *
                      7:  * Redistribution and use in source and binary forms, with or without
                      8:  * modification, are permitted provided that the following conditions
                      9:  * are met:
                     10:  * 1. Redistributions of source code must retain the above copyright
                     11:  *    notice, this list of conditions and the following disclaimer.
                     12:  * 2. Redistributions in binary form must reproduce the above copyright
                     13:  *    notice, this list of conditions and the following disclaimer in the
                     14:  *    documentation and/or other materials provided with the distribution.
                     15:  * 3. Neither the name of the University nor the names of its contributors
                     16:  *    may be used to endorse or promote products derived from this software
                     17:  *    without specific prior written permission.
                     18:  *
                     19:  * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
                     20:  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
                     21:  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
                     22:  * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
                     23:  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
                     24:  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
                     25:  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
                     26:  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
                     27:  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
                     28:  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
                     29:  * SUCH DAMAGE.
                     30:  *
                     31:  *     @(#)mount.h     8.21 (Berkeley) 5/20/95
                     32:  */
                     33:
                     34: #ifndef _SYS_FSTYPES_H_
1.23.2.1! wrstuden   35: #define        _SYS_FSTYPES_H_
1.1       christos   36:
                     37: typedef struct { int32_t __fsid_val[2]; } fsid_t; /* file system id type */
                     38:
1.13      martin     39: #if defined(_KERNEL)
1.1       christos   40: /*
                     41:  * File identifier.
                     42:  * These are unique per filesystem on a single machine.
                     43:  */
                     44: struct fid {
                     45:        unsigned short  fid_len;                /* length of data in bytes */
1.20      pooka      46:        unsigned short  fid_reserved;           /* compat: historic align */
1.23.2.1! wrstuden   47:        char            fid_data[0];            /* data (variable length) */
1.1       christos   48: };
                     49:
                     50: /*
                     51:  * Generic file handle
                     52:  */
                     53: struct fhandle {
                     54:        fsid_t  fh_fsid;        /* File system id of mount point */
                     55:        struct  fid fh_fid;     /* File sys specific id */
                     56: };
                     57: typedef struct fhandle fhandle_t;
                     58:
1.12      yamt       59: /*
                     60:  * FHANDLE_SIZE_MAX: arbitrary value to prevent unreasonable allocation.
                     61:  *
                     62:  * FHANDLE_SIZE_MIN: chosen for compatibility.  smaller handles are zero-padded.
                     63:  */
                     64:
1.14      yamt       65: #define        FHANDLE_SIZE_COMPAT     28
1.12      yamt       66: #define        FHANDLE_SIZE_MAX        1024
1.14      yamt       67: #define        FHANDLE_SIZE_MIN        FHANDLE_SIZE_COMPAT
1.12      yamt       68:
1.10      yamt       69: #define        FHANDLE_FSID(fh)        (&(fh)->fh_fsid)
                     70: #define        FHANDLE_FILEID(fh)      (&(fh)->fh_fid)
1.12      yamt       71: #define        FHANDLE_SIZE_FROM_FILEID_SIZE(fidsize) \
                     72:        MAX(FHANDLE_SIZE_MIN, (offsetof(fhandle_t, fh_fid) + (fidsize)))
                     73: #define        FHANDLE_SIZE(fh) \
                     74:        FHANDLE_SIZE_FROM_FILEID_SIZE(FHANDLE_FILEID(fh)->fid_len)
1.10      yamt       75: #endif /* defined(_KERNEL) */
                     76:
1.1       christos   77: /*
                     78:  * Mount flags.  XXX BEWARE: these are not in numerical order!
                     79:  *
                     80:  * Unmount uses MNT_FORCE flag.
                     81:  *
                     82:  * Note that all mount flags are listed here.  if you need to add one, take
                     83:  * one of the __MNT_UNUSED flags.
                     84:  */
                     85:
1.8       chs        86: #define        __MNT_UNUSED1   0x00020000
                     87: #define        __MNT_UNUSED2   0x00200000
                     88: #define        __MNT_UNUSED3   0x00800000
                     89: #define        __MNT_UNUSED4   0x01000000
1.1       christos   90:
                     91: #define        MNT_RDONLY      0x00000001      /* read only filesystem */
                     92: #define        MNT_SYNCHRONOUS 0x00000002      /* file system written synchronously */
                     93: #define        MNT_NOEXEC      0x00000004      /* can't exec from filesystem */
                     94: #define        MNT_NOSUID      0x00000008      /* don't honor setuid bits on fs */
                     95: #define        MNT_NODEV       0x00000010      /* don't interpret special files */
                     96: #define        MNT_UNION       0x00000020      /* union with underlying filesystem */
                     97: #define        MNT_ASYNC       0x00000040      /* file system written asynchronously */
                     98: #define        MNT_NOCOREDUMP  0x00008000      /* don't write core dumps to this FS */
1.23.2.1! wrstuden   99: #define        MNT_IGNORE      0x00100000      /* don't show entry in df */
        !           100: #define        MNT_LOG         0x02000000      /* Use logging */
        !           101: #define        MNT_NOATIME     0x04000000      /* Never update access times in fs */
        !           102: #define        MNT_SYMPERM     0x20000000      /* recognize symlink permission */
        !           103: #define        MNT_NODEVMTIME  0x40000000      /* Never update mod times for devs */
        !           104: #define        MNT_SOFTDEP     0x80000000      /* Use soft dependencies */
1.1       christos  105:
1.23.2.1! wrstuden  106: #define        __MNT_BASIC_FLAGS \
1.1       christos  107:        { MNT_RDONLY,           0,      "read-only" }, \
                    108:        { MNT_SYNCHRONOUS,      0,      "synchronous" }, \
                    109:        { MNT_NOEXEC,           0,      "noexec" }, \
                    110:        { MNT_NOSUID,           0,      "nosuid" }, \
                    111:        { MNT_NODEV,            0,      "nodev" }, \
                    112:        { MNT_UNION,            0,      "union" }, \
                    113:        { MNT_ASYNC,            0,      "asynchronous" }, \
                    114:        { MNT_NOCOREDUMP,       0,      "nocoredump" }, \
                    115:        { MNT_IGNORE,           0,      "hidden" }, \
                    116:        { MNT_NOATIME,          0,      "noatime" }, \
                    117:        { MNT_SYMPERM,          0,      "symperm" }, \
                    118:        { MNT_NODEVMTIME,       0,      "nodevmtime" }, \
1.23.2.1! wrstuden  119:        { MNT_SOFTDEP,          0,      "soft dependencies" }, \
        !           120:        { MNT_LOG,              0,      "log" },
1.1       christos  121:
                    122: /*
                    123:  * exported mount flags.
                    124:  */
                    125: #define        MNT_EXRDONLY    0x00000080      /* exported read only */
                    126: #define        MNT_EXPORTED    0x00000100      /* file system is exported */
                    127: #define        MNT_DEFEXPORTED 0x00000200      /* exported to the world */
                    128: #define        MNT_EXPORTANON  0x00000400      /* use anon uid mapping for everyone */
                    129: #define        MNT_EXKERB      0x00000800      /* exported with Kerberos uid mapping */
1.23.2.1! wrstuden  130: #define        MNT_EXNORESPORT 0x08000000      /* don't enforce reserved ports (NFS) */
        !           131: #define        MNT_EXPUBLIC    0x10000000      /* public export (WebNFS) */
1.1       christos  132:
1.23.2.1! wrstuden  133: #define        __MNT_EXPORTED_FLAGS \
1.1       christos  134:        { MNT_EXRDONLY,         1,      "exported read-only" }, \
                    135:        { MNT_EXPORTED,         0,      "NFS exported" }, \
                    136:        { MNT_DEFEXPORTED,      1,      "exported to the world" }, \
                    137:        { MNT_EXPORTANON,       1,      "anon uid mapping" }, \
                    138:        { MNT_EXKERB,           1,      "kerberos uid mapping" }, \
                    139:        { MNT_EXNORESPORT,      0,      "non-reserved ports" }, \
                    140:        { MNT_EXPUBLIC,         0,      "WebNFS exports" },
                    141:
                    142: /*
                    143:  * Flags set by internal operations.
                    144:  */
                    145: #define        MNT_LOCAL       0x00001000      /* filesystem is stored locally */
                    146: #define        MNT_QUOTA       0x00002000      /* quotas are enabled on filesystem */
                    147: #define        MNT_ROOTFS      0x00004000      /* identifies the root filesystem */
                    148:
1.23.2.1! wrstuden  149: #define        __MNT_INTERNAL_FLAGS \
1.1       christos  150:        { MNT_LOCAL,            0,      "local" }, \
                    151:        { MNT_QUOTA,            0,      "with quotas" }, \
                    152:        { MNT_ROOTFS,           1,      "root file system" },
                    153:
                    154: /*
                    155:  * Mask of flags that are visible to statvfs()
                    156:  */
1.5       christos  157: #define        MNT_VISFLAGMASK ( \
                    158:      MNT_RDONLY | \
                    159:      MNT_SYNCHRONOUS | \
                    160:      MNT_NOEXEC | \
                    161:      MNT_NOSUID | \
                    162:      MNT_NODEV | \
                    163:      MNT_UNION | \
                    164:      MNT_ASYNC | \
                    165:      MNT_NOCOREDUMP | \
                    166:      MNT_IGNORE | \
                    167:      MNT_NOATIME | \
                    168:      MNT_SYMPERM | \
                    169:      MNT_NODEVMTIME | \
                    170:      MNT_SOFTDEP | \
                    171:      MNT_EXRDONLY | \
                    172:      MNT_EXPORTED | \
                    173:      MNT_DEFEXPORTED | \
                    174:      MNT_EXPORTANON | \
                    175:      MNT_EXKERB | \
                    176:      MNT_EXNORESPORT | \
                    177:      MNT_EXPUBLIC | \
                    178:      MNT_LOCAL | \
                    179:      MNT_QUOTA | \
1.23.2.1! wrstuden  180:      MNT_ROOTFS | \
        !           181:      MNT_LOG)
1.1       christos  182:
                    183: /*
                    184:  * External filesystem control flags.
                    185:  */
                    186: #define        MNT_UPDATE      0x00010000      /* not a real mount, just an update */
                    187: #define        MNT_RELOAD      0x00040000      /* reload filesystem data */
                    188: #define        MNT_FORCE       0x00080000      /* force unmount or readonly change */
                    189: #define        MNT_GETARGS     0x00400000      /* retrieve file system specific args */
                    190:
1.17      yamt      191: #define        MNT_OP_FLAGS    (MNT_UPDATE|MNT_RELOAD|MNT_FORCE|MNT_GETARGS)
                    192:
1.23.2.1! wrstuden  193: #define        __MNT_EXTERNAL_FLAGS \
1.1       christos  194:        { MNT_UPDATE,           1,      "being updated" }, \
                    195:        { MNT_RELOAD,           1,      "reload filesystem data" }, \
                    196:        { MNT_FORCE,            1,      "force unmount or readonly change" }, \
                    197:        { MNT_GETARGS,          1,      "retrieve mount arguments" },
                    198:
                    199: /*
                    200:  * Internal filesystem control flags.
                    201:  * These are set in struct mount mnt_iflag.
                    202:  *
                    203:  * IMNT_UNMOUNT locks the mount entry so that name lookup cannot proceed
                    204:  * past the mount point.  This keeps the subtree stable during mounts
                    205:  * and unmounts.
                    206:  */
                    207: #define        IMNT_GONE       0x00000001      /* filesystem is gone.. */
                    208: #define        IMNT_UNMOUNT    0x00000002      /* unmount in progress */
                    209: #define        IMNT_WANTRDWR   0x00000004      /* upgrade to read/write requested */
1.3       mycroft   210: #define        IMNT_DTYPE      0x00000040      /* returns d_type fields */
1.18      hannken   211: #define        IMNT_HAS_TRANS  0x00000080      /* supports transactions */
1.21      ad        212: #define        IMNT_MPSAFE     0x00000100      /* file system code MP safe */
1.1       christos  213:
1.23.2.1! wrstuden  214: #define        __MNT_FLAGS \
1.1       christos  215:        __MNT_BASIC_FLAGS \
                    216:        __MNT_EXPORTED_FLAGS \
                    217:        __MNT_INTERNAL_FLAGS \
                    218:        __MNT_EXTERNAL_FLAGS
                    219:
1.23.2.1! wrstuden  220: #define        __MNT_FLAG_BITS \
1.1       christos  221:        "\20" \
                    222:        "\40MNT_SOFTDEP" \
                    223:        "\37MNT_NODEVMTIME" \
                    224:        "\36MNT_SYMPERM" \
                    225:        "\35MNT_EXPUBLIC" \
                    226:        "\34MNT_EXNORESPORT" \
                    227:        "\33MNT_NOATIME" \
1.23.2.1! wrstuden  228:        "\32MNT_LOG" \
1.8       chs       229:        "\31MNT_UNUSED" \
                    230:        "\30MNT_UNUSED" \
1.1       christos  231:        "\27MNT_GETARGS" \
1.8       chs       232:        "\26MNT_UNUSED" \
1.1       christos  233:        "\25MNT_IGNORE" \
                    234:        "\24MNT_FORCE" \
                    235:        "\23MNT_RELOAD" \
1.8       chs       236:        "\22MNT_UNUSED" \
1.1       christos  237:        "\21MNT_UPDATE" \
                    238:        "\20MNT_NOCOREDUMP" \
                    239:        "\17MNT_ROOTFS" \
                    240:        "\16MNT_QUOTA" \
                    241:        "\15MNT_LOCAL" \
                    242:        "\14MNT_EXKERB" \
                    243:        "\13MNT_EXPORTANON" \
                    244:        "\12MNT_DEFEXPORTED" \
                    245:        "\11MNT_EXPORTED" \
                    246:        "\10MNT_EXRDONLY" \
                    247:        "\07MNT_ASYNC" \
                    248:        "\06MNT_UNION" \
                    249:        "\05MNT_NODEV" \
                    250:        "\04MNT_NOSUID" \
                    251:        "\03MNT_NOEXEC" \
                    252:        "\02MNT_SYNCHRONOUS" \
                    253:        "\01MNT_RDONLY"
                    254:
1.23.2.1! wrstuden  255: #define        __IMNT_FLAG_BITS \
1.1       christos  256:        "\20" \
1.21      ad        257:         "\20IMNT_MPSAFE" \
1.18      hannken   258:        "\10IMNT_HAS_TRANS" \
1.3       mycroft   259:        "\07IMNT_DTYPE" \
1.1       christos  260:        "\03IMNT_WANTRDWR" \
                    261:        "\02IMNT_UNMOUNT" \
                    262:        "\01IMNT_GONE"
                    263:
                    264: /*
                    265:  * Flags for various system call interfaces.
                    266:  *
                    267:  * waitfor flags to vfs_sync() and getvfsstat()
                    268:  */
1.23.2.1! wrstuden  269: #define        MNT_WAIT        1       /* synchronously wait for I/O to complete */
        !           270: #define        MNT_NOWAIT      2       /* start all I/O, but do not wait for it */
        !           271: #define        MNT_LAZY        3       /* push data not written by filesystem syncer */
1.1       christos  272: #endif /* _SYS_FSTYPES_H_ */

CVSweb <webmaster@jp.NetBSD.org>