]> git.ipfire.org Git - thirdparty/xfsprogs-dev.git/blob - quota/irix.c
xfsprogs: Release v4.17.0
[thirdparty/xfsprogs-dev.git] / quota / irix.c
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 "quota.h"
20 #include <sys/quota.h>
21
22 static int
23 xcommand_to_qcommand(
24 uint command,
25 uint type)
26 {
27 switch (command) {
28 case XFS_QUOTAON:
29 return Q_XQUOTAON;
30 case XFS_QUOTAOFF:
31 return Q_XQUOTAOFF;
32 case XFS_GETQUOTA:
33 if (type == XFS_GROUP_QUOTA)
34 return Q_XGETGQUOTA;
35 if (type == XFS_PROJ_QUOTA)
36 return Q_XGETPQUOTA;
37 return Q_XGETQUOTA;
38 case XFS_SETQLIM:
39 if (type == XFS_GROUP_QUOTA)
40 return Q_XSETGQLIM;
41 if (type == XFS_PROJ_QUOTA)
42 return Q_XSETPQLIM;
43 return Q_XSETQLIM;
44 case XFS_GETQSTAT:
45 return Q_XGETQSTAT;
46 case XFS_QUOTARM:
47 return Q_XQUOTARM;
48 case XFS_QSYNC:
49 return Q_SYNC;
50 }
51 return 0;
52 }
53
54 int
55 xfsquotactl(
56 int command,
57 const char *device,
58 uint type,
59 uint id,
60 void *addr)
61 {
62 int qcommand;
63
64 qcommand = xcommand_to_qcommand(command, type);
65 return quotactl(qcommand, (char *)device, id, addr);
66 }