~ubuntu-branches/ubuntu/edgy/xfsprogs/edgy

« back to all changes in this revision

Viewing changes to quota/quota.h

  • Committer: Bazaar Package Importer
  • Author(s): Nathan Scott
  • Date: 2005-11-16 16:32:35 UTC
  • Revision ID: james.westby@ubuntu.com-20051116163235-synnef6xjj18ny42
Tags: 2.7.7-1
* New upstream release.
* Add support for (optional) ATTR2 format extension (closes: #336350)
* Allow gcc -pedantic option for C++ <xfs.h> users (closes: #249429)
* Fix segv in xfs_db frag command (closes: #338207)

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
 * Copyright (c) 2005 Silicon Graphics, Inc.
 
3
 * All Rights Reserved.
 
4
 *
 
5
 * This program is free software; you can redistribute it and/or
 
6
 * modify it under the terms of the GNU General Public License as
 
7
 * published by the Free Software Foundation.
 
8
 *
 
9
 * This program is distributed in the hope that it would be useful,
 
10
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 
11
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
12
 * GNU General Public License for more details.
 
13
 *
 
14
 * You should have received a copy of the GNU General Public License
 
15
 * along with this program; if not, write the Free Software Foundation,
 
16
 * Inc.,  51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
 
17
 */
 
18
 
 
19
#include <xfs/xqm.h>
 
20
#include <xfs/path.h>
 
21
#include <xfs/project.h>
 
22
 
 
23
/*
 
24
 * Different forms of XFS quota
 
25
 */
 
26
enum {
 
27
        XFS_BLOCK_QUOTA =       0x1,
 
28
        XFS_INODE_QUOTA =       0x2,
 
29
        XFS_RTBLOCK_QUOTA =     0x4,
 
30
};
 
31
 
 
32
/*
 
33
 * System call definitions mapping to platform-specific quotactl
 
34
 */
 
35
extern int xfsquotactl(int __cmd, const char *__device,
 
36
                        uint __type, uint __id, void * __addr);
 
37
enum {
 
38
        XFS_QUOTAON,    /* enable accounting/enforcement */
 
39
        XFS_QUOTAOFF,   /* disable accounting/enforcement */
 
40
        XFS_GETQUOTA,   /* get disk limits and usage */
 
41
        XFS_SETQLIM,    /* set disk limits */
 
42
        XFS_GETQSTAT,   /* get quota subsystem status */
 
43
        XFS_QUOTARM,    /* free disk space used by dquots */
 
44
        XFS_QSYNC,      /* flush delayed allocate space */
 
45
};
 
46
 
 
47
/*
 
48
 * Utility routines
 
49
 */
 
50
extern char *type_to_string(uint __type);
 
51
extern char *form_to_string(uint __form);
 
52
extern char *time_to_string(__uint32_t __time, uint __flags);
 
53
extern char *bbs_to_string(__uint64_t __v, char *__c, uint __size);
 
54
extern char *num_to_string(__uint64_t __v, char *__c, uint __size);
 
55
extern char *pct_to_string(__uint64_t __v, __uint64_t __t, char *__c, uint __s);
 
56
 
 
57
extern FILE *fopen_write_secure(char *__filename);
 
58
 
 
59
/*
 
60
 * Various utility routine flags
 
61
 */
 
62
enum {
 
63
        NO_HEADER_FLAG =        0x0001, /* don't print header */
 
64
        VERBOSE_FLAG =          0x0002, /* increase verbosity */
 
65
        HUMAN_FLAG =            0x0004, /* human-readable values */
 
66
        QUOTA_FLAG =            0x0008, /* uid/gid/prid over-quota (soft) */
 
67
        LIMIT_FLAG =            0x0010, /* uid/gid/prid over-limit (hard) */
 
68
        ALL_MOUNTS_FLAG =       0x0020, /* iterate over every mounted xfs */
 
69
        TERSE_FLAG =            0x0040, /* decrease verbosity */
 
70
        HISTOGRAM_FLAG =        0x0080, /* histogram format output */
 
71
        DEFAULTS_FLAG =         0x0100, /* use value as a default */
 
72
        ABSOLUTE_FLAG =         0x0200, /* absolute time, not related to now */
 
73
        NO_LOOKUP_FLAG =        0x0400, /* skip name lookups, just report ID */
 
74
};
 
75
 
 
76
/*
 
77
 * Identifier (uid/gid/prid) cache routines
 
78
 */
 
79
#define NMAX 32
 
80
extern char *uid_to_name(__uint32_t __uid);
 
81
extern char *gid_to_name(__uint32_t __gid);
 
82
extern char *prid_to_name(__uint32_t __prid);
 
83