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

Annotation of src/sys/ufs/ufs/quota.h, Revision 1.28.8.1

1.28.8.1! mrg         1: /*     $NetBSD: quota.h,v 1.29 2012/01/29 07:16:00 dholland Exp $      */
1.2       cgd         2:
1.1       mycroft     3: /*
                      4:  * Copyright (c) 1982, 1986, 1993
                      5:  *     The Regents of the University of California.  All rights reserved.
                      6:  *
                      7:  * This code is derived from software contributed to Berkeley by
                      8:  * Robert Elz at The University of Melbourne.
                      9:  *
                     10:  * Redistribution and use in source and binary forms, with or without
                     11:  * modification, are permitted provided that the following conditions
                     12:  * are met:
                     13:  * 1. Redistributions of source code must retain the above copyright
                     14:  *    notice, this list of conditions and the following disclaimer.
                     15:  * 2. Redistributions in binary form must reproduce the above copyright
                     16:  *    notice, this list of conditions and the following disclaimer in the
                     17:  *    documentation and/or other materials provided with the distribution.
1.17      agc        18:  * 3. Neither the name of the University nor the names of its contributors
1.1       mycroft    19:  *    may be used to endorse or promote products derived from this software
                     20:  *    without specific prior written permission.
                     21:  *
                     22:  * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
                     23:  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
                     24:  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
                     25:  * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
                     26:  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
                     27:  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
                     28:  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
                     29:  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
                     30:  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
                     31:  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
                     32:  * SUCH DAMAGE.
                     33:  *
1.4       mycroft    34:  *     @(#)quota.h     8.3 (Berkeley) 8/19/94
1.1       mycroft    35:  */
                     36:
1.11      lukem      37: #ifndef        _UFS_UFS_QUOTA_H_
                     38: #define        _UFS_UFS_QUOTA_H_
1.1       mycroft    39:
                     40: /*
1.26      bouyer     41:  * These definitions are common to the original disk quota implementation
                     42:  * (quota1) and the newer implementation (quota2)
1.1       mycroft    43:  */
                     44:
                     45: /*
                     46:  * The following constants define the usage of the quota file array in the
                     47:  * ufsmount structure and dquot array in the inode structure.  The semantics
                     48:  * of the elements of these arrays are defined in the routine getinoquota;
                     49:  * the remainder of the quota code treats them generically and need not be
                     50:  * inspected when changing the size of the array.
                     51:  */
                     52: #define        MAXQUOTAS       2
                     53: #define        USRQUOTA        0       /* element used for user quotas */
                     54: #define        GRPQUOTA        1       /* element used for group quotas */
                     55:
1.27      bouyer     56:
1.28      bouyer     57: #if !defined(HAVE_NBTOOL_CONFIG_H)
1.28.8.1! mrg        58: #include <sys/quota.h>
1.27      bouyer     59: __inline static int __unused
1.28.8.1! mrg        60: quota_idtype_to_ufs(int idtype)
1.27      bouyer     61: {
1.28.8.1! mrg        62:        switch (idtype) {
        !            63:        case QUOTA_IDTYPE_USER:
1.27      bouyer     64:                return USRQUOTA;
1.28.8.1! mrg        65:        case QUOTA_IDTYPE_GROUP:
1.27      bouyer     66:                return GRPQUOTA;
                     67:        default:
                     68:                return -1;
                     69:        }
1.12      simonb     70: }
1.1       mycroft    71:
1.27      bouyer     72: static __inline int __unused
1.28.8.1! mrg        73: quota_idtype_from_ufs(int ufstype)
1.27      bouyer     74: {
1.28.8.1! mrg        75:        switch (ufstype) {
1.27      bouyer     76:        case USRQUOTA:
1.28.8.1! mrg        77:                return QUOTA_IDTYPE_USER;
1.27      bouyer     78:        case GRPQUOTA:
1.28.8.1! mrg        79:                return QUOTA_IDTYPE_GROUP;
1.27      bouyer     80:        default:
                     81:                return -1;
                     82:        }
                     83: }
1.28      bouyer     84: #endif /* !defined(HAVE_NBTOOL_CONFIG_H) */
1.1       mycroft    85:
1.6       jtc        86: #ifdef _KERNEL
1.1       mycroft    87:
                     88: #include <sys/cdefs.h>
                     89:
                     90: __BEGIN_DECLS
1.19      thorpej    91: void   dqinit(void);
                     92: void   dqreinit(void);
                     93: void   dqdone(void);
1.1       mycroft    94: __END_DECLS
1.6       jtc        95: #endif /* _KERNEL */
1.1       mycroft    96:
1.13      matt       97: #endif /* !_UFS_UFS_QUOTA_H_ */

CVSweb <webmaster@jp.NetBSD.org>