]>
Commit | Line | Data |
---|---|---|
5aead01d | 1 | /* |
da23017d NS |
2 | * Copyright (c) 2005 Silicon Graphics, Inc. |
3 | * All Rights Reserved. | |
5aead01d | 4 | * |
da23017d NS |
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 | |
5aead01d NS |
7 | * published by the Free Software Foundation. |
8 | * | |
da23017d NS |
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. | |
5aead01d | 13 | * |
da23017d NS |
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 | |
5aead01d NS |
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 */ | |
546bedf4 | 44 | XFS_QSYNC, /* flush delayed allocate space */ |
5aead01d NS |
45 | }; |
46 | ||
47 | /* | |
48 | * Utility routines | |
49 | */ | |
50 | extern char *type_to_string(uint __type); | |
51 | extern char *form_to_string(uint __form); | |
44214b5a | 52 | extern char *time_to_string(time_t __time, uint __flags); |
5aead01d NS |
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 */ | |
1774874a | 73 | NO_LOOKUP_FLAG = 0x0400, /* skip name lookups, just report ID */ |
5aead01d NS |
74 | }; |
75 | ||
76 | /* | |
77 | * Identifier (uid/gid/prid) cache routines | |
78 | */ | |
ce8d0b3a | 79 | #define NMAX 32 |
5aead01d NS |
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 |