]> git.ipfire.org Git - thirdparty/xfsprogs-dev.git/blame - quota/irix.c
libxfs: clean up IRELE/iput callsites
[thirdparty/xfsprogs-dev.git] / quota / irix.c
CommitLineData
959ef981 1// SPDX-License-Identifier: GPL-2.0
5aead01d 2/*
da23017d
NS
3 * Copyright (c) 2005 Silicon Graphics, Inc.
4 * All Rights Reserved.
5aead01d
NS
5 */
6
7#include "quota.h"
8#include <sys/quota.h>
9
10static int
11xcommand_to_qcommand(
12 uint command,
13 uint type)
14{
15 switch (command) {
16 case XFS_QUOTAON:
17 return Q_XQUOTAON;
18 case XFS_QUOTAOFF:
19 return Q_XQUOTAOFF;
20 case XFS_GETQUOTA:
0717a7db 21 if (type == XFS_GROUP_QUOTA)
5aead01d 22 return Q_XGETGQUOTA;
0717a7db 23 if (type == XFS_PROJ_QUOTA)
5aead01d
NS
24 return Q_XGETPQUOTA;
25 return Q_XGETQUOTA;
26 case XFS_SETQLIM:
0717a7db 27 if (type == XFS_GROUP_QUOTA)
5aead01d 28 return Q_XSETGQLIM;
0717a7db 29 if (type == XFS_PROJ_QUOTA)
5aead01d
NS
30 return Q_XSETPQLIM;
31 return Q_XSETQLIM;
32 case XFS_GETQSTAT:
33 return Q_XGETQSTAT;
34 case XFS_QUOTARM:
35 return Q_XQUOTARM;
546bedf4
NS
36 case XFS_QSYNC:
37 return Q_SYNC;
5aead01d
NS
38 }
39 return 0;
40}
41
42int
43xfsquotactl(
44 int command,
45 const char *device,
46 uint type,
47 uint id,
48 void *addr)
49{
50 int qcommand;
51
52 qcommand = xcommand_to_qcommand(command, type);
0717a7db 53 return quotactl(qcommand, (char *)device, id, addr);
5aead01d 54}